Arngrim

Dragon Ball Z

Dec 8th, 2019
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 129.75 KB | None | 0 0
  1.  
  2.  
  3.  
  4. Option Explicit
  5. Randomize
  6.  
  7.  
  8. Sub startB2S(aB2S)
  9. If B2SOn Then
  10. Controller.B2SSetData 1,0
  11. Controller.B2SSetData 2,0
  12. Controller.B2SSetData 3,0
  13. Controller.B2SSetData 4,0
  14. Controller.B2SSetData 5,0
  15. Controller.B2SSetData 6,0
  16. Controller.B2SSetData 7,0
  17. Controller.B2SSetData 8,0
  18. Controller.B2SSetData 9,0
  19. Controller.B2SSetData 10,0
  20. Controller.B2SSetData 11,0
  21. Controller.B2SSetData 12,0
  22. Controller.B2SSetData 13,0
  23. Controller.B2SSetData 14,0
  24. Controller.B2SSetData 15,0
  25. Controller.B2SSetData 16,0
  26. Controller.B2SSetData 17,0
  27. Controller.B2SSetData 18,0
  28. Controller.B2SSetData 19,0
  29. Controller.B2SSetData 20,0
  30. Controller.B2SSetData 21,0
  31. Controller.B2SSetData 22,0
  32. Controller.B2SSetData 23,0
  33. Controller.B2SSetData 24,0
  34. Controller.B2SSetData 25,0
  35. Controller.B2SSetData 26,0
  36. Controller.B2SSetData 27,0
  37. Controller.B2SSetData 28,0
  38. Controller.B2SSetData 29,0
  39. Controller.B2SSetData 30,0
  40. Controller.B2SSetData 31,0
  41. Controller.B2SSetData 32,0
  42. Controller.B2SSetData 33,0
  43. Controller.B2SSetData 34,0
  44. Controller.B2SSetData 35,0
  45. Controller.B2SSetData aB2S,1
  46. End If
  47. End Sub
  48.  
  49. Const BallSize = 50
  50. Const BallMass = 1.2
  51.  
  52. Const directory = "HKEY_CURRENT_USER\SOFTWARE\Visual Pinball\Controller\"
  53. Dim objShell
  54. Dim PopupMessage
  55. Dim B2SController
  56. Dim Controller
  57. Const DOFContactors = 1
  58. Const DOFKnocker = 2
  59. Const DOFChimes = 3
  60. Const DOFBell = 4
  61. Const DOFGear = 5
  62. Const DOFShaker = 6
  63. Const DOFFlippers = 7
  64. Const DOFTargets = 8
  65. Const DOFDropTargets = 9
  66. Const DOFOff = 0
  67. Const DOFOn = 1
  68. Const DOFPulse = 2
  69.  
  70. Dim DOFeffects(9)
  71. Dim B2SOn
  72. Dim B2SOnALT
  73.  
  74. Sub LoadEM
  75. LoadController("EM")
  76. End Sub
  77.  
  78. Sub LoadPROC(VPMver, VBSfile, VBSver)
  79. LoadVBSFiles VPMver, VBSfile, VBSver
  80. LoadController("PROC")
  81. End Sub
  82.  
  83. Sub LoadVPM(VPMver, VBSfile, VBSver)
  84. LoadVBSFiles VPMver, VBSfile, VBSver
  85. LoadController("VPM")
  86. End Sub
  87.  
  88. 'This is used for tables that need 2 controllers to be launched, one for VPM and the second one for B2S.Server
  89. 'Because B2S.Server can't handle certain solenoid or lamps, we use this workaround to communicate to B2S.Server and DOF
  90. 'By scripting the effects using DOFAlT and SoundFXDOFALT and B2SController
  91. Sub LoadVPMALT(VPMver, VBSfile, VBSver)
  92. LoadVBSFiles VPMver, VBSfile, VBSver
  93. LoadController("VPMALT")
  94. End Sub
  95.  
  96. Sub LoadVBSFiles(VPMver, VBSfile, VBSver)
  97. On Error Resume Next
  98. If ScriptEngineMajorVersion < 5 Then MsgBox "VB Script Engine 5.0 or higher required"
  99. ExecuteGlobal GetTextFile(VBSfile)
  100. If Err Then MsgBox "Unable to open " & VBSfile & ". Ensure that it is in the same folder as this table. " & vbNewLine & Err.Description
  101. InitializeOptions
  102. End Sub
  103.  
  104. Sub LoadVPinMAME
  105. Set Controller = CreateObject("VPinMAME.Controller")
  106. If Err Then MsgBox "Can't load VPinMAME." & vbNewLine & Err.Description
  107. If VPMver > "" Then If Controller.Version < VPMver Or Err Then MsgBox "VPinMAME ver " & VPMver & " required."
  108. If VPinMAMEDriverVer < VBSver Or Err Then MsgBox VBSFile & " ver " & VBSver & " or higher required."
  109. On Error Goto 0
  110. End Sub
  111.  
  112. 'Try to load b2s.server and if not possible, load VPinMAME.Controller instead.
  113. 'The user can put a value of 1 for ForceDisableB2S, which will force to load VPinMAME or no controller for EM tables.
  114. 'Also defines the array of toy categories that will either play the sound or trigger the DOF effect.
  115. Sub LoadController(TableType)
  116. Dim FileObj
  117. Dim DOFConfig
  118. Dim TextStr2
  119. Dim tempC
  120. Dim count
  121. Dim ISDOF
  122. Dim Answer
  123.  
  124. B2SOn = False
  125. B2SOnALT = False
  126. tempC = 0
  127. on error resume next
  128. Set objShell = CreateObject("WScript.Shell")
  129. objShell.RegRead(directory & "ForceDisableB2S")
  130. If Err.number <> 0 Then
  131. PopupMessage = "This latest version of Controller.vbs stores its settings in the registry. To adjust the values, you must use VP 10.2 (or newer) and setup your configuration in the DOF section of the -Keys, Nudge and DOF- dialog of Visual Pinball."
  132. objShell.RegWrite directory & "ForceDisableB2S",0, "REG_DWORD"
  133. objShell.RegWrite directory & "DOFContactors",2, "REG_DWORD"
  134. objShell.RegWrite directory & "DOFKnocker",2, "REG_DWORD"
  135. objShell.RegWrite directory & "DOFChimes",2, "REG_DWORD"
  136. objShell.RegWrite directory & "DOFBell",2, "REG_DWORD"
  137. objShell.RegWrite directory & "DOFGear",2, "REG_DWORD"
  138. objShell.RegWrite directory & "DOFShaker",2, "REG_DWORD"
  139. objShell.RegWrite directory & "DOFFlippers",2, "REG_DWORD"
  140. objShell.RegWrite directory & "DOFTargets",2, "REG_DWORD"
  141. objShell.RegWrite directory & "DOFDropTargets",2, "REG_DWORD"
  142. MsgBox PopupMessage
  143. End If
  144. tempC = objShell.RegRead(directory & "ForceDisableB2S")
  145. DOFeffects(1)=objShell.RegRead(directory & "DOFContactors")
  146. DOFeffects(2)=objShell.RegRead(directory & "DOFKnocker")
  147. DOFeffects(3)=objShell.RegRead(directory & "DOFChimes")
  148. DOFeffects(4)=objShell.RegRead(directory & "DOFBell")
  149. DOFeffects(5)=objShell.RegRead(directory & "DOFGear")
  150. DOFeffects(6)=objShell.RegRead(directory & "DOFShaker")
  151. DOFeffects(7)=objShell.RegRead(directory & "DOFFlippers")
  152. DOFeffects(8)=objShell.RegRead(directory & "DOFTargets")
  153. DOFeffects(9)=objShell.RegRead(directory & "DOFDropTargets")
  154. Set objShell = nothing
  155.  
  156. If TableType = "PROC" or TableType = "VPMALT" Then
  157. If TableType = "PROC" Then
  158. Set Controller = CreateObject("VPROC.Controller")
  159. If Err Then MsgBox "Can't load PROC"
  160. Else
  161. LoadVPinMAME
  162. End If
  163. If tempC = 0 Then
  164. On Error Resume Next
  165. If Controller is Nothing Then
  166. Err.Clear
  167. Else
  168. Set B2SController = CreateObject("B2S.Server")
  169. If B2SController is Nothing Then
  170. Err.Clear
  171. Else
  172. B2SController.B2SName = B2ScGameName
  173. B2SController.Run()
  174. On Error Goto 0
  175. B2SOn = True
  176. B2SOnALT = True
  177. End If
  178. End If
  179. End If
  180. Else
  181. If tempC = 0 Then
  182. On Error Resume Next
  183. Set Controller = CreateObject("B2S.Server")
  184. If Controller is Nothing Then
  185. Err.Clear
  186. If TableType = "VPM" Then
  187. LoadVPinMAME
  188. End If
  189. Else
  190. Controller.B2SName = cGameName
  191. If TableType = "EM" Then
  192. Controller.Run()
  193. End If
  194. On Error Goto 0
  195. B2SOn = True
  196. End If
  197. Else
  198. If TableType = "VPM" Then
  199. LoadVPinMAME
  200. End If
  201. End If
  202. Set DOFConfig=Nothing
  203. Set FileObj=Nothing
  204. End If
  205. End sub
  206.  
  207. 'Additional DOF sound vs toy/effect helpers:
  208.  
  209. 'Mostly used for SS tables, returns the sound to be played or no sound,
  210. 'depending on the toy category that is set to play the sound or not.
  211. 'The trigger of the DOF Effect is set at the DOF method level
  212. 'because for SS tables we usually don't need to script the DOF calls.
  213. 'Just map the Solenoid, Switches and Lamps in the ini file directly.
  214. Function SoundFX (Sound, Effect)
  215. If ((Effect = 0 And B2SOn) Or DOFeffects(Effect)=1) Then
  216. SoundFX = ""
  217. Else
  218. SoundFX = Sound
  219. End If
  220. End Function
  221.  
  222. 'Mostly used for EM tables, because in EM there is most often a direct link
  223. 'between a sound and DOF Trigger, DOFevent is the ID reference of the DOF Call
  224. 'that is used in the DOF ini file and State defines if it pulses, goes on or off.
  225. 'Example based on the constants that must be present in the table script:
  226. 'SoundFXDOF("flipperup",101,DOFOn,contactors)
  227. Function SoundFXDOF (Sound, DOFevent, State, Effect)
  228. If DOFeffects(Effect)=1 Then
  229. SoundFXDOF = ""
  230. DOF DOFevent, State
  231. ElseIf DOFeffects(Effect)=2 Then
  232. SoundFXDOF = Sound
  233. DOF DOFevent, State
  234. Else
  235. SoundFXDOF = Sound
  236. End If
  237. End Function
  238.  
  239. 'Method used to communicate to B2SController instead of the usual Controller
  240. Function SoundFXDOFALT (Sound, DOFevent, State, Effect)
  241. If DOFeffects(Effect)=1 Then
  242. SoundFXDOFALT = ""
  243. DOFALT DOFevent, State
  244. ElseIf DOFeffects(Effect)=2 Then
  245. SoundFXDOFALT = Sound
  246. DOFALT DOFevent, State
  247. Else
  248. SoundFXDOFALT = Sound
  249. End If
  250. End Function
  251.  
  252. 'Pure method that makes it easier to call just a DOF Event.
  253. 'Example DOF 123, DOFOn
  254. 'Where 123 refers to E123 in a line in the DOF ini.
  255. Sub DOF(DOFevent, State)
  256. If B2SOn Then
  257. If State = 2 Then
  258. Controller.B2SSetData DOFevent, 1:Controller.B2SSetData DOFevent, 0
  259. Else
  260. Controller.B2SSetData DOFevent, State
  261. End If
  262. End If
  263. End Sub
  264.  
  265. 'If PROC or B2SController is used, we need to pass B2S events to the B2SController instead of the usual Controller
  266. 'Use this method to pass information to DOF instead of the Sub DOF
  267. Sub DOFALT(DOFevent, State)
  268. If B2SOnALT Then
  269. If State = 2 Then
  270. B2SController.B2SSetData DOFevent, 1:B2SController.B2SSetData DOFevent, 0
  271. Else
  272. B2SController.B2SSetData DOFevent, State
  273. End If
  274. End If
  275. End Sub
  276. ' Load the core.vbs for supporting Subs and functions
  277. LoadCoreVBS
  278.  
  279. Sub LoadCoreVBS
  280. On Error Resume Next
  281. ExecuteGlobal GetTextFile("core.vbs")
  282. If Err Then MsgBox "Can't open core.vbs"
  283. On Error Goto 0
  284. End Sub
  285.  
  286.  
  287. ExecuteGlobal GetTextFile("FPVPX.vbs")
  288. If Err Then MsgBox "you need the fpvpx.vbs for the proper functioning of the table"
  289.  
  290. Const cGameName = "DBZ"
  291.  
  292.  
  293. if Table1.ShowDT Then
  294. D1.visible = 1
  295. Else
  296. D1.visible = 0
  297. End If
  298.  
  299. ' Define any Constants
  300. Const TableName = "Dragon Ball Z"
  301. Const myVersion = "1.0.0"
  302. Const MaxPlayers = 1 ' from 1 to 4
  303. Const BallSaverTime = 15 ' in seconds
  304. Const MaxMultiplier = 5 ' limit to 5x in this game, both bonus multiplier and playfield multiplier
  305. Const BallsPerGame = 3 ' usually 3 or 5
  306. Const MaxMultiballs = 5 ' max number of balls during multiballs
  307.  
  308. ' Define Global Variables
  309. Dim PlayersPlayingGame
  310. Dim CurrentPlayer
  311. Dim Credits
  312. Dim BonusPoints(4)
  313. Dim BonusHeldPoints(4)
  314. Dim BonusMultiplier(4)
  315. Dim PlayfieldMultiplier(4)
  316. Dim bBonusHeld
  317. Dim BallsRemaining(4)
  318. Dim ExtraBallsAwards(4)
  319. Dim Score(4)
  320. Dim HighScore(10)
  321. Dim HighScoreName(10)
  322. Dim Jackpot(4)
  323. Dim SuperJackpot
  324. Dim Tilt
  325. Dim TiltSensitivity
  326. Dim Tilted
  327. Dim TotalGamesPlayed
  328. Dim mBalls2Eject
  329. Dim SkillshotValue(4)
  330. Dim bAutoPlunger
  331. Dim bInstantInfo
  332. Dim bAttractMode
  333.  
  334. ' Define Game Control Variables
  335. Dim LastSwitchHit
  336. Dim BallsOnPlayfield
  337. Dim BallsInLock(4)
  338. Dim BallsInHole
  339.  
  340. ' Define Game Flags
  341. Dim bFreePlay
  342. Dim bGameInPlay
  343. Dim bOnTheFirstBall
  344. Dim bBallInPlungerLane
  345. Dim bBallSaverActive
  346. Dim bBallSaverReady
  347. Dim bMultiBallMode
  348. Dim bMusicOn
  349. Dim bSkillshotReady
  350. Dim bExtraBallWonThisBall
  351. Dim bJustStarted
  352. Dim bJackpot
  353.  
  354. ' core.vbs variables
  355. Dim plungerIM 'used mostly as an autofire plunger during multiballs
  356.  
  357. ' tables variables and Mode init
  358. Dim LaneBonus
  359. Dim TargetBonus
  360. Dim BonusBumper
  361. Dim RampBonus
  362. Dim BumperValue(4)
  363. Dim BumperHits
  364. Dim SuperBumperHits
  365. Dim SpinnerValue(4)
  366. Dim SpinCount
  367. Dim RampHits
  368. Dim OrbitHits
  369. Dim TargetHits
  370. Dim loopCount
  371.  
  372.  
  373. Dim bootT
  374. Sub Table1_Init()
  375. Dim i
  376. Randomize
  377. LoadEM
  378.  
  379.  
  380. 'Impulse Plunger as autoplunger
  381. Const IMPowerSetting = 80 ' Plunger Power
  382. Const IMTime = 1.1 ' Time in seconds for Full Plunge
  383. Set plungerIM = New cvpmImpulseP
  384. With plungerIM
  385. .InitImpulseP swplunger, IMPowerSetting, IMTime
  386. .Random 1.5
  387. .InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_solenoid", DOFContactors)
  388. .CreateEvents "plungerIM"
  389. End With
  390.  
  391. Boot.enabled = 1
  392.  
  393. ' Misc. VP table objects Initialisation, droptargets, animations...
  394. VPObjects_Init
  395.  
  396. ' load saved values, highscore, names, jackpot
  397. Loadhs
  398.  
  399. ' freeplay or coins
  400. bFreePlay = False 'we dont want coins
  401.  
  402. ' Init main variables and any other flags
  403. bAttractMode = False
  404. bOnTheFirstBall = False
  405. bBallInPlungerLane = False
  406. bBallSaverActive = False
  407. bBallSaverReady = False
  408. bMultiBallMode = False
  409. bGameInPlay = False
  410. bAutoPlunger = False
  411. bMusicOn = True
  412. BallsOnPlayfield = 0
  413. Tilt = 0
  414. TiltSensitivity = 6
  415. Tilted = False
  416. bBonusHeld = False
  417. bJustStarted = True
  418. bJackpot = False
  419. bInstantInfo = False
  420. ' set any lights for the attract mode
  421. GiOff
  422. Saiyan = 0
  423. LockDiverterOn
  424.  
  425. 'StartAttractMode
  426. vpmtimer.addtimer 4000, "StartAttractMode '"
  427.  
  428. For i = 1 To MaxPlayers
  429. Score(i) = 0
  430. BonusPoints(i) = 0
  431. BonusHeldPoints(i) = 0
  432. BonusMultiplier(i) = 1
  433. BallsRemaining(i) = BallsPerGame
  434. ExtraBallsAwards(i) = 0
  435. Next
  436.  
  437. If Credits > 0 Then DOF 128, DOFOn
  438.  
  439. End Sub
  440.  
  441. Sub Boot_Timer
  442. bootT = bootT + 1
  443. Select Case bootT
  444. Case 0:
  445. D1.text = "********************************"
  446. DisplayB2SText "********************************"
  447. Playsound "fx_sys11_bootup"
  448. Case 1:
  449. D1.text = "////////////////////////////////"
  450. DisplayB2SText "////////////////////////////////"
  451. Playsound "fx_sys11_bootup"
  452. Case 2:
  453. D1.text = "********************************"
  454. DisplayB2SText "********************************"
  455. Playsound "fx_sys11_bootup"
  456. Case 3:
  457. bootT = 0
  458. D1.text = " "
  459. DisplayB2SText " "
  460. boot.enabled = 0
  461. End Select
  462. End Sub
  463.  
  464.  
  465. '******
  466. ' Keys
  467. '******
  468.  
  469.  
  470. Sub Table1_KeyDown(ByVal Keycode)
  471. If Keycode = AddCreditKey Then
  472. Credits = Credits + 1
  473. DOF 128, DOFOn
  474. If(Tilted = False) Then
  475. PlaySound "fx_coin"
  476. DisplayB2SText " CREDITS " &credits
  477. D1.Text = " CREDITS " &credits
  478. PlaySound "go"
  479. If NOT bGameInPlay Then ShowTableInfo:
  480. End If
  481. End If
  482.  
  483. If keycode = PlungerKey Then
  484. PlungerIM.AutoFire
  485. If bBallInPlungerLane Then
  486. DOF 109, DOFPulse
  487. DOF 118, DOFPulse
  488. End If
  489. End If
  490.  
  491. If bGameInPlay AND NOT Tilted Then
  492. If keycode = LeftTiltKey Then Nudge 90, 6:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt
  493. If keycode = RightTiltKey Then Nudge 270, 6:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt
  494. If keycode = CenterTiltKey Then Nudge 0, 7:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt
  495.  
  496. If keycode = LeftFlipperKey Then SolLFlipper 1
  497. If keycode = RightFlipperKey Then SolRFlipper 1
  498.  
  499. If keycode = StartGameKey Then
  500. If((PlayersPlayingGame < MaxPlayers) AND(bOnTheFirstBall = True) ) Then
  501.  
  502. If(bFreePlay = True) Then
  503. PlayersPlayingGame = PlayersPlayingGame + 1
  504. TotalGamesPlayed = TotalGamesPlayed + 1
  505. Else
  506. If(Credits > 0) then
  507. PlayersPlayingGame = PlayersPlayingGame + 1
  508. TotalGamesPlayed = TotalGamesPlayed + 1
  509. Credits = Credits - 1
  510. If Credits < 1 Then DOF 128, DOFOff
  511. Else
  512. ' Not Enough Credits to start a game.
  513.  
  514. 'DMD CenterLine(0, "CREDITS " & Credits), CenterLine(1, "INSERT COIN"), 0, eNone, eBlink, eNone, 500, True, ""
  515. End If
  516. End If
  517. End If
  518. End If
  519. Else ' If (GameInPlay)
  520.  
  521. If keycode = StartGameKey Then
  522. If(bFreePlay = True) Then
  523. If(BallsOnPlayfield = 0) Then
  524. ResetForNewGame()
  525. End If
  526. Else
  527. If(Credits > 0) Then
  528. If(BallsOnPlayfield = 0) Then
  529. Credits = Credits - 1
  530. If Credits < 1 Then DOF 128, DOFOff
  531. ResetForNewGame()
  532. End If
  533. Else
  534. ' Not Enough Credits to start a game.
  535. D1.Text = " CREDITS " &credits&" INSERT COIN"
  536. DisplayB2SText " CREDITS " &credits &" INSERT COIN "
  537. End If
  538. End If
  539. End If
  540. End If ' If (GameInPlay)
  541.  
  542. If hsbModeActive Then EnterHighScoreKey(keycode)
  543.  
  544. ' Table specific
  545. End Sub
  546.  
  547. Sub Table1_KeyUp(ByVal keycode)
  548. If bGameInPLay AND NOT Tilted Then
  549. If keycode = LeftFlipperKey Then SolLFlipper 0
  550. If keycode = RightFlipperKey Then SolRFlipper 0
  551. End If
  552. End Sub
  553.  
  554.  
  555. Sub InstantInfoTimer_Timer
  556. InstantInfoTimer.Enabled = False
  557. bInstantInfo = True
  558. DMDFlush
  559. UltraDMDTimer.Enabled = 1
  560. End Sub
  561.  
  562. Sub InstantInfo
  563. Jackpot = 10000 + Round(Score(CurrentPlayer) / 10, 0)
  564. D1.Text = "INSTANT INFO"
  565. D1.Text = "JACKPOT " & Jackpot
  566. D1.Text = "BONUS MULT " & BonusMultiplier(CurrentPlayer)
  567. D1.Text = "RAMP BONUS " & RampBonus
  568. DisplayB2SText " INSTANT INFO "
  569. DisplayB2SText " JACKPOT " & Jackpot
  570. DisplayB2SText " BONUS MULT " & BonusMultiplier(CurrentPlayer)
  571. DisplayB2SText " RAMP BONUS " & RampBonus
  572. ' DMD "black.jpg", "", "INSTANT INFO", 500
  573. ' DMD "black.jpg", "JACKPOT", Jackpot, 800
  574. ' DMD "black.jpg", "LEVEL", Level(CurrentPlayer), 800
  575. ' DMD "black.jpg", "BONUS MULT", BonusMultiplier(CurrentPlayer), 800
  576. ' DMD "black.jpg", "ORBIT BONUS", OrbitHits, 800
  577. ' DMD "black.jpg", "LANE BONUS", LaneBonus, 800
  578. ' DMD "black.jpg", "TARGET BONUS", TargetBonus, 800
  579. ' DMD "black.jpg", "RAMP BONUS", RampBonus, 800
  580. ' DMD "black.jpg", "MONSTERS KILLED", Monsters(CurrentPlayer), 800
  581. End Sub
  582.  
  583. '*************
  584. ' Pause Table
  585. '*************
  586.  
  587. Sub table1_Paused
  588. End Sub
  589.  
  590. Sub table1_unPaused
  591. End Sub
  592.  
  593. Sub table1_Exit
  594. Savehs
  595. If B2SOn Then Controller.Stop
  596. End Sub
  597.  
  598. '********************
  599. ' Flippers
  600. '********************
  601.  
  602. Sub SolLFlipper(Enabled)
  603. ' startB2S(4)
  604. If Enabled Then
  605. PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, 1, -0.05, 0.15
  606. LeftFlipper.RotateToEnd
  607. RotateLaneLightsLeft
  608. RotateLaneLightsLeftUp
  609.  
  610. Else
  611. PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, -0.05, 0.15
  612. LeftFlipper.RotateToStart
  613. End If
  614. End Sub
  615.  
  616. Sub SolRFlipper(Enabled)
  617. ' startB2S(4)
  618. If Enabled Then
  619. PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, 1, 0.05, 0.15
  620. RightFlipper.RotateToEnd
  621. RotateLaneLightsRight
  622. RotateLaneLightsRightUp
  623.  
  624. Else
  625. PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, 0.05, 0.15
  626. RightFlipper.RotateToStart
  627. End If
  628. End Sub
  629.  
  630. ' flippers hit Sound
  631.  
  632. Sub LeftFlipper_Collide(parm)
  633. PlaySound "fx_rubber_flipper", 0, parm / 10, -0.05, 0.25
  634. End Sub
  635.  
  636. Sub RightFlipper_Collide(parm)
  637. PlaySound "fx_rubber_flipper", 0, parm / 10, 0.05, 0.25
  638. End Sub
  639.  
  640.  
  641.  
  642.  
  643.  
  644. Sub RotateLaneLightsLeftUp
  645. Dim TempState
  646. TempState = L11.State
  647. l11.State = l12.State
  648. l12.State = L13.State
  649. L13.State = TempState
  650. End Sub
  651.  
  652. Sub RotateLaneLightsRightUp
  653. Dim TempState
  654. TempState = L13.State
  655. L13.State = l12.State
  656. L12.State = L11.State
  657. L11.State = TempState
  658. End Sub
  659.  
  660.  
  661. Sub RotateLaneLightsLeft
  662. Dim TempState
  663. TempState = l14.State
  664. l14.State = l15.State
  665. l15.State = l16.State
  666. l16.State = l17.State
  667. l17.State = TempState
  668. End Sub
  669.  
  670. Sub RotateLaneLightsRight
  671. Dim TempState
  672. TempState = l17.State
  673. l17.State = l16.State
  674. l16.State = l15.State
  675. l15.State = l14.State
  676. l14.State = TempState
  677. End Sub
  678.  
  679.  
  680.  
  681.  
  682. '*********
  683. ' TILT
  684. '*********
  685.  
  686. 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
  687.  
  688. Sub CheckTilt 'Called when table is nudged
  689. Tilt = Tilt + TiltSensitivity 'Add to tilt count
  690. TiltDecreaseTimer.Enabled = True
  691. If(Tilt> TiltSensitivity) AND(Tilt <15) Then 'show a warning
  692. 'DMDFlush
  693. 'DMD "", " ", "CAREFUL!", 800
  694. DisplayB2SText " CAREFUL! "
  695. End if
  696. If Tilt> 15 Then 'If more that 15 then TILT the table
  697. Tilted = True
  698. 'display Tilt
  699. 'DMDFlush
  700. DisplayB2SText " TILT! "
  701. ' DMD "", " ", "TILT!", 99999
  702. DisableTable True
  703. TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
  704. End If
  705. End Sub
  706.  
  707. Sub TiltDecreaseTimer_Timer
  708. ' DecreaseTilt
  709. If Tilt> 0 Then
  710. Tilt = Tilt - 0.1
  711. Else
  712. TiltDecreaseTimer.Enabled = False
  713. End If
  714. End Sub
  715.  
  716. Sub DisableTable(Enabled)
  717. If Enabled Then
  718. 'turn off GI and turn off all the lights
  719. GiOff
  720. LightSeqTilt.Play SeqAllOff
  721. 'Disable slings, bumpers etc
  722. LeftFlipper.RotateToStart
  723. RightFlipper.RotateToStart
  724. Bumper1.Force = 0
  725. Bumper2.Force = 0
  726. Bumper3.Force = 0
  727.  
  728. LeftSlingShot.Disabled = 1
  729. RightSlingShot.Disabled = 1
  730. Else
  731. 'turn back on GI and the lights
  732. GiOn
  733. LightSeqTilt.StopPlay
  734. Bumper1.Force = 7
  735. Bumper2.Force = 7
  736. Bumper3.Force = 7
  737. LeftSlingShot.Disabled = 0
  738. RightSlingShot.Disabled = 0
  739. 'clean up the buffer display
  740. ' DMDFlush
  741. End If
  742. End Sub
  743.  
  744. Sub TiltRecoveryTimer_Timer()
  745. ' if all the balls have been drained then..
  746. If(BallsOnPlayfield = 0) Then
  747. ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
  748. EndOfBall()
  749. TiltRecoveryTimer.Enabled = False
  750. End If
  751. ' else retry (checks again in another second or so)
  752. End Sub
  753.  
  754.  
  755.  
  756. '********************
  757. ' Music as wav sounds
  758. '********************
  759.  
  760. Dim Song
  761. Song = ""
  762.  
  763. Sub PlaySong(name)
  764. If bMusicOn Then
  765. If Song <> name Then
  766. StopSound Song
  767. Song = name
  768. If Song = "DBZ_end" Then
  769. PlaySound Song, 0, 0.1 'this last number is the volume, from 0 to 1
  770. Else
  771. PlaySound Song, -1, 0.1 'this last number is the volume, from 0 to 1
  772. End If
  773. End If
  774. End If
  775. End Sub
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782. '**********************
  783. ' GI effects
  784. ' independent routine
  785. ' it turns on the gi
  786. ' when there is a ball
  787. ' in play
  788. '**********************
  789.  
  790. Dim OldGiState
  791. OldGiState = -1 'start witht the Gi off
  792.  
  793. Sub ChangeGi(col) 'changes the gi color
  794. Dim bulb
  795. For each bulb in aGILights
  796. SetLightColor bulb, col, -1
  797. Next
  798. End Sub
  799.  
  800. Sub GIUpdateTimer_Timer
  801. Dim tmp, obj
  802. tmp = Getballs
  803. If UBound(tmp) <> OldGiState Then
  804. OldGiState = Ubound(tmp)
  805. If UBound(tmp) = -1 Then 'we have 4 captive balls on the table (-1 means no balls, 0 is the first ball, 1 is the second..)
  806. GiOff ' turn off the gi if no active balls on the table, we could also have used the variable ballsonplayfield.
  807. Else
  808. Gion
  809. End If
  810. End If
  811. End Sub
  812.  
  813. Sub GiOn
  814. DOF 126, DOFOn
  815. Dim bulb
  816. For each bulb in aGiLights
  817. bulb.State = 1
  818. Next
  819. PlaySound "fx_relay_on"
  820. Table1.ColorGradeImage = "ColorGradeLUT256x16_ConSat"
  821. End Sub
  822.  
  823. Sub GiOff
  824. DOF 126, DOFOff
  825. Dim bulb
  826. For each bulb in aGiLights
  827. bulb.State = 0
  828. Next
  829. PlaySound "fx_relay_off"
  830. Table1.ColorGradeImage = "ColorGradeLUT256x16_ConSatDark"
  831. End Sub
  832.  
  833.  
  834.  
  835. ' GI & light sequence effects
  836.  
  837. Sub GiEffect(n)
  838. Dim ii
  839. Select Case n
  840. Case 0 'all off
  841. LightSeqGi.Play SeqAlloff
  842. Case 1 'all blink
  843. LightSeqGi.UpdateInterval = 10
  844. LightSeqGi.Play SeqBlinking, , 10, 10
  845. Case 2 'random
  846. LightSeqGi.UpdateInterval = 10
  847. LightSeqGi.Play SeqRandom, 50, , 1000
  848. Case 3 'upon
  849. LightSeqGi.UpdateInterval = 4
  850. LightSeqGi.Play SeqUpOn, 5, 1
  851. Case 4 ' left-right-left
  852. LightSeqGi.UpdateInterval = 5
  853. LightSeqGi.Play SeqLeftOn, 10, 1
  854. LightSeqGi.UpdateInterval = 5
  855. LightSeqGi.Play SeqRightOn, 10, 1
  856. End Select
  857. End Sub
  858.  
  859. Sub LightEffect(n)
  860. Select Case n
  861. Case 0 ' all off
  862. LightSeqInserts.Play SeqAlloff
  863. Case 1 'all blink
  864. LightSeqInserts.UpdateInterval = 10
  865. LightSeqInserts.Play SeqBlinking, , 10, 10
  866. Case 2 'random
  867. LightSeqInserts.UpdateInterval = 10
  868. LightSeqInserts.Play SeqRandom, 50, , 1000
  869. Case 3 'upon
  870. LightSeqInserts.UpdateInterval = 4
  871. LightSeqInserts.Play SeqUpOn, 10, 1
  872. Case 4 ' left-right-left
  873. LightSeqInserts.UpdateInterval = 5
  874. LightSeqInserts.Play SeqLeftOn, 10, 1
  875. LightSeqInserts.UpdateInterval = 5
  876. LightSeqInserts.Play SeqRightOn, 10, 1
  877. End Select
  878. End Sub
  879.  
  880. ' Flasher Effects using lights
  881.  
  882. Dim FEStep, FEffect
  883. FEStep = 0
  884. FEffect = 0
  885.  
  886. Sub FlashEffect(n)
  887. Dim ii
  888. Select case n
  889. Case 0 ' all off
  890. LightSeqFlasher.Play SeqAlloff
  891. Case 1 'all blink
  892. LightSeqFlasher.UpdateInterval = 10
  893. LightSeqFlasher.Play SeqBlinking, , 10, 10
  894. Case 2 'random
  895. LightSeqFlasher.UpdateInterval = 10
  896. LightSeqFlasher.Play SeqRandom, 50, , 1000
  897. Case 3 'upon
  898. LightSeqFlasher.UpdateInterval = 4
  899. LightSeqFlasher.Play SeqUpOn, 10, 1
  900. Case 4 ' left-right-left
  901. LightSeqFlasher.UpdateInterval = 5
  902. LightSeqFlasher.Play SeqLeftOn, 10, 1
  903. LightSeqFlasher.UpdateInterval = 5
  904. LightSeqFlasher.Play SeqRightOn, 10, 1
  905. End Select
  906. End Sub
  907.  
  908. ' *********************************************************************
  909. ' Supporting Ball & Sound Functions
  910. ' *********************************************************************
  911.  
  912. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  913. Vol = Csng(BallVel(ball) ^2 / 1500)
  914. End Function
  915.  
  916. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  917. Dim tmp
  918. tmp = ball.x * 2 / table1.width-1
  919. If tmp> 0 Then
  920. Pan = Csng(tmp ^10)
  921. Else
  922. Pan = Csng(-((- tmp) ^10) )
  923. End If
  924. End Function
  925.  
  926. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  927. Pitch = BallVel(ball) * 20
  928. End Function
  929.  
  930. Function BallVel(ball) 'Calculates the ball speed
  931. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  932. End Function
  933.  
  934. '*****************************************
  935. ' JP's VP10 Rolling Sounds
  936. '*****************************************
  937.  
  938. Const tnob = 20 ' total number of balls
  939. Const lob = 0 'number of locked balls
  940. ReDim rolling(tnob)
  941. InitRolling
  942.  
  943. Sub InitRolling
  944. Dim i
  945. For i = 0 to tnob
  946. rolling(i) = False
  947. Next
  948. End Sub
  949.  
  950. Sub RollingUpdate()
  951. Dim BOT, b, ballpitch
  952. BOT = GetBalls
  953.  
  954. ' stop the sound of deleted balls
  955. For b = UBound(BOT) + 1 to tnob
  956. rolling(b) = False
  957. StopSound("fx_ballrolling" & b)
  958. Next
  959.  
  960. ' exit the sub if no balls on the table
  961. If UBound(BOT) = -1 Then Exit Sub 'there no extra balls on this table
  962.  
  963. ' play the rolling sound for each ball
  964. For b = lob to UBound(BOT)
  965. If BallVel(BOT(b) )> 1 Then
  966. If BOT(b).z <30 Then
  967. ballpitch = Pitch(BOT(b) )
  968. Else
  969. ballpitch = Pitch(BOT(b) ) * 50
  970. End If
  971. rolling(b) = True
  972. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, ballpitch, 1, 0
  973. Else
  974. If rolling(b) = True Then
  975. StopSound("fx_ballrolling" & b)
  976. rolling(b) = False
  977. End If
  978. End If
  979. Next
  980. End Sub
  981.  
  982. '**********************
  983. ' Ball Collision Sound
  984. '**********************
  985.  
  986. Sub OnBallBallCollision(ball1, ball2, velocity)
  987. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  988. End Sub
  989.  
  990.  
  991.  
  992.  
  993.  
  994. '*********** BALL SHADOW *********************************
  995. Dim BallShadow
  996. BallShadow = Array (BallShadow1, BallShadow2, BallShadow3, BallShadow4, BallShadow5, BallShadow6, BallShadow7)
  997.  
  998. Sub BallShadowUpdate()
  999. Dim BOT, b
  1000. BOT = GetBalls
  1001. ' render the shadow for each ball
  1002. For b = 0 to Ubound(BOT)
  1003. If BOT(b).X < Table1.Width/2 Then
  1004. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/10)) + 10
  1005. Else
  1006. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/10)) - 10
  1007. End If
  1008. ballShadow(b).Y = BOT(b).Y + 15
  1009. If BOT(b).Z > 20 Then
  1010. BallShadow(b).visible = 1
  1011. Else
  1012. BallShadow(b).visible = 0
  1013. End If
  1014. Next
  1015. End Sub
  1016.  
  1017.  
  1018.  
  1019. '******************************
  1020. ' Diverse Collection Hit Sounds
  1021. '******************************
  1022.  
  1023. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1024. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber_band", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1025. Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1026. Sub aRubber_Pins_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1027. Sub aPlastics_Hit(idx):PlaySound "fx_plastichit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1028. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1029. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1030.  
  1031.  
  1032.  
  1033. ' Ramp Soundss
  1034. Sub RHelp_Hit()
  1035. StopSound "fx_metalrolling"
  1036. PlaySound "fx_balldrop", 0, 1, pan(ActiveBall)
  1037. End Sub
  1038.  
  1039. Sub LHelp1_Hit()
  1040. StopSound "fx_metalrolling"
  1041. PlaySound "fx_balldrop", 0, 1, pan(ActiveBall)
  1042. End Sub
  1043.  
  1044. Sub RHelp1_Hit()
  1045. StopSound "fx_metalrolling"
  1046. PlaySound "DBZ_teleport", 0, 1, pan(ActiveBall)
  1047. End Sub
  1048.  
  1049. Sub Trigger2_Hit()
  1050. PlaySound "fx_metalrolling", 0, 1, pan(ActiveBall)
  1051. End Sub
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057. '****************************************
  1058. ' Real Time updatess using the GameTimer
  1059. '****************************************
  1060. 'used for all the real time updates
  1061.  
  1062. Sub GameTimer_Timer
  1063. RollingUpdate
  1064. BallShadowUpdate
  1065. LockDiverterP.objRotY = LockDiverter.CurrentAngle
  1066. End Sub
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073. '********************************************************************************************
  1074. ' Only for VPX 10.2 and higher.
  1075. ' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  1076. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  1077. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  1078. '********************************************************************************************
  1079.  
  1080. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first version
  1081.  
  1082. If TypeName(MyLight) = "Light" Then
  1083.  
  1084. If FinalState = 2 Then
  1085. FinalState = MyLight.State 'Keep the current light state
  1086. End If
  1087. MyLight.BlinkInterval = BlinkPeriod
  1088. MyLight.Duration 2, TotalPeriod, FinalState
  1089. ElseIf TypeName(MyLight) = "Flasher" Then
  1090.  
  1091. Dim steps
  1092.  
  1093. ' Store all blink information
  1094. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  1095. If FinalState = 2 Then 'Keep the current flasher state
  1096. FinalState = ABS(MyLight.Visible)
  1097. End If
  1098. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  1099.  
  1100. ' Start blink timer and create timer subroutine
  1101. MyLight.TimerInterval = BlinkPeriod
  1102. MyLight.TimerEnabled = 0
  1103. MyLight.TimerEnabled = 1
  1104. ExecuteGlobal "Sub " & MyLight.Name & "_Timer:" & "Dim tmp, steps, fstate:tmp=me.UserValue:fstate = tmp MOD 10:steps= tmp\10 -1:Me.Visible = steps MOD 2:me.UserValue = steps *10 + fstate:If Steps = 0 then Me.Visible = fstate:Me.TimerEnabled=0:End if:End Sub"
  1105. End If
  1106. End Sub
  1107.  
  1108. '******************************************
  1109. ' Change light color - simulate color leds
  1110. ' changes the light color and state
  1111. ' 10 colors: red, orange, amber, yellow...
  1112. '******************************************
  1113. ' in this table this colors are use to keep track of the progress during the acts and battles
  1114.  
  1115. 'colors
  1116. Dim red, orange, amber, yellow, darkgreen, green, blue, darkblue, purple, white
  1117.  
  1118. red = 10
  1119. orange = 9
  1120. amber = 8
  1121. yellow = 7
  1122. darkgreen = 6
  1123. green = 5
  1124. blue = 4
  1125. darkblue = 3
  1126. purple = 2
  1127. white = 1
  1128.  
  1129. Sub SetLightColor(n, col, stat)
  1130. Select Case col
  1131. Case 0
  1132. n.color = RGB(18, 0, 0)
  1133. n.colorfull = RGB(255, 0, 0)
  1134. Case red
  1135. n.color = RGB(18, 0, 0)
  1136. n.colorfull = RGB(255, 0, 0)
  1137. Case orange
  1138. n.color = RGB(18, 3, 0)
  1139. n.colorfull = RGB(255, 64, 0)
  1140. Case amber
  1141. n.color = RGB(193, 49, 0)
  1142. n.colorfull = RGB(255, 153, 0)
  1143. Case yellow
  1144. n.color = RGB(18, 18, 0)
  1145. n.colorfull = RGB(255, 255, 0)
  1146. Case darkgreen
  1147. n.color = RGB(0, 8, 0)
  1148. n.colorfull = RGB(0, 64, 0)
  1149. Case green
  1150. n.color = RGB(0, 18, 0)
  1151. n.colorfull = RGB(0, 255, 0)
  1152. Case blue
  1153. n.color = RGB(0, 18, 18)
  1154. n.colorfull = RGB(0, 255, 255)
  1155. Case darkblue
  1156. n.color = RGB(0, 8, 8)
  1157. n.colorfull = RGB(0, 64, 64)
  1158. Case purple
  1159. n.color = RGB(128, 0, 128)
  1160. n.colorfull = RGB(255, 0, 255)
  1161. Case white
  1162. n.color = RGB(255, 252, 224)
  1163. n.colorfull = RGB(193, 91, 0)
  1164. Case white
  1165. n.color = RGB(255, 252, 224)
  1166. n.colorfull = RGB(193, 91, 0)
  1167. End Select
  1168. If stat <> -1 Then
  1169. n.State = 0
  1170. n.State = stat
  1171. End If
  1172. End Sub
  1173.  
  1174. Sub ResetAllLightsColor ' Called at a new game
  1175. 'shoot again
  1176. SetLightColor ShootAgainLight, amber, -1
  1177. End Sub
  1178.  
  1179. Sub UpdateBonusColors
  1180. End Sub
  1181.  
  1182. '*************************
  1183. ' Rainbow Changing Lights
  1184. '*************************
  1185.  
  1186. Dim RGBStep, RGBFactor, rRed, rGreen, rBlue, RainbowLights
  1187.  
  1188. Sub StartRainbow(n)
  1189. set RainbowLights = n
  1190. RGBStep = 0
  1191. RGBFactor = 5
  1192. rRed = 255
  1193. rGreen = 0
  1194. rBlue = 0
  1195. RainbowTimer.Enabled = 1
  1196. End Sub
  1197.  
  1198. Sub StopRainbow()
  1199. Dim obj
  1200. RainbowTimer.Enabled = 0
  1201. RainbowTimer.Enabled = 0
  1202. End Sub
  1203.  
  1204. Sub RainbowTimer_Timer 'rainbow led light color changing
  1205. Dim obj
  1206. Select Case RGBStep
  1207. Case 0 'Green
  1208. rGreen = rGreen + RGBFactor
  1209. If rGreen> 255 then
  1210. rGreen = 255
  1211. RGBStep = 1
  1212. End If
  1213. Case 1 'Red
  1214. rRed = rRed - RGBFactor
  1215. If rRed <0 then
  1216. rRed = 0
  1217. RGBStep = 2
  1218. End If
  1219. Case 2 'Blue
  1220. rBlue = rBlue + RGBFactor
  1221. If rBlue> 255 then
  1222. rBlue = 255
  1223. RGBStep = 3
  1224. End If
  1225. Case 3 'Green
  1226. rGreen = rGreen - RGBFactor
  1227. If rGreen <0 then
  1228. rGreen = 0
  1229. RGBStep = 4
  1230. End If
  1231. Case 4 'Red
  1232. rRed = rRed + RGBFactor
  1233. If rRed> 255 then
  1234. rRed = 255
  1235. RGBStep = 5
  1236. End If
  1237. Case 5 'Blue
  1238. rBlue = rBlue - RGBFactor
  1239. If rBlue <0 then
  1240. rBlue = 0
  1241. RGBStep = 0
  1242. End If
  1243. End Select
  1244. For each obj in RainbowLights
  1245. obj.color = RGB(rRed \ 10, rGreen \ 10, rBlue \ 10)
  1246. obj.colorfull = RGB(rRed, rGreen, rBlue)
  1247. Next
  1248. End Sub
  1249.  
  1250.  
  1251. ' ********************************
  1252. ' Table info & Attract Mode
  1253. ' ********************************
  1254.  
  1255. Sub ShowTableInfo
  1256. on Error Resume Next
  1257. Dim i
  1258. 'info goes in a loop only stopped by the credits and the startkey
  1259. If Score(1) Then
  1260. DMD "", "PLAYER 1", Score(1), 3000
  1261. End If
  1262. If Score(2) Then
  1263. DMD "", "PLAYER 2", Score(2), 3000
  1264. End If
  1265. If Score(3) Then
  1266. DMD "", "PLAYER 3", Score(3), 3000
  1267. End If
  1268. If Score(4) Then
  1269. DMD "", "PLAYER 4", Score(4), 3000
  1270. End If
  1271.  
  1272.  
  1273. 'coins or freeplay
  1274. If bFreePlay Then
  1275. DMD " ", "FREE PLAY", 2000
  1276. DMD "IntroMS.wmv", "", "", 24500
  1277. Else
  1278. If Credits> 0 Then
  1279. DMD "", "CREDITS " &credits, "PRESS START", 2000
  1280. Else
  1281. DMD "", "CREDITS " &credits, "INSERT COIN", 2000
  1282. End If
  1283. DMD "IntroMS.wmv", "", "", 24500
  1284. End If
  1285. ' some info about the table
  1286. DMD "", "Javier And Pinwizkid", "PRESENTS", 3000
  1287. DMD "", "", " Metal Slug ", 3000
  1288. ' Highscores
  1289. DMD "", "HIGHSCORE 1", HighScoreName(0) & " " & HighScore(0), 3000
  1290. DMD "", "HIGHSCORE 2", HighScoreName(1) & " " & HighScore(1), 3000
  1291. DMD "", "HIGHSCORE 3", HighScoreName(2) & " " & HighScore(2), 3000
  1292. DMD "", "HIGHSCORE 4", HighScoreName(3) & " " & HighScore(3), 3000
  1293. End Sub
  1294.  
  1295.  
  1296.  
  1297. Sub StartAttractMode()
  1298. bAttractMode = True
  1299. StartLightSeq
  1300. DisplayB2SText ""
  1301. DMDUpdate.enabled = 0
  1302. AttractMessagesTimer.Enabled = TRUE
  1303. End Sub
  1304.  
  1305. Sub StopAttractMode()
  1306. bAttractMode = False
  1307. LightSeqAttract.StopPlay
  1308. LightSeqFlasher.StopPlay
  1309. AttractMessagesTimer.Enabled = FALSE
  1310. End Sub
  1311.  
  1312. Sub StartLightSeq()
  1313. 'lights sequences
  1314. LightSeqFlasher.UpdateInterval = 150
  1315. LightSeqFlasher.Play SeqRandom, 10, , 50000
  1316. LightSeqAttract.Play SeqBlinking, , 5, 150
  1317. LightSeqAttract.Play SeqRandom, 40, , 4000
  1318. LightSeqAttract.Play SeqAllOff
  1319. LightSeqAttract.UpdateInterval = 8
  1320. LightSeqAttract.Play SeqUpOn, 50, 1
  1321. LightSeqAttract.UpdateInterval = 8
  1322. LightSeqAttract.Play SeqDownOn, 25, 1
  1323. LightSeqAttract.UpdateInterval = 8
  1324. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  1325. LightSeqAttract.UpdateInterval = 8
  1326. LightSeqAttract.Play SeqUpOn, 25, 1
  1327. LightSeqAttract.UpdateInterval = 8
  1328. LightSeqAttract.Play SeqDownOn, 25, 1
  1329. LightSeqAttract.UpdateInterval = 8
  1330. LightSeqAttract.Play SeqUpOn, 25, 1
  1331. LightSeqAttract.UpdateInterval = 8
  1332. LightSeqAttract.Play SeqDownOn, 25, 1
  1333. LightSeqAttract.UpdateInterval = 10
  1334. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  1335. LightSeqAttract.UpdateInterval = 5
  1336. LightSeqAttract.Play SeqRightOn, 50, 1
  1337. LightSeqAttract.UpdateInterval = 5
  1338. LightSeqAttract.Play SeqLeftOn, 50, 1
  1339. LightSeqAttract.UpdateInterval = 8
  1340. LightSeqAttract.Play SeqRightOn, 50, 1
  1341. LightSeqAttract.UpdateInterval = 8
  1342. LightSeqAttract.Play SeqLeftOn, 50, 1
  1343. LightSeqAttract.UpdateInterval = 8
  1344. LightSeqAttract.Play SeqRightOn, 40, 1
  1345. LightSeqAttract.UpdateInterval = 8
  1346. LightSeqAttract.Play SeqLeftOn, 40, 1
  1347. LightSeqAttract.UpdateInterval = 10
  1348. LightSeqAttract.Play SeqRightOn, 30, 1
  1349. LightSeqAttract.UpdateInterval = 10
  1350. LightSeqAttract.Play SeqLeftOn, 30, 1
  1351. LightSeqAttract.UpdateInterval = 8
  1352. LightSeqAttract.Play SeqRightOn, 25, 1
  1353. LightSeqAttract.UpdateInterval = 8
  1354. LightSeqAttract.Play SeqLeftOn, 25, 1
  1355. LightSeqAttract.UpdateInterval = 8
  1356. LightSeqAttract.Play SeqRightOn, 15, 1
  1357. LightSeqAttract.UpdateInterval = 8
  1358. LightSeqAttract.Play SeqLeftOn, 15, 1
  1359. LightSeqAttract.UpdateInterval = 10
  1360. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  1361. LightSeqAttract.UpdateInterval = 8
  1362. LightSeqAttract.Play SeqLeftOn, 25, 1
  1363. LightSeqAttract.UpdateInterval = 8
  1364. LightSeqAttract.Play SeqRightOn, 25, 1
  1365. LightSeqAttract.UpdateInterval = 8
  1366. LightSeqAttract.Play SeqLeftOn, 25, 1
  1367. LightSeqAttract.UpdateInterval = 8
  1368. LightSeqAttract.Play SeqUpOn, 25, 1
  1369. LightSeqAttract.UpdateInterval = 8
  1370. LightSeqAttract.Play SeqDownOn, 25, 1
  1371. LightSeqAttract.UpdateInterval = 8
  1372. LightSeqAttract.Play SeqUpOn, 25, 1
  1373. LightSeqAttract.UpdateInterval = 8
  1374. LightSeqAttract.Play SeqDownOn, 25, 1
  1375. LightSeqAttract.UpdateInterval = 5
  1376. LightSeqAttract.Play SeqStripe1VertOn, 50, 2
  1377. LightSeqAttract.UpdateInterval = 8
  1378. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  1379. LightSeqAttract.UpdateInterval = 8
  1380. LightSeqAttract.Play SeqStripe1VertOn, 50, 3
  1381. LightSeqAttract.UpdateInterval = 8
  1382. LightSeqAttract.Play SeqLeftOn, 25, 1
  1383. LightSeqAttract.UpdateInterval = 8
  1384. LightSeqAttract.Play SeqRightOn, 25, 1
  1385. LightSeqAttract.UpdateInterval = 8
  1386. LightSeqAttract.Play SeqLeftOn, 25, 1
  1387. LightSeqAttract.UpdateInterval = 8
  1388. LightSeqAttract.Play SeqUpOn, 25, 1
  1389. LightSeqAttract.UpdateInterval = 8
  1390. LightSeqAttract.Play SeqDownOn, 25, 1
  1391. LightSeqAttract.UpdateInterval = 8
  1392. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  1393. LightSeqAttract.UpdateInterval = 8
  1394. LightSeqAttract.Play SeqStripe2VertOn, 50, 3
  1395.  
  1396. End Sub
  1397.  
  1398. Sub LightSeqAttract_PlayDone()
  1399. StartLightSeq()
  1400. End Sub
  1401.  
  1402. Sub LightSeqTilt_PlayDone()
  1403. LightSeqTilt.Play SeqAllOff
  1404. End Sub
  1405.  
  1406. Sub LightSeqSkillshot_PlayDone()
  1407. LightSeqSkillshot.Play SeqCircleOutOn
  1408. End Sub
  1409.  
  1410. '***********************************************************************
  1411. ' *********************************************************************
  1412. ' Table Specific Script Starts Here
  1413. ' *********************************************************************
  1414. '***********************************************************************
  1415.  
  1416. ' droptargets, animations, etc
  1417. Sub VPObjects_Init
  1418.  
  1419. End Sub
  1420.  
  1421.  
  1422.  
  1423.  
  1424. Sub Game_Init() 'called at the start of a new game
  1425. Dim i
  1426. bExtraBallWonThisBall = False
  1427. TurnOffPlayfieldLights()
  1428. BumperHit = 200
  1429. scoopLit.state = 1
  1430. kamehouseLit.state = 1
  1431. BallsRestart
  1432. PinDiverterL.Isdropped = 1
  1433. PinDiverterR.Isdropped = 1
  1434.  
  1435. PlaySong "DBZ_GamePlay"
  1436. LightSeqAllBalls.Play SeqLeftOn, 50, 1
  1437. End Sub
  1438.  
  1439. Sub ResetNewBallLights() 'turn on or off the needed lights before a new ball is released
  1440. End Sub
  1441.  
  1442. Sub TurnOffPlayfieldLights()
  1443. Dim a
  1444. For each a in aLights
  1445. a.State = 0
  1446. Next
  1447. End Sub
  1448.  
  1449. '-----------------------------
  1450. '----- FS Display Code -----
  1451. '-----------------------------
  1452.  
  1453. 'If You want to hide a display, set the reel value of every reel to 44. This picture is transparent
  1454. 'This is best done using collection:
  1455. '
  1456. ' If HideDisplay then
  1457. ' For Each obj in ReelsCollection:obj.setvalue(44):next
  1458. ' end if
  1459.  
  1460.  
  1461. Dim Char(32),i,TempText 'increase dimension if You need larger displays
  1462.  
  1463.  
  1464.  
  1465. '-----------------------------------------------
  1466. '----- B2S section, not used in the demo -----
  1467. '-----------------------------------------------
  1468.  
  1469. Sub DisplayB2SText(TextPar) 'Procedure to display Text on a 30 digit B2S LED reel. Assuming that it is display 1 with internal digit numbers 1-30
  1470.  
  1471. TempText = TextPar
  1472. for i = 1 to 32
  1473. if i <= len(TextPar) then
  1474. Char(i) = left(TempText,1)
  1475. TempText = right(Temptext,len(TempText)-1)
  1476. else
  1477. Char(i) = " "
  1478. end if
  1479. next
  1480.  
  1481. If B2SOn Then
  1482. for i = 1 to 32
  1483. controller.B2SSetLED i,B2SLEDValue(Char(i))
  1484. next
  1485. End If
  1486.  
  1487. End Sub
  1488.  
  1489. Function B2SLEDValue(CharPar) 'to be used with dB2S 15-segments-LED used in Herweh's Designer
  1490. B2SLEDValue = 0 'default for unknown characters
  1491. select case CharPar
  1492. Case "","": B2SLEDValue = 0
  1493. Case "0": B2SLEDValue = 63
  1494. Case "1": B2SLEDValue = 8704
  1495. Case "2": B2SLEDValue = 2139
  1496. Case "3": B2SLEDValue = 2127
  1497. Case "4": B2SLEDValue = 2150
  1498. Case "5": B2SLEDValue = 2157
  1499. Case "6": B2SLEDValue = 2172
  1500. Case "7": B2SLEDValue = 7
  1501. Case "8": B2SLEDValue = 2175
  1502. Case "9": B2SLEDValue = 2159
  1503. Case "A": B2SLEDValue = 2167
  1504. Case "B": B2SLEDValue = 10767
  1505. Case "C": B2SLEDValue = 57
  1506. Case "D": B2SLEDValue = 8719
  1507. Case "E": B2SLEDValue = 121
  1508. Case "F": B2SLEDValue = 2161
  1509. Case "G": B2SLEDValue = 2109
  1510. Case "H": B2SLEDValue = 2166
  1511. Case "I": B2SLEDValue = 8713
  1512. Case "J": B2SLEDValue = 31
  1513. Case "K": B2SLEDValue = 5232
  1514. Case "L": B2SLEDValue = 56
  1515. Case "M": B2SLEDValue = 1334
  1516. Case "N": B2SLEDValue = 4406
  1517. Case "O": B2SLEDValue = 63
  1518. Case "P": B2SLEDValue = 2163
  1519. Case "Q": B2SLEDValue = 4287
  1520. Case "R": B2SLEDValue = 6259
  1521. Case "S": B2SLEDValue = 2157
  1522. Case "T": B2SLEDValue = 8705
  1523. Case "U": B2SLEDValue = 62
  1524. Case "V": B2SLEDValue = 17456
  1525. Case "W": B2SLEDValue = 20534
  1526. Case "X": B2SLEDValue = 21760
  1527. Case "Y": B2SLEDValue = 9472
  1528. Case "Z": B2SLEDValue = 17417
  1529. Case "<": B2SLEDValue = 5120
  1530. Case ">": B2SLEDValue = 16640
  1531. Case "^": B2SLEDValue = 17414
  1532. Case ".": B2SLEDValue = 8
  1533. Case "!": B2SLEDValue = 0
  1534. Case ".": B2SLEDValue = 128
  1535. Case "*": B2SLEDValue = 32576
  1536. Case "/": B2SLEDValue = 17408
  1537. Case "\": B2SLEDValue = 4352
  1538. Case "|": B2SLEDValue = 8704
  1539. Case "=": B2SLEDValue = 2120
  1540. Case "+": B2SLEDValue = 10816
  1541. Case "-": B2SLEDValue = 2112
  1542. end select
  1543. B2SLEDValue = cint(B2SLEDValue)
  1544. End Function
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552. Dim Ball
  1553. Sub DisplayScore
  1554. If Score(1) < 10000000 Then
  1555. DisplayB2SText (cstr(Score(1))) & " BALL " & Balls
  1556. Else
  1557. DisplayB2SText (cstr(Score(1))) & (Score(1)) & String(32 - Len(Score(1)), " ")
  1558. End If
  1559.  
  1560. If PlayersPlayingGame Then
  1561. DMDUpdate.Interval = 1500
  1562. DMDUpdate.enabled = 1
  1563. End If
  1564.  
  1565. End Sub
  1566.  
  1567.  
  1568. Sub DMDUpdate_Timer
  1569. DMDUpdate.enabled = 0
  1570. D1.Text = " "
  1571. DisplayB2SText " "
  1572. DisplayScore
  1573. AddScore (0)
  1574. End Sub
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583. '*****************************
  1584. ' Load / Save / Highscore
  1585. '*****************************
  1586.  
  1587. Sub Loadhs
  1588. Dim x
  1589. x = LoadValue(TableName, "HighScore1")
  1590. If(x <> "") Then HighScore(0) = CDbl(x) Else HighScore(0) = 100000 End If
  1591.  
  1592. x = LoadValue(TableName, "HighScore1Name")
  1593. If(x <> "") Then HighScoreName(0) = x Else HighScoreName(0) = "AAA" End If
  1594.  
  1595. x = LoadValue(TableName, "HighScore2")
  1596. If(x <> "") then HighScore(1) = CDbl(x) Else HighScore(1) = 100000 End If
  1597.  
  1598. x = LoadValue(TableName, "HighScore2Name")
  1599. If(x <> "") then HighScoreName(1) = x Else HighScoreName(1) = "BBB" End If
  1600.  
  1601. x = LoadValue(TableName, "HighScore3")
  1602. If(x <> "") then HighScore(2) = CDbl(x) Else HighScore(2) = 100000 End If
  1603.  
  1604. x = LoadValue(TableName, "HighScore3Name")
  1605. If(x <> "") then HighScoreName(2) = x Else HighScoreName(2) = "CCC" End If
  1606.  
  1607. x = LoadValue(TableName, "HighScore4")
  1608. If(x <> "") then HighScore(3) = CDbl(x) Else HighScore(3) = 100000 End If
  1609.  
  1610. x = LoadValue(TableName, "HighScore4Name")
  1611. If(x <> "") then HighScoreName(3) = x Else HighScoreName(3) = "DDD" End If
  1612.  
  1613. x = LoadValue(TableName, "Credits")
  1614. If(x <> "") then Credits = CInt(x) Else Credits = 0 End If
  1615.  
  1616. 'x = LoadValue(TableName, "Jackpot")
  1617. 'If(x <> "") then Jackpot = CDbl(x) Else Jackpot = 200000 End If
  1618. x = LoadValue(TableName, "TotalGamesPlayed")
  1619. If(x <> "") then TotalGamesPlayed = CInt(x) Else TotalGamesPlayed = 0 End If
  1620. End Sub
  1621.  
  1622. Sub Savehs
  1623. SaveValue TableName, "HighScore1", HighScore(0)
  1624. SaveValue TableName, "HighScore1Name", HighScoreName(0)
  1625. SaveValue TableName, "HighScore2", HighScore(1)
  1626. SaveValue TableName, "HighScore2Name", HighScoreName(1)
  1627. SaveValue TableName, "HighScore3", HighScore(2)
  1628. SaveValue TableName, "HighScore3Name", HighScoreName(2)
  1629. SaveValue TableName, "HighScore4", HighScore(3)
  1630. SaveValue TableName, "HighScore4Name", HighScoreName(3)
  1631. SaveValue TableName, "Credits", Credits
  1632. 'SaveValue TableName, "Jackpot", Jackpot
  1633. SaveValue TableName, "TotalGamesPlayed", TotalGamesPlayed
  1634. End Sub
  1635.  
  1636. ' ***********************************************************
  1637. ' High Score Initals Entry Functions - based on Black's code
  1638. ' ***********************************************************
  1639.  
  1640. Dim hsbModeActive
  1641. Dim hsEnteredName
  1642. Dim hsEnteredDigits(3)
  1643. Dim hsCurrentDigit
  1644. Dim hsValidLetters
  1645. Dim hsCurrentLetter
  1646. Dim hsLetterFlash
  1647.  
  1648. Sub CheckHighscore()
  1649. DMDUpdate.enabled = 0
  1650. D1.Text = " "
  1651. DisplayB2SText " "
  1652. Dim tmp
  1653. tmp = Score(1)
  1654.  
  1655. If Score(2)> tmp Then tmp = Score(2)
  1656. If Score(3)> tmp Then tmp = Score(3)
  1657. If Score(4)> tmp Then tmp = Score(4)
  1658.  
  1659. If tmp> HighScore(1) Then 'add 1 credit for beating the highscore
  1660. AwardSpecial()
  1661. End If
  1662.  
  1663. If tmp> HighScore(3) Then
  1664. vpmtimer.addtimer 2000, "PlaySound ""vo_contratulationsgreatscore"" '"
  1665. HighScore(3) = tmp
  1666. 'enter player's name
  1667. HighScoreEntryInit()
  1668. Else
  1669. EndOfBallComplete()
  1670. End If
  1671. End Sub
  1672.  
  1673. Sub HighScoreEntryInit()
  1674. hsbModeActive = True
  1675. PlaySound "vo_enteryourinitials"
  1676. hsLetterFlash = 0
  1677.  
  1678. hsEnteredDigits(0) = "A"
  1679. hsEnteredDigits(1) = "A"
  1680. hsEnteredDigits(2) = "A"
  1681. hsCurrentDigit = 0
  1682.  
  1683. hsValidLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ<+-0123456789" ' < is used to delete the last letter
  1684. hsCurrentLetter = 1
  1685. ' DMDFlush
  1686. D1.text = "YOUR NAME:" & " "
  1687. 'DMDId "hsc", "", "YOUR NAME:", " ", 999999
  1688. HighScoreDisplayName()
  1689. End Sub
  1690.  
  1691. Sub EnterHighScoreKey(keycode)
  1692. If keycode = LeftFlipperKey Then
  1693. Playsound "fx_Previous"
  1694. hsCurrentLetter = hsCurrentLetter - 1
  1695. if(hsCurrentLetter = 0) then
  1696. hsCurrentLetter = len(hsValidLetters)
  1697. end if
  1698. HighScoreDisplayName()
  1699. End If
  1700.  
  1701. If keycode = RightFlipperKey Then
  1702. Playsound "fx_Next"
  1703. hsCurrentLetter = hsCurrentLetter + 1
  1704. if(hsCurrentLetter> len(hsValidLetters) ) then
  1705. hsCurrentLetter = 1
  1706. end if
  1707. HighScoreDisplayName()
  1708. End If
  1709.  
  1710. If keycode = StartGameKey OR keycode = PlungerKey Then
  1711. if(mid(hsValidLetters, hsCurrentLetter, 1) <> "<") then
  1712. playsound "fx_Enter"
  1713. hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
  1714. hsCurrentDigit = hsCurrentDigit + 1
  1715. if(hsCurrentDigit = 3) then
  1716. HighScoreCommitName()
  1717. else
  1718. HighScoreDisplayName()
  1719. end if
  1720. else
  1721. playsound "fx_Esc"
  1722. hsEnteredDigits(hsCurrentDigit) = " "
  1723. if(hsCurrentDigit> 0) then
  1724. hsCurrentDigit = hsCurrentDigit - 1
  1725. end if
  1726. HighScoreDisplayName()
  1727. end if
  1728. end if
  1729. End Sub
  1730.  
  1731. Sub HighScoreDisplayName()
  1732. DMDUpdate.enabled = 0
  1733. Dim i, TempStr
  1734. D1.text = TempStr
  1735. DisplayB2SText "" & TempStr
  1736. TempStr = " >"
  1737. if(hsCurrentDigit> 0) then TempStr = TempStr & hsEnteredDigits(0)
  1738. if(hsCurrentDigit> 1) then TempStr = TempStr & hsEnteredDigits(1)
  1739. if(hsCurrentDigit> 2) then TempStr = TempStr & hsEnteredDigits(2)
  1740.  
  1741. if(hsCurrentDigit <> 3) then
  1742. if(hsLetterFlash <> 0) then
  1743. TempStr = TempStr & "_"
  1744. DisplayB2SText TempStr & "_"
  1745. D1.TEXT = TempStr & "_"
  1746. else
  1747. TempStr = TempStr & mid(hsValidLetters, hsCurrentLetter, 1)
  1748. DisplayB2SText TempStr & mid(hsValidLetters, hsCurrentLetter, 1)
  1749. D1.TEXT = TempStr & mid(hsValidLetters, hsCurrentLetter, 1)
  1750. end if
  1751. end if
  1752.  
  1753. if(hsCurrentDigit <1) then TempStr = TempStr & hsEnteredDigits(1)
  1754. if(hsCurrentDigit <2) then TempStr = TempStr & hsEnteredDigits(2)
  1755.  
  1756. TempStr = TempStr & "< "
  1757. ' DMDMod "hsc", "YOUR NAME:", Mid(TempStr, 2, 5), 999999
  1758. DisplayB2SText "ENTER YOUR NAME: " & Mid(TempStr, 2, 5)
  1759. D1.TEXT = "YOUR NAME:" & Mid(TempStr, 2, 5)
  1760. End Sub
  1761.  
  1762. Sub HighScoreCommitName()
  1763. hsbModeActive = False
  1764. 'PlaySong "m_end"
  1765. hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
  1766. if(hsEnteredName = " ") then
  1767. hsEnteredName = "YOU"
  1768. end if
  1769.  
  1770. HighScoreName(3) = hsEnteredName
  1771. SortHighscore
  1772. ' DMDFlush
  1773. DMDUpdate.enabled = 1
  1774. EndOfBallComplete()
  1775. End Sub
  1776.  
  1777. Sub SortHighscore
  1778. Dim tmp, tmp2, i, j
  1779. For i = 0 to 3
  1780. For j = 0 to 2
  1781. If HighScore(j) <HighScore(j + 1) Then
  1782. tmp = HighScore(j + 1)
  1783. tmp2 = HighScoreName(j + 1)
  1784. HighScore(j + 1) = HighScore(j)
  1785. HighScoreName(j + 1) = HighScoreName(j)
  1786. HighScore(j) = tmp
  1787. HighScoreName(j) = tmp2
  1788. End If
  1789. Next
  1790. Next
  1791. End Sub
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799. ' *********************************************************************
  1800. ' User Defined Script Events
  1801. ' *********************************************************************
  1802.  
  1803. ' Initialise the Table for a new Game
  1804. '
  1805. Sub ResetForNewGame()
  1806. Dim i
  1807.  
  1808. bGameInPLay = True
  1809. startB2S(27)
  1810.  
  1811. 'resets the score display, and turn off attrack mode
  1812. StopAttractMode
  1813. GiOn
  1814.  
  1815. TotalGamesPlayed = TotalGamesPlayed + 1
  1816. CurrentPlayer = 1
  1817. PlayersPlayingGame = 1
  1818. bOnTheFirstBall = True
  1819. For i = 1 To MaxPlayers
  1820. Score(i) = 0
  1821. BonusPoints(i) = 0
  1822. BonusMultiplier(i) = 1
  1823. BallsRemaining(i) = BallsPerGame
  1824. ExtraBallsAwards(i) = 0
  1825. Next
  1826.  
  1827. letsGo.enabled = 1
  1828.  
  1829. ' initialise any other flags
  1830. bMultiBallMode = False
  1831. Tilt = 0
  1832. LockL = 0
  1833. LockR = 0
  1834. LockDiverterOff
  1835. LockPinOff
  1836. shenlong = 0
  1837. Saiyan = 0
  1838. SaiyanMultiball = False
  1839. TargetsModeOn = False
  1840. LockDiverterEnabled = False
  1841. ExtraBallIsIit = False
  1842. Drain1.enabled = 0
  1843. Drain.enabled = 1
  1844. ' initialise Game variables
  1845. Game_Init()
  1846.  
  1847. ' you may wish to start some music, play a sound, do whatever at this point
  1848.  
  1849. ' set up the start delay to handle any Start of Game Attract Sequence
  1850. vpmtimer.addtimer 1500, "FirstBall '"
  1851. End Sub
  1852.  
  1853.  
  1854.  
  1855. ' This is used to delay the start of a game to allow any attract sequence to
  1856. ' complete. When it expires it creates a ball for the player to start playing with
  1857.  
  1858. Sub FirstBall
  1859. ' reset the table for a new ball
  1860. ResetForNewPlayerBall()
  1861. ' create a new ball in the shooters lane
  1862. CreateNewBall()
  1863. End Sub
  1864.  
  1865. ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
  1866. ' lost one or we have moved onto the next player (if multiple are playing))
  1867.  
  1868. Sub ResetForNewPlayerBall()
  1869. ' make sure the correct display is upto date
  1870. AddScore 0
  1871.  
  1872.  
  1873. ' reduce the playfield multiplier
  1874. ' reset any drop targets, lights, game Mode etc..
  1875.  
  1876. BonusPoints(CurrentPlayer) = 0
  1877. bBonusHeld = False
  1878. bExtraBallWonThisBall = False
  1879. ResetNewBallLights()
  1880. 'Reset any table specific
  1881.  
  1882.  
  1883. 'This is a new ball, so activate the ballsaver
  1884. bBallSaverReady = True
  1885.  
  1886. 'and the skillshot
  1887. bSkillShotReady = True
  1888.  
  1889. 'Change the music ?
  1890. End Sub
  1891.  
  1892. ' Create a new ball on the Playfield
  1893.  
  1894. Sub CreateNewBall()
  1895. ' create a ball in the plunger lane kicker.
  1896. BallRelease.CreateSizedball BallSize / 2
  1897.  
  1898. ' There is a (or another) ball on the playfield
  1899. BallsOnPlayfield = BallsOnPlayfield + 1
  1900.  
  1901. ' kick it out..
  1902. PlaySound "BallRelease", 0, 1, 0.1, 0.1
  1903. BallRelease.Kick 90, 4
  1904.  
  1905. ' if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations)
  1906. ' set the bAutoPlunger flag to kick the ball in play automatically
  1907. If BallsOnPlayfield> 1 Then
  1908. bMultiBallMode = True
  1909. bAutoPlunger = True
  1910. End If
  1911. End Sub
  1912.  
  1913. ' Add extra balls to the table with autoplunger
  1914. ' Use it as AddMultiball 4 to add 4 extra balls to the table
  1915.  
  1916. Sub AddMultiball(nballs)
  1917. mBalls2Eject = mBalls2Eject + nballs
  1918. CreateMultiballTimer.Enabled = True
  1919. 'and eject the first ball
  1920. CreateMultiballTimer_Timer
  1921. End Sub
  1922.  
  1923. ' Eject the ball after the delay, AddMultiballDelay
  1924. Sub CreateMultiballTimer_Timer()
  1925. ' wait if there is a ball in the plunger lane
  1926. If bBallInPlungerLane Then
  1927. Exit Sub
  1928. Else
  1929. If BallsOnPlayfield <MaxMultiballs Then
  1930. CreateNewBall()
  1931. mBalls2Eject = mBalls2Eject -1
  1932. If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
  1933. CreateMultiballTimer.Enabled = False
  1934. End If
  1935. Else 'the max number of multiballs is reached, so stop the timer
  1936. mBalls2Eject = 0
  1937. CreateMultiballTimer.Enabled = False
  1938. End If
  1939. End If
  1940. End Sub
  1941.  
  1942. ' The Player has lost his ball (there are no more balls on the playfield).
  1943. ' Handle any bonus points awarded
  1944.  
  1945. Sub EndOfBall()
  1946.  
  1947. ' the first ball has been lost. From this point on no new players can join in
  1948. bOnTheFirstBall = False
  1949.  
  1950. ' only process any of this if the table is not tilted. (the tilt recovery
  1951. ' mechanism will handle any extra balls or end of game)
  1952.  
  1953. If NOT Tilted Then
  1954. DMDUpdate.enabled = 0
  1955. EndOfBallTimerBonus.Enabled = 1
  1956. ' add a bit of a delay to allow for the bonus points to be shown & added up
  1957. vpmtimer.addtimer 6000, "EndOfBall2 '"
  1958. Else 'if tilted then only add a short delay
  1959. vpmtimer.addtimer 100, "EndOfBall2 '"
  1960. End If
  1961. End Sub
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970. Dim BonusD
  1971. Sub EndOfBallTimerBonus_Timer()
  1972. Dim AwardPoints, TotalBonus, ii
  1973. AwardPoints = 0
  1974. TotalBonus = 0
  1975.  
  1976. DMDUpdate.enabled = 0
  1977. DisplayB2SText " "
  1978. BonusD = BonusD + 1
  1979. Select Case BonusD
  1980. Case 0:'Number of Target hits
  1981. AwardPoints = TargetBonus * 50
  1982. TotalBonus = TotalBonus + AwardPoints
  1983. DisplayB2SText " TARGET BONUS: " & AwardPoints
  1984. PlaySound "DBZ_teleport"
  1985.  
  1986. Case 1:'Number of Bumper hits
  1987. AwardPoints = BonusBumper * 10
  1988. TotalBonus = TotalBonus + AwardPoints
  1989. DisplayB2SText " BUMPER BONUS: " & AwardPoints
  1990. PlaySound "DBZ_teleport"
  1991.  
  1992. Case 2:'Lane Bonus
  1993. AwardPoints = LaneBonus * 10
  1994. TotalBonus = TotalBonus + AwardPoints
  1995. DisplayB2SText " LANE BONUS: " & AwardPoints
  1996. PlaySound "DBZ_teleport"
  1997.  
  1998. Case 3:'Number of Ramps completed
  1999. AwardPoints = RampBonus * 50
  2000. TotalBonus = TotalBonus + AwardPoints
  2001. DisplayB2SText " RAMP BONUS " & AwardPoints
  2002. PlaySound "DBZ_teleport"
  2003.  
  2004. Case 4:'calculate the totalbonus
  2005. TotalBonus = TotalBonus * BonusMultiplier(CurrentPlayer) + BonusHeldPoints(CurrentPlayer)
  2006. If Balls = BallsPerGame Then ' this is the last ball, so if bonus held has been awarded then double the bonus
  2007. TotalBonus = TotalBonus * 2
  2008. End If
  2009.  
  2010. ' Add the bonus to the score
  2011. DisplayB2SText " TOTAL BONUS "&" X "& BonusMultiplier(CurrentPlayer)
  2012. TotalBonus = TotalBonus * BonusMultiplier(CurrentPlayer)
  2013. 'AddScore TotalBonus
  2014. vpmtimer.addtimer 1000, "AddScore TotalBonus '"
  2015. PlaySound "DBZ_teleport"
  2016. BonusD = 0
  2017. EndOfBallTimerBonus.Enabled = 0
  2018. End Select
  2019.  
  2020.  
  2021.  
  2022. End Sub
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032. ' The Timer which delays the machine to allow any bonus points to be added up
  2033. ' has expired. Check to see if there are any extra balls for this player.
  2034. ' if not, then check to see if this was the last ball (of the CurrentPlayer)
  2035. '
  2036. Sub EndOfBall2()
  2037. ' if were tilted, reset the internal tilted flag (this will also
  2038. ' set TiltWarnings back to zero) which is useful if we are changing player LOL
  2039. Tilted = False
  2040. Tilt = 0
  2041. DisableTable False 'enable again bumpers and slingshots
  2042.  
  2043. ' has the player won an extra-ball ? (might be multiple outstanding)
  2044. If(ExtraBallsAwards(CurrentPlayer) <> 0) Then
  2045. 'debug.print "Extra Ball"
  2046.  
  2047. ' yep got to give it to them
  2048. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) - 1
  2049.  
  2050. ' if no more EB's then turn off any shoot again light
  2051. If(ExtraBallsAwards(CurrentPlayer) = 0) Then
  2052. LightExtraBall.State = 0
  2053. End If
  2054.  
  2055. ' You may wish to do a bit of a song AND dance at this point
  2056. ' DMD " ", "EXTRA BALL", 2000
  2057.  
  2058. ' In this table an extra ball will have the skillshot and ball saver, so we reset the playfield for the new ball
  2059. ResetForNewPlayerBall()
  2060.  
  2061. ' Create a new ball in the shooters lane
  2062. CreateNewBall()
  2063. Else ' no extra balls
  2064.  
  2065. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer) - 1
  2066.  
  2067. ' was that the last ball ?
  2068. If(BallsRemaining(CurrentPlayer) <= 0) Then
  2069. 'debug.print "No More Balls, High Score Entry"
  2070.  
  2071. ' Submit the CurrentPlayers score to the High Score system
  2072. CheckHighScore()
  2073. ' you may wish to play some music at this point
  2074.  
  2075. Else
  2076.  
  2077. ' not the last ball (for that player)
  2078. ' if multiple players are playing then move onto the next one
  2079. EndOfBallComplete()
  2080. End If
  2081. End If
  2082. End Sub
  2083.  
  2084. ' This function is called when the end of bonus display
  2085. ' (or high score entry finished) AND it either end the game or
  2086. ' move onto the next player (or the next ball of the same player)
  2087. '
  2088. Sub EndOfBallComplete()
  2089. Dim NextPlayer
  2090.  
  2091. 'debug.print "EndOfBall - Complete"
  2092.  
  2093. ' are there multiple players playing this game ?
  2094. If(PlayersPlayingGame> 1) Then
  2095. ' then move to the next player
  2096. NextPlayer = CurrentPlayer + 1
  2097. ' are we going from the last player back to the first
  2098. ' (ie say from player 4 back to player 1)
  2099. If(NextPlayer> PlayersPlayingGame) Then
  2100. NextPlayer = 1
  2101. End If
  2102. Else
  2103. NextPlayer = CurrentPlayer
  2104. End If
  2105.  
  2106. 'debug.print "Next Player = " & NextPlayer
  2107.  
  2108. ' is it the end of the game ? (all balls been lost for all players)
  2109. If((BallsRemaining(CurrentPlayer) <= 0) AND(BallsRemaining(NextPlayer) <= 0) ) Then
  2110. ' you may wish to do some sort of Point Match free game award here
  2111. ' generally only done when not in free play mode
  2112.  
  2113. ' set the machine into game over mode
  2114. EndOfGame()
  2115.  
  2116. ' you may wish to put a Game Over message on the desktop/backglass
  2117. D1.Text = " GAME OVER "
  2118. DisplayB2SText " GAME OVER "
  2119.  
  2120. Else
  2121. ' set the next player
  2122. CurrentPlayer = NextPlayer
  2123.  
  2124. ' make sure the correct display is up to date
  2125. AddScore 0
  2126.  
  2127. ' reset the playfield for the new player (or new ball)
  2128. ResetForNewPlayerBall()
  2129. ' PlaySong "DBZ_GamePlay"
  2130. ' AND create a new ball
  2131. CreateNewBall()
  2132.  
  2133. ' play a sound if more than 1 player
  2134. If PlayersPlayingGame> 1 Then
  2135. PlaySound "vo_player" &CurrentPlayer
  2136. 'DMD " ", "PLAYER " &CurrentPlayer, 800
  2137. End If
  2138. End If
  2139. End Sub
  2140.  
  2141. ' This function is called at the End of the Game, it should reset all
  2142. ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
  2143.  
  2144. Sub EndOfGame()
  2145. 'debug.print "End Of Game"
  2146. bGameInPLay = False
  2147. ' just ended your game then play the end of game tune
  2148. If NOT bJustStarted Then
  2149. 'ChangeSong
  2150. End If
  2151.  
  2152. PlaySong "DBZ_End"
  2153.  
  2154. bJustStarted = False
  2155. ' ensure that the flippers are down
  2156. SolLFlipper 0
  2157. SolRFlipper 0
  2158.  
  2159.  
  2160. ' terminate all Mode - eject locked balls
  2161. LockPinOff
  2162.  
  2163. ' most of the Mode/timers terminate at the end of the ball
  2164. Drain.enabled = 0
  2165. Drain1.enabled = 1
  2166. DMDUpdate.enabled = 0
  2167.  
  2168. ' show game over on the DMD
  2169. D1.Text = " GAME OVER "
  2170. DisplayB2SText " GAME OVER "
  2171. AttractMessagesTimerUserData = 16
  2172.  
  2173. ' set any lights for the attract mode
  2174. GiOff
  2175. StartAttractMode
  2176. ' you may wish to light any Game Over Light you may have
  2177. End Sub
  2178.  
  2179. Function Balls
  2180. Dim tmp
  2181. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  2182. If tmp> BallsPerGame Then
  2183. Balls = BallsPerGame
  2184. Else
  2185. Balls = tmp
  2186. End If
  2187. End Function
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193. Sub AwardExtraBall()
  2194. If NOT bExtraBallWonThisBall Then
  2195. 'DMD " ", "EXTRA BALL", 2000
  2196. D1.text = "EXTRA BALL"
  2197. PlaySound "vo_extraball"
  2198. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  2199. bExtraBallWonThisBall = True
  2200. GiEffect 2
  2201. LightEffect 2
  2202. END If
  2203. End Sub
  2204.  
  2205. Sub AwardSpecial()
  2206. 'DMD " ", "EXTRA GAME", 2000
  2207. D1.text = "EXTRA GAME"
  2208. PlaySound "fx_fanfare2"
  2209. Credits = Credits + 1
  2210. LightEffect 2
  2211. FlashEffect 2
  2212. End Sub
  2213.  
  2214. Sub AwardJackpot() 'award a normal jackpot, double or triple jackpot
  2215. ' DMD "JACKPOT", Jackpot(CurrentPlayer), 2000
  2216. D1.text = "JACKPOT" & Jackpot(CurrentPlayer)
  2217. DisplayB2SText " JACKPOT " & Jackpot(CurrentPlayer)
  2218. PlaySound "kamehameha"
  2219. AddScore Jackpot(CurrentPlayer)
  2220. LightEffect 2
  2221. FlashEffect 2
  2222. JackpotMSNTimer.enabled = 1
  2223. End Sub
  2224.  
  2225. Sub AwardSuperJackpot() 'this is actually 4 times a jackpot
  2226. SuperJackpot = Jackpot(CurrentPlayer) * 4
  2227. ' DMD "SUPER JACKPOT", SuperJackpot, 2000
  2228. D1.text = "SUPER JACKPOT"
  2229. DisplayB2SText " SUPER JACKPOT "
  2230. PlaySound "vo_Jackpot2"
  2231. AddScore SuperJackpot
  2232. LightEffect 2
  2233. FlashEffect 2
  2234. 'enabled jackpots again
  2235. StartJackpots
  2236. End Sub
  2237.  
  2238. Sub AwardSkillshot()
  2239. ResetSkillShotTimer_Timer
  2240. 'show dmd animation
  2241. DMDFlush
  2242. DMD "SKILLSHOT", SkillShotValue(CurrentPlayer), 2000
  2243. PlaySound "fx_fanfare2"
  2244. ' increment the skillshot value with 250.000
  2245. SkillShotValue(CurrentPlayer) = SkillShotValue(CurrentPlayer) + 25000
  2246. 'do some light show
  2247. GiEffect 2
  2248. LightEffect 2
  2249. End Sub
  2250.  
  2251.  
  2252. Sub AddBonusMultiplier(n)
  2253. Dim NewBonusLevel
  2254. ' if not at the maximum bonus level
  2255. if(BonusMultiplier(CurrentPlayer) + n <= MaxMultiplier) then
  2256. ' then add and set the lights
  2257. NewBonusLevel = BonusMultiplier(CurrentPlayer) + n
  2258. SetBonusMultiplier(NewBonusLevel)
  2259. DisplayB2SText " BONUS X " & NewBonusLevel
  2260. D1.text = "BONUS X " &NewBonusLevel
  2261. PlaySound "fx_bonux"
  2262. Else
  2263. DisplayB2SText " 5000 "
  2264. D1.text = " 5000 "
  2265. End if
  2266. End Sub
  2267.  
  2268.  
  2269. ' *********************************************************************
  2270. ' ** SCORING FUNCTIONS **
  2271. ' *********************************************************************
  2272.  
  2273.  
  2274.  
  2275. ' Add points to the score.
  2276. '
  2277. Sub AddScore(points)
  2278. If Not(Tilted) Then
  2279. ' Add the points to the current players score variable.
  2280. Score(CurrentPlayer) = Score(CurrentPlayer) + points
  2281. If Not(Tilted) Then
  2282. ' Display score and ball in play.
  2283. If Score(1) < 10000000 Then
  2284. DisplayScore
  2285. D1.Text = FormatScore(Score(1)) & " BALL " & Balls
  2286. Else
  2287. DisplayScore
  2288. D1.Text = FormatScore(Score(1)) & String(25 - Len(Score(1)), " ")
  2289. End If
  2290. Exit Sub
  2291. End If
  2292. End If
  2293. End Sub
  2294.  
  2295.  
  2296. Function FormatScore(ByVal sc)
  2297. Dim fsc
  2298. Dim fdone
  2299. fdone = ""
  2300. While Len(sc) > 3
  2301. fsc = Right(sc, 3)
  2302. If fdone = "" Then
  2303. fdone = "," & fsc
  2304. Else
  2305. fdone = "," & fsc & fdone
  2306. End If
  2307. sc = Left(sc, Len(sc)-3)
  2308. Wend
  2309. fdone = sc & fdone
  2310. FormatScore = fdone
  2311. End Function
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321. Sub Drain_Hit()
  2322. ' pretend to knock the ball into the ball storage mech
  2323. PlaySound "drain"
  2324. startB2S(30)
  2325. if ballsonplayfield = 2 then
  2326. J1.state = 0
  2327. J2.state = 0
  2328. J3.state = 0
  2329. J4.state = 0
  2330. J5.state = 0
  2331. J6.state = 0
  2332. J7.state = 0
  2333.  
  2334. PlaySong "DBZ_End"
  2335. PlaySong "DBZ_GamePlay"
  2336. end if
  2337.  
  2338. Drain.destroyball
  2339. BallsOnPlayfield = BallsOnPlayfield - 1
  2340.  
  2341.  
  2342.  
  2343. ' if there is a game in progress AND it is not Tilted
  2344. If(bGameInPLay = True) AND(Tilted = False) Then
  2345.  
  2346. ' is the ball saver active,
  2347. If(bBallSaverActive = True) Then
  2348.  
  2349. ' yep, create a new ball in the shooters lane
  2350. ' we use the Addmultiball in case the multiballs are being ejected
  2351. AddMultiball 1
  2352. ' we kick the ball with the autoplunger
  2353. bAutoPlunger = True
  2354. ' you may wish to put something on a display or play a sound at this point
  2355. ' DMD " ", "BALL SAVE", 2000
  2356. Else
  2357. ' cancel any multiball if on last ball (ie. lost all other balls)
  2358. If(BallsOnPlayfield = 1) Then
  2359. ' AND in a multi-ball??
  2360. If(bMultiBallMode = True) then
  2361. ' not in multiball mode any more
  2362. bMultiBallMode = False
  2363. ' you may wish to change any music over at this point and
  2364. ' turn off any multiball specific lights
  2365. ResetJackpotLights
  2366. If LockMultiball = True Then
  2367. ResetLockMultiball
  2368. End If
  2369.  
  2370. If ShenlongMultiball = True Then
  2371. ResetShenlongMultiball
  2372. End If
  2373.  
  2374. If SaiyanMultiball = True Then
  2375. ResetSaiyanMultiball
  2376. End If
  2377.  
  2378. ' ChangeSong
  2379. End If
  2380. End If
  2381.  
  2382. ' was that the last ball on the playfield
  2383. If(BallsOnPlayfield = 0) Then
  2384. ' End Mode and timers
  2385. ' ChangeSong
  2386. ChangeGi white
  2387. vpmtimer.addtimer 200, "EndOfBall '" 'the delay is depending of the animation of the end of ball, since there is no animation then move to the end of ball
  2388. End If
  2389. End If
  2390. End If
  2391. End Sub
  2392.  
  2393.  
  2394. Sub Drain1_Hit()
  2395. PlaySound "drain"
  2396. Drain1.destroyball
  2397. BallsOnPlayfield = 0
  2398. End Sub
  2399.  
  2400.  
  2401.  
  2402. Sub swPlungerRest_Hit()
  2403. 'debug.print "ball in plunger lane"
  2404. ' some sound according to the ball position
  2405. PlaySound "fx_sensor", 0, 1, 0.15, 0.25
  2406. bBallInPlungerLane = True
  2407. ' turn on Launch light is there is one
  2408. 'LaunchLight.State = 2
  2409. SkillShotLightsTimer.enabled = 1
  2410.  
  2411. ' kick the ball in play if the bAutoPlunger flag is on
  2412. If bAutoPlunger Then
  2413. 'debug.print "autofire the ball"
  2414. PlungerIM.AutoFire
  2415. PlaySound "fx_fire", 0, 1, 0.05, 0.05
  2416. bAutoPlunger = False
  2417. GateOpenSkillShot.enabled = 1
  2418. End If
  2419. ' if there is a need for a ball saver, then start off a timer
  2420. ' only start if it is ready, and it is currently not running, else it will reset the time period
  2421. If(bBallSaverReady = True) AND(BallSaverTime <> 0) And(bBallSaverActive = False) Then
  2422. EnableBallSaver BallSaverTime
  2423. Else
  2424. ' show the message to shoot the ball in case the player has fallen sleep
  2425. swPlungerRest.TimerEnabled = 1
  2426. End If
  2427. 'Start the Selection of the skillshot if ready
  2428. If bSkillShotReady Then
  2429. ' UpdateSkillshot()
  2430. End If
  2431. ' remember last trigger hit by the ball.
  2432. LastSwitchHit = "swPlungerRest"
  2433. End Sub
  2434.  
  2435.  
  2436. Dim startSeq
  2437. Sub SkillShotLightsTimer_Timer
  2438. startSeq = startSeq + 1
  2439. Select Case startSeq
  2440. case 1: LightBall8.state = 1: DisplayB2SText " SHOT THE BALL ": D1.text = " SHOT THE BALL "
  2441. Case 2: LightBall8.state = 0: LightBall9.state = 1
  2442. Case 3: LightBall9.state = 0: LightBall10.state = 1
  2443. Case 4: LightBall10.state = 0: LightBall11.state = 1
  2444. Case 5: LightBall11.state = 0: LightBall12.state = 1
  2445. Case 6: LightBall12.state = 0: LightBall13.state = 1
  2446. Case 7: LightBall13.state = 0: LightBall14.state = 1
  2447. Case 8: LightBall14.state = 0:
  2448. Case 9: startSeq = 9: UpdateLightsSkillShot
  2449. End Select
  2450. End Sub
  2451.  
  2452. Sub UpdateLightsSkillShot
  2453. If startSeq = 9 Then startSeq = 0: SkillShotLightsTimer.enabled = 1
  2454. End Sub
  2455.  
  2456. Sub GateOpenSkillShot_Timer
  2457. GateOpenSkillShot.enabled = 0
  2458. Gate1.Open = 1
  2459. Gate2.Open = 1
  2460. vpmtimer.addtimer 2000, "ResetGate '"
  2461. End Sub
  2462.  
  2463. Sub ResetGate
  2464. Gate1.Open = 0
  2465. Gate2.Open = 0
  2466. End Sub
  2467.  
  2468.  
  2469. ' The ball is released from the plunger turn off some flags and check for skillshot
  2470.  
  2471. Sub swPlungerRest_UnHit()
  2472. bBallInPlungerLane = False
  2473. swPlungerRest.TimerEnabled = 0 'stop the launch ball timer if active
  2474. If bSkillShotReady Then
  2475. ResetSkillShotTimer.Enabled = 1
  2476. SkillShotLightsTimer.enabled = 0
  2477. LightBall8.state = 0:LightBall9.state = 0:LightBall10.state = 0:LightBall11.state = 0:LightBall12.state = 0:LightBall13.state = 0:LightBall14.state = 0
  2478. End If
  2479. FlashEffect 2
  2480.  
  2481. End Sub
  2482.  
  2483. ' swPlungerRest timer to show the "launch ball" if the player has not shot the ball during 6 seconds
  2484.  
  2485. Sub swPlungerRest_Timer
  2486. 'DMD "", "SHOOT THE BALL", 2000
  2487. D1.text "SHOOT THE BALL"
  2488. swPlungerRest.TimerEnabled = 0
  2489. End Sub
  2490.  
  2491. Sub Trigger3_Hit:startB2S(28): SkillShotLightsTimer.enabled = 0 End Sub
  2492.  
  2493.  
  2494. Sub EnableBallSaver(seconds)
  2495. 'debug.print "Ballsaver started"
  2496. ' set our game flag
  2497. bBallSaverActive = True
  2498. bBallSaverReady = False
  2499. ' start the timer
  2500. BallSaverTimerExpired.Interval = 1000 * seconds
  2501. BallSaverTimerExpired.Enabled = True
  2502. BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
  2503. BallSaverSpeedUpTimer.Enabled = True
  2504. ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
  2505. LightShootAgain.BlinkInterval = 160
  2506. LightShootAgain.State = 2
  2507. End Sub
  2508.  
  2509. ' The ball saver timer has expired. Turn it off AND reset the game flag
  2510. '
  2511. Sub BallSaverTimerExpired_Timer()
  2512. 'debug.print "Ballsaver ended"
  2513. BallSaverTimerExpired.Enabled = False
  2514. ' clear the flag
  2515. bBallSaverActive = False
  2516. ' if you have a ball saver light then turn it off at this point
  2517. LightShootAgain.State = 0
  2518. End Sub
  2519.  
  2520. Sub BallSaverSpeedUpTimer_Timer()
  2521. 'debug.print "Ballsaver Speed Up Light"
  2522. BallSaverSpeedUpTimer.Enabled = False
  2523. ' Speed up the blinking
  2524. LightShootAgain.BlinkInterval = 80
  2525. LightShootAgain.State = 2
  2526. End Sub
  2527.  
  2528. Sub UpdateSkillShot() 'Setup and updates the skillshot lights
  2529. Gate1.Open = 0
  2530. Gate2.Open = 0
  2531. End Sub
  2532.  
  2533. Sub ResetSkillShotTimer_Timer 'timer to reset the skillshot lights & variables
  2534. ResetSkillShotTimer.Enabled = 0
  2535. bSkillShotReady = False
  2536. ' LightSeqSkillshot.StopPlay
  2537. If L11.State = 2 Then L11.State = 0
  2538. L11.State = 0
  2539. Gate1.Open = 0
  2540. Gate2.Open = 0
  2541. 'DMDScoreNow
  2542. End Sub
  2543.  
  2544.  
  2545.  
  2546. Sub CheckSuperJackpot
  2547. If J1.state + J2.state + J3.state + J4.state + J5.state + J6.state = 1 Then
  2548. AwardSuperJackpot
  2549. End If
  2550. End Sub
  2551.  
  2552.  
  2553. '********
  2554. 'Bumpers
  2555. '********
  2556.  
  2557. Dim BumperHit
  2558. Dim ExtraBallAwardBumpers
  2559.  
  2560. ExtraBallAwardBumpers = 200
  2561.  
  2562. Sub bumper1_hit
  2563. If Tilted Then Exit Sub
  2564. startB2S(10)
  2565. PlaySound SoundFXDOF("fx_bumper1", 110, DOFPulse, DOFContactors)
  2566. DOF 111, DOFPulse
  2567. AddScore (100)
  2568. BonusBumper = BonusBumper + 1
  2569. Playsound "DBZ_meleemiss1"
  2570. BumperHit = BumperHit - 1
  2571. checkBumpers()
  2572. D1.text = " " & BumperHit & " HITS "
  2573. FlashForms BumperFlash, 100, 10, 0
  2574. flashforms bumper1L, 500, 100, 1
  2575. LastSwitchHit = "Bumper1"
  2576. End Sub
  2577.  
  2578.  
  2579. Sub bumper2_hit
  2580. If Tilted Then Exit Sub
  2581. startB2S(11)
  2582. PlaySound SoundFXDOF("fx_bumper2", 114, DOFPulse, DOFContactors)
  2583. DOF 115, DOFPulse
  2584. AddScore (100)
  2585. BonusBumper = BonusBumper + 1
  2586. Playsound "DBZ_meleemiss2"
  2587. BumperHit = BumperHit - 1
  2588. checkBumpers()
  2589. D1.text = " " & BumperHit & " HITS "
  2590. FlashForms BumperFlash, 100, 10, 0
  2591. flashforms bumper2L, 500, 100, 1
  2592. LastSwitchHit = "Bumper2"
  2593. End Sub
  2594.  
  2595.  
  2596. Sub bumper3_hit
  2597. If Tilted Then Exit Sub
  2598. startB2S(12)
  2599. PlaySound SoundFXDOF("fx_bumper3", 112, DOFPulse, DOFContactors)
  2600. DOF 113, DOFPulse
  2601. AddScore (100)
  2602. BonusBumper = BonusBumper + 1
  2603. Playsound "DBZ_meleemiss3"
  2604. BumperHit = BumperHit - 1
  2605. checkBumpers()
  2606. D1.text = " " & BumperHit & " HITS "
  2607. FlashForms BumperFlash, 100, 10, 0
  2608. flashforms bumper3L, 500, 100, 1
  2609. LastSwitchHit = "Bumper3"
  2610. End Sub
  2611.  
  2612.  
  2613. Sub checkBumpers()
  2614.  
  2615. ExtraBallAwardBumpers = BumperHit
  2616. If BumperHit <= 0 Then
  2617. AwardExtraBall
  2618. BumperHit = 200
  2619. D1.text = " EXTRABALL AWARD "
  2620. DisplayB2SText " EXTRABALL AWARD "
  2621. Else
  2622. D1.text = " EXTRABALL AT " & ExtraBallAwardBumpers
  2623. DisplayB2SText " EXTRABALL AT " & " " & ExtraBallAwardBumpers & " HITS "
  2624. End If
  2625. End Sub
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633. ' Slingshots has been hit
  2634.  
  2635. Dim LStep, RStep
  2636.  
  2637. Sub LeftSlingShot_Slingshot
  2638. If Tilted Then Exit Sub
  2639. ' startB2S(7)
  2640. PlaySound SoundFXDOF("left_slingshot",103,DOFPulse,DOFContactors), 0, 1, -0.05, 0.05
  2641. DOF 116, DOFPulse
  2642. LeftSling4.Visible = 1:LeftSling1.Visible = 0
  2643. Lemk.RotX = 26
  2644. LStep = 0
  2645. LeftSlingShot.TimerEnabled = True
  2646. ' add some points
  2647. AddScore (500)
  2648. ' add some effect to the table?
  2649. Gi2.State = 0
  2650. ' remember last trigger hit by the ball
  2651. LastSwitchHit = "LeftSlingShot"
  2652. FlashForms gi2, 100, 10, 1
  2653. FlashForms gi18, 100, 10, 1
  2654. FlashForms gi20, 100, 10, 1
  2655. DOF 103, DOFPulse
  2656. End Sub
  2657.  
  2658. Sub LeftSlingShot_Timer
  2659. Select Case LStep
  2660. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  2661. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  2662. Case 3:LeftSLing2.Visible = 0:LeftSling1.Visible = 1:Lemk.RotX = -10:Gi2.State = 1:LeftSlingShot.TimerEnabled = False
  2663. End Select
  2664. LStep = LStep + 1
  2665. End Sub
  2666.  
  2667. Sub RightSlingShot_Slingshot
  2668. ' startB2S(8)
  2669. If Tilted Then Exit Sub
  2670. PlaySound SoundFXDOF("right_slingshot",104,DOFPulse,DOFContactors), 0, 1, 0.05, 0.05
  2671. DOF 117, DOFPulse
  2672. RightSling4.Visible = 1:RightSling1.Visible = 0
  2673. Remk.RotX = 26
  2674. RStep = 0
  2675. RightSlingShot.TimerEnabled = True
  2676. ' add some points
  2677. AddScore (500)
  2678. ' remember last trigger hit by the ball
  2679. LastSwitchHit = "RightSlingShot"
  2680. FlashForms gi1, 100, 10, 0
  2681. FlashForms gi19, 100, 10, 0
  2682. FlashForms gi21, 100, 10, 0
  2683. DOF 104, DOFPulse
  2684. End Sub
  2685.  
  2686. Sub RightSlingShot_Timer
  2687. Select Case RStep
  2688. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
  2689. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
  2690. Case 3:RightSLing2.Visible = 0:RightSLing1.Visible = 1:Remk.RotX = -10:Gi1.State = 1:RightSlingShot.TimerEnabled = False
  2691. End Select
  2692. RStep = RStep + 1
  2693. End Sub
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699. '********************
  2700. 'Ramps Triggers
  2701. '********************
  2702.  
  2703.  
  2704. Dim LockL
  2705. Dim LockR
  2706. Dim LockDiverterEnabled
  2707. Dim LockMultiballReady
  2708.  
  2709. Sub TriggerVukRamp_Hit
  2710. If Tilted Then Exit Sub
  2711. RampBonus = RampBonus + 1
  2712. Playsound "fx_metalrolling"
  2713. FlashForms f2, 1000, 50, 0
  2714. flashforms f2b, 1000, 50, 0
  2715. If LockR = 1 Then
  2716. vpmtimer.addtimer 1000, "LockR = 2 '"
  2717. LockRightRamp.state = 1
  2718. PinR.Isdropped = 0
  2719. Playsound "DiverterOn"
  2720. DisplayB2SText " RIGHT LOCK DONE "
  2721. vpmtimer.addtimer 1000, "UnaBolaMas '"
  2722. vpmtimer.addtimer 2000, "CheckLockDiverter '"
  2723. End If
  2724.  
  2725. If LockR = 0 Then
  2726. LightLock4.state = 1
  2727. vpmtimer.addtimer 4000, "CheckLocks '"
  2728. AddScore 500
  2729.  
  2730. Else
  2731.  
  2732. If J4.state = 2 Then
  2733. J4.state = 1
  2734. AwardJackpot
  2735. Else
  2736. AddScore 500
  2737. CheckSuperJackpot
  2738. End If
  2739. End If
  2740.  
  2741.  
  2742. End Sub
  2743.  
  2744.  
  2745.  
  2746. Sub TriggerRampL_Hit
  2747. If Tilted Then Exit Sub
  2748. RampBonus = RampBonus + 1
  2749. PlaySound "fx_metalrolling", 0, 1, pan(ActiveBall)
  2750. FlashForms f6, 1000, 50, 0
  2751. DOF 210, DOFPulse
  2752. If BallsOnPlayfield = 1 Then
  2753. LightLock2.state = 1
  2754. AddScore 500
  2755. CheckLocks
  2756. If scoopLit.state = 0 Then
  2757. scoopLit.state = 1
  2758. End If
  2759.  
  2760. Else
  2761.  
  2762. If J2.state = 2 Then
  2763. J2.state = 1
  2764. AwardJackpot
  2765. Else
  2766. AddScore 500
  2767. CheckSuperJackpot
  2768. End If
  2769. End If
  2770.  
  2771. 'check for combos
  2772. vpmTimer.AddTimer 100, "ComboblinkLight"
  2773. If ComboReady = True Then
  2774. if LastSwitchHit = "Leftorbittrigger" Or LastSwitchHit = "Rightorbittrigger" Or LastSwitchHit = "TriggerRampL" Or LastSwitchHit = "TriggerRampR" Then
  2775. Addscore jackpot(CurrentPlayer)
  2776. DisplayB2SText " COMBO " & jackpot(CurrentPlayer)
  2777. ComboMSNTimer.Interval = 500
  2778. ComboMSNTimer.enabled = 1
  2779. D1.TEXT = "COMBO" & jackpot(CurrentPlayer)
  2780. ' DMD "COMBO", jackpot(CurrentPlayer), 1000
  2781. End If
  2782. End If
  2783. LastSwitchHit = "TriggerRampL"
  2784.  
  2785. End Sub
  2786.  
  2787.  
  2788. Sub TriggerRampLockL_Hit
  2789. Playsound "fx_metalrolling", 0, 1, pan(ActiveBall)
  2790. If BallsOnPlayfield > 1 Then
  2791. CheckLockLeft
  2792. Else
  2793.  
  2794. If LockL = 1 Then
  2795. LockL = 2
  2796. LockLeftRamp.state = 1
  2797. PinL.Isdropped = 0
  2798. Playsound "DiverterOn"
  2799. DisplayB2SText " LEFT LOCK DONE "
  2800. vpmtimer.addtimer 1000, "UnaBolaMas '"
  2801. vpmtimer.addtimer 2000, "CheckLockDiverter '"
  2802. Else
  2803. CheckLockLeft
  2804. End If
  2805. End If
  2806. End Sub
  2807.  
  2808. Sub CheckLockLeft()
  2809. If LockL = 2 Then
  2810. PinL.Isdropped = 1
  2811. Playsound "DiverterOff"
  2812. ResetPinL.interval = 400
  2813. ResetPinL.enabled = 1
  2814. End If
  2815. End Sub
  2816.  
  2817. Sub ResetPinL_Timer
  2818. ResetPinL.enabled = 0
  2819. PinL.Isdropped = 0
  2820. Playsound "DiverterOn"
  2821. End Sub
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828. Sub TriggerRampR_Hit
  2829. If Tilted Then Exit Sub
  2830. RampBonus = RampBonus + 1
  2831. PlaySound "fx_metalrolling", 0, 1, pan(ActiveBall)
  2832. FlashForms f5, 1000, 50, 0
  2833. DOF 210, DOFPulse
  2834. If BallsOnPlayfield = 1 Then
  2835. LightLock6.state = 1
  2836. AddScore 500
  2837. vpmtimer.addtimer 3500, "CheckLocks '"
  2838. If kamehouseLit.state = 0 Then
  2839. kamehouseLit.state = 1
  2840. End If
  2841.  
  2842. Else
  2843.  
  2844. If J6.state = 2 Then
  2845. J6.state = 1
  2846. AwardJackpot
  2847. Else
  2848. AddScore 500
  2849. CheckSuperJackpot
  2850. End If
  2851. End If
  2852.  
  2853. 'check for combos
  2854. vpmTimer.AddTimer 100, "ComboblinkLight"
  2855. If ComboReady = True Then
  2856. if LastSwitchHit = "Leftorbittrigger" Or LastSwitchHit = "Rightorbittrigger" Or LastSwitchHit = "TriggerRampL" Or LastSwitchHit = "TriggerRampR" Then
  2857. Addscore jackpot(CurrentPlayer)
  2858. DisplayB2SText " COMBO " & jackpot(CurrentPlayer)
  2859. ComboMSNTimer.Interval = 500
  2860. ComboMSNTimer.enabled = 1
  2861. D1.TEXT = "COMBO" & jackpot(CurrentPlayer)
  2862. ' DMD "COMBO", jackpot(CurrentPlayer), 1000
  2863. End If
  2864. End If
  2865. LastSwitchHit = "TriggerRampR"
  2866.  
  2867. End Sub
  2868.  
  2869.  
  2870. Sub TriggerRampLockR_Hit
  2871. CheckLockRight
  2872. End Sub
  2873.  
  2874. Sub TriggerRampLockR1_Hit
  2875. CheckLockRight
  2876. End Sub
  2877.  
  2878. Sub CheckLockRight()
  2879. If LockR = 2 Then
  2880. PinR.Isdropped = 1
  2881. Playsound "DiverterOff"
  2882. ResetPinR.interval = 300
  2883. ResetPinR.enabled = 1
  2884. End If
  2885. End Sub
  2886.  
  2887.  
  2888. Sub ResetPinR_Timer
  2889. ResetPinR.enabled = 0
  2890. PinR.Isdropped = 0
  2891. Playsound "DiverterOn"
  2892. End Sub
  2893.  
  2894.  
  2895. Sub CheckLockDiverter()
  2896. If LockL = 2 And LockR = 2 Then
  2897. vpmtimer.addtimer 3000, "LockMultiballReady = True '"
  2898. DisplayB2SText " MULTIBALL READY "
  2899. LockDiverterEnabled = True
  2900. LockDiverterL.state = 2
  2901. LockDiverterR.state = 2
  2902. FlashForMs f1, 1000, 50, 2
  2903. FlashForMs f1b, 1000, 50, 2
  2904. End If
  2905. End Sub
  2906.  
  2907.  
  2908. Sub Leftorbittrigger_Hit
  2909. If Tilted Then Exit Sub
  2910. PlaySound "DBZ_jump", 0, 1, pan(ActiveBall)
  2911. If BallsOnPlayfield = 1 Then
  2912. LightLock1.state = 1
  2913. AddScore 500
  2914. CheckLocks
  2915. If LockL = 2 And LockR = 2 And LockMultiballReady = True Then
  2916. LockDiverterOn
  2917. Gate1.Open = 1
  2918. PinDiverterR.Isdropped = 0
  2919. Playsound "DiverterOn"
  2920. LeftorbittriggerTimer.Interval = 2000
  2921. LeftorbittriggerTimer.enabled = 1
  2922. End If
  2923.  
  2924. Else
  2925.  
  2926. If J1.state = 2 Then
  2927. J1.state = 1
  2928. AwardJackpot
  2929. Else
  2930. CheckSuperJackpot
  2931. End If
  2932. End If
  2933.  
  2934. 'check for combos
  2935. If ComboReady = True Then
  2936. GateOpenSkillShot.enabled = 1
  2937. if LastSwitchHit = "Leftorbittrigger" Or LastSwitchHit = "Rightorbittrigger" Or LastSwitchHit = "TriggerRampL" Or LastSwitchHit = "TriggerRampR" Then
  2938. Addscore jackpot(CurrentPlayer)
  2939. DisplayB2SText " COMBO " & jackpot(CurrentPlayer)
  2940. ComboMSNTimer.Interval = 500
  2941. ComboMSNTimer.enabled = 1
  2942. D1.TEXT = "COMBO" & jackpot(CurrentPlayer)
  2943. ' DMD "COMBO", jackpot(CurrentPlayer), 1000
  2944. End If
  2945. End If
  2946.  
  2947. LastSwitchHit = "Leftorbittrigger"
  2948.  
  2949. End Sub
  2950.  
  2951. Sub LeftorbittriggerTimer_Timer
  2952. LeftorbittriggerTimer.enabled = 0
  2953. LockDiverterOff
  2954. Playsound "DiverterOff"
  2955. Gate1.Open = 0
  2956. PinDiverterR.Isdropped = 1
  2957. End Sub
  2958.  
  2959. Sub Rightorbittrigger_Hit
  2960. If Tilted Then Exit Sub
  2961. PlaySound "DBZ_jump", 0, 1, pan(ActiveBall)
  2962. If BallsOnPlayfield = 1 Then
  2963. LightLock7.state = 1
  2964. AddScore 500
  2965. CheckLocks
  2966. If LockL = 2 And LockR = 2 And LockMultiballReady = True Then
  2967. LockDiverterOn
  2968. Playsound "DiverterOff"
  2969. Gate2.Open = 0
  2970. PinDiverterL.Isdropped = 0
  2971. RightorbittriggerTimer.interval = 1000
  2972. RightorbittriggerTimer.enabled = 1
  2973. End If
  2974.  
  2975. Else
  2976.  
  2977. If J7.state = 2 Then
  2978. J7.state = 1
  2979. AwardJackpot
  2980. Else
  2981. CheckSuperJackpot
  2982. End If
  2983. End If
  2984.  
  2985. 'check for combos
  2986. If ComboReady = True Then
  2987. GateOpenSkillShot.enabled = 1
  2988. if LastSwitchHit = "Leftorbittrigger" Or LastSwitchHit = "Rightorbittrigger" Or LastSwitchHit = "TriggerRampL" Or LastSwitchHit = "TriggerRampR" Then
  2989. Addscore jackpot(CurrentPlayer)
  2990. DisplayB2SText " COMBO " & jackpot(CurrentPlayer)
  2991. ComboMSNTimer.Interval = 500
  2992. ComboMSNTimer.enabled = 1
  2993. D1.TEXT = "COMBO" & jackpot(CurrentPlayer)
  2994. ' DMD "COMBO", jackpot(CurrentPlayer), 1000
  2995. End If
  2996. End If
  2997. LastSwitchHit = "Rightorbittrigger"
  2998.  
  2999. End Sub
  3000.  
  3001. Sub RightorbittriggerTimer_Timer
  3002. RightorbittriggerTimer.enabled = 0
  3003. Playsound "DiverterOff"
  3004. Gate2.Open = 1
  3005. PinDiverterL.Isdropped = 1
  3006. LockDiverterOff
  3007. End Sub
  3008.  
  3009.  
  3010.  
  3011.  
  3012. Sub CheckLocks()
  3013. If LockDiverterEnabled = True Then Exit Sub
  3014. If LockL = 2 Or LockR = 2 Then Exit Sub
  3015.  
  3016. If LightLock1.state = 1 And LightLock2.state = 1 And LightLock3.state = 1 And LightLock4.state = 1 And LightLock5.state = 1 And LightLock6.state = 1 And LightLock7.state = 1 Then
  3017. LockLeftRamp.state = 2
  3018. LockRightRamp.state = 2
  3019. LockL = 1
  3020. LockR = 1
  3021. DisplayB2SText " LOCK THE BALLS "
  3022. FlashForms f3, 500, 50, 2
  3023. flashforms f3b, 500, 50, 2
  3024. FlashForms f4, 500, 50, 2
  3025. flashforms f4b, 500, 50, 2
  3026. DOF 105 ,DOFPulse
  3027. DOF 106 ,DOFPulse
  3028. End If
  3029. End Sub
  3030.  
  3031.  
  3032.  
  3033.  
  3034. '******
  3035. 'Oyos
  3036. '******
  3037.  
  3038. Dim ShenlongMultiball
  3039. Dim Shenlong
  3040. Sub Scoop_Hit
  3041. ScoopFake.enabled = 0
  3042. If BallsOnPlayfield > 1 Then
  3043.  
  3044. If J3.state = 2 Then
  3045. J3.state = 1
  3046. AwardJackpot
  3047. Else
  3048. CheckSuperJackpot
  3049. End If
  3050. vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3051. Else
  3052.  
  3053. If ExtraBallIsIit = True Then
  3054. ExtraBallIsIit = False
  3055. LightExtraBallLit.state = 0
  3056. LightExtraBall.state = 1
  3057. AwardExtraBall()
  3058. End If
  3059.  
  3060. ScoopTimer1.enabled = 1
  3061. End If
  3062. End Sub
  3063.  
  3064.  
  3065.  
  3066. Sub ScoopTimer1_Timer
  3067. ScoopTimer1.enabled = 0
  3068. AddScore 1000
  3069. If BallsOnPlayfield = 1 Then
  3070. LightLock3.state = 1
  3071. CheckLocks
  3072. End If
  3073. If scoopLit.state = 1 Then
  3074. scoopLit.state = 0
  3075. shenlong = shenlong + 1
  3076. CheckBalls
  3077. Else
  3078. vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3079. DisplayB2SText " FIND THE DRAGON BALLS "
  3080. D1.text = "FIND THE DRAGON BALLS"
  3081. End If
  3082. End Sub
  3083.  
  3084. Sub ScoopFake_Hit
  3085. Playsound "fx_balldrop"
  3086. End Sub
  3087.  
  3088. Sub CheckBalls
  3089. Dim i
  3090. If shenlong = 7 Then
  3091. startB2S(31)
  3092. LightSeqAllBalls.Play SeqRandom, 10, , 50000
  3093. AddMultiball 6
  3094. ShenlongMultiball = True
  3095. bMultiBallMode = True
  3096. LightBall1.state = 0
  3097. LightBall2.state = 0
  3098. LightBall3.state = 0
  3099. LightBall4.state = 0
  3100. LightBall5.state = 0
  3101. LightBall6.state = 0
  3102. LightBall7.state = 0
  3103. PlaySong "DBZ_End"
  3104. PlaySong "DBZ_Multiball"
  3105. StartJackpots
  3106. OjoL.state = 2
  3107. OjoR.state = 2
  3108. vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3109. DisplayB2SText " SHENLONG MULTIBALL "
  3110. D1.text = "SHENLONG MULTIBALL"
  3111. SHENLONGMSNTimer.interval = 1000
  3112. SHENLONGMSNTimer.enabled = 1
  3113. ResetLanes()
  3114. End If
  3115.  
  3116. If shenlong = 6 Then LightBall6.state = 1: startB2S(6): LightSeqBalls5.StopPlay: BallsMessage() :vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3117. If shenlong = 5 Then LightBall5.state = 1: startB2S(5): LightSeqBalls4.StopPlay: BallsMessage(): LightSeqBalls5.Play SeqLeftOn, 25, 1: LightSeqBalls5.UpdateInterval = 25:
  3118.  
  3119. LightSeqBalls5.Play SeqRightOn, 25, 1: vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3120. If shenlong = 4 Then LightBall4.state = 1: startB2S(4): LightSeqBalls3.StopPlay: BallsMessage(): LightSeqBalls4.Play SeqLeftOn, 25, 1: LightSeqBalls4.UpdateInterval = 25:
  3121.  
  3122. LightSeqBalls4.Play SeqRightOn, 25, 1: vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3123. If shenlong = 3 Then LightBall3.state = 1: startB2S(3): LightSeqBalls2.StopPlay: BallsMessage(): LightSeqBalls3.Play SeqLeftOn, 25, 1: LightSeqBalls3.UpdateInterval = 25:
  3124.  
  3125. LightSeqBalls3.Play SeqRightOn, 25, 1: vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3126. If shenlong = 2 Then LightBall2.state = 1: startB2S(2): LightSeqBalls1.StopPlay: BallsMessage(): LightSeqBalls2.Play SeqLeftOn, 25, 1: LightSeqBalls2.UpdateInterval = 25:
  3127.  
  3128. LightSeqBalls2.Play SeqRightOn, 25, 1: vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3129. If shenlong = 1 Then LightBall1.state = 1: startB2S(1): LightSeqAllBalls.StopPlay: BallsMessage(): LightSeqBalls1.Play SeqLeftOn, 25, 1: LightSeqBalls1.UpdateInterval = 25: LightSeqBalls1.Play SeqRightOn, 25, 1: vpmtimer.addtimer 2500, "ScoopSolenoidPulse '"
  3130. End Sub
  3131.  
  3132. Sub LightSeqAllBalls_PlayDone()
  3133. BallsRestart()
  3134. End Sub
  3135.  
  3136.  
  3137. Sub BallsRestart
  3138. Dim i
  3139. shenlong = 0
  3140. LightSeqAllBalls.UpdateInterval = 25
  3141. LightSeqAllBalls.Play SeqLeftOn, 25, 1
  3142. LightSeqAllBalls.UpdateInterval = 25
  3143. LightSeqAllBalls.Play SeqRightOn, 25, 1
  3144. LightSeqAllBalls.UpdateInterval = 25
  3145. LightSeqAllBalls.UpdateInterval = 25
  3146. LightSeqAllBalls.Play SeqLeftOn, 25, 1
  3147. LightSeqAllBalls.UpdateInterval = 25
  3148. LightSeqAllBalls.Play SeqRightOn, 25, 1
  3149. LightSeqAllBalls.UpdateInterval = 25
  3150. End Sub
  3151.  
  3152.  
  3153. Sub BallsRestart6
  3154. LightBall7.state = 2
  3155. End Sub
  3156.  
  3157.  
  3158. Sub LightSeqBalls5_PlayDone()
  3159. BallsRestart5()
  3160. End Sub
  3161.  
  3162.  
  3163. Sub BallsRestart5
  3164. Dim i
  3165. LightSeqBalls5.UpdateInterval = 25
  3166. LightSeqBalls5.Play SeqLeftOn, 25, 1
  3167. LightSeqBalls5.UpdateInterval = 25
  3168. LightSeqBalls5.Play SeqRightOn, 25, 1
  3169. LightSeqBalls5.UpdateInterval = 25
  3170. LightSeqBalls5.UpdateInterval = 25
  3171. LightSeqBalls5.Play SeqLeftOn, 25, 1
  3172. LightSeqBalls5.UpdateInterval = 25
  3173. LightSeqBalls5.Play SeqRightOn, 25, 1
  3174. LightSeqBalls5.UpdateInterval = 25
  3175. End Sub
  3176.  
  3177.  
  3178. Sub LightSeqBalls4_PlayDone()
  3179. BallsRestart4()
  3180. End Sub
  3181.  
  3182.  
  3183. Sub BallsRestart4
  3184. Dim i
  3185. LightSeqBalls4.UpdateInterval = 25
  3186. LightSeqBalls4.Play SeqLeftOn, 25, 1
  3187. LightSeqBalls4.UpdateInterval = 25
  3188. LightSeqBalls4.Play SeqRightOn, 25, 1
  3189. LightSeqBalls4.UpdateInterval = 25
  3190. LightSeqBalls4.UpdateInterval = 25
  3191. LightSeqBalls4.Play SeqLeftOn, 25, 1
  3192. LightSeqBalls4.UpdateInterval = 25
  3193. LightSeqBalls4.Play SeqRightOn, 25, 1
  3194. LightSeqBalls4.UpdateInterval = 25
  3195. End Sub
  3196.  
  3197.  
  3198. Sub LightSeqBalls3_PlayDone()
  3199. BallsRestart3()
  3200. End Sub
  3201.  
  3202.  
  3203. Sub BallsRestart3
  3204. Dim i
  3205. LightSeqBalls3.UpdateInterval = 25
  3206. LightSeqBalls3.Play SeqLeftOn, 25, 1
  3207. LightSeqBalls3.UpdateInterval = 25
  3208. LightSeqBalls3.Play SeqRightOn, 25, 1
  3209. LightSeqBalls3.UpdateInterval = 25
  3210. LightSeqBalls3.UpdateInterval = 25
  3211. LightSeqBalls3.Play SeqLeftOn, 25, 1
  3212. LightSeqBalls3.UpdateInterval = 25
  3213. LightSeqBalls3.Play SeqRightOn, 25, 1
  3214. LightSeqBalls3.UpdateInterval = 25
  3215. End Sub
  3216.  
  3217.  
  3218. Sub LightSeqBalls2_PlayDone()
  3219. BallsRestart2()
  3220. End Sub
  3221.  
  3222.  
  3223. Sub BallsRestart2
  3224. Dim i
  3225. LightSeqBalls2.UpdateInterval = 25
  3226. LightSeqBalls2.Play SeqLeftOn, 25, 1
  3227. LightSeqBalls2.UpdateInterval = 25
  3228. LightSeqBalls2.Play SeqRightOn, 25, 1
  3229. LightSeqBalls2.UpdateInterval = 25
  3230. LightSeqBalls2.UpdateInterval = 25
  3231. LightSeqBalls2.Play SeqLeftOn, 25, 1
  3232. LightSeqBalls2.UpdateInterval = 25
  3233. LightSeqBalls2.Play SeqRightOn, 25, 1
  3234. LightSeqBalls2.UpdateInterval = 25
  3235. End Sub
  3236.  
  3237.  
  3238. Sub LightSeqBalls1_PlayDone()
  3239. BallsRestart1
  3240. End Sub
  3241.  
  3242.  
  3243. Sub BallsRestart1
  3244. Dim i
  3245. LightSeqBalls1.UpdateInterval = 25
  3246. LightSeqBalls1.Play SeqLeftOn, 25, 1
  3247. LightSeqBalls1.UpdateInterval = 25
  3248. LightSeqBalls1.Play SeqRightOn, 25, 1
  3249. LightSeqBalls1.UpdateInterval = 25
  3250. LightSeqBalls1.UpdateInterval = 25
  3251. LightSeqBalls1.Play SeqLeftOn, 25, 1
  3252. LightSeqBalls1.UpdateInterval = 25
  3253. LightSeqBalls1.Play SeqRightOn, 25, 1
  3254. LightSeqBalls1.UpdateInterval = 25
  3255. End Sub
  3256.  
  3257. Sub ResetShenlongMultiball
  3258. D1.Text = " END SHENLONG MULTIBALL "
  3259. DisplayB2SText " END SHENLONG MULTIBALL "
  3260. ShenlongMultiball = False
  3261. shenlong = 0
  3262. LightBall1.state = 0
  3263. LightBall2.state = 0
  3264. LightBall3.state = 0
  3265. LightBall4.state = 0
  3266. LightBall5.state = 0
  3267. LightBall6.state = 0
  3268. LightBall7.state = 0
  3269. OjoL.state = 0
  3270. OjoR.state = 0
  3271. BallsRestart
  3272. ResetLanes
  3273. End Sub
  3274.  
  3275. Sub BallsMessage()
  3276. select Case shenlong
  3277. Case 0: If scoopLit.state = 0 Then
  3278. DisplayB2SText " FIND THE DRAGON BALLS "
  3279. D1.text = "FIND THE DRAGON BALLS"
  3280. End If
  3281. Case 1: If shenlong = 1 Then
  3282. DisplayB2SText " DRAGON BALL 1 UNLOCKET ":
  3283. D1.text = "DRAGON BALL 1 UNLOCKET"
  3284. BallsRestart1
  3285. End If
  3286. Case 2: If shenlong = 2 Then
  3287. DisplayB2SText " DRAGON BALL 2 UNLOCKET ":
  3288. D1.text = "DRAGON BALL 2 UNLOCKET"
  3289. BallsRestart2
  3290. End If
  3291.  
  3292. Case 3: If shenlong = 3 Then
  3293. DisplayB2SText " DRAGON BALL 3 UNLOCKET ":
  3294. D1.text = "DRAGON BALL 3 UNLOCKET"
  3295. BallsRestart3
  3296. End If
  3297.  
  3298. Case 4: If shenlong = 4 Then
  3299. DisplayB2SText " DRAGON BALL 4 UNLOCKET ":
  3300. D1.text = "DRAGON BALL 4 UNLOCKET"
  3301. BallsRestart4
  3302. End If
  3303.  
  3304. Case 5: If shenlong = 5 Then
  3305. DisplayB2SText " DRAGON BALL 5 UNLOCKET ":
  3306. D1.text = "DRAGON BALL 5 UNLOCKET"
  3307. BallsRestart5
  3308. End If
  3309.  
  3310. Case 6: If shenlong = 6 Then
  3311. DisplayB2SText " DRAGON BALL 6 UNLOCKET ":
  3312. D1.text = "DRAGON BALL 6 UNLOCKET"
  3313. BallsRestart6
  3314. End If
  3315.  
  3316. Case 7: If shenlong = 7 Then
  3317. DisplayB2SText " DRAGON BALL 7 UNLOCKET ":
  3318. D1.text = "DRAGON BALL 7 UNLOCKET"
  3319. End If
  3320. End Select
  3321. End Sub
  3322.  
  3323.  
  3324.  
  3325. '***************
  3326. 'KameHouse
  3327. '***************
  3328.  
  3329. Sub kamehouse_Hit
  3330. kamehouseFake.enabled = 0
  3331. If BallsOnPlayfield = 1 Then
  3332. LightLock5.state = 1
  3333. CheckLocks
  3334. RandomAwardTimer.interval = 2000
  3335. RandomAwardTimer.enabled = 1
  3336. Else
  3337. If J5.state = 2 Then
  3338. J5.state = 1
  3339. AwardJackpot
  3340. Else
  3341. CheckSuperJackpot
  3342. End If
  3343. vpmtimer.addtimer 2500, "kamehouseSolenoidPulse '"
  3344. End If
  3345. End Sub
  3346.  
  3347. Sub RandomAwardTimer_Timer
  3348. RandomAwardTimer.enabled = 0
  3349. If kamehouseLit.state = 1 Then
  3350. kamehouseLit.state = 0
  3351. kamehouseAward
  3352. Else
  3353. kamehouseSolenoidPulse
  3354. DisplayB2SText " NOBODY'S HOME "
  3355. D1.TEXT = "NOBODY'S HOME"
  3356. AddScore 1000
  3357. End If
  3358. End Sub
  3359.  
  3360. Sub kamehouseFake_Hit
  3361. Playsound "fx_balldrop"
  3362. End Sub
  3363.  
  3364.  
  3365. Dim ExtraBallIsIit
  3366. Sub kamehouseAward() 'from the Pyramid
  3367. Dim tmp, tmp2
  3368.  
  3369. tmp = INT(RND(1) * 80)
  3370. Select Case tmp
  3371. Case 1, 2, 3, 4, 5, 6 'Lit Extra Ball
  3372. 'DMD "EXTRA BALL IS LIT", " ", 2000
  3373. D1.text = "EXTRA BALL IS LIT"
  3374. DisplayB2SText " EXTRA BALL IS LIT "
  3375. ExtraBallIsIit = True
  3376. LightExtraBallLit.State = 2
  3377. Case 7, 8, 13, 14, 15 '100,000 points
  3378. 'DMD "BIG POINTS", "10000", 2000
  3379. D1.text = "BIG POINTS 10000"
  3380. DisplayB2SText " BIG POINTS 10000 "
  3381. AddScore 10000
  3382. Case 9, 10, 11, 12 'Hold Bonus
  3383. 'DMD "BONUS HELD", "ACTIVATED", 2000
  3384. DisplayB2SText " BONUS HELD ACTIVATED "
  3385. D1.text = " BONUS HELD ACTIVATED "
  3386. bBonusHeld = True
  3387. Case 16, 17, 18 'Increase Bonus Multiplier
  3388. 'DMD "INCREASED", "BONUS X", 2000
  3389. D1.text = "INCREASED BONUS X"
  3390. DisplayB2SText " INCREASED BONUS X "
  3391. AddBonusMultiplier 1
  3392. Case 19, 20, 21 'Add a Dragon Ball
  3393. Shenlong = Shenlong + 1
  3394. D1.text = "DRAGON BALL FOUND"
  3395. DisplayB2SText " DRAGON BALL FOUND "
  3396. CheckBalls
  3397. Case 22, 23, 36, 37, 38 'PlayField multiplier
  3398. ' DMD "INCREASED", "PLAYFIELD X", 2000
  3399. ' AddPlayfieldMultiplier 1
  3400. Case 24, 25, 26, 27, 28 '100,000 points
  3401. 'DMD "BIG POINTS", "10000", 2000
  3402. D1.text = "BIG POINTS 50000"
  3403. DisplayB2SText " BIG POINTS 50000 "
  3404. AddScore 50000
  3405. Case 29, 30, 31, 32, 33, 34, 35 'Increase Bumper value
  3406. BumperValue(CurrentPlayer) = BumperValue(CurrentPlayer) + 500
  3407. ' DMD "BUMPER VALUE", BumperValue(CurrentPlayer), 2000
  3408. D1.text = "BUMPER VALUE" & BumperValue(CurrentPlayer)
  3409. DisplayB2SText " BUMPER VALUE " & BumperValue(CurrentPlayer)
  3410. Case 39, 40, 43, 44 'extra multiball
  3411. 'DMD "EXTRA", "MULTIBALL", 2000
  3412. D1.text = "QUICK MULTIBALL"
  3413. DisplayB2SText " QUICK MULTIBALL "
  3414. UnaBolaMas: bMultiBallMode = True :BallsOnPlayfield = 2 : PlaySong "DBZ_End": PlaySong "DBZ_Multiball": EnableBallSaver 10: StartJackpots: GiEffect 2:
  3415.  
  3416. LightEffect 2
  3417. Case 45, 46, 47, 48 ' Ball Save
  3418. ' DMD "BALL SAVE", "ACTIVATED", 2000
  3419. D1.text = "BALL SAVE ACTIVATED"
  3420. DisplayB2SText " BALL SAVE ACTIVATED "
  3421. EnableBallSaver 20
  3422. Case 51, 52, 53, 54 ' Add Light Lock
  3423. Select Case tmp
  3424. Case 1: If LightLock1.state = 0 Then
  3425. LightLock1.blinkinterval = 1000
  3426. LightLock1.state = 1
  3427. CheckLocks
  3428. End If
  3429. Case 2: If LightLock2.state = 0 Then
  3430. LightLock2.blinkinterval = 1000
  3431. LightLock2.state = 1
  3432. CheckLocks
  3433. End If
  3434. Case 3: If LightLock3.state = 0 Then
  3435. LightLock3.blinkinterval = 1000
  3436. LightLock3.state = 1
  3437. CheckLocks
  3438. End If
  3439. Case 4: If LightLock4.state = 0 Then
  3440. LightLock4.blinkinterval = 1000
  3441. LightLock4.state = 1
  3442. CheckLocks
  3443. End If
  3444. Case 5: If LightLock5.state = 0 Then
  3445. LightLock5.blinkinterval = 1000
  3446. LightLock5.state = 1
  3447. CheckLocks
  3448. End If
  3449. Case 6: If LightLock6.state = 0 Then
  3450. LightLock6.blinkinterval = 1000
  3451. LightLock6.state = 1
  3452. CheckLocks
  3453. End If
  3454. Case 7: If LightLock7.state = 0 Then
  3455. LightLock7.blinkinterval = 1000
  3456. LightLock7.state = 1
  3457. CheckLocks
  3458. End If
  3459. End Select
  3460. D1.text = "ADD LIGHT LOCK"
  3461. DisplayB2SText " ADD LIGHT LOCK "
  3462. Case 60, 61, 62, 63 ' Add Saiyan Level
  3463. Saiyan = Saiyan + 1
  3464. CheckNivel
  3465. D1.text = "ADD SAIYAN LEVEL"
  3466. DisplayB2SText " ADD SAIYAN LEVEL "
  3467. Case ELSE 'Add a Random score from 10.000 to 100,000 points
  3468. tmp2 = INT((RND) * 9) * 1000 + 10000
  3469. ' DMD "EXTRA POINTS", tmp2, 2000
  3470. D1.text = "EXTRA POINTS " & tmp2
  3471. DisplayB2SText " EXTRA POINTS " & tmp2
  3472. AddScore tmp2
  3473. End Select
  3474.  
  3475. kamehouseSolenoidPulse
  3476.  
  3477. End Sub
  3478.  
  3479.  
  3480.  
  3481. '**************
  3482. ' LockHole
  3483. '**************
  3484.  
  3485. Sub LockHole_Hit
  3486. LockDiverterOff
  3487. ResetLanes()
  3488. LockDiverterL.state = 1
  3489. LockDiverterR.state = 1
  3490. Gate4.Open = 1
  3491. PlaySong "DBZ_End"
  3492. PlaySong "DBZ_Multiball"
  3493. LightEffect 2
  3494. FlashEffect 2
  3495. Playsound "subway2"
  3496. LockHoleTimer.interval = 4000
  3497. LockHoleTimer.enabled = 1
  3498. End Sub
  3499.  
  3500. Sub LockHoleSolenoidPulse
  3501. ScoopFake.enabled = 0
  3502. LockHole.kick 225, 10
  3503. End Sub
  3504.  
  3505. Sub LockHoleTimer_Timer
  3506. LockHoleTimer.enabled = 0
  3507. LockMultiballReady = False
  3508. LockMultiball = True
  3509. bMultiBallMode = True
  3510. LockL = 0
  3511. LockR = 0
  3512. LockPinOff
  3513. BallsOnPlayfield = 3
  3514. StartJackpots
  3515. scoop1.enabled = 1
  3516. scoop.enabled = 0
  3517. DisplayB2SText " MULTIBALL "
  3518. MultiballMSNTimer.interval = 2000
  3519. MultiballMSNTimer.enabled = 1
  3520. LockHoleSolenoidPulse
  3521. FlashForMs f1, 1000, 50, 0
  3522. FlashForMs f1b, 1000, 50, 0
  3523. End Sub
  3524.  
  3525. Sub scoop1_Hit
  3526. scoop1.kick 0, 30 , 1.5
  3527. Playsound "salidadebola"
  3528. scoop1.enabled = 0
  3529. Scoop1Timer.interval = 1000
  3530. Scoop1Timer.enabled = 1
  3531. End Sub
  3532.  
  3533. Sub Scoop1Timer_Timer
  3534. Scoop1Timer.enabled = 0
  3535. scoop.enabled = 1
  3536. End Sub
  3537.  
  3538. Sub kamehouseSolenoidPulse
  3539. Playsound "salidadebola"
  3540. debug.print "test"
  3541. kamehouseFake.enabled = 0
  3542. kamehouse.kick 0, 33, 1.5
  3543. kamehouseTimer.interval = 500
  3544. kamehouseTimer.enabled = 1
  3545. End Sub
  3546.  
  3547. Sub kamehouseTimer_Timer
  3548. kamehouseTimer.enabled = 0
  3549. kamehouseFake.enabled = 1
  3550. End Sub
  3551.  
  3552. Sub ScoopSolenoidPulse
  3553. Playsound SoundFXDOF("salidadebola", 127, DOFPulse, DOFContactors)
  3554. DOF 118, DOFPulse
  3555. ScoopFake.enabled = 0
  3556. scoop.kick 0, 30 , 1.5
  3557. scoopTimer.interval = 500
  3558. scoopTimer.enabled = 1
  3559. End Sub
  3560. Sub ScoopTimer_Timer
  3561. ScoopTimer.enabled = 0
  3562. ScoopFake.enabled = 1
  3563. End Sub
  3564.  
  3565.  
  3566. Sub Kicker1_Hit
  3567. Kicker1.kick 180, 1
  3568. End Sub
  3569.  
  3570. Sub Kicker2_Hit
  3571. Kicker2.kick 180, 1
  3572. End Sub
  3573.  
  3574.  
  3575. Sub LockPinOff()
  3576. PinL.Isdropped = 1
  3577. PinR.Isdropped = 1
  3578. End Sub
  3579.  
  3580.  
  3581.  
  3582. Sub LockPinOn()
  3583. PinL.Isdropped = 0
  3584. PinR.Isdropped = 0
  3585. End Sub
  3586.  
  3587.  
  3588.  
  3589. Sub LockDiverterOff()
  3590. LockDiverter.RotateToStart
  3591. End Sub
  3592.  
  3593. Sub LockDiverterOn()
  3594. LockDiverter.RotateToEnd
  3595. End Sub
  3596.  
  3597.  
  3598. Sub IncrementBonusMultiplier()
  3599. Dim NewBonusLevel
  3600.  
  3601. ' if not at the maximum bonus level
  3602. if(BonusMultiplier(CurrentPlayer) < MaxMultiplier) then
  3603. ' then set it the next next one AND set the lights
  3604. NewBonusLevel = BonusMultiplier(CurrentPlayer) + 1
  3605. SetBonusMultiplier(NewBonusLevel)
  3606. D1.Text = " BONUS X: " & BonusMultiplier(CurrentPlayer)
  3607. DisplayB2SText " BONUS X: " & BonusMultiplier(CurrentPlayer)
  3608. End if
  3609. End Sub
  3610.  
  3611. Sub SetBonusMultiplier(Level)
  3612. ' Set the multiplier to the specified level
  3613. BonusMultiplier(CurrentPlayer) = Level
  3614. ' UPdateBonusXLights(Level)
  3615. End Sub
  3616.  
  3617. Sub CheckMultiplier
  3618. If(l11.State = 1) And(L12.State = 1) And(L13.State = 1) Then
  3619. AddScore 5000
  3620. LightSeqLanesUP.Play SeqRandom, 5, , 2000
  3621. IncrementBonusMultiplier()
  3622. L11.State = 0
  3623. L12.State = 0
  3624. L13.State = 0
  3625. End If
  3626. End Sub
  3627.  
  3628.  
  3629.  
  3630.  
  3631. Sub ResetJackpotLights 'when multiball is finished, resets jackpot and superjackpot lights
  3632. bJackpot = False
  3633. J1.State = 0
  3634. J2.State = 0
  3635. J3.State = 0
  3636. J4.State = 0
  3637. J5.State = 0
  3638. J6.State = 0
  3639. J7.State = 0
  3640. End Sub
  3641.  
  3642. Sub StartJackpots
  3643. If bMultiballMode Then
  3644. bJackpot = True
  3645. J1.State = 2
  3646. J2.State = 2
  3647. J3.State = 2
  3648. J4.State = 2
  3649. J5.State = 2
  3650. J6.State = 2
  3651. J7.State = 2
  3652. End If
  3653. End Sub
  3654.  
  3655.  
  3656. Dim LockMultiball
  3657. Sub ResetLockMultiball
  3658. LockL = 0
  3659. LockR = 0
  3660. bJackpot = False
  3661. LockMultiball = False
  3662. LockDiverterEnabled = False
  3663. LightLock1.State = 0
  3664. LightLock2.State = 0
  3665. LightLock3.State = 0
  3666. LightLock4.State = 0
  3667. LightLock5.State = 0
  3668. LightLock6.State = 0
  3669. LightLock7.State = 0
  3670. LockRightRamp.State = 0
  3671. LockLeftRamp.State = 0
  3672. LockDiverterL.State = 0
  3673. LockDiverterR.State = 0
  3674. ResetLanes()
  3675. End Sub
  3676.  
  3677.  
  3678. Sub ResetLanes()
  3679. L14.state = 0
  3680. L15.state = 0
  3681. L16.state = 0
  3682. L17.state = 0
  3683. End Sub
  3684. '**********************
  3685. 'LaneTriggersUp
  3686. '**********************
  3687. Sub LeftLaneTriggerUp_Hit()
  3688. DOF 119, DOFPulse
  3689. If Tilted Then Exit Sub
  3690. LaneBonus = LaneBonus + 1
  3691. L11.state = 1
  3692. AddScore 500
  3693. CheckMultiplier
  3694. End Sub
  3695.  
  3696.  
  3697. Sub MiddleLaneTriggerUp_Hit()
  3698. DOF 120, DOFPulse
  3699. If Tilted Then Exit Sub
  3700. LaneBonus = LaneBonus + 1
  3701. L12.state = 1
  3702. AddScore 500
  3703. CheckMultiplier
  3704. End Sub
  3705.  
  3706.  
  3707.  
  3708. Sub RightLaneTriggerUp_Hit()
  3709. DOF 121, DOFPulse
  3710. If Tilted Then Exit Sub
  3711. LaneBonus = LaneBonus + 1
  3712. L13.state = 1
  3713. AddScore 500
  3714. CheckMultiplier
  3715. End Sub
  3716.  
  3717.  
  3718. '**********************
  3719. 'LaneTriggersDown
  3720. '**********************
  3721. Sub LeftOutLaneTrigger_Hit()
  3722. DOF 122, DOFPulse
  3723. If Tilted Then Exit Sub
  3724. LaneSounds()
  3725. LaneBonus = LaneBonus + 1
  3726. L14.state = 1
  3727. AddScore 500
  3728. CheckLaneTriggersDown
  3729.  
  3730. If(bBallSaverActive = True) Then
  3731. bBallSaverActive = False
  3732. EnableBallSaver 1
  3733. BallsOnPlayfield = BallsOnPlayfield + 1
  3734. UnaBolaMas
  3735. End If
  3736. End Sub
  3737.  
  3738. Sub LeftInLaneTrigger_Hit()
  3739. DOF 123, DOFPulse
  3740. If Tilted Then Exit Sub
  3741. LaneBonus = LaneBonus + 1
  3742. LaneSounds()
  3743. L15.state = 1
  3744. AddScore 500
  3745. CheckLaneTriggersDown
  3746. End Sub
  3747.  
  3748.  
  3749. Sub RightInLaneTrigger_Hit()
  3750. DOF 124, DOFPulse
  3751. If Tilted Then Exit Sub
  3752. LaneBonus = LaneBonus + 1
  3753. LaneSounds()
  3754. L16.state = 1
  3755. AddScore 500
  3756. CheckLaneTriggersDown
  3757. End Sub
  3758.  
  3759. Sub RightOutLaneTrigger_Hit()
  3760. DOF 125, DOFPulse
  3761. If Tilted Then Exit Sub
  3762. LaneBonus = LaneBonus + 1
  3763. LaneSounds()
  3764. L17.state = 1
  3765. AddScore 500
  3766. CheckLaneTriggersDown
  3767.  
  3768. If(bBallSaverActive = True) Then
  3769. bBallSaverActive = False
  3770. EnableBallSaver 1
  3771. BallsOnPlayfield = BallsOnPlayfield + 1
  3772. UnaBolaMas
  3773. End If
  3774.  
  3775. End Sub
  3776.  
  3777. Sub CheckLaneTriggersDown()
  3778. If bMultiBallMode Then Exit Sub
  3779. If(l14.State = 1) And(L15.State = 1) And(l16.State = 1) And(L17.State = 1) Then
  3780. LightSeqLanesDown.Play SeqRandom, 5, , 2000
  3781. AddScore 4000
  3782. l14.State = 0
  3783. l15.State = 0
  3784. l16.State = 0
  3785. L17.State = 0
  3786. EnableBallSaver 10
  3787. End If
  3788. End Sub
  3789.  
  3790.  
  3791.  
  3792.  
  3793. '******************
  3794. 'Static Targets
  3795. '******************
  3796.  
  3797. Sub TargetL1_Hit
  3798. If Tilted Then Exit Sub
  3799. AddScore 500
  3800. TargetBonus = TargetBonus + 1
  3801. TargetsSounds()
  3802. If bMultiBallMode Then Exit Sub
  3803. L81.State = 1
  3804. DOF 119, DOFPulse
  3805. TargetsMode()
  3806. LastSwitchHit = "TargetL1"
  3807. End Sub
  3808.  
  3809.  
  3810. Sub TargetL2_Hit
  3811. If Tilted Then Exit Sub
  3812. AddScore 500
  3813. TargetBonus = TargetBonus + 1
  3814. TargetsSounds()
  3815. If bMultiBallMode Then Exit Sub
  3816. L91.State = 1
  3817. DOF 119, DOFPulse
  3818. TargetsMode()
  3819. LastSwitchHit = "TargetL2"
  3820. End Sub
  3821.  
  3822. Sub TargetL3_Hit
  3823. If Tilted Then Exit Sub
  3824. AddScore 500
  3825. TargetBonus = TargetBonus + 1
  3826. TargetsSounds()
  3827. If bMultiBallMode Then Exit Sub
  3828. L101.State = 1
  3829. DOF 119, DOFPulse
  3830. TargetsMode()
  3831. LastSwitchHit = "TargetL3"
  3832. End Sub
  3833.  
  3834. Sub TargetR1_Hit
  3835. If Tilted Then Exit Sub
  3836. AddScore 500
  3837. TargetBonus = TargetBonus + 1
  3838. TargetsSounds()
  3839. If bMultiBallMode Then Exit Sub
  3840. L131.State = 1
  3841. DOF 120, DOFPulse
  3842. TargetsMode()
  3843. LastSwitchHit = "TargetR1"
  3844. End Sub
  3845.  
  3846. Sub TargetR2_Hit
  3847. If Tilted Then Exit Sub
  3848. AddScore 500
  3849. TargetBonus = TargetBonus + 1
  3850. TargetsSounds()
  3851. If bMultiBallMode Then Exit Sub
  3852. L121.State = 1
  3853. DOF 120, DOFPulse
  3854. TargetsMode()
  3855. LastSwitchHit = "TargetR2"
  3856. End Sub
  3857.  
  3858. Sub TargetR3_Hit
  3859. If Tilted Then Exit Sub
  3860. AddScore 500
  3861. TargetBonus = TargetBonus + 1
  3862. TargetsSounds()
  3863. If bMultiBallMode Then Exit Sub
  3864. L111.State = 1
  3865. DOF 120, DOFPulse
  3866. TargetsMode()
  3867. LastSwitchHit = "TargetR3"
  3868. End Sub
  3869.  
  3870.  
  3871. Dim TargetsModeOn
  3872. Dim Saiyan: Saiyan = 0
  3873. Dim SaiyanMultiball
  3874.  
  3875. Sub TargetsMode()
  3876. If TargetsModeOn Then Exit Sub
  3877. If(L81.State = 1) And(L91.State = 1) And(L101.State = 1) And(L111.State = 1) And(L121.State = 1) And(L131.State = 1) Then
  3878. LightSeqTargets.Play SeqRandom, 5, , 2000
  3879. AddScore 6000
  3880. D1.Text = " TRANSFORM "
  3881. DisplayB2SText " TRANSFORM "
  3882. ' Saiyan = Saiyan + 1
  3883. TargetsModeOn = True
  3884. vpmtimer.addtimer 400, "CheckNivel '"
  3885. EnableBallSaver 10
  3886. End If
  3887. End Sub
  3888.  
  3889.  
  3890.  
  3891. Sub CheckNivel
  3892. Saiyan = Saiyan + 1
  3893. If Saiyan >= 5 Then
  3894. Saiyan = 5
  3895. AddScore 5000
  3896. D1.Text = " SAIYAN LEVEL 5 "
  3897. DisplayB2SText " SAIYAN LEVEL 5 "
  3898. Playsound "burning_charge"
  3899. startB2S(29)
  3900. SetLightColor L81, yellow, 110
  3901. SetLightColor L91, yellow, 110
  3902. SetLightColor L101, yellow, 110
  3903. SetLightColor L111, yellow, 110
  3904. SetLightColor L121, yellow, 110
  3905. SetLightColor L131, yellow, 110
  3906.  
  3907. L81.State = 2
  3908. L91.State = 2
  3909. L101.State = 2
  3910. L111.State = 2
  3911. L121.State = 2
  3912. L131.State = 2
  3913. FlashForms f3, 2000, 50, 2
  3914. flashforms f3b, 2000, 50, 2
  3915. FlashForms f4, 2000, 50, 2
  3916. flashforms f4b, 2000, 50, 2
  3917. FlashForms f7, 2000, 50, 2
  3918. DOF 105 ,DOFPulse
  3919. DOF 106 ,DOFPulse
  3920. PlaySong "DBZ_End"
  3921. PlaySong "DBZ_Multiball"
  3922. StartJackpots
  3923. AddMultiball 5
  3924. SaiyanMultiball = True
  3925. bMultiBallMode = True
  3926. D1.Text = " SAIYAN MULTIBALL "
  3927. DisplayB2SText " SAIYAN MULTIBALL "
  3928. 'vpmtimer.addtimer 2500, "TargetsLightOff '"
  3929. TargetsLightOffTimer.Interval = 2500
  3930. TargetsLightOffTimer.Enabled = TRUE
  3931. End If
  3932.  
  3933.  
  3934. If Saiyan = 4 Then
  3935. AddScore 4000
  3936. D1.Text = " SAIYAN LEVEL 4 "
  3937. DisplayB2SText " SAIYAN LEVEL 4 "
  3938. Playsound "burning_charge"
  3939. SetLightColor L81, yellow, 80
  3940. SetLightColor L91, yellow, 80
  3941. SetLightColor L101, yellow, 80
  3942. SetLightColor L111, yellow, 80
  3943. SetLightColor L121, yellow, 80
  3944. SetLightColor L131, yellow, 80
  3945.  
  3946. L81.State = 2
  3947. L91.State = 2
  3948. L101.State = 2
  3949. L111.State = 2
  3950. L121.State = 2
  3951. L131.State = 2
  3952. FlashForms f3, 2000, 50, 2
  3953. flashforms f3b, 2000, 50, 2
  3954. FlashForms f4, 2000, 50, 2
  3955. flashforms f4b, 2000, 50, 2
  3956. FlashForms f7, 2000, 50, 2
  3957. DOF 105 ,DOFPulse
  3958. DOF 106 ,DOFPulse
  3959. 'vpmtimer.addtimer 2500, "TargetsLightOff '"
  3960. TargetsLightOffTimer.Interval = 2500
  3961. TargetsLightOffTimer.Enabled = TRUE
  3962. End If
  3963.  
  3964.  
  3965. If Saiyan = 3 Then
  3966. AddScore 3000
  3967. D1.Text = " SAIYAN LEVEL 3 "
  3968. DisplayB2SText " SAIYAN LEVEL 3 "
  3969. Playsound "burning_charge"
  3970. startB2S(29)
  3971. SetLightColor L81, yellow, 50
  3972. SetLightColor L91, yellow, 50
  3973. SetLightColor L101, yellow, 50
  3974. SetLightColor L111, yellow, 50
  3975. SetLightColor L121, yellow, 50
  3976. SetLightColor L131, yellow, 50
  3977.  
  3978. L81.State = 2
  3979. L91.State = 2
  3980. L101.State = 2
  3981. L111.State = 2
  3982. L121.State = 2
  3983. L131.State = 2
  3984. FlashForms f3, 2000, 50, 2
  3985. flashforms f3b, 2000, 50, 2
  3986. FlashForms f4, 2000, 50, 2
  3987. flashforms f4b, 2000, 50, 2
  3988. FlashForms f7, 2000, 50, 2
  3989. DOF 105 ,DOFPulse
  3990. DOF 106 ,DOFPulse
  3991. 'vpmtimer.addtimer 2500, "TargetsLightOff '"
  3992. TargetsLightOffTimer.Interval = 2500
  3993. TargetsLightOffTimer.Enabled = TRUE
  3994. End If
  3995.  
  3996.  
  3997. If Saiyan = 2 Then
  3998. AddScore 2000
  3999. D1.Text = " SAIYAN LEVEL 2 "
  4000. DisplayB2SText " SAIYAN LEVEL 2 "
  4001. Playsound "burning_charge"
  4002. SetLightColor L81, yellow, 30
  4003. SetLightColor L91, yellow, 30
  4004. SetLightColor L101, yellow, 30
  4005. SetLightColor L111, yellow, 30
  4006. SetLightColor L121, yellow, 30
  4007. SetLightColor L131, yellow, 30
  4008.  
  4009. L81.State = 2
  4010. L91.State = 2
  4011. L101.State = 2
  4012. L111.State = 2
  4013. L121.State = 2
  4014. L131.State = 2
  4015. FlashForms f3, 2000, 50, 2
  4016. flashforms f3b, 2000, 50, 2
  4017. FlashForms f4, 2000, 50, 2
  4018. flashforms f4b, 2000, 50, 2
  4019. FlashForms f7, 2000, 50, 2
  4020. DOF 105 ,DOFPulse
  4021. DOF 106 ,DOFPulse
  4022. 'vpmtimer.addtimer 2500, "TargetsLightOff '"
  4023. TargetsLightOffTimer.Interval = 2500
  4024. TargetsLightOffTimer.Enabled = TRUE
  4025. End If
  4026.  
  4027.  
  4028. If Saiyan <= 1 Then
  4029. AddScore 1000
  4030. D1.Text = " SAIYAN LEVEL 1 "
  4031. DisplayB2SText " SAIYAN LEVEL 1 "
  4032. Playsound "burning_charge"
  4033. SetLightColor L81, yellow, 1
  4034. SetLightColor L91, yellow, 1
  4035. SetLightColor L101, yellow, 1
  4036. SetLightColor L111, yellow, 1
  4037. SetLightColor L121, yellow, 1
  4038. SetLightColor L131, yellow, 1
  4039.  
  4040. L81.State = 2
  4041. L91.State = 2
  4042. L101.State = 2
  4043. L111.State = 2
  4044. L121.State = 2
  4045. L131.State = 2
  4046. FlashForms f3, 2000, 50, 2
  4047. flashforms f3b, 2000, 50, 2
  4048. FlashForms f4, 2000, 50, 2
  4049. flashforms f4b, 2000, 50, 2
  4050. FlashForms f7, 2000, 50, 2
  4051. DOF 105 ,DOFPulse
  4052. DOF 106 ,DOFPulse
  4053. 'vpmtimer.addtimer 2500, "TargetsLightOff '"
  4054. TargetsLightOffTimer.Interval = 2500
  4055. TargetsLightOffTimer.Enabled = TRUE
  4056. End If
  4057. End Sub
  4058.  
  4059. Sub TargetsLightOffTimer_Timer()
  4060. TargetsLightOffTimer.Enabled = False
  4061. TargetsLightOff
  4062. End Sub
  4063.  
  4064. Sub TargetsLightOff
  4065. LightSeqTargets.StopPlay
  4066. L81.State = 0
  4067. L91.State = 0
  4068. L101.State = 0
  4069. L111.State = 0
  4070. L121.State = 0
  4071. L131.State = 0
  4072. TargetsModeOn = False
  4073. FlashForms f3, 50, 50, 2
  4074. flashforms f3b, 50, 50, 2
  4075. FlashForms f4, 50, 50, 2
  4076. flashforms f4b, 50, 50, 2
  4077. FlashForms f7, 50, 50, 2
  4078. DOF 105 ,DOFPulse
  4079. DOF 106 ,DOFPulse
  4080. Playsound "DBZ_aura"
  4081. vpmtimer.addtimer 1000, "Aura '"
  4082. End Sub
  4083.  
  4084. Sub Aura
  4085. FlashForms f3, 4500, 50, 2
  4086. flashforms f3b, 4500, 50, 2
  4087. FlashForms f4, 4500, 50, 2
  4088. flashforms f4b, 4500, 50, 2
  4089. FlashForms f7, 4500, 50, 2
  4090. DOF 105 ,DOFPulse
  4091. DOF 106 ,DOFPulse
  4092. AuraTimer.interval = 4600
  4093. AuraTimer.enabled = 1
  4094. End Sub
  4095.  
  4096.  
  4097. Sub AuraTimer_Timer
  4098. f3.State = 0
  4099. f3.State = 0
  4100. f4.State = 0
  4101. f4.State = 0
  4102. f7.State = 0
  4103. AuraTimer.enabled = 0
  4104. End Sub
  4105.  
  4106.  
  4107. Sub ResetSaiyanMultiball
  4108. D1.Text = " END SAIYAN MULTIBALL "
  4109. DisplayB2SText " END SAIYAN MULTIBALL "
  4110. SaiyanMultiball = False
  4111. Saiyan = 0
  4112. End Sub
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120. Sub UnaBolaMas()
  4121. BallsOnPlayfield = BallsOnPlayfield -1
  4122. CreateNewBall()
  4123. bAutoPlunger = True
  4124. bBallInPlungerLane = True
  4125. End Sub
  4126.  
  4127.  
  4128.  
  4129.  
  4130. Dim ComboReady
  4131. sub ComboblinkLight(dummy)
  4132. ComboReady = True
  4133. Combo1.BlinkInterval = 180
  4134. Combo2.BlinkInterval = 180
  4135. Combo2b.BlinkInterval = 180
  4136. Combo3.BlinkInterval = 180
  4137. Combo3b.BlinkInterval = 180
  4138. Combo4.BlinkInterval = 180
  4139. Combo1.state=2
  4140. Combo2.state=2
  4141. Combo2b.state=2
  4142. Combo3.state=2
  4143. Combo3b.state=2
  4144. Combo4.state=2
  4145. ComboblinkLightTimer.Enabled = True
  4146. end sub
  4147.  
  4148. sub ComboblinkLightTimer_timer()
  4149. Combo1.state=0
  4150. Combo2.state=0
  4151. Combo2b.state=0
  4152. Combo3.state=0
  4153. Combo3b.state=0
  4154. Combo4.state=0
  4155. ComboReady = False
  4156. LastSwitchHit = "Sw28"
  4157. me.enabled=0
  4158. end sub
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173. Sub LaneSounds()
  4174. If PlayersPlayingGame Then
  4175. Dim tmp
  4176. tmp = INT(RND * 3)
  4177. Select Case tmp
  4178. Case 0:PlaySound "Lane_1"
  4179. Case 1:PlaySound "Lane_2"
  4180. Case 2:PlaySound "Lane_3"
  4181. End Select
  4182. End If
  4183. End Sub
  4184.  
  4185.  
  4186. Sub TargetsSounds()
  4187. Dim tmp
  4188. tmp = INT(RND * 8)
  4189. Select Case tmp
  4190. Case 0:PlaySound "Gok_0"
  4191. Case 1:PlaySound "Gok_1"
  4192. Case 2:PlaySound "Gok_2"
  4193. Case 3:PlaySound "Gok_3"
  4194. Case 4:PlaySound "Gok_4"
  4195. Case 5:PlaySound "Gok_5"
  4196. Case 6:PlaySound "Gok_6"
  4197. Case 7:PlaySound "Gok_7"
  4198. End Select
  4199. End Sub
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215. Dim AttractMessagesTimerUserData
  4216. Sub AttractMessagesTimer_Timer()
  4217. DMDUpdate.enabled = 0
  4218. DisplayB2SText " "
  4219. AttractMessagesTimerUserData = AttractMessagesTimerUserData + 1
  4220. Select Case AttractMessagesTimerUserData
  4221. Case 0:
  4222. D1.Text = " DRAGON BALL Z "
  4223. DisplayB2SText " DRAGON BALL Z "
  4224. Case 1:
  4225. D1.Text = " GAME OVER "
  4226. DisplayB2SText " GAME OVER "
  4227. Case 2:
  4228. D1.Text = " JAVIER PRESENTS "
  4229. DisplayB2SText " JAVIER PRESENTS "
  4230. Case 3:
  4231. D1.Text = "DRAGON BALL Z"
  4232. DisplayB2SText " DRAGON BALL Z "
  4233. Case 4:
  4234. D1.Text = " BY JAVIER "
  4235. DisplayB2SText " BY JAVIER "
  4236. Case 5:
  4237. D1.Text = " BASED ON THE CARTOON "
  4238. DisplayB2SText " BASED ON THE CARTOON "
  4239. Case 6:
  4240. D1.Text = " BANDAI "
  4241. DisplayB2SText " BANDAI "
  4242. Case 7:
  4243. D1.Text = " SPECIAL THANKS TO "
  4244. DisplayB2SText " SPECIAL THANKS TO "
  4245. Case 8:
  4246. D1.Text = " DEV TEAM "
  4247. DisplayB2SText " DEV TEAM / JP SALAS "
  4248. Case 9:
  4249. D1.Text = " AND THE WHOLE COMMUNITY OF VP "
  4250. DisplayB2SText " AND THE WHOLE COMMUNITY OF VP "
  4251. Case 10:
  4252. D1.Text = " * GAME RULES * "
  4253. DisplayB2SText " * GAME RULES * "
  4254. Case 11:
  4255. D1.Text = " HIT BUMPERS "
  4256. DisplayB2SText " HIT BUMPERS "
  4257. Case 12:
  4258. D1.Text = " FOR EXTRABALL "
  4259. DisplayB2SText " FOR EXTRABALL "
  4260. Case 13:
  4261. D1.Text = " COLLECT LIGHT LOCKS "
  4262. DisplayB2SText " COLLECT LIGHT LOCKS "
  4263. Case 14:
  4264. D1.Text = " FOR MULTIBALL "
  4265. DisplayB2SText " FOR MULTIBALL "
  4266. Case 15:
  4267. D1.Text = " COMPLETE DRAGON BALLS "
  4268. DisplayB2SText " COMPLETE DRAGON BALLS "
  4269. Case 16:
  4270. D1.Text = " FOR SHENLONG MULTIBALL "
  4271. DisplayB2SText " FOR SHENLONG MULTIBALL "
  4272. Case 17:
  4273. D1.Text = " LEVEL UP SAIYAN "
  4274. DisplayB2SText " LEVEL UP SAIYAN "
  4275. Case 18:
  4276. D1.Text = " FOR SAIYAN MULTIBALL "
  4277. DisplayB2SText " FOR SAIYAN MULTIBALL "
  4278. Case 19:
  4279. D1.Text = " ** GOOD LUCK ON YOUR GAME ** "
  4280. DisplayB2SText " ** GOOD LUCK ON YOUR GAME ** "
  4281. Case 20:
  4282. If Score(1) Then
  4283. D1.Text = "PLAYER 1"& Score(1)
  4284. DisplayB2SText "PLAYER 1"& Score(1)
  4285. End If
  4286. If Score(2) Then
  4287. D1.Text = "PLAYER 2"& Score(2)
  4288. DisplayB2SText "PLAYER 1"& Score(2)
  4289. End If
  4290. If Score(3) Then
  4291. D1.Text = "PLAYER 3"& Score(3)
  4292. DisplayB2SText "PLAYER 1"& Score(3)
  4293. End If
  4294. If Score(4) Then
  4295. D1.Text = "PLAYER 4"& Score(4)
  4296. DisplayB2SText "PLAYER 1"& Score(4)
  4297. End If
  4298.  
  4299. 'coins or freeplay
  4300. If bFreePlay Then
  4301. D1.Text = "FREE PLAY"
  4302. DisplayB2SText " FREE PLAY "
  4303. Else
  4304. If Credits> 0 Then
  4305. DisplayB2SText " CREDITS " &credits& " PRESS START"
  4306. D1.Text = "CREDITS " &credits& " PRESS START"
  4307. Else
  4308. DisplayB2SText " CREDITS " &credits& " INSERT COIN"
  4309. D1.Text = "CREDITS " &credits& " INSERT COIN"
  4310. End If
  4311. End If
  4312. Case 21:
  4313. If (Score(1) = 0) And (Credits = 0) Then
  4314. D1.Text = " PLEASE INSERT COIN "
  4315. DisplayB2SText " PLEASE INSERT COIN "
  4316. ElseIf (Score(1) = 0) And (Credits > 0) Then
  4317. D1.Text = " PUSH START BUTTON TO PLAY "
  4318. DisplayB2SText " PUSH START BUTTON TO PLAY "
  4319. Else
  4320. DisplayB2SText " LAST SCORE WAS -> " & " " & Score(1)', 0, , , -1
  4321. D1.Text = " LAST SCORE WAS " & FormatScore(Score(1)) & String(8 - Int((Len(Score(1)) - 1) / 2), " ")
  4322.  
  4323. End If
  4324.  
  4325. Case 22:
  4326. DisplayB2SText " HIGHSCORES "& "1> " & HighScoreName(0) & " :" & HighScore(0)', 0, , , -1
  4327. D1.Text = " HIGHSCORES"& " 1> " & HighScoreName(0) & " " & FormatNumber(HighScore(0), 0, , , -1)
  4328. Case 23:
  4329. DisplayB2SText " HIGHSCORES "& "2> " & HighScoreName(1) & " :" & HighScore(1)', 0, , , -1
  4330. D1.Text = " HIGHSCORES"& " 2> " & HighScoreName(1) & " " & FormatNumber(HighScore(1), 0, , , -1)
  4331. Case 24:
  4332. DisplayB2SText " HIGHSCORES "& "3> " & HighScoreName(2) & " :" & HighScore(2)', 0, , , -1
  4333. D1.Text = " HIGHSCORES"& " 3> " & HighScoreName(2) & " " & FormatNumber(HighScore(2), 0, , , -1)
  4334. Case 25:
  4335. DisplayB2SText " HIGHSCORES "& "4> " & HighScoreName(3) & " :" & HighScore(3)', 0, , , -1
  4336. D1.Text = " HIGHSCORES"& " 4> " & HighScoreName(3) & " " & FormatNumber(HighScore(3), 0, , , -1)
  4337. AttractMessagesTimerUserData = 0
  4338. End Select
  4339. End Sub
  4340.  
  4341.  
  4342.  
  4343. '*****************
  4344. 'Mensajes varios
  4345. '*****************
  4346.  
  4347.  
  4348.  
  4349. 'multi 3 balls
  4350. Dim MultiballMSN
  4351. Sub MultiballMSNTimer_Timer
  4352. MultiballMSN = MultiballMSN + 1
  4353. Select Case MultiballMSN
  4354. Case 1:
  4355. DisplayB2SText " MULTIBALL "
  4356. D1.text = " MULTIBALL "
  4357. Case 2:
  4358. DisplayB2SText " "
  4359. D1.text = " "
  4360. Case 3:
  4361. DisplayB2SText " MULTIBALL "
  4362. D1.text = " MULTIBALL "
  4363. Case 4:
  4364. DisplayB2SText " "
  4365. D1.text = " "
  4366. Case 5:
  4367. DisplayB2SText " MULTIBALL "
  4368. D1.text = " MULTIBALL "
  4369. Case 6:
  4370. DisplayB2SText " "
  4371. D1.text = " "
  4372. Case 7:
  4373. DisplayB2SText " MULTIBALL "
  4374. D1.text = " MULTIBALL "
  4375. Case 8:
  4376. DisplayB2SText " "
  4377. D1.text = " "
  4378. Case 9:
  4379. DisplayB2SText " MULTIBALL "
  4380. D1.text = " MULTIBALL "
  4381. Case 10:
  4382. DisplayB2SText " "
  4383. D1.text = " "
  4384. Case 11:
  4385. DisplayB2SText " MULTIBALL "
  4386. D1.text = " MULTIBALL "
  4387. Case 12:
  4388. DisplayB2SText " "
  4389. D1.text = " "
  4390. Case 13:
  4391. DisplayB2SText " MULTIBALL "
  4392. D1.text = " MULTIBALL "
  4393. Case 14:
  4394. DisplayB2SText " "
  4395. D1.text = " "
  4396. Case 15:
  4397. DisplayB2SText " MULTIBALL "
  4398. D1.text = " MULTIBALL "
  4399. Case 16:
  4400. DisplayB2SText " "
  4401. D1.text = " "
  4402. Case 17:
  4403. DisplayB2SText " MULTIBALL "
  4404. D1.text = " MULTIBALL "
  4405. Case 18:
  4406. DisplayB2SText " "
  4407. D1.text = " "
  4408. MultiballMSN = 0
  4409. MultiballMSNTimer.enabled = 0
  4410. End Select
  4411. DisplayB2SText " "
  4412. End Sub
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419. Dim SHENLONGMSN
  4420. Sub SHENLONGMSNTimer_Timer
  4421. SHENLONGMSN = SHENLONGMSN + 1
  4422. Select Case SHENLONGMSN
  4423. Case 1:
  4424. DisplayB2SText " SHENLONG MULTIBALL "
  4425. D1.text = " SHENLONG MULTIBALL "
  4426. Case 2:
  4427. DisplayB2SText " "
  4428. D1.text = " "
  4429. Case 3:
  4430. DisplayB2SText " SHENLONG MULTIBALL "
  4431. D1.text = " SHENLONG MULTIBALL "
  4432. Case 4:
  4433. DisplayB2SText " "
  4434. D1.text = " "
  4435. Case 5:
  4436. DisplayB2SText " SHENLONG MULTIBALL "
  4437. D1.text = " SHENLONG MULTIBALL "
  4438. Case 6:
  4439. DisplayB2SText " "
  4440. D1.text = " "
  4441. Case 7:
  4442. DisplayB2SText " SHENLONG MULTIBALL "
  4443. D1.text = " SHENLONG MULTIBALL "
  4444. Case 8:
  4445. DisplayB2SText " "
  4446. D1.text = " "
  4447. Case 9:
  4448. DisplayB2SText " SHENLONG MULTIBALL "
  4449. D1.text = " SHENLONG MULTIBALL "
  4450. Case 10:
  4451. DisplayB2SText " "
  4452. D1.text = " "
  4453. Case 11:
  4454. DisplayB2SText " SHENLONG MULTIBALL "
  4455. D1.text = " SHENLONG MULTIBALL "
  4456. Case 12:
  4457. DisplayB2SText " "
  4458. D1.text = " "
  4459. Case 13:
  4460. DisplayB2SText " SHENLONG MULTIBALL "
  4461. D1.text = " SHENLONG MULTIBALL "
  4462. Case 14:
  4463. DisplayB2SText " "
  4464. D1.text = " "
  4465. Case 15:
  4466. DisplayB2SText " SHENLONG MULTIBALL "
  4467. D1.text = " MULTIBALL "
  4468. Case 16:
  4469. DisplayB2SText " "
  4470. D1.text = " "
  4471. Case 17:
  4472. DisplayB2SText " SHENLONG MULTIBALL "
  4473. D1.text = " SHENLONG MULTIBALL "
  4474. Case 18:
  4475. DisplayB2SText " "
  4476. D1.text = " "
  4477. SHENLONGMSN = 0
  4478. SHENLONGMSNTimer.enabled = 0
  4479. End Select
  4480. DisplayB2SText " "
  4481. End Sub
  4482.  
  4483.  
  4484.  
  4485.  
  4486. 'Combo
  4487. Dim ComboMSN
  4488. Sub ComboMSNTimer_Timer
  4489. ComboMSN = ComboMSN + 1
  4490. Select Case ComboMSN
  4491. Case 1:
  4492. DisplayB2SText " COMBO "
  4493. D1.text = " COMBO "
  4494. Case 2:
  4495. DisplayB2SText " "
  4496. D1.text = " "
  4497. Case 3:
  4498. DisplayB2SText " COMBO "
  4499. D1.text = " COMBO "
  4500. Case 4:
  4501. DisplayB2SText " "
  4502. D1.text = " "
  4503. Case 5:
  4504. DisplayB2SText " COMBO "
  4505. D1.text = " COMBO "
  4506. Case 6:
  4507. DisplayB2SText " "
  4508. D1.text = " "
  4509. Case 7:
  4510. DisplayB2SText " COMBO "
  4511. D1.text = " COMBO "
  4512. Case 8:
  4513. DisplayB2SText " "
  4514. D1.text = " "
  4515.  
  4516. End Select
  4517. ComboMSN = 0
  4518. ComboMSNTimer.enabled = 0
  4519. DisplayB2SText " "
  4520. End Sub
  4521.  
  4522.  
  4523. 'Jackpot
  4524. Dim JackpotMSN
  4525. Sub JackpotMSNTimer_Timer
  4526. JackpotMSN = JackpotMSN + 1
  4527. Select Case JackpotMSN
  4528. Case 1:
  4529. DisplayB2SText " JACKPOT " & Jackpot(CurrentPlayer)
  4530. D1.text = " JACKPOT " & Jackpot(CurrentPlayer)
  4531. Case 2:
  4532. DisplayB2SText " "
  4533. D1.text = " "
  4534. Case 3:
  4535. DisplayB2SText " JACKPOT " & Jackpot(CurrentPlayer)
  4536. D1.text = " JACKPOT " & Jackpot(CurrentPlayer)
  4537. Case 4:
  4538. DisplayB2SText " "
  4539. D1.text = " "
  4540. Case 5:
  4541. DisplayB2SText " JACKPOT " & Jackpot(CurrentPlayer)
  4542. D1.text = " JACKPOT " & Jackpot(CurrentPlayer)
  4543. Case 6:
  4544. DisplayB2SText " "
  4545. D1.text = " "
  4546. Case 7:
  4547. DisplayB2SText " JACKPOT " & Jackpot(CurrentPlayer)
  4548. D1.text = " JACKPOT " & Jackpot(CurrentPlayer)
  4549. Case 8:
  4550. DisplayB2SText " "
  4551. D1.text = " "
  4552. Case 9:
  4553. DisplayB2SText " JACKPOT " & Jackpot(CurrentPlayer)
  4554. D1.text = " JACKPOT " & Jackpot(CurrentPlayer)
  4555. Case 10:
  4556. DisplayB2SText " "
  4557. D1.text = " "
  4558. Case 11:
  4559. DisplayB2SText " JACKPOT " & Jackpot(CurrentPlayer)
  4560. D1.text = " JACKPOT " & Jackpot(CurrentPlayer)
  4561. Case 12:
  4562. DisplayB2SText " "
  4563. D1.text = " "
  4564.  
  4565. End Select
  4566. JackpotMSN = 0
  4567. JackpotMSNTimer.enabled = 0
  4568. DisplayB2SText " "
  4569. End Sub
  4570.  
  4571.  
  4572.  
  4573.  
  4574. Dim letsGoMSN
  4575. Sub letsGo_Timer
  4576. letsGoMSN = letsGoMSN + 1
  4577. Select Case letsGoMSN
  4578. Case 0: DisplayB2SText " LETS GO "
  4579. D1.text = " LETS GO "
  4580. Case 1: DisplayB2SText " "
  4581. D1.text = " "
  4582. Case 2: DisplayB2SText " LETS GO "
  4583. D1.text = " LETS GO "
  4584. Case 3: DisplayB2SText " "
  4585. D1.text = " "
  4586. Case 4: DisplayB2SText " LETS GO "
  4587. D1.text = " LETS GO "
  4588. Case 5: DisplayB2SText " "
  4589. D1.text = " "
  4590. Case 6: DisplayB2SText " LETS GO "
  4591. D1.text = " LETS GO "
  4592. Case 7: DisplayB2SText " "
  4593. D1.text = " "
  4594. Case 8: DisplayB2SText " LETS GO "
  4595. D1.text = " LETS GO "
  4596. Case 9: DisplayB2SText " "
  4597. D1.text = " "
  4598. End Select
  4599. letsGo.enabled = 0
  4600. End Sub
Advertisement
Add Comment
Please, Sign In to add comment