Outhere

SpongeBob's Bikini Bottom Pinball (SkillShot 2021) v1.00

Sep 4th, 2021 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 110.07 KB | None | 0 0
  1. '************************************************************
  2. ' SpongeBob's Bikini Bottom Pinball
  3. ' Table Author: SkillShot
  4. ' Version 1.00
  5. ' Release: Mar 2021
  6. '
  7. ' Based on the Attack & Revenge from Mars table
  8. ' Made by jpsalas with DOF by arngrim
  9. '************************************************************
  10.  
  11. 'DOF UPDATE BY OUTHERE
  12. '101 Left Flipper
  13. '102 Right Flipper
  14. '103 Left Slingshot
  15. '104
  16. '105 Right Slingshot
  17. '106
  18. '107 Bumper Left
  19. '108 Bumper Center
  20. '109 Bumper Right
  21. '110 Ball Release
  22. '111 AutoPlunger
  23. '112 RandomKickerS
  24. '113 Shaker
  25. '114 Beacon
  26. '115 Krabby Patty
  27. '116 PatRick
  28. '117 Squidward
  29. '118 Spongebob
  30.  
  31. Option Explicit
  32. Randomize
  33.  
  34. ExecuteGlobal GetTextFile("core.vbs")
  35.  
  36. On Error Resume Next
  37. ExecuteGlobal GetTextFile("Controller.vbs")
  38. If Err Then MsgBox "Unable to open Controller.vbs. Ensure that it is in the scripts folder."
  39. On Error Goto 0
  40.  
  41. Dim RomSoundVolume
  42. Dim MechSoundVolume
  43. Dim B2SonDesktop
  44. Dim TiltLevel
  45.  
  46. '********************
  47. 'User Settings
  48. '********************
  49.  
  50. TiltLevel = .15 'Threshold for Analog Nudge. Raise value to tilt less often. Values are small, only adjust by .01 at a time.
  51. B2SonDesktop = 0 '0= No B2S when in desktop mode. 1= Use B2S backglass in desktop mode (B2S server must be configured)
  52.  
  53. '********************
  54. 'Initialize B2S
  55. '********************
  56.  
  57. If ShowDT = False Or B2SonDesktop = 1 Then
  58. BallsText.Y = BallsText.Y - 500
  59. DMDText.Y = DMDText.Y - 500
  60. ScoreText.Y = ScoreText.Y - 500
  61. ScoreText2.Y = ScoreText2.Y - 500
  62. ScoreText3.Y = ScoreText3.Y - 500
  63. ScoreText4.Y = ScoreText4.Y - 500
  64. Dim Controller
  65. Set Controller = CreateObject("B2S.Server")
  66. Controller.B2SName = "spongebob"
  67. ' Controller.Run
  68. End If
  69.  
  70.  
  71. '********************
  72. 'Standard definitions
  73. '********************
  74.  
  75. Const UseLamps = 0
  76. Const UseSync = 0
  77. Const HandleMech = 0
  78.  
  79. ' special fastflips
  80. Const cSingleLFlip = 0
  81. Const cSingleRFlip = 0
  82.  
  83. ' Standard Sounds
  84. Const SSolenoidOn = "fx_Solenoidon"
  85. Const SSolenoidOff = "fx_solenoidoff"
  86. Const SCoin = "fx_Coin"
  87.  
  88.  
  89. Dim bsTrough, bsL, bsR, dtDrop, x, BallFrame, plungerIM, Mech3bank
  90. Dim BankMove, MoveSpeed, currpos, NewBankDown, ShakeThree, ShakeMain, ShakeSponge, ShakePatty, ShakePatrick, ShakeSquidward, i
  91. Dim HSI1, HSI2, HSI3
  92. Dim StartGame
  93. Dim CurrentBall
  94. Dim Players
  95. Dim CurrentPlayer
  96. Dim PreviousPlayer
  97. Dim ROrbitHit
  98. Dim LOrbitHit
  99. Dim RRampHit
  100. Dim LRampHit
  101. Dim PlayTime
  102. Dim OrbitSaved
  103. Dim RoundScore
  104. Dim BallInLane
  105. Dim SkillShot
  106. Dim SkillShot2
  107. Dim SSText
  108. Dim LEDMessage2
  109. Dim AreLightsOff
  110. Dim DelayMusic
  111. Dim DScoreValue
  112. Dim SongNumber
  113. Dim LaneTune
  114. Dim HSDisplay
  115. Dim HSDisplay2
  116. Dim ScoreNumber
  117. Dim HSDigit
  118. Dim HSChr
  119. Dim DrainSave
  120. Dim SideSave
  121. Dim LTiltPower
  122. Dim RTiltPower
  123. Dim CTiltPower
  124. Dim LeftPress
  125. Dim RightPress
  126. Dim CenterPress
  127. Dim WarningCount
  128. Dim TiltGame
  129. Dim SkillSelect
  130. Dim SeqNum
  131. Dim SpongeBalls
  132. Dim soundcount
  133. Dim TiltTime
  134. Dim HSTextFile
  135. Dim PartyMode
  136. Dim B2sLightState
  137. Dim FanfareSelect
  138. Dim HighScores(4,1)
  139. Dim b2sChrLookup2(96)
  140. Dim MusicInterval(11)
  141. Dim DMDDisplay(9,1)
  142. Dim MultiBallReady(4)
  143. Dim ModeText(4)
  144. Dim TotalScore(4)
  145. Dim KickerSave(4)
  146. Dim BallSaveTime(4)
  147. Dim ExtraBall
  148. Dim BonusRounds
  149. Dim BankDown(4)
  150. Dim TriggerWallCollide(4)
  151. Dim TriggerDown(4)
  152. Dim ModeReady(4)
  153. Dim CurrentMode
  154. Dim NextMode(4)
  155. Dim ModesComplete(4)
  156. Dim BallsLocked(4)
  157. Dim SJPReady(4)
  158. Dim L01State(4)
  159. Dim L02State(4)
  160. Dim L03State(4)
  161. Dim L04State(4)
  162. Dim L05State(4)
  163. Dim L06State(4)
  164. Dim L07State(4)
  165. Dim L08State(4)
  166. Dim L09State(4)
  167. Dim L10State(4)
  168. Dim L11State(4)
  169. Dim L12State(4)
  170. Dim L13State(4)
  171. Dim L14State(4)
  172. Dim L15State(4)
  173. Dim L16State(4)
  174. Dim L17State(4)
  175. Dim L18State(4)
  176. Dim L19State(4)
  177. Dim L20State(4)
  178. Dim L21State(4)
  179. Dim L22State(4)
  180. Dim L23State(4)
  181. Dim L24State(4)
  182. Dim L25State(4)
  183. Dim L26State(4)
  184. Dim L27State(4)
  185. Dim L28State(4)
  186. Dim L29State(4)
  187. Dim L30State(4)
  188. Dim L31State(4)
  189. Dim L32State(4)
  190. Dim L33State(4)
  191. Dim L34State(4)
  192. Dim L35State(4)
  193. Dim L36State(4)
  194. Dim L37State(4)
  195. Dim L38State(4)
  196. Dim L39State(4)
  197. Dim L40State(4)
  198. Dim L41State(4)
  199. Dim L42State(4)
  200. Dim L43State(4)
  201. Dim L44State(4)
  202. Dim L45State(4)
  203. Dim L46State(4)
  204. Dim L47State(4)
  205. Dim L48State(4)
  206. Dim L49State(4)
  207. Dim L50State(4)
  208. Wall002.IsDropped = True
  209. Wall003.IsDropped = True
  210. Wall004.IsDropped = True
  211. Wall005.IsDropped = True
  212.  
  213. ' Predefined characters, A-Z 0-9 and + - * " ' ( ) / < = > [ \ ] _ `
  214. b2sChrLookup2(34)=514:b2sChrLookup2(35)=0:b2sChrLookup2(39)=1024:b2sChrLookup2(40)=5120:b2sChrLookup2(41)=16640:b2sChrLookup2(42)=32576
  215. b2sChrLookup2(43)=10816:b2sChrLookup2(44)=16384:b2sChrLookup2(45)=2112:b2sChrLookup2(47)=17408:b2sChrLookup2(48)=17471
  216. b2sChrLookup2(49)=8704:b2sChrLookup2(50)=2139:b2sChrLookup2(51)=2127:b2sChrLookup2(52)=2150:b2sChrLookup2(53)=2157:b2sChrLookup2(54)=2173
  217. b2sChrLookup2(55)=7:b2sChrLookup2(56)=2175:b2sChrLookup2(57)=2159:b2sChrLookup2(60)=5120:b2sChrLookup2(61)=2120:b2sChrLookup2(62)=16640
  218. b2sChrLookup2(65)=2167:b2sChrLookup2(66)=10767:b2sChrLookup2(67)=57:b2sChrLookup2(68)=8719:b2sChrLookup2(69)=2169:b2sChrLookup2(70)=2161
  219. b2sChrLookup2(71)=2109:b2sChrLookup2(72)=2166:b2sChrLookup2(73)=8713:b2sChrLookup2(74)=30:b2sChrLookup2(75)=5232:b2sChrLookup2(76)=56
  220. b2sChrLookup2(77)=1334:b2sChrLookup2(78)=4406:b2sChrLookup2(79)=63:b2sChrLookup2(80)=2163:b2sChrLookup2(81)=4159:b2sChrLookup2(82)=6259
  221. b2sChrLookup2(83)=2157:b2sChrLookup2(84)=8705:b2sChrLookup2(85)=62:b2sChrLookup2(86)=17456:b2sChrLookup2(87)=20534:b2sChrLookup2(88)=21760
  222. b2sChrLookup2(89)=9472:b2sChrLookup2(90)=17417:b2sChrLookup2(91)=57:b2sChrLookup2(92)=4352:b2sChrLookup2(93)=15:b2sChrLookup2(95)=8:
  223. b2sChrLookup2(96)=256
  224.  
  225. ScoreText.Text = ""
  226. ScoreText2.Text = ""
  227. ScoreText3.Text = ""
  228. ScoreText4.Text = ""
  229. BallsText.Text = ""
  230. LoadVolumeLevel
  231. Call PlayTableMusic(12)
  232. InsertSequence.Play SeqCircleOutOn,50,100
  233. DMDText.Text = "Bikini Bottom Pinball: Press Start" : LEDText("Bikini Bottom Pinball Press Start")
  234.  
  235. '******************
  236. ' RealTime Updates
  237. '******************
  238.  
  239.  
  240. Sub RealTimeUpdates
  241. RollingUpdate
  242. End Sub
  243.  
  244. '************
  245. ' Table init.
  246. '************
  247.  
  248. Const cGameName = "spongebob"
  249.  
  250. Sub Table1_Init
  251.  
  252. LoadEM
  253.  
  254. BankMove = 0
  255. NewBankDown = 0
  256. StartGame = 0
  257. CurrentBall = 3
  258. Players = 0
  259. CurrentPlayer = 0
  260. CurrentMode = 0
  261. ROrbitHit = 0
  262. LOrbitHit = 0
  263. RRampHit = 0
  264. LRampHit = 0
  265. PlayTime = 0
  266. ExtraBall = 0
  267. OrbitSaved = 0
  268. RoundScore = 0
  269. BonusRounds = 0
  270. BallInLane = 0
  271. SkillShot = 0
  272. SSText = 0
  273. AreLightsOff = 0
  274. DelayMusic = 0
  275. DScoreValue = 0
  276. HSDisplay2 = 0
  277. ScoreNumber = ""
  278. HSDigit = 0
  279. HsChr = 65
  280. DrainSave = 0
  281. SideSave = 0
  282. SeqNum = 0
  283. SpongeBalls = 0
  284. soundcount = 0
  285. B2sLightState = 1
  286. WarningCount = 0
  287. TiltGame = 1
  288. FanfareSelect = int(rnd*5)
  289. SongNumber = int(rnd*7)
  290. for i = 0 To 4
  291. BankDown(i)=0
  292. TriggerWallCollide(i)=True
  293. TriggerDown(i)=False
  294. ModeReady(i)=0
  295. MultiBallReady(i) = 0
  296. ModesComplete(i)=0
  297. NextMode(i)=0
  298. BallsLocked(i)=0
  299. BallSaveTime(i)=10
  300. KickerSave(i) = 2
  301. TotalScore(i) = 0
  302. SJPReady(i) = 0
  303. ModeText(i) = ""
  304. L01State(i)=0
  305. L02State(i)=0
  306. L03State(i)=0
  307. L04State(i)=0
  308. L05State(i)=0
  309. L06State(i)=0
  310. L07State(i)=0
  311. L08State(i)=0
  312. L09State(i)=0
  313. L10State(i)=0
  314. L11State(i)=0
  315. L12State(i)=0
  316. L13State(i)=0
  317. L14State(i)=0
  318. L15State(i)=0
  319. L16State(i)=0
  320. L17State(i)=0
  321. L18State(i)=0
  322. L19State(i)=0
  323. L20State(i)=0
  324. L21State(i)=0
  325. L22State(i)=0
  326. L23State(i)=0
  327. L24State(i)=0
  328. L25State(i)=0
  329. L26State(i)=0
  330. L27State(i)=0
  331. L28State(i)=0
  332. L29State(i)=0
  333. L30State(i)=0
  334. L31State(i)=0
  335. L32State(i)=0
  336. L33State(i)=0
  337. L34State(i)=0
  338. L35State(i)=0
  339. L36State(i)=0
  340. L37State(i)=0
  341. L38State(i)=0
  342. L39State(i)=0
  343. L40State(i)=0
  344. L41State(i)=0
  345. L42State(i)=0
  346. L43State(i)=0
  347. L44State(i)=0
  348. L45State(i)=0
  349. L46State(i)=0
  350. L47State(i)=0
  351. L48State(i)=0
  352. L49State(i)=0
  353. L50State(i)=0
  354. Next
  355.  
  356. For i = 0 To 9
  357. DMDDisplay(i,0) = ""
  358. DMDDisplay(i,1) = ""
  359. Next
  360.  
  361. For i = 0 To 11
  362. MusicInterval(i) = 2000
  363. Next
  364.  
  365. MusicInterval(1) = 6096 '17948
  366. MusicInterval(2) = 6372
  367. MusicInterval(3) = 3930 '5312
  368. MusicInterval(4) = 5928
  369. MusicInterval(5) = 9148
  370. MusicInterval(6) = 8668 '16210
  371. MusicInterval(7) = 6524
  372. MusicInterval(8) = 9854
  373. MusicInterval(9) = 8284
  374. MusicInterval(10) = 9376
  375. MusicInterval(11) = 9376
  376.  
  377. LoadHighScores
  378.  
  379. UpdateLights
  380. Call ChangeGILights(0)
  381. Diverter.RotateToStart
  382. TriggerWall.Collidable = True
  383. sw77.IsDropped = False
  384. HSDisplay = 1 : DisplayHS.Enabled = True
  385.  
  386. ' Impulse Plunger
  387. Const IMPowerSetting = 42 'Plunger Power
  388. Const IMTime = 0.6 ' Time in seconds for Full Plunge
  389. Set plungerIM = New cvpmImpulseP
  390. With plungerIM
  391. .InitImpulseP swplunger, IMPowerSetting, IMTime
  392. .Random 0.3
  393. .InitExitSnd SoundFX("fx_plunger",DOFContactors), SoundFX("fx_plunger",DOFContactors)
  394. .CreateEvents "plungerIM"
  395. End With
  396. End Sub
  397.  
  398. Sub ResetPlayer
  399. ROrbitHit = 0
  400. LOrbitHit = 0
  401. LRampHit = 0
  402. RRampHit = 0
  403. WarningCount = 0
  404. LGate.Open=False
  405. RGate.Open=False
  406. PreviousPlayer = CurrentPlayer - 1
  407. If CurrentPlayer = 0 OR CurrentPlayer = 1 Then PreviousPlayer = Players
  408. If CurrentBall > 0 Then
  409. If BankDown(CurrentPlayer) = 1 AND BankDown(PreviousPlayer) = 0 Then currpos = 50 : Call Update3Bank(50,0)
  410. If BankDown(CurrentPlayer) = 0 AND BankDown(PreviousPlayer) = 1 Then currpos = 0 : Call Update3Bank(0,50)
  411. End If
  412. sw77.IsDropped = TriggerDown(CurrentPlayer)
  413. TriggerWall.Collidable = TriggerWallCollide(CurrentPlayer)
  414. UpdateLights
  415. Diverter.RotateToStart
  416. If ModeReady(CurrentPlayer) = 1 And MultiBallReady(CurrentPlayer) = 0 Then Diverter.RotateToEnd
  417. End Sub
  418.  
  419. Sub startB2S(aB2S)
  420. If B2SOn Then
  421. Controller.B2SSetData 1,0
  422. Controller.B2SSetData 2,0
  423. Controller.B2SSetData 3,0
  424. Controller.B2SSetData 4,0
  425. Controller.B2SSetData 5,0
  426. Controller.B2SSetData 6,0
  427. Controller.B2SSetData 7,0
  428. Controller.B2SSetData 8,0
  429. Controller.B2SSetData 9,0
  430. Controller.B2SSetData 10,0
  431. Controller.B2SSetData 11,0
  432. Controller.B2SSetData 12,0
  433. Controller.B2SSetData 13,0
  434. Controller.B2SSetData 14,0
  435. Controller.B2SSetData aB2S,1
  436. End If
  437. End Sub
  438.  
  439. '**********
  440. ' Keys
  441. '**********
  442.  
  443. Sub table1_KeyDown(ByVal Keycode)
  444. If keycode = PlungerKey Then
  445. If BallInLane = 1 Then SkillShot = 1 : SkillShotMessage.Enabled = False : SkillShotTimer.Enabled = True : DMDText.TimerEnabled = False
  446. End If
  447. If keycode = LeftTiltKey Then LeftPress = 1
  448. If keycode = RightTiltKey Then RightPress = 1
  449. If keycode = CenterTiltKey Then CenterPress = 1
  450. If Keycode = LeftFlipperKey Then
  451. If PartyMode = 1 Then StopSound "Sfx_Airhorn" : PlaySound "Sfx_Airhorn",0,RomSoundVolume
  452. If FanfareTimer.Enabled = True Then FanfareSfx
  453. If TiltGame <> 1 Then
  454. If ScoreNumber = "" Then
  455. If CurrentMode <> 2 Then
  456. PlaySoundAt SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), LeftFlipper
  457. LeftFlipper.RotateToEnd
  458. Else
  459. PlaySoundAt SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), RightFlipper
  460. RightFlipper.RotateToEnd
  461. End If
  462. End If
  463. End If
  464. End If
  465. If Keycode = RightFlipperKey Then
  466. If PartyMode = 1 Then StopSound "Sfx_Airhorn" : PlaySound "Sfx_Airhorn",0,RomSoundVolume
  467. If FanfareTimer.Enabled = True Then FanfareSfx
  468. If TiltGame <> 1 Then
  469. If ScoreNumber = "" Then
  470. If CurrentMode <> 2 Then
  471. PlaySoundAt SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), RightFlipper
  472. RightFlipper.RotateToEnd
  473. Else
  474. PlaySoundAt SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), LeftFlipper
  475. LeftFlipper.RotateToEnd
  476. End If
  477. End If
  478. End If
  479. End If
  480. End Sub
  481.  
  482. Sub table1_KeyUp(ByVal Keycode)
  483. If keycode = LeftMagnaSave Then
  484. If StartGame = 0 Then
  485. MechSoundVolume = MechSoundVolume + .1
  486. If MechSoundVolume > 1 Then MechSoundVolume = 0
  487. StopSound "fx_Bumper"
  488. PlaySoundAt SoundFX("fx_bumper", DOFContactors), Bumper1
  489. SaveVolumeLevel
  490. DMDText.Text = "Mech Sound Volume " & MechSoundVolume * 100 : LEDText("Mech Sound Volume " & MechSoundVolume * 100)
  491. DisplayHS.Enabled = False
  492. VolumeTimer.Enabled = False
  493. VolumeTimer.Enabled = True
  494. End If
  495. End If
  496. If keycode = RightMagnaSave Then
  497. If StartGame = 0 Then
  498. RomSoundVolume = RomSoundVolume + .1
  499. If RomSoundVolume > 1 Then RomSoundVolume = 0
  500. StopTableMusic
  501. PlaySound "Mode0",0,RomSoundVolume
  502. SaveVolumeLevel
  503. DMDText.Text = "Music Volume " & RomSoundVolume * 100 : LEDText("Music Volume " & RomSoundVolume * 100)
  504. DisplayHS.Enabled = False
  505. VolumeTimer.Enabled = False
  506. VolumeTimer.Enabled = True
  507. End If
  508. End If
  509. If keycode = PlungerKey Then
  510. If BallInLane = 1 Then SkillShot = 0 : Auto_Plunger
  511. End If
  512. If keycode = LeftTiltKey Then LeftPress = 0 : Nudge 90, LTiltPower/5 : PlaySound SoundFX("fx_nudge",0), 0, 1, -0.1, 0.25:a3BankShake2:CheckTilt
  513. If keycode = RightTiltKey Then RightPress = 0 : Nudge 270, RTiltPower/5 : PlaySound SoundFX("fx_nudge",0), 0, 1, 0.1, 0.25:a3BankShake2:CheckTilt
  514. If keycode = CenterTiltKey Then CenterPress = 0 : Nudge 0, CTiltPower/5 : PlaySound SoundFX("fx_nudge",0), 0, 1, 0, 0.25:a3BankShake2:CheckTilt
  515. If keycode = LeftFlipperKey Then
  516. If TiltGame <> 1 Then
  517. If ScoreNumber = "" Then
  518. If CurrentMode <> 2 Then
  519. PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
  520. LeftFlipper.RotateToStart
  521. Else
  522. PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
  523. RightFlipper.RotateToStart
  524. End If
  525. End If
  526. If ScoreNumber <> "" Then
  527. If HSDigit = 0 Then HSDigit = 1
  528. HSChr = HSChr - 1
  529. If HSChr = 64 Then HSChr = 90
  530. EnterHS
  531. End If
  532. End If
  533. End If
  534. If keycode = RightFlipperKey Then
  535. If TiltGame <> 1 Then
  536. If ScoreNumber = "" Then
  537. If CurrentMode <> 2 Then
  538. PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
  539. RightFlipper.RotateToStart
  540. Else
  541. PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
  542. LeftFlipper.RotateToStart
  543. End If
  544. End If
  545. If ScoreNumber <> "" Then
  546. If HSDigit = 0 Then HSDigit = 1
  547. HSChr = HSChr + 1
  548. If HSChr = 91 Then HSChr = 65
  549. EnterHS
  550. End If
  551. End If
  552. End If
  553. If keycode = StartGameKey Then
  554. If ScoreNumber = "" Then
  555. If CurrentBall = 3 and Players < 4 Then
  556. If Players = 0 Then : ScoreText.Text = "" : ScoreText2.Text = "" : ScoreText3.Text = "" : ScoreText4.Text = "" : ScoresClear
  557. Players = Players + 1
  558. If Players = 1 Then
  559. ScoreText.Text = 0
  560. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 10, b2sChrLookup2(Asc(0))
  561. End If
  562. If Players = 2 Then
  563. ScoreText2.Text = 0
  564. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 20, b2sChrLookup2(Asc(0))
  565. StopSound "Sfx_NewPlayer": PlaySound "Sfx_NewPlayer",0,RomSoundVolume
  566. End If
  567. If Players = 3 Then
  568. ScoreText3.Text = 0
  569. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 30, b2sChrLookup2(Asc(0))
  570. StopSound "Sfx_NewPlayer": PlaySound "Sfx_NewPlayer",0,RomSoundVolume
  571. End If
  572. If Players = 4 Then
  573. ScoreText4.Text = 0
  574. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 40, b2sChrLookup2(Asc(0))
  575. StopSound "Sfx_NewPlayer": PlaySound "Sfx_NewPlayer",0,RomSoundVolume
  576. End If
  577. If StartGame = 0 Then
  578. If RoosterTimer.Enabled = False Then
  579. StopTableMusic
  580. InsertSequence.StopPlay()
  581. HSDisplay = 0 : DisplayHS.Enabled = False
  582. HSMusicPlaying.Enabled = False
  583. Call DMDMessage("GAME START", 2)
  584. PlaySound "Sfx_StartGame",0,RomSoundVolume
  585. RoosterTimer.Enabled = True
  586. End If
  587. End If
  588. End If
  589. End If
  590. If HSDigit >= 1 Then
  591. HSDigit = HSDigit + 1
  592. HSChr = 65
  593. If HSDigit > 4 Then HSDigit = 4
  594. EnterHS
  595. End If
  596. UpdateText
  597. End If
  598. End Sub
  599.  
  600. Sub RoosterTimer_Timer
  601. RoosterTimer.Enabled = False
  602. BallRelease.CreateBall
  603. DOF 110, DOFPulse
  604. BallRelease.Kick 80,6
  605. startB2S(5)
  606. BallInLane = 1
  607. TiltGame = 0
  608. PlayTableMusic(13)
  609. Call ChangeGILights(1)
  610. StartGame = 1
  611. CurrentPlayer = 1
  612. Call DMDMessage("Player 1", 1)
  613. UpdateText
  614. End Sub
  615.  
  616. '********************
  617. 'Current Ball Text
  618. '********************
  619. Sub UpdateText
  620. If StartGame = 1 And 4 - CurrentBall < 4 Then
  621. BallsText.Text = 4 - CurrentBall
  622. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81, b2sChrLookup2(Asc(4 - CurrentBall))
  623. Else
  624. BallsText.Text = ""
  625. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81, b2sChrLookup2(Asc(" "))
  626. End If
  627. End Sub
  628.  
  629. '********************
  630. 'Lights
  631. '********************
  632. Sub UpdateLights
  633. If AreLightsOff = 0 Then
  634. 'l01.State = L01State(CurrentPlayer)
  635. l02.State = L02State(CurrentPlayer)
  636. l03.State = L03State(CurrentPlayer)
  637. l04.State = L04State(CurrentPlayer)
  638. l05.State = L05State(CurrentPlayer)
  639. l06.State = L06State(CurrentPlayer)
  640. l07.State = L07State(CurrentPlayer)
  641. l08.State = L08State(CurrentPlayer)
  642. l09.State = L09State(CurrentPlayer)
  643. l10.State = L10State(CurrentPlayer)
  644. l11.State = L11State(CurrentPlayer)
  645. l12.State = L12State(CurrentPlayer)
  646. l13.State = L13State(CurrentPlayer)
  647. If KickerSave(CurrentPlayer) < 1 Then l14.State = L14State(CurrentPlayer)
  648. l15.State = L15State(CurrentPlayer)
  649. If KickerSave(CurrentPlayer) < 1 Then l16.State = L16State(CurrentPlayer)
  650. l17.State = L17State(CurrentPlayer)
  651. l18.State = L18State(CurrentPlayer)
  652. l19.State = L19State(CurrentPlayer)
  653. l20.State = L20State(CurrentPlayer)
  654. l21.State = L21State(CurrentPlayer)
  655. l22.State = L22State(CurrentPlayer)
  656. l23.State = L23State(CurrentPlayer)
  657. l24.State = L24State(CurrentPlayer)
  658. l25.State = L25State(CurrentPlayer)
  659. l26.State = L26State(CurrentPlayer)
  660. l27.State = L27State(CurrentPlayer)
  661. l28.State = L28State(CurrentPlayer)
  662. l29.State = L29State(CurrentPlayer)
  663. l30.State = L30State(CurrentPlayer)
  664. l31.State = L31State(CurrentPlayer)
  665. l32.State = L32State(CurrentPlayer)
  666. l33.State = L33State(CurrentPlayer)
  667. l34.State = L34State(CurrentPlayer)
  668. l35.State = L35State(CurrentPlayer)
  669. l36.State = L36State(CurrentPlayer)
  670. If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 OR MultiBallReady(CurrentPlayer) = 1 then l37.State = L37State(CurrentPlayer) : l37.BlinkPattern = "10"
  671. If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 OR MultiBallReady(CurrentPlayer) = 1 then l38.State = L38State(CurrentPlayer) : l38.BlinkPattern = "10"
  672. If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 OR MultiBallReady(CurrentPlayer) = 1 then l39.State = L39State(CurrentPlayer) : l39.BlinkPattern = "10"
  673. l40.State = L40State(CurrentPlayer)
  674. l41.State = L41State(CurrentPlayer)
  675. l42.State = L42State(CurrentPlayer)
  676. l43.State = L43State(CurrentPlayer)
  677. l44.State = L44State(CurrentPlayer)
  678. l45.State = L45State(CurrentPlayer)
  679. l46.State = L46State(CurrentPlayer)
  680. l47.State = L47State(CurrentPlayer)
  681. l48.State = L48State(CurrentPlayer)
  682. l49.State = L49State(CurrentPlayer)
  683. l50.State = L50State(CurrentPlayer)
  684.  
  685. If ModeReady(CurrentPlayer) = 1 Then
  686. ModeReadyLights
  687. If CurrentMode = 4 Then Call DMDMessage("MR KRABS MODE COMPLETE", 1) : CurrentMode = 0 : IntroMusic : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  688. End If
  689. If CurrentMode <> 0 Then BonusLights
  690. If SJPReady(CurrentPlayer) = 1 Then
  691. TurnLightsOff
  692. If CurrentMode = 11 Then L33.State = 2 : L34.State = 2 : L35.State = 2 : L36.State = 2
  693. If CurrentMode = 0 Then ModeReadyLights
  694. End If
  695. End If
  696. End Sub
  697.  
  698. Sub ModeReadyLights
  699. If ModeReady(CurrentPlayer) = 1 Then
  700. For i = 0 to 49
  701. If InsertLights(i).State = 2 then
  702. If i <> 0 AND i <> 11 AND i <> 12 AND i <> 13 AND i <> 14 AND i <> 15 AND i <> 23 AND i <> 24 AND i <> 25 AND i <> 39 AND i <> 46 Then InsertLights(i).State = 0
  703. End If
  704. Next
  705. If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 And SJPReady(CurrentPlayer) = 0 Then l04.state = 2
  706. If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then l37.state = 2 : l37.BlinkPattern = "100"
  707. If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then l38.state = 2 : l38.BlinkPattern = "010"
  708. If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then l39.state = 2 : l39.BlinkPattern = "001"
  709. If SJPReady(CurrentPlayer) = 1 Then l13.state = 2
  710. End If
  711. End Sub
  712.  
  713. Sub ModeLights
  714. If ModesComplete(CurrentPlayer) = 1 Then L05State(CurrentPlayer) = 1
  715. If ModesComplete(CurrentPlayer) = 2 Then L06State(CurrentPlayer) = 1
  716. If ModesComplete(CurrentPlayer) = 3 Then L07State(CurrentPlayer) = 1
  717. If ModesComplete(CurrentPlayer) = 4 Then L08State(CurrentPlayer) = 1
  718. If ModesComplete(CurrentPlayer) = 5 Then L09State(CurrentPlayer) = 1
  719. If ModesComplete(CurrentPlayer) = 6 Then L10State(CurrentPlayer) = 1
  720. If ModesComplete(CurrentPlayer) = 7 Then L11State(CurrentPlayer) = 1
  721. If ModesComplete(CurrentPlayer) = 8 Then L12State(CurrentPlayer) = 1
  722. If ModesComplete(CurrentPlayer) = 9 Then
  723. L13State(CurrentPlayer) = 1
  724. l40State(CurrentPlayer) = 0 : l41State(CurrentPlayer) = 0 : l42State(CurrentPlayer) = 0
  725. l27State(CurrentPlayer) = 0 : l28State(CurrentPlayer) = 0 : l29State(CurrentPlayer) = 0
  726. l43State(CurrentPlayer) = 0 : l44State(CurrentPlayer) = 0 : l45State(CurrentPlayer) = 0
  727. l37State(CurrentPlayer) = 0 : l38State(CurrentPlayer) = 0 : l39State(CurrentPlayer) = 0
  728. l46State(CurrentPlayer) = 0 : l47State(CurrentPlayer) = 0 : l48State(CurrentPlayer) = 0
  729. l24State(CurrentPlayer) = 0 : l25State(CurrentPlayer) = 0 : l26State(CurrentPlayer) = 0
  730. l18State(CurrentPlayer) = 0 : l19State(CurrentPlayer) = 0 : l20State(CurrentPlayer) = 0
  731. l21State(CurrentPlayer) = 0 : l22State(CurrentPlayer) = 0 : l23State(CurrentPlayer) = 0
  732. l30State(CurrentPlayer) = 0 : l31State(CurrentPlayer) = 0 : l32State(CurrentPlayer) = 0
  733. End If
  734. End Sub
  735.  
  736. Sub ResetModeLights
  737. If ModesComplete(CurrentPlayer) = 10 Then
  738. L05State(CurrentPlayer) = 0
  739. L06State(CurrentPlayer) = 0
  740. L07State(CurrentPlayer) = 0
  741. L08State(CurrentPlayer) = 0
  742. L09State(CurrentPlayer) = 0
  743. L10State(CurrentPlayer) = 0
  744. L11State(CurrentPlayer) = 0
  745. L12State(CurrentPlayer) = 0
  746. L13State(CurrentPlayer) = 0
  747. End If
  748. End Sub
  749.  
  750. Sub BonusLights
  751. If CurrentMode = 1 Then l40.State = 2 : l41.State = 2 : l42.State = 2
  752. If CurrentMode = 2 Then l27.State = 2 : l28.State = 2 : l29.State = 2
  753. If CurrentMode = 3 Then l43.State = 2 : l44.State = 2 : l45.State = 2
  754. If CurrentMode = 4 Then l37.State = 2 : l38.State = 2 : l39.State = 2
  755. If CurrentMode = 5 Then l46.State = 2 : l47.State = 2 : l48.State = 2
  756. If CurrentMode = 6 Then l24.State = 2 : l25.State = 2 : l26.State = 2
  757. If CurrentMode = 7 Then l18.State = 2 : l19.State = 2 : l20.State = 2
  758. If CurrentMode = 8 Then l21.State = 2 : l22.State = 2 : l23.State = 2
  759. If CurrentMode = 9 Then l30.State = 2 : l31.State = 2 : l32.State = 2
  760. If CurrentMode = 11 Then l36.State = 2
  761. End Sub
  762.  
  763. Sub TurnLightsOff
  764. For i = 0 to 39
  765. GILights(i).State = 0
  766. Next
  767. For i = 0 to 37
  768. GILights2(i).State = 0
  769. Next
  770. For i = 0 to 49
  771. InsertLights(i).State = 0
  772. Next
  773. End Sub
  774.  
  775. Sub ChangeGILights(GILightState)
  776. If GILightState = 0 Then
  777. For i = 0 to 39
  778. GILights(i).State = 0
  779. Next
  780. For i = 0 to 37
  781. GILights2(i).State = 0
  782. Next
  783. End If
  784. If GILightState = 1 Then
  785. For i = 0 to 39
  786. GILights(i).State = 1
  787. Next
  788. For i = 0 to 37
  789. GILights2(i).State = 1
  790. Next
  791. End If
  792. End Sub
  793.  
  794. Sub JackpotSequence(SequenceTime)
  795. InsertSequence.Play SeqRandom,10,,SequenceTime
  796. GISequence.Play SeqRandom,10,,SequenceTime
  797. GISequence2.Play SeqRandom,10,,SequenceTime
  798. End Sub
  799.  
  800. Sub SJPSequence
  801. If SJPReady(CurrentPlayer) = 2 Then
  802. If SeqNum = 1 Then
  803. InsertSequence.UpdateInterval = 10 : GISequence.UpdateInterval = 10 : GISequence2.UpdateInterval = 10
  804. SJPLight.Interval = 9603 : SJPLight.Enabled = True
  805. InsertSequence.Play SeqHatch1VertOn,10,100
  806. GISequence.Play SeqHatch1VertOn,10,100
  807. GISequence2.Play SeqHatch1VertOn,10,100
  808. End If
  809. If SeqNum = 2 Then
  810. InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
  811. SJPLight.Interval = 5830 : SJPLight.Enabled = True
  812. InsertSequence.Play SeqCircleInOn,10,100
  813. GISequence.Play SeqCircleInOn,10,100
  814. GISequence2.Play SeqCircleInOn,10,100
  815. End If
  816. If SeqNum = 3 Then
  817. InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
  818. InsertSequence.UpdateInterval = 20 : GISequence.UpdateInterval = 20 : GISequence2.UpdateInterval = 20
  819. InsertSequence.Play SeqRandom,10,,3177
  820. GISequence.Play SeqRandom,10,,3177
  821. GISequence2.Play SeqRandom,10,,3177
  822. SeqNum = 0
  823. End If
  824. Else
  825. If SeqNum = 1 Then
  826. PlaySound "Sfx_SJP2",0,RomSoundVolume
  827. InsertSequence.UpdateInterval = 10 : GISequence.UpdateInterval = 10 : GISequence2.UpdateInterval = 10
  828. SJPLight.Interval = 7085 : SJPLight.Enabled = True
  829. InsertSequence.Play SeqCircleInOn,10,100
  830. GISequence.Play SeqCircleInOn,10,100
  831. GISequence2.Play SeqCircleInOn,10,100
  832. End If
  833. If SeqNum = 2 Then
  834. InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
  835. SJPLight.Interval = 10719 : SJPLight.Enabled = True
  836. InsertSequence.Play SeqHatch1VertOn,10,100
  837. GISequence.Play SeqHatch1VertOn,10,100
  838. GISequence2.Play SeqHatch1VertOn,10,100
  839. End If
  840. If SeqNum = 3 Then
  841. InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
  842. InsertSequence.UpdateInterval = 20 : GISequence.UpdateInterval = 20 : GISequence2.UpdateInterval = 20
  843. InsertSequence.Play SeqRandom,10,,3000
  844. GISequence.Play SeqRandom,10,,3000
  845. GISequence2.Play SeqRandom,10,,3000
  846. SeqNum = 0
  847. End If
  848. End If
  849. End Sub
  850.  
  851. Sub SJPLight_Timer
  852. SJPLight.Enabled = False
  853. SeqNum = SeqNum + 1
  854. Call SJPSequence
  855. End Sub
  856.  
  857. 'Sub gi038_Timer
  858. ' gi038.TimerEnabled = False
  859. ' If BumperLightTop.State = 1 Then BumperLightTop.State = 0
  860. ' If BumperLightRight.State = 1 Then BumperLightRight.State = 0
  861. ' If BumperLightLeft.State = 1 Then BumperLightLeft.State = 0
  862. ' If CurrentMode <> 2 Then gi038.State = 1
  863. ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 0
  864. 'End Sub
  865.  
  866. Sub ThunderTimer_Timer
  867. ThunderTimer.Enabled = False
  868. If CurrentMode = 2 Then
  869. PlaySound "Sfx_Thunder",0,RomSoundVolume
  870. ' gi038.State = 1 : gi038.TimerEnabled = True
  871. Nudge int(rnd*360), 5
  872. ThunderTimer.Interval = int(rnd*10000)
  873. ThunderTimer.Enabled = True
  874. End If
  875. End Sub
  876.  
  877. Sub MBIntroLights_Timer
  878. MBIntroLights.Enabled = False
  879. JackpotSequence(1394)
  880. End Sub
  881.  
  882.  
  883. '********************
  884. 'Slings & div switches
  885. '********************
  886.  
  887. Dim LStep, RStep
  888.  
  889. Sub LeftSlingShot_Slingshot
  890. startB2S(7)
  891. 'startB2S(10)
  892. PlaySoundAt SoundFXDOF("fx_Slingshot",103,DOFPulse, DOFContactors), Lemk
  893. AddScore(101230) : SlingSfx
  894. LeftSling4.Visible = 1
  895. Lemk.RotX = 26
  896. LStep = 0
  897. LeftSlingShot.TimerEnabled = 1
  898. End Sub
  899.  
  900. Sub LeftSlingShot_Timer
  901. Select Case LStep
  902. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  903. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  904. Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -10:LeftSlingShot.TimerEnabled = 0
  905. End Select
  906.  
  907. LStep = LStep + 1
  908. End Sub
  909.  
  910. Sub RightSlingShot_Slingshot
  911. startB2S(12)
  912. 'startB2S(10)
  913. PlaySoundAt SoundFXDOF("fx_Slingshot",105,DOFPulse, DOFContactors), Remk
  914. AddScore(101230) : SlingSfx
  915. RightSling4.Visible = 1
  916. Remk.RotX = 26
  917. RStep = 0
  918. RightSlingShot.TimerEnabled = 1
  919. End Sub
  920.  
  921. Sub RightSlingShot_Timer
  922. Select Case RStep
  923. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
  924. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
  925. Case 3:RightSLing2.Visible = 0:Remk.RotX = -10:RightSlingShot.TimerEnabled = 0
  926. End Select
  927.  
  928. RStep = RStep + 1
  929. End Sub
  930.  
  931. '********************
  932. 'Bumpers
  933. '********************
  934. Sub Bumper1_Hit
  935. startB2S(3)
  936. PlaySoundAt SoundFXDOF("fx_bumper",108,DOFPulse, DOFContactors), Bumper1
  937. AddScore(53120) : BumperSfx
  938. BumperLightTop.State = 1
  939. ' If CurrentMode <> 2 Then gi038.State = 0
  940. ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 1
  941. ' gi038.TimerEnabled = True
  942. If CurrentMode = 5 Then AddScore(446880)
  943. End Sub
  944.  
  945. Sub Bumper2_Hit
  946. startB2S(10)
  947. PlaySoundAt SoundFXDOF("fx_bumper",109,DOFPulse, DOFContactors), Bumper2
  948. AddScore(53120) : BumperSfx
  949. BumperLightRight.State = 1
  950. ' If CurrentMode <> 2 Then gi038.State = 0
  951. ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 1
  952. ' gi038.TimerEnabled = True
  953. If CurrentMode = 5 Then AddScore(446880)
  954. End Sub
  955.  
  956. Sub Bumper3_Hit
  957.  
  958. startB2S(11)
  959. PlaySoundAt SoundFXDOF("fx_bumper",107,DOFPulse, DOFContactors), Bumper3
  960. AddScore(53120) : BumperSfx
  961. BumperLightLeft.State = 1
  962. ' If CurrentMode <> 2 Then gi038.State = 0
  963. ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 1
  964. ' gi038.TimerEnabled = True
  965. If CurrentMode = 5 Then AddScore(446880)
  966. End Sub
  967.  
  968. '********************
  969. 'Drain holes, vuks & saucers
  970. '********************
  971. Sub Drain_Hit
  972. startB2S(9)
  973. Drain.DestroyBall
  974. If SJPReady(CurrentPlayer) = 2 Then Exit Sub
  975. PlaysoundAt "fx_drain", drain
  976. SideSave = 0
  977. If OrbitSaved = 1 Then OrbitSaved = 0 : Exit Sub
  978. If CurrentMode <> 11 Then L49State(CurrentPlayer) = 0 : L50State(CurrentPlayer) = 0
  979.  
  980. If Playtime < BallSaveTime(CurrentPlayer) Then
  981. If CurrentMode <> 11 Then BallSaverTimer.Enabled = False
  982. If DrainSave = 0 Then
  983. Call RandomKicker(4)
  984. DrainSave = 1
  985. Else
  986. Call RandomKicker(3)
  987. End If
  988. Call DMDMessage("Ball Saved", 1) : StopSound "Sfx_BallSaved" : PlaySound "Sfx_BallSaved",0,RomSoundVolume
  989. DOF 110, DOFPulse
  990. UpdateLights
  991. End If
  992.  
  993. If Playtime >= BallSaveTime(CurrentPlayer) Then
  994. If CurrentMode <> 11 Then
  995. BallSaverTimer.Enabled = False
  996. TurnLightsOff
  997. StopTableMusic
  998. SongTimer.Enabled = False
  999. EndingMusic
  1000. Drain.TimerEnabled = True
  1001. RoundEndTimer.Enabled = True
  1002. TiltGame = 1
  1003. LeftFlipper.RotateToStart : RightFlipper.RotateToStart
  1004. DOF 101, DOFOff
  1005. DOF 102, DOFOff
  1006. ClearDMD
  1007. Call DMDMessage("Round Over", 1)
  1008. Call DelayScore(((RoundScore/10) * (BonusRounds+1)),3.5)
  1009. Call DMDMessage("BONUS SCORE " & FormatNumber(RoundScore/10,0,,,-1), 1)
  1010. Call DMDMessage("MULTIPLIER X" & BonusRounds + 1, 1)
  1011. Call DMDMessage("TOTAL BONUS " & FormatNumber((RoundScore/10) * (BonusRounds + 1),0,,,-1), 1)
  1012. Else
  1013. CurrentMode = 0
  1014. Call ChangeGILights(1)
  1015. ModeReady(CurrentPlayer) = 0
  1016. SJPReady(CurrentPlayer) = 0
  1017. If BankDown(CurrentPlayer) = 1 Then
  1018. If MoveSpeed < 48 Then NewBankDown = 0
  1019. If MoveSpeed > 47 Then currpos = 0 : Call Update3Bank(0,50)
  1020. End If
  1021. sw77.IsDropped = False : TriggerDown(CurrentPlayer) = False
  1022. TriggerWall.Collidable = True : TriggerWallCollide(CurrentPlayer)=True
  1023. L33State(CurrentPlayer) = 0 : L34State(CurrentPlayer) = 0 : L35State(CurrentPlayer) = 0 : L36State(CurrentPlayer) = 0
  1024. If NextMode(CurrentPlayer) > 0 Then ModeReady(CurrentPlayer) = 1 : Diverter.RotateToEnd
  1025. Call ChangeGILights(1)
  1026. UpdateLights
  1027. Call DMDMessage("Multiball Complete", 1)
  1028. IntroMusic
  1029. End If
  1030. End If
  1031. End Sub
  1032.  
  1033. Sub Drain_Timer
  1034. Drain.TimerEnabled = False
  1035. If Playtime >= BallSaveTime(CurrentPlayer) Then
  1036. If CurrentMode <> 11 Then
  1037. RoundScore = 0
  1038. BonusRounds = 0
  1039. TiltGame = 0
  1040. TiltTime = 0
  1041. If ExtraBall = 0 then
  1042. If CurrentBall = 1 Then CheckHighScores
  1043. If CurrentPlayer = Players Then
  1044. CurrentBall = CurrentBall - 1
  1045. CurrentPlayer = 1
  1046. Else
  1047. CurrentPlayer = CurrentPlayer +1
  1048. End If
  1049. PlayTime = 0
  1050. CurrentMode = 0
  1051. StartNewPlayer
  1052. Else
  1053. PlayTime = 0
  1054. ExtraBall = ExtraBall - 1
  1055. Call DMDMessage("Extra Ball: Shoot Again", 1)
  1056. BallRelease.CreateBall : BallRelease.Kick 80,6
  1057. SongNumber = int(rnd*7)
  1058. PlayTableMusic(13)
  1059. BallInLane = 1
  1060. Call ChangeGILights(1)
  1061. CurrentMode = 0
  1062. UpdateLights
  1063. End If
  1064. End If
  1065. End If
  1066. End Sub
  1067.  
  1068. Sub StartNewPlayer
  1069. If ScoreNumber = "" Then
  1070. If CurrentBall > 0 Then
  1071. HSMusicPlaying.Enabled = False
  1072. BallRelease.CreateBall
  1073. DOF 110, DOFPulse
  1074. BallRelease.Kick 80,6
  1075. BallInLane = 1
  1076. Call ChangeGILights(1)
  1077. Call DMDMessage("Player " & CurrentPlayer, 1)
  1078. SongNumber = int(rnd*7)
  1079. PlayTableMusic(13)
  1080. End If
  1081. 'PlayTime = 0
  1082. 'CurrentMode = 0
  1083. ResetPlayer
  1084. l14.State = L14State(CurrentPlayer) : l16.State = L16State(CurrentPlayer)
  1085. If CurrentBall = 0 Then
  1086. If BankDown(PreviousPlayer) = 1 Then currpos = 0 : Call Update3Bank(0,50)
  1087. l14.State = 0 : l16.State = 0
  1088. Table1_Init
  1089. EndingMusic
  1090. End If
  1091. UpdateText
  1092. End If
  1093. End Sub
  1094.  
  1095. Sub sw36a_Hit
  1096. PlaySoundAt "fx_kicker_enter", sw36a : StopQuotes
  1097. sw36a.DestroyBall
  1098. TiltGame = 1
  1099. ClearDMD
  1100. BallSaverTimer.Enabled = False
  1101. If ModesComplete(CurrentPlayer) = 4 Then ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1) : Call JackpotSequence(750) : StopTableMusic : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
  1102. If ModesComplete(CurrentPlayer) = 8 Then
  1103. SJPReady(CurrentPlayer) = 0
  1104. TiltGame = 1
  1105. FanfareTimer.Interval = 21026 : FanfareTimer.Enabled = True
  1106. Call DelayScore(20000000, 19.304)
  1107. Call DMDMessage(" ", 1) : Call DMDMessage("ALL MODES OPENED", 7.085) : Call DMDMessage("SUPER JACKPOT", 10.719) : Call DMDMessage("20 MILLION", 3.222)
  1108. SJPLight.Interval = 1000 : SJPLight.Enabled = True
  1109. StopTableMusic
  1110. End If
  1111. Call ChangeGILights(0)
  1112. Call DMDMessage(" ", 2) : Call DMDMessage(ModeText(CurrentPlayer), (((MusicInterval(NextMode(CurrentPlayer)))/1000)-2))
  1113. If ModesComplete(CurrentPlayer) <> 8 Then AddScore(500000)
  1114. Diverter.RotateToStart
  1115. sw36a.TimerInterval = MusicInterval(NextMode(CurrentPlayer))
  1116. If ModesComplete(CurrentPlayer) = 4 Then sw36a.TimerInterval = sw36a.TimerInterval + 1000
  1117. If ModesComplete(CurrentPlayer) = 8 Then sw36a.TimerInterval = sw36a.TimerInterval + 22026
  1118. sw36a.TimerEnabled = True
  1119. ModeReady(CurrentPlayer)=0
  1120. BonusRounds = BonusRounds + 1
  1121. ModesComplete(CurrentPlayer) = ModesComplete(CurrentPlayer) + 1
  1122. If ModesComplete(CurrentPlayer) = 10 Then ResetModeLights : ModesComplete(CurrentPlayer) = 1
  1123. CurrentMode = NextMode(CurrentPlayer)
  1124. If ModesComplete(CurrentPlayer) <> 5 AND ModesComplete(CurrentPlayer) <> 9 Then IntroMusic
  1125. If ModesComplete(CurrentPlayer) = 5 Then DelayMusic = 1 : SongTimer.Interval = 1000 : SongTimer.Enabled = True
  1126. If ModesComplete(CurrentPlayer) = 9 Then DelayMusic = 1 : SongTimer.Interval = 22026 : SongTimer.Enabled = True
  1127. LeftFlipper.RotateToStart : RightFlipper.RotateToStart
  1128. DOF 101, DOFOff
  1129. DOF 102, DOFOff
  1130. NextMode(CurrentPlayer) = 0
  1131. ModeLights
  1132. UpdateLights
  1133. TurnLightsOff
  1134. End Sub
  1135. Sub sw36a_Timer
  1136. sw36a.TimerEnabled = False
  1137. TiltGame = 0
  1138. Call RandomKicker(3)
  1139. PlayTime = 0
  1140. BallSaverTimer.Enabled = True
  1141. If CurrentMode <> 2 Then Call ChangeGILights(1)
  1142. If CurrentMode = 2 Then ThunderTimer.Interval = int(rnd*10000) : ThunderTimer.Enabled = True
  1143. UpdateLights
  1144. End Sub
  1145.  
  1146. Sub sw37a_Hit
  1147. PlaySoundAt "fx_hole_enter", sw37a
  1148. sw37a.DestroyBall
  1149. sw37a.TimerEnabled = True
  1150. If CurrentMode <> 11 Then StopTableMusic : StopQuotes : TiltGame = 1 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
  1151. DOF 101, DOFOff
  1152. DOF 102, DOFOff
  1153. If CurrentMode <> 11 Then ChangeGILights(0)
  1154. PlaySound "Sfx_SecretShot",0,RomSoundVolume
  1155. Call DMDMessage("SECRET SHOT", .75) : Call DMDMessage("1 MILLION", .75)
  1156. Call DelayScore(1000000, 1)
  1157. InsertSequence.Play SeqRandom,10,,1500
  1158. End Sub
  1159. Sub sw37a_Timer
  1160. sw37a.TimerEnabled = False
  1161. RandomKicker(3)
  1162. If CurrentMode <> 2 And SJPReady(CurrentPlayer) = 0 Then ChangeGILights(1)
  1163. If CurrentMode <> 11 Then Call PlayTableMusic(CurrentMode) : TiltGame = 0
  1164. End Sub
  1165.  
  1166. Dim aBall
  1167.  
  1168. Sub sw78_Hit
  1169. startB2S(4)
  1170. PlaySoundAt "fx_hole_enter", sw78 : StopQuotes
  1171. DOF 113,2
  1172. DOF 114,2
  1173. ' startB2S(2)
  1174. ShakeMain=1
  1175. a3BankShake
  1176. sw78.DestroyBall
  1177. TiltGame = 1 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
  1178. DOF 101, DOFOff
  1179. DOF 102, DOFOff
  1180. ClearDMD
  1181. BallSaverTimer.Enabled = False
  1182. ChangeGILights(0)
  1183. If CurrentMode <> 11 Then AddScore(500000)
  1184. If CurrentMode = 11 Then
  1185. Call DelayScore(20000000, 18.534)
  1186. Call DMDMessage(" ", 2.622) : Call DMDMessage("SUPER JACKPOT", 15.412) : Call DMDMessage("20 MILLION", 4.077) : Call DMDMessage("LETS DO IT AGAIN", 2)
  1187. StopTableMusic
  1188. PlaySound "Sfx_SJP1",0,RomSoundVolume
  1189. FanfareTimer.Interval = 22111 : FanfareTimer.Enabled = True
  1190. SJPLight.Interval = 2622 : SJPLight.Enabled = True
  1191. SJPReady(CurrentPlayer) = 2
  1192. SongTimer.Enabled = False
  1193. sw78.TimerInterval = 22141
  1194. TiltGame = 1
  1195. LeftFlipper.RotateToStart : RightFlipper.RotateToStart
  1196. DOF 101, DOFOff
  1197. DOF 102, DOFOff
  1198. End If
  1199. sw77.IsDropped = False : TriggerDown(CurrentPlayer) = False
  1200. TriggerWall.Collidable = True : TriggerWallCollide(CurrentPlayer)=True
  1201. If CurrentMode < 10 Then BallsLocked(CurrentPlayer) = BallsLocked(CurrentPlayer)+1
  1202. If BallsLocked(CurrentPlayer) = 1 Then Call DMDMessage("Ball Locked", 2.5) : StopTableMusic : PlaySound "Sfx_Lock1",0,RomSoundVolume : SongTimer.Enabled = False : sw78.TimerInterval = 2500
  1203. If BallsLocked(CurrentPlayer) = 2 Then CurrentMode = 10 : MultiBallReady(CurrentPlayer) = 0 : BallsLocked(CurrentPlayer) = 0 : StopTableMusic : PlaySound "Sfx_Lock2",0,RomSoundVolume : DelayMusic = 1 : PartyMode = 1 : TiltGame = 1 : SongTimer.Interval = 3380 : SongTimer.Enabled = True : MBIntroLights.Enabled = True : Call DMDMessage("BALL LOCKED", 3.38) : Call DMDMessage("ARE YOU READY KIDS", 3) : Call DMDMessage("I CANT HEAR YOU", 4) : Call DMDMessage("OHHHHHHHH", 2) : Call DMDMessage("MULTI-BALL", 2) : sw78.TimerInterval = MusicInterval(11) + 3380 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
  1204. DOF 101, DOFOff
  1205. DOF 102, DOFOff
  1206. sw78.TimerEnabled = True
  1207. currPos = 0
  1208. Call Update3Bank(0,50)
  1209. BankMove = 0
  1210. L33State(CurrentPlayer) = 0
  1211. L34State(CurrentPlayer) = 0
  1212. L35State(CurrentPlayer) = 0
  1213. L36State(CurrentPlayer) = 0 : L03State(CurrentPlayer) = 0
  1214. If BallsLocked(CurrentPlayer) = 0 Then L02State(CurrentPlayer) = 0
  1215. If BallsLocked(CurrentPlayer) = 1 Then L02State(CurrentPlayer) = 1
  1216. UpdateLights
  1217. TurnLightsOff : AreLightsOff = 1
  1218. End Sub
  1219. ' PlaySoundAt SoundFXDOF("fx_bumper",108,DOFPulse, DOFContactors), Bumper1
  1220. Sub sw78_Timer
  1221. sw78.TimerEnabled = False
  1222. sw78.TimerInterval = 1000
  1223. BallSaverTimer.Enabled = True
  1224. If CurrentMode = 10 Then CurrentMode = 11 : ModeReady(CurrentPlayer) = 1 : PlayTime = 0 : KickerSave(CurrentPlayer) = 2 : Diverter.RotateToStart : RandomKicker(4) : sw78.TimerEnabled = True : UpdateLights: PartyMode = 0 : TiltGame = 0 : Exit Sub
  1225. TiltGame = 0
  1226. RandomKicker(3)
  1227. If CurrentMode <> 11 Or SJPReady(CurrentPlayer) = 2 Then Call PlayTableMusic(CurrentMode)
  1228. If SJPReady(CurrentPlayer) = 2 Then RandomKicker(4) : SJPReady(CurrentPlayer) = 0 : TiltGame = 0
  1229. If CurrentMode <> 2 Then Call ChangeGILights(1)
  1230. AreLightsOff = 0
  1231. UpdateLights
  1232. End Sub
  1233.  
  1234. Dim bBall
  1235.  
  1236. Sub sw37_Hit
  1237. startB2S(5)
  1238. PlaySoundAt "fx_hole_enter", sw37
  1239. SpongeBalls = SpongeBalls + 1
  1240. sw37.DestroyBall
  1241. If CurrentMode <> 1 Then AddScore(350000) : Call PlayQuote(3)
  1242. If CurrentMode = 1 Then AddScore(2500000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("2,5 MILLION", .75) : Call JackpotSequence(1000) : JackpotSfx
  1243. sw37.TimerEnabled = True
  1244. ShakeSponge = 2
  1245. SpongeTimer.Interval = 250
  1246. SpongeTimer.Enabled = True
  1247. If L42State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1248. L42State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=1 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Do the Sponge Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1249. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1250. UpdateLights
  1251. End If
  1252. If L40State(CurrentPlayer) = 1 AND L41State(CurrentPlayer) = 0 Then L41State(CurrentPlayer) = 1 : L42State(CurrentPlayer) = 2 : UpdateLights
  1253. If L40State(CurrentPlayer) = 0 Then L40State(CurrentPlayer) = 1 : UpdateLights
  1254. End Sub
  1255.  
  1256. Sub sw37_Timer
  1257. sw37.TimerEnabled = False
  1258. SpongeBalls = SpongeBalls - 1
  1259. RandomKicker(int(rnd(1)*3))
  1260. If SpongeBalls > 0 Then sw37.TimerEnabled = True
  1261. End Sub
  1262.  
  1263. Sub RandomKicker(KickerSelect)
  1264. Select Case KickerSelect
  1265. Case 0 : sw37.CreateBall : sw37.Kick int(rnd(1)*2 + 199), int(rnd(1)*2 + 23) : PlaySoundAt SoundFXDOF("fx_popper",112,DOFPulse,DOFContactors), sw37
  1266. Case 1 : sw37.CreateBall : sw37.Kick int(rnd(1)*2 + 190), int(rnd(1)*2 + 14) : PlaySoundAt SoundFXDOF("fx_popper",112,DOFPulse,DOFContactors), sw37
  1267. Case 2 : DrainShooter.CreateBall : DrainShooter2.Enabled = True : DrainShooter.Kick 0, 40 : PlaySoundAt SoundFXDOF("fx_popper",110,DOFPulse,DOFContactors), DrainShooter
  1268. Case 3 : sw36.CreateBall : sw36.Kick int(rnd(1)*2 - 1), int(rnd(1)*2 + 1) : PlaySoundAt SoundFXDOF("fx_popper",112,DOFPulse,DOFContactors), sw36
  1269. Case 4 : BallRelease.CreateBall : BallRelease.Kick 80,6 : BallRelease.TimerEnabled = True
  1270. End Select
  1271. End Sub
  1272.  
  1273. Sub BallRelease_Timer
  1274. BallRelease.TimerEnabled = False
  1275. Auto_Plunger
  1276. DOF 111, DOFPulse
  1277. End Sub
  1278.  
  1279. Sub DrainShooter2_Hit
  1280. DrainShooter2.Kick int(rnd(1)*30 - 15), int(rnd(1)*2 + 19)
  1281. DrainShooter2.Enabled = False
  1282. End Sub
  1283.  
  1284. '********************
  1285. 'Rollovers & Ramp Switches
  1286. '********************
  1287. Sub sw16_Hit
  1288. PlaySoundAt "fx_sensor", sw16
  1289. If PlayTime < BallSaveTime(CurrentPlayer) Then BallSaverTimer.Enabled = False
  1290. If PlayTime > BallSaveTime(CurrentPlayer)-1 Then
  1291. If SideSave = 0 Then KickerSave(CurrentPlayer) = KickerSave(CurrentPlayer) - 1
  1292. If KickerSave(CurrentPlayer) >= 0 And SJPReady(CurrentPlayer) <> 2 Then
  1293. If SideSave = 0 Then Call RandomKicker(2) : OrbitSaved = 1 : SideSave = 1 : Call DMDMessage("Ball Saved", 1) : StopSound "Sfx_BallSaved" : PlaySound "Sfx_BallSaved",0,RomSoundVolume
  1294. End If
  1295. If KickerSave(CurrentPlayer) < 0 Then L14State(CurrentPlayer)=1
  1296. If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
  1297. ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1.5) : Call JackpotSequence(750) : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
  1298. L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
  1299. End If
  1300. UpdateLights
  1301. End If
  1302. End Sub
  1303.  
  1304.  
  1305. Sub sw26_Hit
  1306. PlaySoundAt "fx_sensor", sw26
  1307. If LRampHit = 0 Then L15State(CurrentPlayer) = 1
  1308. LRampHit = 0
  1309. If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
  1310. ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1.5) : Call JackpotSequence(750) : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
  1311. L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
  1312. End If
  1313. UpdateLights
  1314. End Sub
  1315. Sub sw26_UnHit:End Sub
  1316.  
  1317. Sub sw17_Hit
  1318. PlaySoundAt "fx_sensor", sw17
  1319. If RRampHit = 0 Then L17State(CurrentPlayer) = 1
  1320. RRampHit = 0
  1321. If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
  1322. ExtraBall = ExtraBall + 1 : Call DMDMessage("ExtraBall", 1)
  1323. L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
  1324. End If
  1325. UpdateLights
  1326. End Sub
  1327. Sub sw17_UnHit:End Sub
  1328.  
  1329. Sub sw27_Hit
  1330. PlaySoundAt "fx_sensor", sw27
  1331. If PlayTime < BallSaveTime(CurrentPlayer) Then BallSaverTimer.Enabled = False
  1332. If PlayTime > BallSaveTime(CurrentPlayer)-1 Then
  1333. If SideSave = 0 Then KickerSave(CurrentPlayer) = KickerSave(CurrentPlayer) - 1
  1334. If KickerSave(CurrentPlayer) >= 0 And SJPReady(CurrentPlayer) <> 2 Then
  1335. If SideSave = 0 Then Call RandomKicker(2) : OrbitSaved = 1 : SideSave = 1 : Call DMDMessage("Ball Saved", 1) : StopSound "Sfx_BallSaved" : PlaySound "Sfx_BallSaved",0,RomSoundVolume
  1336. End If
  1337. If KickerSave(CurrentPlayer) < 0 Then L16State(CurrentPlayer)=1
  1338. If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
  1339. ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1.5) : Call JackpotSequence(750) : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
  1340. L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
  1341. End If
  1342. UpdateLights
  1343. End If
  1344. End Sub
  1345. Sub sw27_UnHit:End Sub
  1346.  
  1347. Sub sw38_Hit
  1348. PlaySoundAt "fx_sensor", sw38
  1349. L49State(CurrentPlayer)=1
  1350. If L49State(CurrentPlayer) = 1 AND L50State(CurrentPlayer) = 1 Then
  1351. BallSaveTime(CurrentPlayer) = BallSaveTime(CurrentPlayer) + 1
  1352. StopSound "Sfx_Timer" : PlaySound "Sfx_Timer",0,RomSoundVolume
  1353. Call DMDMessage("Ball Save Now " & BallSaveTime(CurrentPlayer) & " sec", 2)
  1354. L49State(CurrentPlayer) = 0 : L50State(CurrentPlayer) = 0
  1355. End If
  1356. UpdateLights
  1357. End Sub
  1358. Sub sw38_Unhit:End Sub
  1359.  
  1360. Sub sw48_Hit
  1361. PlaySoundAt "fx_sensor", sw48
  1362. L50State(CurrentPlayer)=1
  1363. If L49State(CurrentPlayer) = 1 AND L50State(CurrentPlayer) = 1 Then
  1364. BallSaveTime(CurrentPlayer) = BallSaveTime(CurrentPlayer) + 1
  1365. StopSound "Sfx_Timer" : PlaySound "Sfx_Timer",0,RomSoundVolume
  1366. Call DMDMessage("Ball Save Now " & BallSaveTime(CurrentPlayer) & " sec", 2)
  1367. L49State(CurrentPlayer) = 0 : L50State(CurrentPlayer) = 0
  1368. End If
  1369. UpdateLights
  1370. End Sub
  1371. Sub sw48_Unhit:End Sub
  1372.  
  1373. Sub sw71_Hit
  1374. PlaySoundAt "fx_sensor", sw71
  1375. LGate.Open=True : sw71.TimerEnabled=True
  1376. End Sub
  1377. Sub sw71_UnHit:End Sub
  1378. Sub sw71_Timer
  1379. sw71.TimerEnabled=False
  1380. LGate.Open=False
  1381. End Sub
  1382.  
  1383. Sub sw72_Hit
  1384. startB2S(7)
  1385. startB2S(5)
  1386. PlaySoundAt "fx_sensor", sw72 : StopLOrbitSfx
  1387. If ActiveBall.VelY < 0 Then
  1388. LOrbitSfx
  1389. sw72.TimerEnabled = False
  1390. sw72.TimerEnabled = True
  1391. End If
  1392. End Sub
  1393. Sub sw72_Unhit:End Sub
  1394. Sub sw72_Timer
  1395. sw72.TimerEnabled = False
  1396. End Sub
  1397.  
  1398. Sub sw73_Hit
  1399. PlaySoundAt "fx_sensor", sw73
  1400. End Sub
  1401. Sub sw73_Unhit:End Sub
  1402.  
  1403. Sub sw74_Hit
  1404. 'startB2S(8)
  1405. startB2S(5)
  1406. PlaySoundAt "fx_sensor", sw74 : StopSound "Sfx_ROrbit"
  1407. If ActiveBall.VelY < 0 Then
  1408. PlaySound "Sfx_ROrbit",0,RomSoundVolume
  1409. sw74.TimerEnabled = False
  1410. sw74.TimerEnabled = True
  1411. End If
  1412. End Sub
  1413. Sub sw74_Unhit:End Sub
  1414. Sub sw74_Timer
  1415. sw74.TimerEnabled = False
  1416. End Sub
  1417.  
  1418. Sub sw61_Hit
  1419. startB2S(5)
  1420. RRampHit = RRampHit + 1
  1421. If RRampHit > 1 Then RRampHit = 0
  1422. If ActiveBall.VelY < 0 Then
  1423. RRampSfx
  1424. Else
  1425. StopRRampSfx
  1426. End If
  1427. End Sub
  1428. Sub sw61_Unhit:End Sub
  1429.  
  1430. Sub sw62_Hit
  1431. If ModeReady(CurrentPlayer) = 0 OR CurrentMode = 11 Then RGate.Open=True : sw62.TimerEnabled=True
  1432. End Sub
  1433. Sub sw62_Unhit:End Sub
  1434. Sub sw62_Timer
  1435. sw62.TimerEnabled=False
  1436. If ModeReady(CurrentPlayer)=1 AND CurrentMode <> 11 then Diverter.RotateToEnd : RGate.Open=False
  1437. If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 then RGate.Open=False
  1438. End Sub
  1439. Sub DiverterStuck_Hit
  1440. If ModeReady(CurrentPlayer)=1 AND CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then
  1441. Diverter.RotateToStart
  1442. sw62.TimerEnabled=True
  1443. End If
  1444. End Sub
  1445.  
  1446. Sub sw63_Hit
  1447. startB2S(5)
  1448. If ActiveBall.VelY < 0 Then
  1449. If CurrentMode <> 2 Then LRampSfx
  1450. If CurrentMode = 2 Then Call PlayQuote(5)
  1451. Else
  1452. StopLRampSfx
  1453. End If
  1454. End Sub
  1455.  
  1456. Sub sw63_Unhit:End Sub
  1457.  
  1458. Sub LeftRamp_Hit
  1459. LRampHit = LRampHit + 1
  1460. StopLRampSfx
  1461. If CurrentMode <> 2 Then AddScore(500000)
  1462. If CurrentMode = 2 Then AddScore(10000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("10 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
  1463. If L29State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1464. L29State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=2 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Plankton has Taken Over" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1465. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1466. UpdateLights
  1467. End If
  1468. If L27State(CurrentPlayer) = 1 AND L28State(CurrentPlayer) = 0 Then L28State(CurrentPlayer) = 1 : L29State(CurrentPlayer) = 2 : UpdateLights
  1469. If L27State(CurrentPlayer) = 0 Then L27State(CurrentPlayer) = 1 : UpdateLights
  1470. End Sub
  1471.  
  1472. Sub RightRamp_Hit
  1473. RRampHit = RRampHit + 1
  1474. StopRRampSfx
  1475. If RRampHit = 2 Then
  1476. If CurrentMode <> 3 Then AddScore(500000)
  1477. If CurrentMode = 3 Then AddScore(5000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("5 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
  1478. If L45State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1479. L45State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=3 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Sandy's Rodeo Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1480. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1481. UpdateLights
  1482. End If
  1483. If L43State(CurrentPlayer) = 1 AND L44State(CurrentPlayer) = 0 Then L44State(CurrentPlayer) = 1 : L45State(CurrentPlayer) = 2 : UpdateLights
  1484. If L43State(CurrentPlayer) = 0 Then L43State(CurrentPlayer) = 1 : UpdateLights
  1485. End If
  1486. End Sub
  1487.  
  1488. Sub sw64_Hit:End Sub
  1489. Sub sw64_Unhit:End Sub
  1490.  
  1491. Sub sw65_Hit:End Sub
  1492. Sub sw65_Unhit:End Sub
  1493.  
  1494. Sub sw65a_Hit:End Sub
  1495. Sub sw65a_Unhit:End Sub
  1496.  
  1497. Sub Gate001_Hit
  1498. If ActiveBall.VelY < 0 Then
  1499. If CurrentMode <> 4 Then AddScore(350000) : Call PlayQuote(2)
  1500. If CurrentMode = 4 Then AddScore(7000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("7 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
  1501. If L39State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1502. L39State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=4 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Mr Krabs Money Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1503. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1504. UpdateLights
  1505. End If
  1506. If L37State(CurrentPlayer) = 1 AND L38State(CurrentPlayer) = 0 Then L38State(CurrentPlayer) = 1 : L39State(CurrentPlayer) = 2 : UpdateLights
  1507. If L37State(CurrentPlayer) = 0 Then L37State(CurrentPlayer) = 1 : UpdateLights
  1508. End If
  1509. End Sub
  1510.  
  1511. Sub LGateTrigger_Hit
  1512. If sw74.TimerEnabled = True AND ActiveBall.VelX < 0 Then 'ROrbitHit = 3 Then
  1513. AddScore(350000)
  1514. If CurrentMode = 5 Then Call DMDMessage("Jackpot", 1.5) : Call JackpotSequence(1000) : JackpotSfx
  1515. If L48State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1516. L48State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=5 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Jellyfish Party Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1517. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1518. UpdateLights
  1519. End If
  1520. If L46State(CurrentPlayer) = 1 AND L47State(CurrentPlayer) = 0 Then L47State(CurrentPlayer) = 1 : L48State(CurrentPlayer) = 2 : UpdateLights
  1521. If L46State(CurrentPlayer) = 0 Then L46State(CurrentPlayer) = 1 : UpdateLights
  1522. End If
  1523. End Sub
  1524.  
  1525. Sub RGate_Hit
  1526. If sw72.TimerEnabled = True AND ActiveBall.VelY < 0 Then 'LOrbitHit = 3 Then
  1527. If CurrentMode <> 6 Then AddScore(350000)
  1528. If CurrentMode = 6 Then AddScore(5000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("5 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
  1529. If L26State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1530. L26State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=6 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Boating School Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1531. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1532. UpdateLights
  1533. End If
  1534. If L24State(CurrentPlayer) = 1 AND L25State(CurrentPlayer) = 0 Then L25State(CurrentPlayer) = 1 : L26State(CurrentPlayer) = 2 : UpdateLights
  1535. If L24State(CurrentPlayer) = 0 Then L24State(CurrentPlayer) = 1 : UpdateLights
  1536. End If
  1537. End Sub
  1538.  
  1539. '********************
  1540. 'Targets
  1541. '********************
  1542. Sub sw56_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakeSquidward=1:a3BankShake:PlaySoundAt "fx_solenoidon2", alien5:LeftTargetsHit:End Sub
  1543. Sub sw57_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakeSquidward=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien5:LeftTargetsHit:End Sub
  1544. Sub sw58_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakeSquidward=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien5:LeftTargetsHit:End Sub
  1545. Sub LeftTargetsHit
  1546. DOF 117,DOFPulse
  1547. startB2S(14)
  1548. If CurrentMode <> 7 Then AddScore(250000) : Call PlayQuote(1)
  1549. If CurrentMode = 7 Then AddScore(2500000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("2,5 MILLION", .75) : Call JackpotSequence(1000) : JackpotSfx
  1550. If L20State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1551. L20State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=7 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Squidward's Tiki Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1552. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1553. UpdateLights
  1554. End If
  1555. If L18State(CurrentPlayer) = 1 AND L19State(CurrentPlayer) = 0 Then L19State(CurrentPlayer) = 1 : L20State(CurrentPlayer) = 2 : UpdateLights
  1556. If L18State(CurrentPlayer) = 0 Then L18State(CurrentPlayer) = 1 : UpdateLights
  1557. End Sub
  1558.  
  1559. Sub sw41_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakePatrick=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien14:RightTargetsHit:End Sub
  1560. Sub sw42_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakePatrick=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien14:RightTargetsHit:End Sub
  1561. Sub sw44_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakePatrick=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien14:RightTargetsHit:End Sub
  1562. Sub RightTargetsHit
  1563. DOF 116,DOFPulse
  1564. startB2S(13)
  1565. If CurrentMode <> 8 Then AddScore(250000) : Call PlayQuote(4)
  1566. If CurrentMode = 8 Then AddScore(2500000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("2,5 MILLION", .75) : Call JackpotSequence(1000) : JackpotSfx
  1567. If L23State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1568. L23State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=8 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Goofy Goobers Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1569. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1570. UpdateLights
  1571. End If
  1572. If L21State(CurrentPlayer) = 1 AND L22State(CurrentPlayer) = 0 Then L22State(CurrentPlayer) = 1 : L23State(CurrentPlayer) = 2 : UpdateLights
  1573. If L21State(CurrentPlayer) = 0 Then L21State(CurrentPlayer) = 1 : UpdateLights
  1574. End Sub
  1575.  
  1576. Sub sw43_Hit
  1577. DOF 115,DOFPulse
  1578. startB2S(8)
  1579. PlaySoundAtBall SoundFX("fx_target", DOFTargets)
  1580. ShakePatty=1 : a3BankShake : PlaySoundAt "fx_solenoidon2", Alien6
  1581. If CurrentMode <> 9 Then AddScore(250000) : TargetSfx
  1582. If CurrentMode = 9 Then AddScore(5000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("5 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
  1583. If L32State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
  1584. L32State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=9 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Krusty Krab Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
  1585. If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
  1586. UpdateLights
  1587. End If
  1588. If L30State(CurrentPlayer) = 1 AND L31State(CurrentPlayer) = 0 Then L31State(CurrentPlayer) = 1 : L32State(CurrentPlayer) = 2 : UpdateLights
  1589. If L30State(CurrentPlayer) = 0 Then L30State(CurrentPlayer) = 1 : UpdateLights
  1590. End Sub
  1591.  
  1592. Sub sw75_Hit
  1593. DOF 113,DOFPulse
  1594. startB2S(4)
  1595. PlaySoundAtBall SoundFX("fx_target", DOFTargets) : TargetSfx
  1596. ShakeMain=1
  1597. a3BankShake
  1598. AddScore(100000)
  1599. If L34State(CurrentPlayer) <> 2 And SJPReady(CurrentPlayer) = 0 Then L33State(CurrentPlayer) = 1
  1600. If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
  1601. TriggerWall.Collidable = False : TriggerWallCollide(CurrentPlayer)=False
  1602. sw77.IsDropped = True : TriggerDown(CurrentPlayer) = True
  1603. L34State(CurrentPlayer) = 2
  1604. L36State(CurrentPlayer) = 2
  1605. If BallsLocked(CurrentPlayer) = 0 AND CurrentMode <> 11 Then L02State(CurrentPlayer) = 2 : Call DMDMessage("Ball Lock Ready", 1)
  1606. If BallsLocked(CurrentPlayer) = 1 AND CurrentMode <> 11 Then
  1607. L03State(CurrentPlayer) = 2 : L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2 : Call DMDMessage("MULTI-BALL READY", 2) : Call ChangeGILights(1)
  1608. MultiBallReady(CurrentPlayer) = 1
  1609. CurrentMode = 0 : IntroMusic : ModeReady(CurrentPlayer) = 1 : Diverter.RotateToStart
  1610. End If
  1611. If CurrentMode = 11 Then
  1612. L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2
  1613. SJPReady(CurrentPlayer) = 1
  1614. IntroMusic
  1615. End If
  1616. End If
  1617. UpdateLights
  1618. End Sub
  1619. Sub sw76_Hit
  1620. DOF 113,DOFPulse
  1621. startB2S(3)
  1622. PlaySoundAtBall SoundFX("fx_target", DOFTargets) : TargetSfx
  1623. ShakeMain=1
  1624. a3BankShake
  1625. AddScore(100000)
  1626. If L34State(CurrentPlayer) <> 2 And SJPReady(CurrentPlayer) = 0 Then L35State(CurrentPlayer) = 1
  1627. If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
  1628. TriggerWall.Collidable = False : TriggerWallCollide(CurrentPlayer)=False
  1629. sw77.IsDropped = True : TriggerDown(CurrentPlayer) = True
  1630. L34State(CurrentPlayer) = 2
  1631. L36State(CurrentPlayer) = 2
  1632. If BallsLocked(CurrentPlayer) = 0 AND CurrentMode <> 11 Then L02State(CurrentPlayer) = 2 : Call DMDMessage("Ball Lock Ready", 1)
  1633. If BallsLocked(CurrentPlayer) = 1 AND CurrentMode <> 11 Then
  1634. L03State(CurrentPlayer) = 2 : L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2 : Call DMDMessage("MULTI-BALL READY", 2) : Call ChangeGILights(1)
  1635. MultiBallReady(CurrentPlayer) = 1
  1636. CurrentMode = 0 : IntroMusic : ModeReady(CurrentPlayer) = 1 : Diverter.RotateToStart
  1637. End If
  1638. If CurrentMode = 11 Then
  1639. L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2
  1640. SJPReady(CurrentPlayer) = 1
  1641. IntroMusic
  1642. End If
  1643. End If
  1644. UpdateLights
  1645. End Sub
  1646.  
  1647. '********************
  1648. '3 Bank
  1649. '********************
  1650. Sub sw45_Hit
  1651. DOF 113,DOFPulse
  1652. startB2S(5)
  1653. PlaySoundAtBall SoundFX("fx_target", DOFTargets)
  1654. If MoveSpeed > 47 Or MoveSpeed = 0 Then
  1655. ShakeThree=1
  1656. ShakeMain=.5
  1657. a3BankShake
  1658. TargetSfx
  1659. AddScore(250000)
  1660. BankMove = BankMove + 1
  1661. L33State(CurrentPlayer) = 1
  1662. UpdateLights
  1663. currpos = 50
  1664. If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
  1665. Call Update3Bank(50, 0)
  1666. L33State(CurrentPlayer) = 0
  1667. L34State(CurrentPlayer) = 0
  1668. L35State(CurrentPlayer) = 0
  1669. L36State(CurrentPlayer) = 1 : L03State(CurrentPlayer) = 0
  1670. End If
  1671. End If
  1672. End Sub
  1673.  
  1674. Sub sw46_Hit
  1675. DOF 113,DOFPulse
  1676. startB2S(5)
  1677. PlaySoundAtBall SoundFX("fx_target", DOFTargets)
  1678. If MoveSpeed > 47 Or MoveSpeed = 0 Then
  1679. ShakeThree=1
  1680. ShakeMain=.5
  1681. a3BankShake
  1682. TargetSfx
  1683. AddScore(250000)
  1684. BankMove = BankMove + 1
  1685. L34State(CurrentPlayer) = 1
  1686. UpdateLights
  1687. currpos = 50
  1688. If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
  1689. Call Update3Bank(50, 0)
  1690. L33State(CurrentPlayer) = 0
  1691. L34State(CurrentPlayer) = 0
  1692. L35State(CurrentPlayer) = 0
  1693. L36State(CurrentPlayer) = 1 : L03State(CurrentPlayer) = 0
  1694. End If
  1695. End If
  1696. End Sub
  1697.  
  1698. Sub sw47_Hit
  1699. DOF 113,DOFPulse
  1700. startB2S(5)
  1701. PlaySoundAtBall SoundFX("fx_target", DOFTargets)
  1702. If MoveSpeed > 47 Or MoveSpeed = 0 Then
  1703. ShakeThree=1
  1704. ShakeMain=.5
  1705. a3BankShake
  1706. TargetSfx
  1707. AddScore(250000)
  1708. BankMove = BankMove + 1
  1709. L35State(CurrentPlayer) = 1
  1710. UpdateLights
  1711. currpos = 50
  1712. If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
  1713. Call Update3Bank(50, 0)
  1714. L33State(CurrentPlayer) = 0
  1715. L34State(CurrentPlayer) = 0
  1716. L35State(CurrentPlayer) = 0
  1717. L36State(CurrentPlayer) = 1 : L03State(CurrentPlayer) = 0
  1718. End If
  1719. End If
  1720. End Sub
  1721.  
  1722. '********************
  1723. 'Droptarget
  1724. '********************
  1725. Sub TriggerWall_Hit
  1726. PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw77 : TargetSfx
  1727. ShakeMain= 1
  1728. a3BankShake
  1729. AddScore(100000)
  1730. If SJPReady(CurrentPlayer) = 0 Then L34State(CurrentPlayer) = 1
  1731. If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
  1732. TriggerWall.Collidable = False : TriggerWallCollide(CurrentPlayer)=False
  1733. sw77.IsDropped = True : TriggerDown(CurrentPlayer) = True
  1734. L34State(CurrentPlayer) = 2
  1735. L36State(CurrentPlayer) = 2
  1736. If BallsLocked(CurrentPlayer) = 0 AND CurrentMode <> 11 Then L02State(CurrentPlayer) = 2 : Call DMDMessage("Ball Lock Ready", 1)
  1737. If BallsLocked(CurrentPlayer) = 1 AND CurrentMode <> 11 Then
  1738. L03State(CurrentPlayer) = 2 : L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2 : Call DMDMessage("MULTI-BALL READY", 2) : Call ChangeGILights(1)
  1739. MultiBallReady(CurrentPlayer) = 1
  1740. CurrentMode = 0 : IntroMusic : ModeReady(CurrentPlayer) = 1 : Diverter.RotateToStart
  1741. End If
  1742. If CurrentMode = 11 Then
  1743. L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2
  1744. SJPReady(CurrentPlayer) = 1
  1745. IntroMusic
  1746. End If
  1747. End If
  1748. UpdateLights
  1749. End Sub
  1750.  
  1751. Sub sw77_Hit
  1752. DOF 113, DOFPulse
  1753. End Sub
  1754.  
  1755. Sub PlungerLaneTrigger_Hit
  1756. startB2S(5)
  1757. BallSaverTimer.Enabled = True
  1758. If PlayTime < BallSaveTime(CurrentPlayer) Then
  1759. l01.State=2
  1760. Else
  1761. If ExtraBall > 0 Then l01.State=1
  1762. End If
  1763. If BallInLane = 1 Then
  1764. SkillShot = 0
  1765. SSText = 0
  1766. If DMDText.Text = "PINEAPPLE" Then
  1767. IntroMusic : Call DMDMessage("SKILL SHOT", .5) : Call DMDMessage("1 MILLION", 1) : AddScore(1000000) : InsertSequence.Play SeqRandom,10,,750
  1768. Else
  1769. StopTableMusic : PlaySound "Sfx_SkillMiss",0,RomSoundVolume : DelayMusic = 0 : SongTimer.Interval = 459 : SongTimer.Enabled = True
  1770. Call DMDMessage("SKILL SHOT MISSED", 1)
  1771. End If
  1772. End If
  1773. BallInLane = 0
  1774. DrainSave = 0
  1775. End Sub
  1776.  
  1777. '********************
  1778. 'Ball Save Timer
  1779. '********************
  1780. Sub BallSaverTimer_Timer()
  1781. BallSaverTimer.Enabled = False
  1782. PlayTime = PlayTime+1
  1783. If PlayTime < BallSaveTime(CurrentPlayer) Then
  1784. l01.State=2
  1785. L14.State = L14State(CurrentPlayer) : L16.State = L16State(CurrentPlayer)
  1786. End If
  1787. If PlayTime > BallSaveTime(CurrentPlayer)-1 Then
  1788. If ExtraBall = 0 Then l01.State=0
  1789. If ExtraBall > 0 Then l01.State=1
  1790. If KickerSave(CurrentPlayer) > 0 Then L14.State = 2 : L16.State = 2
  1791. End If
  1792. BallSaverTimer.Enabled = True
  1793. End Sub
  1794.  
  1795. '**********************
  1796. ' Skill Shot
  1797. '**********************
  1798. Sub SkillShotDMD
  1799. Call DMDMessage("WHO", .15)
  1800. Call DMDMessage("LIVES", .15)
  1801. Call DMDMessage("IN A", .15)
  1802. Call DMDMessage("PINEAPPLE", .15)
  1803. Call DMDMessage("UNDER", .15)
  1804. Call DMDMessage("THE SEA", .15)
  1805. End Sub
  1806.  
  1807. Sub SkillShotTimer_Timer
  1808. SkillShotTimer.Enabled = False
  1809. If SkillShot = 1 Then
  1810. SkillShotSfx
  1811. If SkillShot2 = 0 Then DMDText.Text = "WHO" : LEDText("WHO")
  1812. If SkillShot2 = 1 Then DMDText.Text = "LIVES" : LEDText("LIVES")
  1813. If SkillShot2 = 2 Then DMDText.Text = "IN A" : LEDText("IN A")
  1814. If SkillShot2 = 3 Then DMDText.Text = "PINEAPPLE" : LEDText("PINEAPPLE")
  1815. If SkillShot2 = 4 Then DMDText.Text = "UNDER" : LEDText("UNDER")
  1816. If SkillShot2 = 5 Then DMDText.Text = "THE SEA" : LEDText("THE SEA")
  1817. SkillShot2 = SkillShot2 + 1
  1818. If SkillShot2 = 6 Then SkillShot2 = 0
  1819. SkillShotTimer.Enabled = True
  1820. End If
  1821. End Sub
  1822.  
  1823. Sub SkillShotMessage_Timer
  1824. SkillShotMessage.Enabled = False : SkillShotMessage.Interval = 10
  1825. If SSText = 0 AND SkillShot = 0 AND BallInLane = 1 Then DMDText.Text = "HOLD PLUNGER BUTTON" : LEDText("HOLD PLUNGER BUTTON")
  1826. If SSText = 1 AND SkillShot = 0 AND BallInLane = 1 Then DMDText.Text = "STOP ON PINEAPPLE FOR SKILL SHOT" : LEDText("STOP ON PINEAPPLE FOR SKILL SHOT")
  1827. If SSText = 2 AND SkillShot = 0 AND BallInLane = 1 Then DMDText.Text = "PLAYER " & CurrentPlayer : LEDText("PLAYER " & CurrentPlayer)
  1828. If SkillShot = 0 AND BallInLane = 1 Then SSText = SSText + 1
  1829. If SSText = 3 Then SSText = 0
  1830. If BallInLane = 1 AND SkillShot = 0 Then SkillShotMessage.Enabled = True : SkillShotMessage.Interval = 1000
  1831. End Sub
  1832.  
  1833. '*********
  1834. 'Solenoids
  1835. '*********
  1836.  
  1837. Sub Auto_Plunger
  1838. PlungerIM.AutoFire
  1839. End Sub
  1840.  
  1841. '********************
  1842. ' JP Flippers
  1843. '********************
  1844.  
  1845. Sub LeftFlipper_Collide(parm)
  1846. PlaySound "fx_rubber_flipper", 0, (parm/60) * MechSoundVolume, pan(ActiveBall), 0.2, 0, 0, 0, AudioFade(ActiveBall)
  1847. End Sub
  1848.  
  1849. Sub RightFlipper_Collide(parm)
  1850. PlaySound "fx_rubber_flipper", 0, (parm/60) * MechSoundVolume, pan(ActiveBall), 0.2, 0, 0, 0, AudioFade(ActiveBall)
  1851. End Sub
  1852.  
  1853. '******************
  1854. 'Motor Bank Up Down
  1855. '******************
  1856.  
  1857. Sub Update3Bank(currpos, lastpos)
  1858. If currpos <> lastpos Then
  1859. PlaySound "fx_motor",0,MechSoundVolume * .3
  1860. MoveSpeed = 0
  1861. c3BankTimer.Enabled = True
  1862. End If
  1863. If currpos > 40 Then
  1864. NewBankDown = 1
  1865. sw45.Isdropped = 1
  1866. sw46.Isdropped = 1
  1867. sw47.Isdropped = 1
  1868. 'UFORotSpeedMedium
  1869. End If
  1870. If currpos < 10 Then
  1871. NewBankDown = 0
  1872. sw45.Isdropped = 0
  1873. sw46.Isdropped = 0
  1874. sw47.Isdropped = 0
  1875. 'UFORotSpeedSlow
  1876. End If
  1877. End Sub
  1878.  
  1879. Sub c3BankTimer_Timer
  1880. MoveSpeed = MoveSpeed + 1
  1881. If currpos = 50 AND MoveSpeed < 48 Then
  1882. BackBank.Z = BackBank.Z - 1
  1883. swp45.Z = swp45.Z - 1
  1884. swp46.Z = swp45.Z - 1
  1885. swp47.Z = swp47.Z - 1
  1886. BankDown(CurrentPlayer) = 1
  1887. End If
  1888. If currpos = 0 AND MoveSpeed < 48 Then
  1889. BackBank.Z = BackBank.Z + 1
  1890. swp45.Z = swp45.Z + 1
  1891. swp46.Z = swp45.Z + 1
  1892. swp47.Z = swp47.Z + 1
  1893. BankDown(CurrentPlayer) = 0
  1894. End If
  1895. If MoveSpeed > 47 Then
  1896. c3BankTimer.Enabled = False
  1897. UpdateLights
  1898. If BankDown(CurrentPlayer) = 1 AND NewBankDown = 0 Then currpos = 0 : Call Update3Bank(0,50)
  1899. End If
  1900. End Sub
  1901.  
  1902. '*************
  1903. ' 3Bank Shake
  1904. '*************
  1905.  
  1906. Dim ccBall
  1907. Const cMod = .65 'percentage of hit power transfered to the 3 Bank of targets
  1908.  
  1909. ShakeMain = 0
  1910. ShakeThree = 0
  1911. ShakeSponge = 0
  1912. ShakePatty = 0
  1913. ShakePatrick = 0
  1914. ShakeSquidward = 0
  1915.  
  1916. a3BankInit
  1917.  
  1918. Sub a3BankShake
  1919. ccball.velx = activeball.velx * cMod
  1920. ccball.vely = activeball.vely * cMod
  1921. a3BankTimer.enabled = True
  1922. b3BankTimer.enabled = True
  1923. End Sub
  1924.  
  1925. Sub a3BankShake2 'when nudging
  1926. ShakeThree=1
  1927. ShakeMain=.5
  1928. a3BankTimer.enabled = True
  1929. b3BankTimer.enabled = True
  1930. End Sub
  1931.  
  1932. Sub a3BankInit
  1933. Set ccBall = hball.createball
  1934. hball.Kick 0, 0
  1935. ccball.Mass = 1.6
  1936. End Sub
  1937.  
  1938. Sub a3BankTimer_Timer 'start animation
  1939. Dim x, y
  1940. x = (hball.x - ccball.x) / 4 'reduce the X axis movement
  1941. y = (hball.y - ccball.y) / 2
  1942. backbank.transy = x * ShakeThree
  1943. backbank.transx = - y * ShakeThree
  1944. swp45.transy = x * ShakeThree
  1945. swp45.transx = - y * ShakeThree
  1946. swp46.transy = x * ShakeThree
  1947. swp46.transx = - y * ShakeThree
  1948. swp47.transy = x * ShakeThree
  1949. swp47.transx = - y * ShakeThree
  1950. Ufo1.transx = ((rnd(1) * 20) - 10) * ShakeMain
  1951. Ufo1.transz = rnd(1) * 10 * ShakeMain
  1952. Alien5.Transy = 20 * ShakeSquidward : If ShakeSquidward = 1 Then Wall002.IsDropped = False
  1953. Alien6.Transy = 20 * ShakePatty : If ShakePatty = 1 Then Wall004.IsDropped = False
  1954. Alien14.Transy = 20 * ShakePatrick : If ShakePatrick = 1 Then Wall003.IsDropped = False
  1955. End Sub
  1956.  
  1957. Sub b3BankTimer_Timer 'stop animation
  1958. backbank.transx = 0
  1959. backbank.transy = 0
  1960. swp45.transz = 0
  1961. swp45.transx = 0
  1962. swp46.transz = 0
  1963. swp46.transx = 0
  1964. swp47.transz = 0
  1965. swp47.transx = 0
  1966. Ufo1.transx = 0
  1967. Ufo1.transz = 0
  1968. Alien5.Transy = 0 : Wall002.IsDropped = True
  1969. Alien6.Transy = 0 : Wall004.IsDropped = True
  1970. Alien14.Transy = 0 : Wall003.IsDropped = True
  1971. a3BankTimer.enabled = False
  1972. b3BankTimer.enabled = False
  1973. ShakeMain = 0
  1974. ShakeThree = 0
  1975. ShakePatty = 0
  1976. ShakePatrick = 0
  1977. ShakeSquidward = 0
  1978. End Sub
  1979.  
  1980. Sub SpongeTimer_Timer
  1981. SpongeTimer.Enabled = False
  1982. If ShakeSponge > 0 Then
  1983. Alien8.Transy = 20 : Wall005.IsDropped = False
  1984. PlaySoundAt SoundFXDOF("fx_solenoidon2",118,DOFPulse,DOFContactors) , Alien8
  1985. 'PlaySoundAt "fx_solenoidon2", Alien8
  1986. startB2S(1)
  1987. ShakeSponge = ShakeSponge - 1
  1988. ShakeDown.Enabled = True
  1989.  
  1990. Else
  1991. Alien8.Transy = 0 : : Wall005.IsDropped = True
  1992. End If
  1993.  
  1994. End Sub
  1995.  
  1996. Sub ShakeDown_Timer
  1997. ShakeDown.Enabled = False
  1998. Alien8.Transy = 0
  1999. SpongeTimer.Interval = 125
  2000. SpongeTimer.Enabled = True
  2001. End Sub
  2002.  
  2003. '******************************
  2004. ' Diverse Collection Hit Sounds
  2005. '******************************
  2006.  
  2007. Sub aMetals_Hit(idx):PlaySoundAtBall "fx_MetalHit":End Sub
  2008. Sub aRubbers_Hit(idx):PlaySoundAtBall "fx_rubber_band":End Sub
  2009. Sub aPostRubbers_Hit(idx):PlaySoundAtBall "fx_rubber_post":End Sub
  2010. Sub aRubber_Pins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub
  2011. Sub aPlastics_Hit(idx):PlaySoundAtBall "fx_PlasticHit":End Sub
  2012. Sub aGates_Hit(idx):PlaySoundAtBall "fx_Gate":End Sub
  2013. Sub aWoods_Hit(idx):PlaySoundAtBall "fx_Woodhit":End Sub
  2014.  
  2015. ' *********************************************************************
  2016. ' Supporting Ball & Sound Functions
  2017. ' *********************************************************************
  2018.  
  2019. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  2020. Vol = Csng(BallVel(ball) ^2 / 2000)
  2021. End Function
  2022.  
  2023. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  2024. Dim tmp
  2025. tmp = ball.x * 2 / table1.width-1
  2026. If tmp > 0 Then
  2027. Pan = Csng(tmp ^10)
  2028. Else
  2029. Pan = Csng(-((- tmp) ^10))
  2030. End If
  2031. End Function
  2032.  
  2033. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  2034. Pitch = BallVel(ball) * 20
  2035. End Function
  2036.  
  2037. Function BallVel(ball) 'Calculates the ball speed
  2038. BallVel = (SQR((ball.VelX ^2) + (ball.VelY ^2)))
  2039. End Function
  2040.  
  2041. Function AudioFade(ball) 'only on VPX 10.4 and newer
  2042. Dim tmp
  2043. tmp = ball.y * 2 / Table1.height-1
  2044. If tmp > 0 Then
  2045. AudioFade = Csng(tmp ^10)
  2046. Else
  2047. AudioFade = Csng(-((- tmp) ^10))
  2048. End If
  2049. End Function
  2050.  
  2051. Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
  2052. PlaySound soundname, 0, MechSoundVolume, Pan(tableobj), 0.06, 0, 0, 0, AudioFade(tableobj)
  2053. End Sub
  2054.  
  2055. Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets, metals, plastics
  2056. PlaySound soundname, 0, Vol(ActiveBall) * MechSoundVolume, pan(ActiveBall), 0.2, 0, 0, 0, AudioFade(ActiveBall)
  2057. End Sub
  2058.  
  2059. '********************************************
  2060. ' JP's VP10 Rolling Sounds + Ballshadow
  2061. ' uses a collection of shadows, aBallShadow
  2062. '********************************************
  2063.  
  2064. Const tnob = 3 ' total number of balls
  2065. Const lob = 0 'number of locked balls
  2066. ReDim rolling(tnob)
  2067. InitRolling
  2068.  
  2069. Sub InitRolling
  2070. Dim i
  2071. For i = 0 to tnob
  2072. rolling(i) = False
  2073. Next
  2074. End Sub
  2075.  
  2076. Sub RollingTimer_Timer()
  2077. Dim BOT, b, ballpitch, ballvol, X, Y
  2078. BOT = GetBalls
  2079. NudgeSensorStatus X, Y
  2080.  
  2081. 'Tilt Routines
  2082. If LeftPress = 1 Then LTiltPower = LTiltPower + 1
  2083. If RightPress = 1 Then RTiltPower = RTiltPower + 1
  2084. If CenterPress = 1 Then CTiltPower = CTiltPower + 1
  2085. If TiltGame = 0 Then
  2086. If WarningCount = 1 And TiltTime < 51 Then TiltTime = TiltTime + 1
  2087. If abs(X) > TiltLevel Or abs(Y) > TiltLevel Then
  2088. If WarningCount = 0 Then CTiltPower = 30 : CheckTilt
  2089. If WarningCount = 1 And TiltTime > 50 Then CTiltPower = 30 : CheckTilt
  2090. End If
  2091. End If
  2092.  
  2093. 'Flipper Primitive
  2094. batleft.ObjRotZ = LeftFlipper.CurrentAngle
  2095. batright.ObjRotZ = RightFlipper.CurrentAngle
  2096.  
  2097. ' 'B2S Lights
  2098. ' If ShowDT = False Or B2SonDesktop = 1 Then
  2099. ' If B2sLightState <> gi038.State Then
  2100. ' Controller.B2SSetData 1, gi038.State
  2101. ' Controller.B2SSetData 2, gi038.State
  2102. ' Controller.B2SSetData 3, gi038.State
  2103. ' Controller.B2SSetData 4, gi038.State
  2104. ' Controller.B2SSetData 5, gi038.State
  2105. ' Controller.B2SSetData 6, gi038.State
  2106. ' Controller.B2SSetData 7, gi038.State
  2107. ' Controller.B2SSetData 8, gi038.State
  2108. ' Controller.B2SSetData 9, gi038.State
  2109. ' Controller.B2SSetData 10, gi038.State
  2110. ' Controller.B2SSetData 11, gi038.State
  2111. ' Controller.B2SSetData 12, gi038.State
  2112. ' Controller.B2SSetData 13, gi038.State
  2113. ' Controller.B2SSetData 14, gi038.State
  2114. ' Controller.B2SSetData 15, gi038.State
  2115. ' Controller.B2SSetData 16, gi038.State
  2116. ' B2sLightState = gi038.State
  2117. ' End If
  2118. ' End If
  2119.  
  2120. ' stop the sound of deleted balls
  2121. For b = UBound(BOT) + 1 to tnob
  2122. rolling(b) = False
  2123. StopSound("fx_ballrolling" & b)
  2124. Next
  2125.  
  2126. ' exit the sub if no balls on the table
  2127. If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table
  2128.  
  2129. ' play the rolling sound for each ball and draw the shadow
  2130. For b = lob to UBound(BOT)
  2131.  
  2132. If BallVel(BOT(b) )> 1 Then
  2133. If BOT(b).z <30 Then
  2134. ballpitch = Pitch(BOT(b) )
  2135. ballvol = Vol(BOT(b) ) * 10
  2136. Else
  2137. ballpitch = Pitch(BOT(b) ) + 25000 'increase the pitch on a ramp
  2138. ballvol = Vol(BOT(b) ) * 10
  2139. End If
  2140. rolling(b) = True
  2141. PlaySound("fx_ballrolling" & b), -1, ballvol * MechSoundVolume, Pan(BOT(b) ), 0, ballpitch, 1, 0, AudioFade(BOT(b) )
  2142. Else
  2143. If rolling(b) = True Then
  2144. StopSound("fx_ballrolling" & b)
  2145. rolling(b) = False
  2146. End If
  2147. End If
  2148. ' rothbauerw's Dropping Sounds
  2149. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  2150. PlaySound "fx_balldrop", 0, (ABS(BOT(b).velz)/17) * MechSoundVolume, Pan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  2151. End If
  2152. Next
  2153. End Sub
  2154.  
  2155. '**********************
  2156. ' Ball Collision Sound
  2157. '**********************
  2158.  
  2159. Sub OnBallBallCollision(ball1, ball2, velocity)
  2160. PlaySound("fx_collide"), 0, (Csng(velocity) ^2 / 2000) * MechSoundVolume, Pan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  2161. End Sub
  2162.  
  2163. '********************
  2164. 'Adding Score
  2165. '********************
  2166.  
  2167. Sub AddScore(points)
  2168. If Drain.TimerEnabled = False Then RoundScore = RoundScore + points
  2169. TotalScore(CurrentPlayer) = TotalScore(CurrentPlayer) + points
  2170. If CurrentPlayer = 1 Then ScoreText.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
  2171. If CurrentPlayer = 2 Then ScoreText2.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
  2172. If CurrentPlayer = 3 Then ScoreText3.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
  2173. If CurrentPlayer = 4 Then ScoreText4.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
  2174.  
  2175. If ShowDT = False Or B2SonDesktop = 1 Then
  2176. For i = 0 to Len(TotalScore(CurrentPlayer)) - 1
  2177. Controller.B2SSetLED ((10*CurrentPlayer)-i), b2sChrLookup2(Asc(Mid(TotalScore(CurrentPlayer),Len(TotalScore(CurrentPlayer)) - i,1)))
  2178. If i = 3 OR i = 6 OR i = 9 Then
  2179. Controller.B2SSetLED ((10*CurrentPlayer)-i), b2sChrLookup2(Asc(Mid(TotalScore(CurrentPlayer),Len(TotalScore(CurrentPlayer)) - i,1))) + 128
  2180. End If
  2181. Next
  2182.  
  2183. If Len(LEDMessage2) <= 0 AND BallInLane = 0 AND DMDText.TimerEnabled = False Then
  2184. For i = 0 to Len(FormatNumber(TotalScore(CurrentPlayer),0,,,-1)) - 1
  2185. Controller.B2SSetLED (80 - i), b2sChrLookup2(Asc(Mid(FormatNumber(TotalScore(CurrentPlayer),0,,,-1),Len(FormatNumber(TotalScore(CurrentPlayer),0,,,-1)) - i,1)))
  2186. Next
  2187. End If
  2188. End If
  2189. End Sub
  2190.  
  2191. Sub DelayScore(dscore, dtime)
  2192. DScoreValue = dscore
  2193. DelayScoreTimer.Interval = dtime * 1000
  2194. DelayScoreTimer.Enabled = True
  2195. End Sub
  2196.  
  2197. Sub DelayScoreTimer_Timer
  2198. DelayScoreTimer.Enabled = False
  2199. AddScore(DScoreValue)
  2200. End Sub
  2201.  
  2202. '**********************
  2203. ' DMD Display
  2204. '**********************
  2205. Dim h, j
  2206.  
  2207. Sub DMDMessage(Message, DisplayTime)
  2208. For h = 0 to 9
  2209. If DMDDisplay(h,0) = "" Then
  2210. DMDDisplay(h,0) = Message
  2211. DMDDisplay(h,1) = DisplayTime
  2212. Exit For
  2213. End If
  2214. Next
  2215.  
  2216. If DMDText.TimerEnabled = False Then
  2217. DMDText.Text = Message : LEDText(Message)
  2218. DMDText.TimerInterval = DisplayTime * 1000
  2219. DMDText.TimerEnabled = True
  2220. End If
  2221. End Sub
  2222.  
  2223. Sub DMDText_Timer
  2224. DMDText.TimerEnabled = False
  2225. For j = 0 to 8
  2226. DMDDisplay(j,0) = DMDDisplay(j+1,0)
  2227. DMDDisplay(j,1) = DMDDisplay(j+1,1)
  2228. Next
  2229.  
  2230. DMDDisplay(9,0) = ""
  2231. DMDDisplay(9,1) = ""
  2232.  
  2233. If DMDDisplay(0,0) <> "" Then
  2234. DMDText.Text = DMDDisplay(0,0) : LEDText(DMDDisplay(0,0))
  2235. DMDText.TimerInterval = DMDDisplay(0,1) * 1000
  2236. DMDText.TimerEnabled = True
  2237. Else
  2238. If StartGame = 0 Then
  2239. ClearDMD
  2240. If ScoreNumber = "" Then DMDText.Text = "Game Over" : LEDText("Game Over"):startB2S(6)
  2241. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81,0
  2242. If ScoreNumber <> "" Then EnterHS
  2243. Else
  2244. Select Case CurrentMode
  2245. Case 0
  2246. If SkillShot = 0 Then
  2247. If ScoreNumber = "" Then DMDText.Text = "Player " & CurrentPlayer : LEDText("Player " & CurrentPlayer)
  2248. If ModesComplete(CurrentPlayer) = 8 Then DMDText.Text = "Shoot Vault for Super Jackpot" : LEDText("Shoot Vault for Super Jackpot")
  2249. If ScoreNumber <> "" Then EnterHS
  2250. If BallInLane = 1 Then SkillShotMessage.Enabled = True
  2251. End If
  2252. Case 1 : DMDText.Text = "Shoot Spongebob for Jackpot" : LEDText("Shoot Spongebob for Jackpot")
  2253. Case 2 : DMDText.Text = "Shoot Left Ramp for Jackpot" : LEDText("Shoot Left Ramp for Jackpot")
  2254. Case 3 : DMDText.Text = "Shoot Right Ramp for Jackpot" : LEDText("Shoot Right Ramp for Jackpot")
  2255. Case 4 : DMDText.Text = "Shoot Mr Krab's Vault for Jackpot" : LEDText("Shoot Mr Krab's Vault for Jackpot")
  2256. Case 5 : DMDText.Text = "BUMPERS SCORE 500 THOUSAND" : LEDText("BUMPERS SCORE 500 THOUSAND")
  2257. Case 6 : DMDText.Text = "Shoot Left Orbit for Jackpot" : LEDText("Shoot Left Orbit for Jackpot")
  2258. Case 7 : DMDText.Text = "Shoot Squidward for Jackpot" : LEDText("Shoot Squidward for Jackpot")
  2259. Case 8 : DMDText.Text = "Shoot Patrick for Jackpot" : LEDText("Shoot Patrick for Jackpot")
  2260. Case 9 : DMDText.Text = "Shoot Krabby Patty for Jackpot" : LEDText("Shoot Krabby Patty for Jackpot")
  2261. Case 11 : DMDText.Text = "Shoot Pineapple for Super Jackpot" : LEDText("Shoot Pineapple for Super Jackpot")
  2262. End Select
  2263. End If
  2264. End If
  2265. End Sub
  2266.  
  2267. Sub ScoresClear
  2268. If ShowDT = False Or B2SonDesktop = 1 Then
  2269. For i = 1 to 40
  2270. Controller.B2SSetLED i,0
  2271. Next
  2272. Controller.B2SSetLED 81,0
  2273. End If
  2274. End Sub
  2275.  
  2276. Sub LEDText(LEDMessage)
  2277. If ShowDT = False Or B2SonDesktop = 1 Then
  2278. LEDMessage2 = ""
  2279.  
  2280. If Len(LEDMessage) > 20 Then
  2281. LEDMessage2 = Mid(LEDMessage, InStrRev(LEDMessage," ",20) + 1, Len(LEDMessage))
  2282. LEDMessage = Mid(LEDMessage, 1, InStrRev(LEDMessage," ",20))
  2283. End If
  2284.  
  2285. For i = 41 to 80
  2286. Controller.B2SSetLED i, 0
  2287. Next
  2288.  
  2289. For i = 1 to Len(LEDMessage)
  2290. Controller.B2SSetLED 40 + i, b2sChrLookup2(Asc(UCase(Mid(LEDMessage,i,1))))
  2291. Next
  2292.  
  2293. If Len(LEDMessage2) > 0 Then
  2294. For i = 1 to Len(LEDMessage2)
  2295. Controller.B2SSetLED 60 + i, b2sChrLookup2(Asc(UCase(Mid(LEDMessage2,i,1))))
  2296. Next
  2297. End If
  2298. End If
  2299. End Sub
  2300.  
  2301. Sub ClearDMD
  2302. DMDText.TimerEnabled = False
  2303. For h = 0 to 9
  2304. DMDDisplay(h,0) = ""
  2305. DMDDisplay(h,1) = ""
  2306. Next
  2307. End Sub
  2308.  
  2309. '**********************
  2310. ' Music & Sound Routines
  2311. '**********************
  2312. Sub PlayTableMusic(SongSelect)
  2313. StopTableMusic
  2314. Select Case SongSelect
  2315. Case 0
  2316. If MultiBallReady(CurrentPlayer) = 1 Then
  2317. PlaySound "Mode0d", -1 , RomSoundVolume
  2318. ElseIf SJPReady(CurrentPlayer) = 1 Then
  2319. PlaySound "Sfx_SJPReady",-1,RomSoundVolume
  2320. Else
  2321. If SongNumber = 0 Then PlaySound "Mode0", -1, RomSoundVolume
  2322. If SongNumber = 1 Then PlaySound "Mode0a", -1, RomSoundVolume
  2323. If SongNumber = 2 Then PlaySound "Mode0b", -1, RomSoundVolume
  2324. If SongNumber = 3 Then PlaySound "Mode0c", -1, RomSoundVolume
  2325. If SongNumber = 4 Then PlaySound "Mode0e", -1, RomSoundVolume
  2326. If SongNumber = 5 Then PlaySound "Sfx_Greenhorn", -1, RomSoundVolume
  2327. If SongNumber = 6 Then PlaySound "Sfx_Clownfish", -1, RomSoundVolume
  2328. End If
  2329. Case 1 : PlaySound "Mode1", -1, RomSoundVolume
  2330. Case 2 : PlaySound "Mode2", -1, RomSoundVolume
  2331. Case 3 : PlaySound "Mode3", -1, RomSoundVolume
  2332. Case 4 : PlaySound "Mode4", -1, RomSoundVolume
  2333. Case 5 : PlaySound "Mode5", -1, RomSoundVolume
  2334. Case 6 : PlaySound "Mode6", -1, RomSoundVolume
  2335. Case 7 : PlaySound "Mode7", -1, RomSoundVolume
  2336. Case 8 : PlaySound "Mode8", -1, RomSoundVolume
  2337. Case 9 : PlaySound "Mode9", -1, RomSoundVolume
  2338. Case 10 : PlaySound "Mode11", -1, RomSoundVolume
  2339. Case 11
  2340. If SJPReady(CurrentPlayer) = 1 Then
  2341. PlaySound "Sfx_SJPReady",-1,RomSoundVolume
  2342. Else
  2343. PlaySound "Mode11", -1, RomSoundVolume
  2344. End If
  2345. Case 12: PlaySound "Opening", 0, RomSoundVolume
  2346. Case 13
  2347. If MultiBallReady(CurrentPlayer) = 1 Then
  2348. PlaySound "ShooterLaned", -1, RomSoundVolume
  2349. ElseIf SJPReady(CurrentPlayer) = 1 Then
  2350. PlaySound "Sfx_SJPReadyShooter",-1,RomSoundVolume
  2351. Else
  2352. If SongNumber = 0 Then PlaySound "ShooterLane", -1, RomSoundVolume
  2353. If SongNumber = 1 Then PlaySound "ShooterLanea", -1, RomSoundVolume
  2354. If SongNumber = 2 Then PlaySound "ShooterLaneb", -1, RomSoundVolume
  2355. If SongNumber = 3 Then PlaySound "ShooterLanec", -1, RomSoundVolume
  2356. If SongNumber = 4 Then PlaySound "ShooterLanee", -1, RomSoundVolume
  2357. If SongNumber = 5 Then PlaySound "Sfx_GreenhornShooter", -1, RomSoundVolume
  2358. If SongNumber = 6 Then PlaySound "Sfx_ClownfishShooter", -1, RomSoundVolume
  2359. End If
  2360. End Select
  2361. End Sub
  2362.  
  2363. Sub StopTableMusic
  2364. StopSound "Opening"
  2365. StopSound "ShooterLane"
  2366. StopSound "ShooterLanea"
  2367. StopSound "ShooterLaneb"
  2368. StopSound "ShooterLanec"
  2369. StopSound "ShooterLaned"
  2370. StopSound "ShooterLanee"
  2371. StopSound "Mode0"
  2372. StopSound "Mode0a"
  2373. StopSound "Mode0b"
  2374. StopSound "Mode0c"
  2375. StopSound "Mode0d"
  2376. StopSound "Mode0e"
  2377. StopSound "IntroMode0"
  2378. StopSound "IntroMode0a"
  2379. StopSound "IntroMode0b"
  2380. StopSound "IntroMode0c"
  2381. StopSound "IntroMode0d"
  2382. StopSound "IntroMode0e"
  2383. StopSound "IntroMode1"
  2384. StopSound "Mode1"
  2385. StopSound "Mode2"
  2386. StopSound "Mode3"
  2387. StopSound "Mode4"
  2388. StopSound "Mode5"
  2389. StopSound "Mode6"
  2390. StopSound "IntroMode6"
  2391. StopSound "Mode7"
  2392. StopSound "Mode8"
  2393. StopSound "Mode9"
  2394. StopSound "Mode11"
  2395. StopSound "GameOverMusic"
  2396. StopSound "HSMusic"
  2397. StopSound "Sfx_ROrbit"
  2398. StopSound "Sfx_ModeReady"
  2399. StopSound "Sfx_Greenhorn"
  2400. StopSound "Sfx_GreenhornShooter"
  2401. StopSound "Sfx_GreenhornIntro"
  2402. StopSound "Sfx_Clownfish"
  2403. StopSound "Sfx_ClownfishShooter"
  2404. StopSound "Sfx_ClownfishIntro"
  2405. StopSound "Sfx_SJPReady"
  2406. StopSound "Sfx_SJPReadyShooter"
  2407. StopSound "Sfx_SJPReadyIntro"
  2408. StopJackpotSfx
  2409. StopLOrbitSfx
  2410. End Sub
  2411.  
  2412. Sub IntroMusic
  2413. StopTableMusic
  2414. Select Case CurrentMode
  2415. Case 0
  2416. If MultiBallReady(CurrentPlayer) = 1 Then
  2417. PlaySound "IntroMode0d",0,RomSoundVolume : SongTimer.Interval = 1589 : SongTimer.Enabled = True
  2418. ElseIf SJPReady(CurrentPlayer) = 1 Then
  2419. PlaySound "Sfx_SJPReadyIntro",0,RomSoundVolume : SongTimer.Interval = 800 : SongTimer.Enabled = True
  2420. Else
  2421. If SongNumber = 0 Then PlaySound "IntroMode0",0,RomSoundVolume : SongTimer.Interval = 919 : SongTimer.Enabled = True
  2422. If SongNumber = 1 Then PlaySound "IntroMode0a",0,RomSoundVolume : SongTimer.Interval = 1261 : SongTimer.Enabled = True
  2423. If SongNumber = 2 Then PlaySound "IntroMode0b",0,RomSoundVolume : SongTimer.Interval = 1589 : SongTimer.Enabled = True
  2424. If SongNumber = 3 Then PlaySound "IntroMode0c",0,RomSoundVolume : SongTimer.Interval = 2053 : SongTimer.Enabled = True
  2425. If SongNumber = 4 Then PlaySound "IntroMode0e",0,RomSoundVolume : SongTimer.Interval = 919 : SongTimer.Enabled = True
  2426. If SongNumber = 5 Then PlaySound "Sfx_GreenhornIntro",0,RomSoundVolume : SongTimer.Interval = 1499 : SongTimer.Enabled = True
  2427. If SongNumber = 6 Then PlaySound "Sfx_ClownfishIntro",0,RomSoundVolume : SongTimer.Interval = 1580 : SongTimer.Enabled = True
  2428. End If
  2429. Case 1 : PlaySound "IntroMode1",0,RomSoundVolume : SongTimer.Interval = 17948 : SongTimer.Enabled = True
  2430. Case 2 : PlaySound "IntroMode2",0,RomSoundVolume : SongTimer.Interval = 6372 : SongTimer.Enabled = True
  2431. Case 3 : PlaySound "IntroMode3",0,RomSoundVolume : SongTimer.Interval = 5312 : SongTimer.Enabled = True
  2432. Case 4 : PlaySound "IntroMode4",0,RomSoundVolume : SongTimer.Interval = 5928 : SongTimer.Enabled = True
  2433. Case 5 : PlaySound "IntroMode5",0,RomSoundVolume : SongTimer.Interval = 9148 : SongTimer.Enabled = True
  2434. Case 6 : PlaySound "IntroMode6",0,RomSoundVolume : SongTimer.Interval = 16210 : SongTimer.Enabled = True
  2435. Case 7 : PlaySound "IntroMode7",0,RomSoundVolume : SongTimer.Interval = 6524 : SongTimer.Enabled = True
  2436. Case 8 : PlaySound "IntroMode8",0,RomSoundVolume : SongTimer.Interval = 9854 : SongTimer.Enabled = True
  2437. Case 9 : PlaySound "IntroMode9",0,RomSoundVolume : SongTimer.Interval = 8284 : SongTimer.Enabled = True
  2438. Case 10 : PlaySound "IntroMode11",0,RomSoundVolume : SongTimer.Interval = 9376 : SongTimer.Enabled = True
  2439. Case 11
  2440. If SJPReady(CurrentPlayer) = 1 Then
  2441. PlaySound "Sfx_SJPReadyIntro",0,RomSoundVolume : SongTimer.Interval = 800 : SongTimer.Enabled = True
  2442. Else
  2443. PlaySound "IntroMode11",0,RomSoundVolume : SongTimer.Interval = 9376 : SongTimer.Enabled = True
  2444. End If
  2445. End Select
  2446. End Sub
  2447.  
  2448. Sub EndingMusic
  2449. If StartGame = 0 Then InsertSequence.Play SeqCircleOutOn,50,100
  2450. If HSMusicPlaying.Enabled = True Then Exit Sub
  2451. If StartGame = 0 Then PlaySound "GameOverMusic",0,RomSoundVolume : Exit Sub
  2452. Select Case CurrentMode
  2453. Case 0
  2454. If MultiBallReady(CurrentPlayer) = 1 Then
  2455. PlaySound "EndingMode0b",0,RomSoundVolume
  2456. ElseIf SJPReady(CurrentPlayer) = 1 Then
  2457. PlaySound "Sfx_SJPReadyEnding",0,RomSoundVolume
  2458. Else
  2459. If SongNumber = 0 Then PlaySound "EndingMode0",0,RomSoundVolume
  2460. If SongNumber = 1 Then PlaySound "EndingMode0a",0,RomSoundVolume
  2461. If SongNumber = 2 Then PlaySound "EndingMode0b",0,RomSoundVolume
  2462. If SongNumber = 3 Then PlaySound "EndingMode0c",0,RomSoundVolume
  2463. If SongNumber = 4 Then PlaySound "EndingMode0e",0,RomSoundVolume
  2464. If SongNumber = 5 Then PlaySound "Sfx_GreenhornEnding",0,RomSoundVolume
  2465. If SongNumber = 6 Then PlaySound "Sfx_ClownfishEnding",0,RomSoundVolume
  2466. End If
  2467. Case 1 : PlaySound "EndingMode1",0,RomSoundVolume
  2468. Case 2 : PlaySound "EndingMode2",0,RomSoundVolume
  2469. Case 3 : PlaySound "EndingMode3",0,RomSoundVolume
  2470. Case 4 : PlaySound "EndingMode4",0,RomSoundVolume
  2471. Case 5 : PlaySound "EndingMode5",0,RomSoundVolume
  2472. Case 6 : PlaySound "EndingMode6",0,RomSoundVolume
  2473. Case 7 : PlaySound "EndingMode7",0,RomSoundVolume
  2474. Case 8 : PlaySound "EndingMode8",0,RomSoundVolume
  2475. Case 9 : PlaySound "EndingMode9",0,RomSoundVolume
  2476. Case 10 : PlaySound "EndingMode11",0,RomSoundVolume
  2477. Case 11
  2478. If SJPReady(CurrentPlayer) = 1 Then
  2479. PlaySound "Sfx_SJPReadyEnding",0,RomSoundVolume
  2480. Else
  2481. PlaySound "EndingMode11",0,RomSoundVolume
  2482. End If
  2483. End Select
  2484. End Sub
  2485.  
  2486. Sub SongTimer_Timer
  2487. SongTimer.Enabled = False
  2488. If DelayMusic = 0 Then Call PlayTableMusic(CurrentMode)
  2489. If DelayMusic = 1 Then IntroMusic : DelayMusic = 0
  2490. End Sub
  2491.  
  2492. Sub HSMusicPlaying_Timer
  2493. HSMusicPlaying.Enabled = False
  2494. End Sub
  2495.  
  2496. Sub PlayQuote(QuoteNumber)
  2497. Dim QuoteSelect
  2498. If CurrentMode = 2 Then QuoteNumber = 5
  2499. Select Case QuoteNumber
  2500. Case 1
  2501. If QuoteTimer.Enabled = True Then SlingSfx
  2502. If QuoteTimer.Enabled = False Then
  2503. QuoteSelect = int(rnd*11)
  2504. Select Case QuoteSelect
  2505. Case 0 : PlaySound "Sfx_Squid1",0,RomSoundVolume : QuoteTimer.Interval = 5070 : QuoteTimer.Enabled = True
  2506. Case 1 : PlaySound "Sfx_Squid2",0,RomSoundVolume : QuoteTimer.Interval = 7128 : QuoteTimer.Enabled = True
  2507. Case 2 : PlaySound "Sfx_Squid3",0,RomSoundVolume : QuoteTimer.Interval = 2564 : QuoteTimer.Enabled = True
  2508. Case 3 : PlaySound "Sfx_Squid4",0,RomSoundVolume : QuoteTimer.Interval = 1904 : QuoteTimer.Enabled = True
  2509. Case 4 : PlaySound "Sfx_Squid5",0,RomSoundVolume : QuoteTimer.Interval = 2611 : QuoteTimer.Enabled = True
  2510. Case 5 : PlaySound "Sfx_Squid6",0,RomSoundVolume : QuoteTimer.Interval = 3380 : QuoteTimer.Enabled = True
  2511. Case 6 : PlaySound "Sfx_Squid7",0,RomSoundVolume : QuoteTimer.Interval = 1477 : QuoteTimer.Enabled = True
  2512. Case 7 : PlaySound "Sfx_Squid8",0,RomSoundVolume : QuoteTimer.Interval = 3302 : QuoteTimer.Enabled = True
  2513. Case 8 : PlaySound "Sfx_Squid9",0,RomSoundVolume : QuoteTimer.Interval = 2323 : QuoteTimer.Enabled = True
  2514. Case 9 : PlaySound "Sfx_Squid10",0,RomSoundVolume : QuoteTimer.Interval = 2713 : QuoteTimer.Enabled = True
  2515. Case 10 : PlaySound "Sfx_Squid11",0,RomSoundVolume : QuoteTimer.Interval = 2692 : QuoteTimer.Enabled = True
  2516. End Select
  2517. End If
  2518. Case 2
  2519. If QuoteTimer.Enabled = False Then
  2520. QuoteSelect = int(rnd*10)
  2521. Select Case QuoteSelect
  2522. Case 0 : PlaySound "Sfx_Krabs1",0,RomSoundVolume : QuoteTimer.Interval = 4320 : QuoteTimer.Enabled = True
  2523. Case 1 : PlaySound "Sfx_Krabs2",0,RomSoundVolume : QuoteTimer.Interval = 2356 : QuoteTimer.Enabled = True
  2524. Case 2 : PlaySound "Sfx_Krabs3",0,RomSoundVolume : QuoteTimer.Interval = 4978 : QuoteTimer.Enabled = True
  2525. Case 3 : PlaySound "Sfx_Krabs4",0,RomSoundVolume : QuoteTimer.Interval = 3352 : QuoteTimer.Enabled = True
  2526. Case 4 : PlaySound "Sfx_Krabs5",0,RomSoundVolume : QuoteTimer.Interval = 1941 : QuoteTimer.Enabled = True
  2527. Case 5 : PlaySound "Sfx_Krabs6",0,RomSoundVolume : QuoteTimer.Interval = 3601 : QuoteTimer.Enabled = True
  2528. Case 6 : PlaySound "Sfx_Krabs7",0,RomSoundVolume : QuoteTimer.Interval = 4750 : QuoteTimer.Enabled = True
  2529. Case 7 : PlaySound "Sfx_Krabs8",0,RomSoundVolume : QuoteTimer.Interval = 4435 : QuoteTimer.Enabled = True
  2530. Case 8 : PlaySound "Sfx_Krabs9",0,RomSoundVolume : QuoteTimer.Interval = 3576 : QuoteTimer.Enabled = True
  2531. Case 9 : PlaySound "Sfx_Krabs10",0,RomSoundVolume : QuoteTimer.Interval = 2261 : QuoteTimer.Enabled = True
  2532. End Select
  2533. End If
  2534. Case 3
  2535. If QuoteTimer.Enabled = False Then
  2536. QuoteSelect = int(rnd*16)
  2537. Select Case QuoteSelect
  2538. Case 0 : PlaySound "Sfx_Sponge1",0,RomSoundVolume : QuoteTimer.Interval = 3917 : QuoteTimer.Enabled = True
  2539. Case 1 : PlaySound "Sfx_Sponge2",0,RomSoundVolume : QuoteTimer.Interval = 3552 : QuoteTimer.Enabled = True
  2540. Case 2 : PlaySound "Sfx_Sponge3",0,RomSoundVolume : QuoteTimer.Interval = 3133 : QuoteTimer.Enabled = True
  2541. Case 3 : PlaySound "Sfx_Sponge4",0,RomSoundVolume : QuoteTimer.Interval = 3032 : QuoteTimer.Enabled = True
  2542. Case 4 : PlaySound "Sfx_Sponge5",0,RomSoundVolume : QuoteTimer.Interval = 5167 : QuoteTimer.Enabled = True
  2543. Case 5 : PlaySound "Sfx_Sponge6",0,RomSoundVolume : QuoteTimer.Interval = 4846 : QuoteTimer.Enabled = True
  2544. Case 6 : PlaySound "Sfx_Sponge7",0,RomSoundVolume : QuoteTimer.Interval = 6999 : QuoteTimer.Enabled = True
  2545. Case 7 : PlaySound "Sfx_Sponge8",0,RomSoundVolume : QuoteTimer.Interval = 2801 : QuoteTimer.Enabled = True
  2546. Case 8 : PlaySound "Sfx_Sponge9",0,RomSoundVolume : QuoteTimer.Interval = 5277 : QuoteTimer.Enabled = True
  2547. Case 9 : PlaySound "Sfx_Sponge10",0,RomSoundVolume : QuoteTimer.Interval = 3472 : QuoteTimer.Enabled = True
  2548. Case 10 : PlaySound "Sfx_Sponge11",0,RomSoundVolume : QuoteTimer.Interval = 4456 : QuoteTimer.Enabled = True
  2549. Case 11 : PlaySound "Sfx_Sponge12",0,RomSoundVolume : QuoteTimer.Interval = 6586 : QuoteTimer.Enabled = True
  2550. Case 12 : PlaySound "Sfx_Sponge13",0,RomSoundVolume : QuoteTimer.Interval = 6221 : QuoteTimer.Enabled = True
  2551. Case 13 : PlaySound "Sfx_Sponge14",0,RomSoundVolume : QuoteTimer.Interval = 4418 : QuoteTimer.Enabled = True
  2552. Case 14 : PlaySound "Sfx_Sponge15",0,RomSoundVolume : QuoteTimer.Interval = 5053 : QuoteTimer.Enabled = True
  2553. Case 15 : PlaySound "Sfx_Sponge16",0,RomSoundVolume : QuoteTimer.Interval = 6505 : QuoteTimer.Enabled = True
  2554. End Select
  2555. End If
  2556. Case 4
  2557. If QuoteTimer.Enabled = True Then SlingSfx
  2558. If QuoteTimer.Enabled = False Then
  2559. QuoteSelect = int(rnd*10)
  2560. Select Case QuoteSelect
  2561. Case 0 : PlaySound "Sfx_Patrick1",0,RomSoundVolume : QuoteTimer.Interval = 4340 : QuoteTimer.Enabled = True
  2562. Case 1 : PlaySound "Sfx_Patrick2",0,RomSoundVolume : QuoteTimer.Interval = 3960 : QuoteTimer.Enabled = True
  2563. Case 2 : PlaySound "Sfx_Patrick3",0,RomSoundVolume : QuoteTimer.Interval = 5170 : QuoteTimer.Enabled = True
  2564. Case 3 : PlaySound "Sfx_Patrick4",0,RomSoundVolume : QuoteTimer.Interval = 5790 : QuoteTimer.Enabled = True
  2565. Case 4 : PlaySound "Sfx_Patrick5",0,RomSoundVolume : QuoteTimer.Interval = 2657 : QuoteTimer.Enabled = True
  2566. Case 5 : PlaySound "Sfx_Patrick6",0,RomSoundVolume : QuoteTimer.Interval = 5520 : QuoteTimer.Enabled = True
  2567. Case 6 : PlaySound "Sfx_Patrick7",0,RomSoundVolume : QuoteTimer.Interval = 1670 : QuoteTimer.Enabled = True
  2568. Case 7 : PlaySound "Sfx_Patrick8",0,RomSoundVolume : QuoteTimer.Interval = 4060 : QuoteTimer.Enabled = True
  2569. Case 8 : PlaySound "Sfx_Patrick9",0,RomSoundVolume : QuoteTimer.Interval = 3643 : QuoteTimer.Enabled = True
  2570. Case 9 : PlaySound "Sfx_Patrick10",0,RomSoundVolume : QuoteTimer.Interval = 1768 : QuoteTimer.Enabled = True
  2571. End Select
  2572. End If
  2573. Case 5
  2574. If QuoteTimer.Enabled = False Then
  2575. QuoteSelect = int(rnd*10)
  2576. Select Case QuoteSelect
  2577. Case 0 : PlaySound "Sfx_Plankton1",0,RomSoundVolume : QuoteTimer.Interval = 4030 : QuoteTimer.Enabled = True
  2578. Case 1 : PlaySound "Sfx_Plankton2",0,RomSoundVolume : QuoteTimer.Interval = 2990 : QuoteTimer.Enabled = True
  2579. Case 2 : PlaySound "Sfx_Plankton3",0,RomSoundVolume : QuoteTimer.Interval = 3880 : QuoteTimer.Enabled = True
  2580. Case 3 : PlaySound "Sfx_Plankton4",0,RomSoundVolume : QuoteTimer.Interval = 1490 : QuoteTimer.Enabled = True
  2581. Case 4 : PlaySound "Sfx_Plankton5",0,RomSoundVolume : QuoteTimer.Interval = 2101 : QuoteTimer.Enabled = True
  2582. Case 5 : PlaySound "Sfx_Plankton6",0,RomSoundVolume : QuoteTimer.Interval = 6370 : QuoteTimer.Enabled = True
  2583. Case 6 : PlaySound "Sfx_Plankton7",0,RomSoundVolume : QuoteTimer.Interval = 2167 : QuoteTimer.Enabled = True
  2584. Case 7 : PlaySound "Sfx_Plankton8",0,RomSoundVolume : QuoteTimer.Interval = 3440 : QuoteTimer.Enabled = True
  2585. Case 8 : PlaySound "Sfx_Plankton9",0,RomSoundVolume : QuoteTimer.Interval = 4055 : QuoteTimer.Enabled = True
  2586. Case 9 : PlaySound "Sfx_Plankton10",0,RomSoundVolume : QuoteTimer.Interval = 2695 : QuoteTimer.Enabled = True
  2587. End Select
  2588. End If
  2589. End Select
  2590. End Sub
  2591.  
  2592. Sub SlingSfx
  2593. Dim SfxSelect
  2594. SfxSelect = int(rnd*6)
  2595. StopSfx
  2596. Select Case SfxSelect
  2597. Case 0 : PlaySound "Sfx_Sling1",0,RomSoundVolume
  2598. Case 1 : PlaySound "Sfx_Sling2",0,RomSoundVolume
  2599. Case 2 : PlaySound "Sfx_Sling3",0,RomSoundVolume
  2600. Case 3 : PlaySound "Sfx_Sling4",0,RomSoundVolume
  2601. Case 4 : PlaySound "Sfx_Sling5",0,RomSoundVolume
  2602. Case 5 : PlaySound "Sfx_Sling6",0,RomSoundVolume
  2603. End Select
  2604. End Sub
  2605.  
  2606. Sub TargetSfx
  2607. Dim SfxSelect
  2608. SfxSelect = int(rnd*7)
  2609. StopSfx
  2610. Select Case SfxSelect
  2611. Case 0 : PlaySound "Sfx_Target1",0,RomSoundVolume
  2612. Case 1 : PlaySound "Sfx_Target2",0,RomSoundVolume
  2613. Case 2 : PlaySound "Sfx_Target3",0,RomSoundVolume
  2614. Case 3 : PlaySound "Sfx_Target4",0,RomSoundVolume
  2615. Case 4 : PlaySound "Sfx_Target5",0,RomSoundVolume
  2616. Case 5 : PlaySound "Sfx_Target6",0,RomSoundVolume
  2617. Case 6 : PlaySound "Sfx_Target7",0,RomSoundVolume
  2618. End Select
  2619. End Sub
  2620.  
  2621. Sub BumperSfx
  2622. Dim SfxSelect
  2623. SfxSelect = int(rnd*3)
  2624. StopSound "Sfx_Bumper1" : StopSound "Sfx_Bumper2" : StopSound "Sfx_Bumper3"
  2625. Select Case SfxSelect
  2626. Case 0 : PlaySound "Sfx_Bumper1",0,RomSoundVolume
  2627. Case 1 : PlaySound "Sfx_Bumper2",0,RomSoundVolume
  2628. Case 2 : PlaySound "Sfx_Bumper3",0,RomSoundVolume
  2629. End Select
  2630. End Sub
  2631.  
  2632. Sub LOrbitSfx
  2633. Dim SfxSelect
  2634. SfxSelect = int(rnd*4)
  2635. Select Case SfxSelect
  2636. Case 0 : PlaySound "Sfx_LOrbit",0,RomSoundVolume
  2637. Case 1 : PlaySound "Sfx_LOrbit2",0,RomSoundVolume
  2638. Case 2 : PlaySound "Sfx_LOrbit3",0,RomSoundVolume
  2639. Case 3 : PlaySound "Sfx_LOrbit4",0,RomSoundVolume
  2640. End Select
  2641. End Sub
  2642.  
  2643. Sub LRampSfx
  2644. Dim SfxSelect
  2645. SfxSelect = int(rnd*2)
  2646. Select Case SfxSelect
  2647. Case 0 : PlaySound "Sfx_LRamp1",0,RomSoundVolume
  2648. Case 1 : PlaySound "Sfx_LRamp2",0,RomSoundVolume
  2649. End Select
  2650. End Sub
  2651.  
  2652. Sub RRampSfx
  2653. Dim SfxSelect
  2654. SfxSelect = int(rnd*2)
  2655. Select Case SfxSelect
  2656. Case 0 : PlaySound "Sfx_RRamp1",0,RomSoundVolume
  2657. Case 1 : PlaySound "Sfx_RRamp2",0,RomSoundVolume
  2658. End Select
  2659. End Sub
  2660.  
  2661. Sub JackpotSfx
  2662. Dim SfxSelect
  2663. SfxSelect = int(rnd*4)
  2664. StopJackpotSfx
  2665. Select Case SfxSelect
  2666. Case 0 : PlaySound "Sfx_Jackpot",0,RomSoundVolume
  2667. Case 1 : PlaySound "Sfx_Jackpot2",0,RomSoundVolume
  2668. Case 2 : PlaySound "Sfx_Jackpot3",0,RomSoundVolume
  2669. Case 3 : PlaySound "Sfx_Jackpot4",0,RomSoundVolume
  2670. End Select
  2671. End Sub
  2672.  
  2673. Sub SkillShotSfx
  2674. Select Case SkillSelect
  2675. Case 0 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
  2676. Case 1 : PlaySound "Sfx_Skill9",0,RomSoundVolume *.15
  2677. Case 2 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
  2678. Case 3 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
  2679. Case 4 : PlaySound "Sfx_Skill0",0,RomSoundVolume *.15
  2680. Case 5 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
  2681. Case 6 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
  2682. Case 7 : PlaySound "Sfx_Skill9",0,RomSoundVolume *.15
  2683. Case 8 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
  2684. Case 9 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
  2685. Case 10 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
  2686. Case 11 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
  2687. End Select
  2688. SkillSelect = SkillSelect + 1
  2689. If SkillSelect > 11 Then SkillSelect = 0
  2690. End Sub
  2691.  
  2692. Sub RoundBonusSfx
  2693. Dim SfxSelect
  2694. SfxSelect = int(rnd*7)
  2695. Select Case SfxSelect
  2696. Case 0 : PlaySound "Sfx_Bonus1",0,RomSoundVolume
  2697. Case 1 : PlaySound "Sfx_Bonus2",0,RomSoundVolume
  2698. Case 2 : PlaySound "Sfx_Bonus3",0,RomSoundVolume
  2699. Case 3 : PlaySound "Sfx_Bonus4",0,RomSoundVolume
  2700. Case 4 : PlaySound "Sfx_Bonus5",0,RomSoundVolume
  2701. Case 5 : PlaySound "Sfx_Bonus6",0,RomSoundVolume
  2702. Case 6 : PlaySound "Sfx_Bonus7",0,RomSoundVolume
  2703. End Select
  2704. End Sub
  2705.  
  2706. Sub StopQuotes
  2707. StopSound "Sfx_Squid1"
  2708. StopSound "Sfx_Squid2"
  2709. StopSound "Sfx_Squid3"
  2710. StopSound "Sfx_Squid4"
  2711. StopSound "Sfx_Squid5"
  2712. StopSound "Sfx_Squid6"
  2713. StopSound "Sfx_Squid7"
  2714. StopSound "Sfx_Squid8"
  2715. StopSound "Sfx_Squid9"
  2716. StopSound "Sfx_Squid10"
  2717. StopSound "Sfx_Squid11"
  2718. StopSound "Sfx_Krabs1"
  2719. StopSound "Sfx_Krabs2"
  2720. StopSound "Sfx_Krabs3"
  2721. StopSound "Sfx_Krabs4"
  2722. StopSound "Sfx_Krabs5"
  2723. StopSound "Sfx_Krabs6"
  2724. StopSound "Sfx_Krabs7"
  2725. StopSound "Sfx_Krabs8"
  2726. StopSound "Sfx_Krabs9"
  2727. StopSound "Sfx_Krabs10"
  2728. StopSound "Sfx_Sponge1"
  2729. StopSound "Sfx_Sponge2"
  2730. StopSound "Sfx_Sponge3"
  2731. StopSound "Sfx_Sponge4"
  2732. StopSound "Sfx_Sponge5"
  2733. StopSound "Sfx_Sponge6"
  2734. StopSound "Sfx_Sponge7"
  2735. StopSound "Sfx_Sponge8"
  2736. StopSound "Sfx_Sponge9"
  2737. StopSound "Sfx_Sponge10"
  2738. StopSound "Sfx_Sponge11"
  2739. StopSound "Sfx_Sponge12"
  2740. StopSound "Sfx_Sponge13"
  2741. StopSound "Sfx_Sponge14"
  2742. StopSound "Sfx_Sponge15"
  2743. StopSound "Sfx_Sponge16"
  2744. StopSound "Sfx_Patrick1"
  2745. StopSound "Sfx_Patrick2"
  2746. StopSound "Sfx_Patrick3"
  2747. StopSound "Sfx_Patrick4"
  2748. StopSound "Sfx_Patrick5"
  2749. StopSound "Sfx_Patrick6"
  2750. StopSound "Sfx_Patrick7"
  2751. StopSound "Sfx_Patrick8"
  2752. StopSound "Sfx_Patrick9"
  2753. StopSound "Sfx_Patrick10"
  2754. QuoteTimer.Enabled = False
  2755. End Sub
  2756.  
  2757. Sub StopSfx
  2758. StopSound "Sfx_Sling1"
  2759. StopSound "Sfx_Sling2"
  2760. StopSound "Sfx_Sling3"
  2761. StopSound "Sfx_Sling4"
  2762. StopSound "Sfx_Sling5"
  2763. StopSound "Sfx_Sling6"
  2764. StopSound "Sfx_Target1"
  2765. StopSound "Sfx_Target2"
  2766. StopSound "Sfx_Target3"
  2767. StopSound "Sfx_Target4"
  2768. StopSound "Sfx_Target5"
  2769. StopSound "Sfx_Target6"
  2770. StopSound "Sfx_Target7"
  2771. End Sub
  2772.  
  2773. Sub StopLOrbitSfx
  2774. StopSound "Sfx_LOrbit"
  2775. StopSound "Sfx_LOrbit2"
  2776. StopSound "Sfx_LOrbit3"
  2777. StopSound "Sfx_LOrbit4"
  2778. End Sub
  2779.  
  2780. Sub StopLRampSfx
  2781. StopSound "Sfx_LRamp1"
  2782. StopSound "Sfx_LRamp2"
  2783. End Sub
  2784.  
  2785. Sub StopRRampSfx
  2786. StopSound "Sfx_RRamp1"
  2787. StopSound "Sfx_RRamp2"
  2788. End Sub
  2789.  
  2790. Sub StopJackpotSfx
  2791. StopSound "Sfx_Jackpot"
  2792. StopSound "Sfx_Jackpot2"
  2793. StopSound "Sfx_Jackpot3"
  2794. StopSound "Sfx_Jackpot4"
  2795. End Sub
  2796.  
  2797.  
  2798. Sub QuoteTimer_Timer
  2799. QuoteTimer.Enabled = False
  2800. End Sub
  2801.  
  2802. Sub RoundEndTimer_Timer
  2803. RoundEndTimer.Enabled = False
  2804. If soundcount < 3 Then RoundBonusSfx : soundcount = soundcount + 1
  2805. If soundcount < 3 Then RoundEndTimer.Enabled = True
  2806. If soundcount = 3 Then soundcount = 0
  2807. End Sub
  2808.  
  2809. Sub FanfareSfx
  2810. FanfareSelect = FanfareSelect + 1
  2811. If FanfareSelect > 4 Then FanfareSelect = 0
  2812. StopFanfareSfx
  2813. Select Case FanfareSelect
  2814. Case 0 : PlaySound "Sfx_Cheer1",0,RomSoundVolume
  2815. Case 1 : PlaySound "Sfx_Cheer4",0,RomSoundVolume
  2816. Case 2 : PlaySound "Sfx_Cheer2",0,RomSoundVolume
  2817. Case 3 : PlaySound "Sfx_Cheer5",0,RomSoundVolume
  2818. Case 4 : PlaySound "Sfx_Cheer3",0,RomSoundVolume
  2819. End Select
  2820. End Sub
  2821.  
  2822. Sub StopFanfareSfx
  2823. StopSound "Sfx_Cheer1"
  2824. StopSound "Sfx_Cheer2"
  2825. StopSound "Sfx_Cheer3"
  2826. StopSound "Sfx_Cheer4"
  2827. StopSound "Sfx_Cheer5"
  2828. End Sub
  2829.  
  2830. Sub FanfareTimer_Timer
  2831. FanfareTimer.Enabled = False
  2832. TiltGame = 0
  2833. End Sub
  2834.  
  2835. Sub LoadVolumeLevel
  2836. Dim objReg, RKEY
  2837. Set objReg = CreateObject("Wscript.shell")
  2838. On Error Resume Next
  2839. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeMechVol")
  2840. If RKey <> "" Then
  2841. MechSoundVolume = RKey / 100
  2842. Else
  2843. MechSoundVolume = .3
  2844. End If
  2845. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeRomVol")
  2846. If RKey <> "" Then
  2847. RomSoundVolume = RKey / 100
  2848. Else
  2849. RomSoundVolume = 1
  2850. End If
  2851. Set objReg = Nothing
  2852. End Sub
  2853.  
  2854. Sub SaveVolumeLevel
  2855. Dim objReg, RKEY
  2856. Set objReg = CreateObject("Wscript.shell")
  2857. On Error Resume Next
  2858. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeMechVol",MechSoundVolume*100,"REG_DWORD")
  2859. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeRomVol",RomSoundVolume*100,"REG_DWORD")
  2860. Set objReg = Nothing
  2861. End Sub
  2862.  
  2863. '**********************
  2864. ' High Scores
  2865. '**********************
  2866.  
  2867. Sub LoadHighScores
  2868. Dim objReg, RKEY
  2869. Set objReg = CreateObject("Wscript.shell")
  2870. On Error Resume Next
  2871.  
  2872. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS1"): HighScores(0,0) = RKey
  2873. If HighScores(0,0)>0 Then
  2874. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI1"):HighScores(0,1) = RKey
  2875. Else
  2876. HighScores(0,0)=200000000
  2877. HighScores(0,1)="PLK"
  2878. End If
  2879.  
  2880. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS2"): HighScores(1,0) = RKey
  2881. If HighScores(1,0)>0 Then
  2882. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI2"):HighScores(1,1) = RKey
  2883. Else
  2884. HighScores(1,0)=150000000
  2885. HighScores(1,1)="SPB"
  2886. End If
  2887.  
  2888. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS3"): HighScores(2,0) = RKey
  2889. If HighScores(2,0)>0 Then
  2890. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI3"):HighScores(2,1) = RKey
  2891. Else
  2892. HighScores(2,0)=100000000
  2893. HighScores(2,1)="PAT"
  2894. End If
  2895.  
  2896. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS4"): HighScores(3,0) = RKey
  2897. If HighScores(3,0)>0 Then
  2898. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI4"):HighScores(3,1) = RKey
  2899. Else
  2900. HighScores(3,0)=70000000
  2901. HighScores(3,1)="SQD"
  2902. End If
  2903.  
  2904. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS5"): HighScores(4,0) = RKey
  2905. If HighScores(4,0)>0 Then
  2906. RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI5"):HighScores(4,1) = RKey
  2907. Else
  2908. HighScores(4,0)=50000000
  2909. HighScores(4,1)="KRB"
  2910. End If
  2911.  
  2912. Set objReg = Nothing
  2913. End Sub
  2914.  
  2915. Sub SaveHighScores
  2916. Dim objReg, RKEY, FileObj, ScoreFile
  2917. Dim P1,P2,P3,P4,P5
  2918. Set objReg = CreateObject("Wscript.shell")
  2919. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS1",HighScores(0,0),"REG_DWORD")
  2920. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS2",HighScores(1,0),"REG_DWORD")
  2921. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS3",HighScores(2,0),"REG_DWORD")
  2922. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS4",HighScores(3,0),"REG_DWORD")
  2923. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS5",HighScores(4,0),"REG_DWORD")
  2924. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI1",HighScores(0,1),"REG_SZ")
  2925. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI2",HighScores(1,1),"REG_SZ")
  2926. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI3",HighScores(2,1),"REG_SZ")
  2927. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI4",HighScores(3,1),"REG_SZ")
  2928. RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI5",HighScores(4,1),"REG_SZ")
  2929. Set objReg = Nothing
  2930.  
  2931. 'Save HS Text Files
  2932. HSTextFile = 0
  2933. If HSTextFile = 1 Then
  2934. Set FileObj=CreateObject("Scripting.FileSystemObject")
  2935. If Not FileObj.FolderExists(UserDirectory) then
  2936. Exit Sub
  2937. End if
  2938. P1 = "1. " & HighScores(0,1) & " " & HighScores(0,0)
  2939. P2 = "2. " & HighScores(1,1) & " " & HighScores(1,0)
  2940. P3 = "3. " & HighScores(2,1) & " " & HighScores(2,0)
  2941. P4 = "4. " & HighScores(3,1) & " " & HighScores(3,0)
  2942. P5 = "5. " & HighScores(4,1) & " " & HighScores(4,0)
  2943. Set ScoreFile=FileObj.CreateTextFile("C:\Games\HiScores\" & cGameName & ".txt",True)
  2944. ScoreFile.WriteLine "High Scores"
  2945. ScoreFile.WriteLine P1
  2946. ScoreFile.WriteLine P2
  2947. ScoreFile.WriteLine P3
  2948. ScoreFile.WriteLine P4
  2949. ScoreFile.WriteLine P5
  2950. ScoreFile.Close
  2951. Set ScoreFile=Nothing
  2952. Dim dd, mm, yy, hh, nn, ss
  2953. Dim datevalue, timevalue, dtsnow, dtsvalue
  2954.  
  2955. 'Store DateTimeStamp once.
  2956. dtsnow = Now()
  2957.  
  2958. 'Individual date components
  2959. dd = Right("00" & Day(dtsnow), 2)
  2960. mm = Right("00" & Month(dtsnow), 2)
  2961. yy = Year(dtsnow)
  2962. hh = Right("00" & Hour(dtsnow), 2)
  2963. nn = Right("00" & Minute(dtsnow), 2)
  2964. ss = Right("00" & Second(dtsnow), 2)
  2965.  
  2966. 'Build the date string in the format mm/dd/yyyy
  2967. datevalue = mm & "/" & dd & "/" & yy
  2968. 'Build the time string in the format hh:mm:ss
  2969. timevalue = hh & ":" & nn & ":" & ss
  2970. 'Concatenate both together to build the timestamp mm/dd/yyyy hh:mm:ss
  2971. dtsvalue = datevalue & " " & timevalue
  2972. Set ScoreFile=FileObj.OpenTextFile("C:\Games\HiScores\log.txt",8,False)
  2973. ScoreFile.WriteLine dtsvalue & ", Changed, " & cGameName & ".nv"
  2974. Set ScoreFile=Nothing
  2975. Set FileObj=Nothing
  2976. End If
  2977. End Sub
  2978.  
  2979. Sub CheckHighScores
  2980. For i = 0 to 4
  2981. If TotalScore(CurrentPlayer) > HighScores(i,0) Then
  2982. ScoreNumber = i
  2983. If i = 0 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = HighScores(2,0) : HighScores(2,0) = HighScores(1,0) : HighScores(1,0) = HighScores(0,0) : HighScores(0,0) = TotalScore(CurrentPlayer)
  2984. If i = 0 Then HighScores(4,1) = HighScores(3,1) : HighScores(3,1) = HighScores(2,1) : HighScores(2,1) = HighScores(1,1) : HighScores(1,1) = HighScores(0,1) : Exit For
  2985. If i = 1 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = HighScores(2,0) : HighScores(2,0) = HighScores(1,0) : HighScores(1,0) = TotalScore(CurrentPlayer)
  2986. If i = 1 Then HighScores(4,1) = HighScores(3,1) : HighScores(3,1) = HighScores(2,1) : HighScores(2,1) = HighScores(1,1) : Exit For
  2987. If i = 2 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = HighScores(2,0) : HighScores(2,0) = TotalScore(CurrentPlayer)
  2988. If i = 2 Then HighScores(4,1) = HighScores(3,1) : HighScores(3,1) = HighScores(2,1) : Exit For
  2989. If i = 3 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = TotalScore(CurrentPlayer)
  2990. If i = 3 Then HighScores(4,1) = HighScores(3,1) : Exit For
  2991. If i = 4 Then HighScores(4,0) = TotalScore(CurrentPlayer) : Exit For
  2992. Else
  2993. ScoreNumber = ""
  2994. End If
  2995. Next
  2996. End Sub
  2997.  
  2998. Sub EnterHS
  2999. HSDisplay = 0 : DisplayHS.Enabled = False
  3000. If HSDigit = 0 Then DMDText.Text = "HIGH SCORE " & ScoreNumber+1 & " -- ENTER INITIALS WITH FLIPPERS" : LEDText("HIGH SCORE " & ScoreNumber+1 & " -- ENTER INITIALS") : PlaySound "HSMusic",0,RomSoundVolume : HSMusicPlaying.Enabled = True
  3001. If HSDigit = 1 Then DMDText.Text = Chr(HSChr) : LEDText(Chr(HSChr)) : HSI1 = Chr(HSChr)
  3002. If HSDigit = 2 Then DMDText.Text = HSI1 & Chr(HSChr) : LEDText(HSI1 & Chr(HSChr)) : HSI2 = Chr(HSChr)
  3003. If HSDigit = 3 Then DMDText.Text = HSI1 & HSI2 & Chr(HSChr) : LEDText(HSI1 & HSI2 & Chr(HSChr)) : HSI3 = Chr(HSChr) : HighScores(ScoreNumber, 1) = HSI1 & HSI2 & HSI3
  3004. If HSDigit = 4 Then
  3005. SaveHighScores
  3006. DMDText.Text = "NUMBER " & ScoreNumber+1 & " SCORE -- CONGRATULATIONS" : LEDText("NUMBER " & ScoreNumber+1 & " SCORE -- CONGRATULATIONS")
  3007. HSDigit = 0 : ScoreNumber = ""
  3008. If StartGame = 1 Then StartNewPlayer
  3009. If StartGame = 0 Then
  3010. HSDisplay = 1 : DisplayHS.Interval = 5000 : DisplayHS.Enabled = True
  3011. If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81,0
  3012. End If
  3013. End If
  3014. End Sub
  3015.  
  3016. Sub DisplayHS_Timer
  3017. DisplayHS.Enabled = False
  3018. DisplayHS.Interval = 2000
  3019. If HSDisplay = 1 Then
  3020. If HSDisplay2 = 0 Then DMDText.Text = "Bikini Bottom Pinball: Press Start" : LEDText("Bikini Bottom Pinball Press Start")
  3021. If HSDisplay2 = 1 Then DMDText.Text = "HS 1- " & FormatNumber(HighScores(0,0),0,,,-1) & " " & HighScores(0,1) : LEDText("HS 1- " & FormatNumber(HighScores(0,0),0,,,-1) & " " & HighScores(0,1))
  3022. If HSDisplay2 = 2 Then DMDText.Text = "HS 2- " & FormatNumber(HighScores(1,0),0,,,-1) & " " & HighScores(1,1) : LEDText("HS 2- " & FormatNumber(HighScores(1,0),0,,,-1) & " " & HighScores(1,1))
  3023. If HSDisplay2 = 3 Then DMDText.Text = "HS 3- " & FormatNumber(HighScores(2,0),0,,,-1) & " " & HighScores(2,1) : LEDText("HS 3- " & FormatNumber(HighScores(2,0),0,,,-1) & " " & HighScores(2,1))
  3024. If HSDisplay2 = 4 Then DMDText.Text = "HS 4- " & FormatNumber(HighScores(3,0),0,,,-1) & " " & HighScores(3,1) : LEDText("HS 4- " & FormatNumber(HighScores(3,0),0,,,-1) & " " & HighScores(3,1))
  3025. If HSDisplay2 = 5 Then DMDText.Text = "HS 5- " & FormatNumber(HighScores(4,0),0,,,-1) & " " & HighScores(4,1) : LEDText("HS 5- " & FormatNumber(HighScores(4,0),0,,,-1) & " " & HighScores(4,1))
  3026. HSDisplay2 = HSDisplay2 + 1
  3027. If HSDisplay2 = 6 Then HSDisplay2 = 0
  3028. DisplayHS.Enabled = True
  3029. End If
  3030. End Sub
  3031.  
  3032. Sub VolumeTimer_Timer
  3033. VolumeTimer.Enabled = False
  3034. DisplayHS_Timer
  3035. End Sub
  3036.  
  3037. '**********************
  3038. ' Tilt
  3039. '**********************
  3040.  
  3041. Sub CheckTilt
  3042. If StartGame = 1 And TiltGame = 0 And BallInLane = 0 And Drain.TimerEnabled = False Then
  3043. If LTiltPower > 25 Or RTiltPower > 25 Or CTiltPower > 25 Then
  3044. WarningCount = WarningCount + 1
  3045. If WarningCount = 1 Then ClearDMD : Call DMDMessage("WARNING",1) : Playsound "Sfx_Warning", 0, RomSoundVolume
  3046. End If
  3047. If WarningCount > 1 Then ClearDMD : Call DMDMessage("TILT",2) : TiltGame = 1 : Playtime = 100 : StopTableMusic : PlaySound "Sfx_Tilt",0,RomSoundVolume : WarningCount = 0 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
  3048. DOF 101, DOFOff
  3049. DOF 102, DOFOff
  3050. End If
  3051. LTiltPower = 0 : RTiltPower = 0 : CTiltPower = 0
  3052. End Sub
  3053.  
  3054.  
  3055. Sub Table1_Exit
  3056.  
  3057. If B2SOn Then Controller.Stop
  3058.  
  3059. End Sub
  3060.  
  3061.  
Add Comment
Please, Sign In to add comment