Outhere

Blade Runner 2049 2.0 SSF_FlexDMD

Jun 4th, 2021 (edited)
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 126.28 KB | None | 0 0
  1. ' ****************************************************************
  2. ' VISUAL PINBALL X
  3. ' Marcade MODs Presents Blade Runner 2049 Pinball
  4. ' Built from JPSalas Pokémon Pinball DT v2.0.2
  5. ' Many Thanks to JPSalas for the great Table!
  6. ' ****************************************************************
  7. ' 6/4/2021 SSF adjustment BY Alberto Medini
  8. ' 6/4/2021 Flexdmd added by OUTHERE - It's not perfect but it's pretty good
  9.  
  10. Option Explicit
  11. Randomize
  12.  
  13. Const BallSize = 50 ' 50 is the normal size
  14. Const BallMass = 1.7 ' 1 is normal ball
  15. Const SongVolume = 0.1 ' 1 is full volume. Value is from 0 to 1
  16.  
  17. ' Load the core.vbs for supporting Subs and functions
  18.  
  19. LoadCoreFiles
  20.  
  21. Sub LoadCoreFiles
  22. On Error Resume Next
  23. ExecuteGlobal GetTextFile("core.vbs")
  24. If Err Then MsgBox "Can't open core.vbs"
  25. ExecuteGlobal GetTextFile("controller.vbs")
  26. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  27. On Error Goto 0
  28. End Sub
  29.  
  30. ' Define any Constants
  31. Const cGameName = "Pokemon_Pinball" 'Const cGameName = "BladeRunner2049"
  32. Const myVersion = "2.0.2"
  33. Const MaxPlayers = 4
  34. Const BallSaverTime = 15 ' value in seconds
  35. Const MaxMultiplier = 99 ' almost no limit in this game
  36. Const BallsPerGame = 3 ' 3 or 5
  37. Const MaxMultiballs = 6 ' max number of balls during multiballs
  38.  
  39. ' Define Global Variables
  40. Dim PlayersPlayingGame
  41. Dim CurrentPlayer
  42. Dim Credits
  43. Dim Bonus
  44. Dim BonusPoints(4)
  45. Dim BonusMultiplier(4)
  46. Dim BallsRemaining(4)
  47. Dim ExtraBallsAwards(4)
  48. Dim Score(4)
  49. Dim HighScore(4)
  50. Dim HighScoreName(4)
  51. Dim Jackpot
  52. Dim Tilt
  53. Dim TiltSensitivity
  54. Dim Tilted
  55. Dim TotalGamesPlayed
  56. Dim mBalls2Eject
  57. Dim SkillshotValue
  58. Dim bAutoPlunger
  59. Dim ActiveDOFCol
  60.  
  61. ' Define Game Control Variables
  62. Dim LastSwitchHit
  63. Dim BallsOnPlayfield
  64. Dim BallsInLock
  65. Dim BallsInHole
  66.  
  67. ' Define Game Flags
  68. Dim bFreePlay
  69. Dim bGameInPlay
  70. Dim bOnTheFirstBall
  71. Dim bBallInPlungerLane
  72. Dim bBallSaverActive
  73. Dim bBallSaverReady
  74. Dim bMultiBallMode
  75. Dim bMusicOn
  76. Dim bSkillshotReady
  77. Dim bExtraBallWonThisBall
  78. Dim bJustStarted
  79.  
  80. Dim plungerIM 'used mostly as an autofire plunger
  81. Dim ttable
  82. Dim EggMagnet
  83.  
  84. ' *********************************************************************
  85. ' Visual Pinball Defined Script Events
  86. ' *********************************************************************
  87.  
  88. Sub Table1_Init()
  89. LoadEM
  90. Dim i
  91. Randomize
  92.  
  93. 'Impulse Plunger as autoplunger
  94. Const IMPowerSetting = 46 ' Plunger Power
  95. Const IMTime = 0.25 ' Time in seconds for Full Plunge
  96. Set plungerIM = New cvpmImpulseP
  97. With plungerIM
  98. .InitImpulseP swplunger, IMPowerSetting, IMTime
  99. .Random 1.5
  100. .InitExitSnd SoundFXDOF("fx_kicker", 141, DOFPulse, DOFContactors), SoundFXDOF("fx_solenoid", 141, DOFPulse, DOFContactors)
  101. .CreateEvents "plungerIM"
  102. End With
  103.  
  104. 'Venusaur turntable
  105. Set ttable = New cvpmTurnTable
  106. With ttable
  107. .InitTurnTable Magnet1, 90
  108. .spinCW = False
  109. .MotorOn = True
  110. .CreateEvents "ttable"
  111. End With
  112.  
  113. 'Egg Magnet, it activates when the 4 eggs are lit
  114. Set EggMagnet = New cvpmMagnet
  115. With EggMagnet
  116. .InitMagnet Magnet2, 90
  117. .GrabCenter = 1
  118. .CreateEvents "EggMagnet"
  119. End With
  120.  
  121. ' Misc. VP table objects Initialisation, droptargets, animations...
  122. VPObjects_Init
  123.  
  124. 'load saved values, highscore, names, jackpot
  125. Loadhs
  126.  
  127. 'Init main variables
  128. For i = 1 To MaxPlayers
  129. Score(i) = 0
  130. BonusPoints(i) = 0
  131. BonusMultiplier(i) = 1
  132. BallsRemaining(i) = BallsPerGame
  133. ExtraBallsAwards(i) = 0
  134. Next
  135.  
  136. ' initalise the DMD display
  137. DMD_Init
  138.  
  139. ' freeplay or coins
  140. bFreePlay = False 'Set it to True if you don't want coins
  141.  
  142. ' initialse any other flags
  143. bOnTheFirstBall = False
  144. bBallInPlungerLane = False
  145. bBallSaverActive = False
  146. bBallSaverReady = False
  147. bMultiBallMode = False
  148. bGameInPlay = False
  149. bAutoPlunger = False
  150. bMusicOn = True
  151. BallsOnPlayfield = 0
  152. BallsInLock = 0
  153. BallsInHole = 0
  154. LastSwitchHit = ""
  155. Tilt = 0
  156. TiltSensitivity = 6
  157. Tilted = False
  158. bJustStarted = True
  159. EndOfGame()
  160. End Sub
  161.  
  162.  
  163. '******
  164. ' Keys
  165. '******
  166.  
  167. Sub Table1_KeyDown(ByVal Keycode)
  168. If Keycode = AddCreditKey Then
  169. Credits = Credits + 1
  170. DOF 125, DOFOn
  171. If(Tilted = False) Then
  172. DMDFlush
  173. DMD "_", CL(1, "CREDITS: " & Credits), "", eNone, eNone, eNone, 500, True, "fx_coin"
  174. If NOT bGameInPlay Then ShowTableInfo
  175. End If
  176. End If
  177.  
  178. If keycode = PlungerKey Then
  179. PlungerIM.AutoFire:AnimateRattata
  180. FlashForMs Flasher8, 1000, 50, 0
  181. End If
  182.  
  183.  
  184. If bGameInPlay AND NOT Tilted Then
  185.  
  186. If keycode = LeftTiltKey Then Nudge 90, 6:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25:CheckTilt
  187. If keycode = RightTiltKey Then Nudge 270, 6:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25:CheckTilt
  188. If keycode = CenterTiltKey Then Nudge 0, 7:PlaySound SoundFX("fx_nudge", 0), 0, 1, 1, 0.25:CheckTilt
  189.  
  190. If keycode = LeftFlipperKey Then SolLFlipper 1
  191. If keycode = RightFlipperKey Then SolRFlipper 1
  192.  
  193. If keycode = StartGameKey Then
  194. If((PlayersPlayingGame <MaxPlayers) AND(bOnTheFirstBall = True) ) Then
  195.  
  196. If(bFreePlay = True) Then
  197. PlayersPlayingGame = PlayersPlayingGame + 1
  198. TotalGamesPlayed = TotalGamesPlayed + 1
  199. PlaySound "po_fanfare1"
  200. DMD "_", CL(1, PlayersPlayingGame & " PLAYERS"), "", eNone, eBlink, eNone, 500, True, ""
  201. Else
  202. If(Credits> 0) then
  203. PlayersPlayingGame = PlayersPlayingGame + 1
  204. TotalGamesPlayed = TotalGamesPlayed + 1
  205. Credits = Credits - 1
  206. PlaySound "po_fanfare1"
  207. DMD "_", CL(1, PlayersPlayingGame & " PLAYERS"), "", eNone, eBlink, eNone, 500, True, ""
  208.  
  209. If Credits <1 Then DOF 125, DOFOff
  210. Else
  211. ' Not Enough Credits to start a game.
  212. DMDFlush
  213. DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 500, True, ""
  214. End If
  215. End If
  216. End If
  217. End If
  218. Else ' If (GameInPlay)
  219.  
  220. If keycode = StartGameKey Then
  221. If(bFreePlay = True) Then
  222. If(BallsOnPlayfield = 0) Then
  223. ResetForNewGame()
  224. End If
  225. Else
  226. If(Credits> 0) Then
  227. If(BallsOnPlayfield = 0) Then
  228. Credits = Credits - 1
  229. If Credits <1 Then DOF 125, DOFOff
  230. ResetForNewGame()
  231. End If
  232. Else
  233. ' Not Enough Credits to start a game.
  234. DMDFlush
  235. DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 500, True, ""
  236. ShowTableInfo
  237. End If
  238. End If
  239. End If
  240. End If ' If (GameInPlay)
  241.  
  242. If hsbModeActive Then EnterHighScoreKey(keycode)
  243.  
  244. ' Table specific
  245. End Sub
  246.  
  247. Sub Table1_KeyUp(ByVal keycode)
  248.  
  249. If bGameInPLay AND NOT Tilted Then
  250. If keycode = LeftFlipperKey Then SolLFlipper 0
  251. If keycode = RightFlipperKey Then SolRFlipper 0
  252. End If
  253. End Sub
  254.  
  255. '*************
  256. ' Pause Table
  257. '*************
  258.  
  259. Sub table1_Paused
  260. End Sub
  261.  
  262. Sub table1_unPaused
  263. End Sub
  264.  
  265. Sub table1_Exit
  266. If Not FlexDMD is Nothing Then FlexDMD.Run = False
  267. If B2SOn Then Controller.Stop
  268. Savehs
  269. End Sub
  270.  
  271. '********************
  272. ' Flippers
  273. '********************
  274.  
  275. Sub SolLFlipper(Enabled)
  276. If Enabled Then
  277. PlaySoundAt SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), LeftFlipper
  278. LeftFlipper.EOSTorque = 0.75: LeftFlipper.RotateToEnd
  279. RotateLaneLightsLeft
  280. Else
  281. PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
  282. LeftFlipper.EOSTorque = 0.1: LeftFlipper.RotateToStart
  283. End If
  284. End Sub
  285.  
  286. Sub SolRFlipper(Enabled)
  287. If Enabled Then
  288. PlaySoundAt SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), RightFlipper
  289. RightFlipper.EOSTorque = 0.75: RightFlipper.RotateToEnd
  290. RotateLaneLightsRight
  291. Else
  292. PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
  293. RightFlipper.EOSTorque = 0.1: RightFlipper.RotateToStart
  294. End If
  295. End Sub
  296.  
  297. ' flippers hit Sound
  298.  
  299. Sub LeftFlipper_Collide(parm)
  300. PlaySound "fx_rubber_flipper", 0, parm / 10, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  301. End Sub
  302.  
  303. Sub RightFlipper_Collide(parm)
  304. PlaySound "fx_rubber_flipper", 0, parm / 10, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  305. End Sub
  306.  
  307. Sub RotateLaneLightsLeft
  308. Dim TempState
  309. TempState = LeftOutlane.State
  310. LeftOutlane.State = LeftInlane1.State
  311. LeftInlane1.State = LeftInlane2.State
  312. LeftInlane2.State = RightInlane.State
  313. RightInlane.State = RightOutlane.State
  314. RightOutlane.State = TempState
  315. End Sub
  316.  
  317. Sub RotateLaneLightsRight
  318. Dim TempState
  319. TempState = RightOutlane.State
  320. RightOutlane.State = RightInlane.State
  321. RightInlane.State = LeftInlane2.State
  322. LeftInlane2.State = LeftInlane1.State
  323. LeftInlane1.State = LeftOutlane.State
  324. LeftOutlane.State = TempState
  325. End Sub
  326.  
  327. '*********
  328. ' TILT
  329. '*********
  330.  
  331. 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
  332.  
  333. Sub CheckTilt 'Called when table is nudged
  334. Tilt = Tilt + TiltSensitivity 'Add to tilt count
  335. TiltDecreaseTimer.Enabled = True
  336. If(Tilt> TiltSensitivity) AND(Tilt <15) Then 'show a warning
  337. DMD "_", CL(1, "CAREFUL!"), "", eNone, eBlinkFast, eNone, 500, True, ""
  338. End if
  339. If Tilt> 15 Then 'If more that 15 then TILT the table
  340. Tilted = True
  341. 'display Tilt
  342. DMDFlush
  343. DMD "", "", "tilt", eNone, eNone, eBlink, 200, False, ""
  344. DisableTable True
  345. TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
  346. End If
  347. End Sub
  348.  
  349. Sub TiltDecreaseTimer_Timer
  350. ' DecreaseTilt
  351. If Tilt> 0 Then
  352. Tilt = Tilt - 0.1
  353. Else
  354. Me.Enabled = False
  355. End If
  356. End Sub
  357.  
  358. Sub DisableTable(Enabled)
  359. If Enabled Then
  360. 'turn off GI and turn off all the lights
  361. GiOff
  362. 'Disable slings, bumpers etc
  363. LeftFlipper.RotateToStart
  364. RightFlipper.RotateToStart
  365. 'Bumper1.Force = 0
  366.  
  367. LeftSlingshot.Disabled = 1
  368. RightSlingshot.Disabled = 1
  369. LeftSlingshot1.Disabled = 1
  370. RightSlingshot1.Disabled = 1
  371. Else
  372. 'turn back on GI and the lights
  373. 'GiOn
  374. 'Bumper1.Force = 6
  375. LeftSlingshot.Disabled = 0
  376. RightSlingshot.Disabled = 0
  377. LeftSlingshot1.Disabled = 0
  378. RightSlingshot1.Disabled = 0
  379. 'clean up the buffer display
  380. DMDFlush
  381. End If
  382. End Sub
  383.  
  384. Sub TiltRecoveryTimer_Timer()
  385. ' if all the balls have been drained then..
  386. If(BallsOnPlayfield = 0) Then
  387. ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
  388. EndOfBall()
  389. Me.Enabled = False
  390. End If
  391. ' else retry (checks again in another second or so)
  392. End Sub
  393.  
  394. '********************
  395. ' Music as wav sounds
  396. '********************
  397.  
  398. Dim Song
  399. Song = ""
  400.  
  401. Sub PlaySong(name)
  402. If bMusicOn Then
  403. If Song <> name Then
  404. StopSound Song
  405. Song = name
  406. PlaySound Song, -1, SongVolume
  407. End If
  408. End If
  409. End Sub
  410.  
  411. Sub PlayBattleSong
  412. Dim tmp
  413. tmp = INT(RND * 4)
  414. Select Case tmp
  415. Case 0:PlaySong "mu_battle1"
  416. Case 1:PlaySong "mu_battle2"
  417. Case 2:PlaySong "mu_battle3"
  418. Case 3:PlaySong "mu_battle4"
  419. End Select
  420. End Sub
  421.  
  422. Sub ChangeSong
  423. If(BallsOnPlayfield = 0) Then
  424. PlaySong "mu_end"
  425. Else
  426. If bMultiballMode Then
  427. PlaySong "mu_multi"
  428. Else
  429. If bCatchemMode Then
  430. PlayBattleSong
  431. Else
  432. PlaySong "mu_main"
  433. End If
  434. End If
  435. End If
  436. End Sub
  437. '**********************
  438. ' GI effects
  439. ' independent routine
  440. ' it turns on the gi
  441. ' when there is a ball
  442. ' in play
  443. '**********************
  444.  
  445. Dim OldGiState
  446. OldGiState = -1 'start witht the Gi off
  447.  
  448. Sub ChangeGi(col) 'changes the gi color
  449. Dim bulb
  450. For each bulb in aGILights
  451. SetLightColor bulb, col, -1
  452. Next
  453. End Sub
  454.  
  455. Sub GIUpdateTimer_Timer
  456. Dim tmp, obj
  457. tmp = Getballs
  458. If UBound(tmp) <> OldGiState Then
  459. OldGiState = Ubound(tmp)
  460. If UBound(tmp) = -1 Then
  461. GiOff
  462. Else
  463. Gion
  464. End If
  465. End If
  466. End Sub
  467.  
  468. Sub GiOn
  469. Dim bulb
  470. For each bulb in aGiLights
  471. bulb.State = 1
  472. Next
  473. End Sub
  474.  
  475. Sub GiOff
  476. Dim bulb
  477. For each bulb in aGiLights
  478. bulb.State = 0
  479. Next
  480. End Sub
  481.  
  482. ' GI light sequence effects
  483.  
  484. Sub GiEffect(n)
  485. Dim ii
  486. Select Case n
  487. Case 0 'all off
  488. LightSeqGi.Play SeqAlloff
  489. Case 1 'all blink
  490. LightSeqGi.UpdateInterval = 10
  491. LightSeqGi.Play SeqBlinking, , 10, 10
  492. Case 2 'random
  493. LightSeqGi.UpdateInterval = 10
  494. LightSeqGi.Play SeqRandom, 50, , 1000
  495. Case 1 'all blink fast
  496. LightSeqGi.UpdateInterval = 10
  497. LightSeqGi.Play SeqBlinking, , 5, 10
  498. End Select
  499. End Sub
  500.  
  501. Sub LightEffect(n)
  502. Select Case n
  503. Case 0 ' all off
  504. LightSeqInserts.Play SeqAlloff
  505. Case 1 'all blink
  506. LightSeqInserts.UpdateInterval = 10
  507. LightSeqInserts.Play SeqBlinking, , 10, 10
  508. Case 2 'random
  509. LightSeqInserts.UpdateInterval = 10
  510. LightSeqInserts.Play SeqRandom, 50, , 1000
  511. Case 3 'all blink fast
  512. LightSeqInserts.UpdateInterval = 10
  513. LightSeqInserts.Play SeqBlinking, , 5, 10
  514. End Select
  515. End Sub
  516.  
  517.  
  518. '*****Advert Animation
  519. 'Sub GiOn
  520. ' DOF ActiveDOFCol, DOFOn
  521. 'Dim bulb
  522. 'For each bulb in aGiLights
  523. 'bulb.State = 1
  524. 'Next
  525.  
  526. 'StarAdvert
  527. 'End Sub
  528.  
  529. Sub GiOff
  530. DOF ActiveDOFCol, DOFOff
  531. Dim bulb
  532. For each bulb in aGiLights
  533. bulb.State = 0
  534. Next
  535.  
  536. StartAdvert
  537. End Sub
  538.  
  539. Dim Advert1Pos, Advert2Pos, Advert3Pos, Frames
  540. Frames = Array("advert_001", "advert_002", "advert_003", "advert_004", "advert_005", "advert_006", "advert_007", "advert_008", "advert_009", _
  541. "advert_010", "advert_011", "advert_012", "advert_013", "advert_014", "advert_015", "advert_016", "advert_017", "advert_018", "advert_019", _
  542. "advert_020", "advert_021", "advert_022", "advert_023", "advert_024", "advert_025", "advert_026", "advert_027", "advert_028", "advert_029", _
  543. "advert_030", "advert_031", "advert_032", "advert_033", "advert_034", "advert_035", "advert_036", "advert_037", "advert_038", "advert_039", _
  544. "advert_040", "advert_041", "advert_042", "advert_043", "advert_044", "advert_045", "advert_046", "advert_047", "advert_048", "advert_049", _
  545. "advert_050", "advert_051", "advert_052", "advert_053", "advert_054", "advert_055", "advert_056", "advert_057", "advert_058", "advert_059", _
  546. "advert_060", "advert_061", "advert_062", "advert_063", "advert_064", "advert_065", "advert_066", "advert_067", "advert_068", "advert_069", _
  547. "advert_070", "advert_071", "advert_072", "advert_073", "advert_074", "advert_075", "advert_076", "advert_077", "advert_078", "advert_079", _
  548. "advert_080", "advert_081", "advert_082", "advert_083", "advert_084", "advert_085", "advert_086", "advert_087", "advert_088", "advert_089", _
  549. "advert_090", "advert_091", "advert_092", "advert_093", "advert_094", "advert_095", "advert_096", "advert_097", "advert_098", "advert_099", _
  550. "advert_100", "advert_101", "advert_102", "advert_103", "advert_104", "advert_105", "advert_106", "advert_107", "advert_108", "advert_109", _
  551. "advert_110", "advert_111", "advert_112", "advert_113", "advert_114", "advert_115", "advert_116", "advert_117", "advert_118", "advert_119", _
  552. "advert_120", "advert_121", "advert_122", "advert_123", "advert_124", "advert_125", "advert_126", "advert_127", "advert_128", "advert_129", _
  553. "advert_130", "advert_131", "advert_132", "advert_133", "advert_134", "advert_135", "advert_136", "advert_137", "advert_138", "advert_139", _
  554. "advert_140", "advert_141", "advert_142", "advert_143", "advert_144", "advert_145", "advert_146", "advert_147", "advert_148", "advert_149", _
  555. "advert_150", "advert_151", "advert_152", "advert_153", "advert_154", "advert_155", "advert_156", "advert_157", "advert_158", "advert_159", _
  556. "advert_160", "advert_161", "advert_162", "advert_163", "advert_164", "advert_165", "advert_166", "advert_167", "advert_168", "advert_169", _
  557. "advert_170", "advert_171", "advert_172", "advert_173", "advert_174", "advert_175", "advert_176", "advert_177", "advert_178", "advert_179", _
  558. "advert_180", "advert_181", "advert_182", "advert_183", "advert_184", "advert_185", "advert_186", "advert_187", "advert_188", "advert_189", _
  559. "advert_190", "advert_191", "advert_192", "advert_193", "advert_194", "advert_195", "advert_196", "advert_197", "advert_198", "advert_199", _
  560. "advert_200", "advert_201", "advert_202", "advert_203", "advert_204", "advert_205", "advert_206", "advert_207", "advert_208", "advert_209", _
  561. "advert_210", "advert_211", "advert_212", "advert_213", "advert_214", "advert_215", "advert_216", "advert_217", "advert_218", "advert_219", _
  562. "advert_220", "advert_221", "advert_222", "advert_223", "advert_224", "advert_225", "advert_226", "advert_227", "advert_228", "advert_229", _
  563. "advert_230", "advert_231", "advert_232", "advert_233", "advert_234", "advert_235", "advert_236", "advert_237", "advert_238", "advert_239", _
  564. "advert_240", "advert_241", "advert_242", "advert_243", "advert_244", "advert_245", "advert_246", "advert_247", "advert_248", "advert_249", _
  565. "advert_250", "advert_251", "advert_252", "advert_253", "advert_254", "advert_255", "advert_256", "advert_257", "advert_258", "advert_259", _
  566. "advert_260", "advert_261", "advert_262", "advert_263", "advert_264", "advert_265", "advert_266", "advert_267", "advert_268", "advert_269", _
  567. "advert_270", "advert_271", "advert_272", "advert_273", "advert_274", "advert_275", "advert_276", "advert_277", "advert_278", "advert_279", _
  568. "advert_280", "advert_281", "advert_282", "advert_283", "advert_284", "advert_285", "advert_286", "advert_287", "advert_288", "advert_289", _
  569. "advert_290", "advert_291", "advert_292", "advert_293", "advert_294", "advert_295", "advert_296", "advert_297", "advert_298", "advert_299", _
  570. "advert_300", "advert_301", "advert_302", "advert_303", "advert_304", "advert_305", "advert_306", "advert_307")
  571.  
  572. Sub StartAdvert
  573. Advert1Pos = 0
  574. Advert2Pos = 221
  575. Advert3Pos = 156
  576. advertTimer.Enabled = 1
  577. End Sub
  578.  
  579. Sub advertTimer_Timer
  580. 'debug.print Advert1pos
  581. Advert1.ImageA = Frames(Advert1Pos)
  582. Advert2.ImageA = Frames(Advert2Pos)
  583. Advert3.ImageA = Frames(Advert3Pos)
  584. Advert1Pos = (Advert1Pos + 1) MOD 307
  585. Advert2Pos = (Advert2Pos + 1) MOD 307
  586. Advert3Pos = (Advert3Pos + 1) MOD 307
  587. End Sub
  588.  
  589.  
  590. ' *********************************************************************
  591. ' Supporting Ball & Sound Functions
  592. ' *********************************************************************
  593.  
  594. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  595. Vol = Csng(BallVel(ball) ^2 / 2000)
  596. End Function
  597.  
  598. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  599. Dim tmp
  600. tmp = ball.x * 2 / table1.width-1
  601. If tmp > 0 Then
  602. Pan = Csng(tmp ^10)
  603. Else
  604. Pan = Csng(-((- tmp) ^10))
  605. End If
  606. End Function
  607.  
  608. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  609. Pitch = BallVel(ball) * 20
  610. End Function
  611.  
  612. Function BallVel(ball) 'Calculates the ball speed
  613. BallVel = (SQR((ball.VelX ^2) + (ball.VelY ^2)))
  614. End Function
  615.  
  616. Function AudioFade(ball) 'only on VPX 10.4 and newer
  617. Dim tmp
  618. tmp = ball.y * 2 / Table1.height-1
  619. If tmp > 0 Then
  620. AudioFade = Csng(tmp ^10)
  621. Else
  622. AudioFade = Csng(-((- tmp) ^10))
  623. End If
  624. End Function
  625.  
  626. Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
  627. PlaySound soundname, 0, 1, Pan(tableobj), 0.06, 0, 0, 0, AudioFade(tableobj)
  628. End Sub
  629.  
  630. Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets, metals, plastics
  631. PlaySound soundname, 0, Vol(ActiveBall), pan(ActiveBall), 0.2, 0, 0, 0, AudioFade(ActiveBall)
  632. End Sub
  633.  
  634. '********************************************
  635. ' JP's VP10 Rolling Sounds + Ballshadow
  636. ' uses a collection of shadows, aBallShadow
  637. '********************************************
  638.  
  639. Const tnob = 20 ' total number of balls
  640. Const lob = 0 'number of locked balls
  641. ReDim rolling(tnob)
  642. InitRolling
  643.  
  644. Sub InitRolling
  645. Dim i
  646. For i = 0 to tnob
  647. rolling(i) = False
  648. Next
  649. End Sub
  650.  
  651. Sub RollingUpdate()
  652. Dim BOT, b, ballpitch, ballvol
  653. BOT = GetBalls
  654.  
  655. ' stop the sound of deleted balls
  656. For b = UBound(BOT) + 1 to tnob
  657. rolling(b) = False
  658. StopSound("fx_ballrolling" & b)
  659. Next
  660.  
  661. ' exit the sub if no balls on the table
  662. If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table
  663.  
  664. ' play the rolling sound for each ball and draw the shadow
  665. For b = lob to UBound(BOT)
  666.  
  667. aBallShadow(b).X = BOT(b).X
  668. aBallShadow(b).Y = BOT(b).Y
  669.  
  670. If BallVel(BOT(b) )> 1 Then
  671. If BOT(b).z <30 Then
  672. ballpitch = Pitch(BOT(b) )
  673. ballvol = Vol(BOT(b) )
  674. Else
  675. ballpitch = Pitch(BOT(b) ) + 25000 'increase the pitch on a ramp
  676. ballvol = Vol(BOT(b) ) * 10
  677. End If
  678. rolling(b) = True
  679. PlaySound("fx_ballrolling" & b), -1, ballvol, Pan(BOT(b) ), 0, ballpitch, 1, 0, AudioFade(BOT(b) )
  680. Else
  681. If rolling(b) = True Then
  682. StopSound("fx_ballrolling" & b)
  683. rolling(b) = False
  684. End If
  685. End If
  686. ' rothbauerw's Dropping Sounds
  687. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  688. PlaySound "fx_balldrop", 0, ABS(BOT(b).velz)/17, Pan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  689. End If
  690. Next
  691. End Sub
  692.  
  693.  
  694. '**********************
  695. ' Ball Collision Sound
  696. '**********************
  697.  
  698. Sub OnBallBallCollision(ball1, ball2, velocity)
  699. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  700. End Sub
  701.  
  702. '******************************
  703. ' Diverse Collection Hit Sounds
  704. '******************************
  705.  
  706. Sub aMetals_Hit(idx):PlaySoundAtBall "fx_MetalHit":End Sub
  707. Sub aRubber_Bands_Hit(idx):PlaySoundAtBall "fx_rubber_band":End Sub
  708. Sub aRubber_Posts_Hit(idx):PlaySoundAtBall "fx_rubber_post":End Sub
  709. Sub aRubber_Pins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub
  710. Sub aPlastics_Hit(idx):PlaySoundAtBall "fx_PlasticHit":End Sub
  711. Sub aGates_Hit(idx):PlaySoundAtBall "fx_Gate":End Sub
  712. Sub aWoods_Hit(idx):PlaySoundAtBall "fx_Woodhit":End Sub
  713.  
  714. ' Pokémon sound efects and fanfares
  715.  
  716. Sub PlaySoundEffect()
  717. Dim n
  718. n = "po_effect" & INT(RND * 36) + 1
  719. PlaySound n, 0, 1, pan(ActiveBall)
  720. End Sub
  721.  
  722. Sub PlayFanfare()
  723. Dim n
  724. n = "po_fanfare" & INT(RND * 6) + 1
  725. PlaySound n
  726. End Sub
  727.  
  728. ' *********************************************************************
  729. ' User Defined Script Events
  730. ' *********************************************************************
  731.  
  732. ' Initialise the Table for a new Game
  733. '
  734. Sub ResetForNewGame()
  735. Dim i
  736.  
  737. bGameInPLay = True
  738.  
  739. 'resets the score display, and turn off attrack mode
  740. StopAttractMode
  741. GiOn
  742.  
  743. TotalGamesPlayed = TotalGamesPlayed + 1
  744. CurrentPlayer = 1
  745. PlayersPlayingGame = 1
  746. bOnTheFirstBall = True
  747. For i = 1 To MaxPlayers
  748. Score(i) = 0
  749. BonusPoints(i) = 0
  750. BonusMultiplier(i) = 1
  751. BallsRemaining(i) = BallsPerGame
  752. ExtraBallsAwards(i) = 0
  753. Coins(i) = 0
  754. Next
  755.  
  756. ' initialise any other flags
  757. bMultiBallMode = False
  758. Tilt = 0
  759.  
  760. ' initialise Game variables
  761. Game_Init()
  762.  
  763. ' you may wish to start some music, play a sound, do whatever at this point
  764.  
  765. ' set up the start delay to handle any Start of Game Attract Sequence
  766. vpmtimer.addtimer 1500, "FirstBall '"
  767. End Sub
  768.  
  769. ' This is used to delay the start of a game to allow any attract sequence to
  770. ' complete. When it expires it creates a ball for the player to start playing with
  771.  
  772. Sub FirstBall
  773. ' reset the table for a new ball
  774. ResetForNewPlayerBall()
  775. ' create a new ball in the shooters lane
  776. CreateNewBall()
  777. End Sub
  778.  
  779. ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
  780. ' lost one or we have moved onto the next player (if multiple are playing))
  781.  
  782. Sub ResetForNewPlayerBall()
  783. ' make sure the correct display is upto date
  784. AddScore 0
  785.  
  786. ' set the current players bonus multiplier back down to 1X
  787. SetBonusMultiplier 1
  788.  
  789. ' reset any drop targets, lights, game modes etc..
  790. 'LightShootAgain.State = 0
  791. Bonus = 0
  792. bExtraBallWonThisBall = False
  793. ResetNewBallLights()
  794.  
  795. 'This is a new ball, so activate the ballsaver
  796. bBallSaverReady = True
  797.  
  798. 'and the skillshot
  799. 'bSkillShotReady = True 'no skillshot in this game
  800.  
  801. 'Change the music ?
  802.  
  803. 'Reset any table specific
  804. TargetBonus = 0
  805. BumperBonus = 0
  806. HoleBonus = 0
  807. End Sub
  808.  
  809. ' Create a new ball on the Playfield
  810.  
  811. Sub CreateNewBall()
  812. ' create a ball in the plunger lane kicker.
  813. BallRelease.CreateSizedball BallSize / 2
  814. UpdateBallImage
  815. ' There is a (or another) ball on the playfield
  816. BallsOnPlayfield = BallsOnPlayfield + 1
  817.  
  818. ' kick it out..
  819. PlaySoundAt SoundFXDOF("fx_Ballrel", 123, DOFPulse, DOFContactors), BallRelease
  820. BallRelease.Kick 90, 4
  821.  
  822. ' if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations)
  823. ' set the bAutoPlunger flag to kick the ball in play automatically
  824. If BallsOnPlayfield> 1 Then
  825. bMultiBallMode = True
  826. bAutoPlunger = True
  827. ChangeSong
  828. End If
  829. End Sub
  830.  
  831. ' Add extra balls to the table with autoplunger
  832. ' Use it as AddMultiball 4 to add 4 extra balls to the table
  833.  
  834. Sub AddMultiball(nballs)
  835. mBalls2Eject = mBalls2Eject + nballs
  836. CreateMultiballTimer.Enabled = True
  837. End Sub
  838.  
  839. ' Eject the ball after the delay, AddMultiballDelay
  840. Sub CreateMultiballTimer_Timer()
  841. ' wait if there is a ball in the plunger lane
  842. If bBallInPlungerLane Then
  843. Exit Sub
  844. Else
  845. If BallsOnPlayfield <MaxMultiballs Then
  846. CreateNewBall()
  847. mBalls2Eject = mBalls2Eject -1
  848. If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
  849. Me.Enabled = False
  850. End If
  851. Else 'the max number of multiballs is reached, so stop the timer
  852. mBalls2Eject = 0
  853. Me.Enabled = False
  854. End If
  855. End If
  856. End Sub
  857.  
  858. ' The Player has lost his ball (there are no more balls on the playfield).
  859. ' Handle any bonus points awarded
  860. '
  861. Sub EndOfBall()
  862. Dim BonusDelayTime
  863. ' the first ball has been lost. From this point on no new players can join in
  864. bOnTheFirstBall = False
  865.  
  866. ' only process any of this if the table is not tilted. (the tilt recovery
  867. ' mechanism will handle any extra balls or end of game)
  868. If(Tilted = False) Then
  869. Dim AwardPoints, TotalBonus
  870. AwardPoints = 0:TotalBonus = 0
  871.  
  872. ' add in any bonus points (multipled by the bonus multiplier)
  873. 'AwardPoints = BonusPoints(CurrentPlayer) * BonusMultiplier(CurrentPlayer)
  874. 'AddScore AwardPoints
  875. 'debug.print "Bonus Points = " & AwardPoints
  876. 'DMD "", CL(1, "BONUS: " & BonusPoints(CurrentPlayer) & " X" & BonusMultiplier(CurrentPlayer) ), "", eNone, eBlink, eNone, 1000, True, ""
  877.  
  878. 'this table uses several bonus
  879. AwardPoints = TargetBonus * 1000
  880. TotalBonus = TotalBonus + AwardPoints
  881. DMD CL(0, FormatScore(AwardPoints) ), CL(1, "TARGET BONUS: " & TargetBonus), "", eBlink, eNone, eNone, 800, False, "po_bonus1"
  882.  
  883. AwardPoints = HoleBonus * 5000
  884. TotalBonus = TotalBonus + AwardPoints
  885. DMD CL(0, FormatScore(AwardPoints) ), CL(1, "HOLE BONUS: " & HoleBonus), "", eBlink, eNone, eNone, 800, False, "po_bonus2"
  886.  
  887. AwardPoints = PokemonBonusAward(CurrentPlayer) * 62500
  888. TotalBonus = TotalBonus + AwardPoints
  889. DMD CL(0, FormatScore(AwardPoints) ), CL(1, "EVIDENCE FOUND: " & PokemonBonus(CurrentPlayer) ), "", eBlink, eNone, eNone, 800, False, "po_bonus3"
  890.  
  891. AwardPoints = EggBonus(CurrentPlayer) * 250000
  892. TotalBonus = TotalBonus + AwardPoints
  893. DMD CL(0, FormatScore(AwardPoints) ), CL(1, "BONUS: " & EggBonus(CurrentPlayer) ), "", eBlink, eNone, eNone, 800, False, "po_bonus4"
  894.  
  895. AwardPoints = BumperBonus * 100000
  896. TotalBonus = TotalBonus + AwardPoints
  897. DMD CL(0, FormatScore(AwardPoints) ), CL(1, "BUMPER BONUS: " & BumperBonus), "", eBlink, eNone, eNone, 800, False, "po_bonus5"
  898.  
  899. If Balls = BallsPerGame Then 'this is the last ball, add the coins left to the score
  900. AwardPoints = Coins(CurrentPlayer) * 1000
  901. TotalBonus = TotalBonus + AwardPoints
  902. DMD CL(0, FormatScore(AwardPoints) ), CL(1, "COIN BONUS: " & Coins(CurrentPlayer) ), "", eBlink, eNone, eNone, 800, False, "po_bonus6"
  903. End If
  904.  
  905. DMD CL(0, FormatScore(TotalBonus) ), CL(1, "TOTAL BONUS " & " X" & BonusMultiplier(CurrentPlayer) ), "", eBlinkFast, eNone, eNone, 1500, True, "po_bonus7"
  906. TotalBonus = TotalBonus * BonusMultiplier(CurrentPlayer)
  907.  
  908. ' add a bit of a delay to allow for the bonus points to be shown & added up
  909. BonusDelayTime = 7000
  910. vpmtimer.addtimer BonusDelayTime, "Addscore TotalBonus '"
  911. Else
  912. 'no bonus to count so move quickly to the next stage
  913. BonusDelayTime = 100
  914. End If
  915. ' start the end of ball timer which allows you to add a delay at this point
  916. vpmtimer.addtimer BonusDelayTime, "EndOfBall2 '"
  917. End Sub
  918.  
  919. ' The Timer which delays the machine to allow any bonus points to be added up
  920. ' has expired. Check to see if there are any extra balls for this player.
  921. ' if not, then check to see if this was the last ball (of the currentplayer)
  922. '
  923. Sub EndOfBall2()
  924. ' if were tilted, reset the internal tilted flag (this will also
  925. ' set TiltWarnings back to zero) which is useful if we are changing player LOL
  926. Tilted = False
  927. Tilt = 0
  928. DisableTable False 'enable again bumpers and slingshots
  929.  
  930. ' has the player won an extra-ball ? (might be multiple outstanding)
  931. If(ExtraBallsAwards(CurrentPlayer) <> 0) Then
  932. 'debug.print "Extra Ball"
  933. DMD "_", CL(1, ("EXTRA BALL") ), "_", eNone, eBlink, eNone, 1000, True, ""
  934.  
  935. ' yep got to give it to them
  936. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) - 1
  937.  
  938. ' if no more EB's then turn off any shoot again light
  939. If(ExtraBallsAwards(CurrentPlayer) = 0) Then
  940. LightShootAgain.State = 0
  941. End If
  942.  
  943. ' You may wish to do a bit of a song AND dance at this point
  944.  
  945. ' Create a new ball in the shooters lane
  946. CreateNewBall()
  947. Else ' no extra balls
  948.  
  949. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer) - 1
  950.  
  951. ' was that the last ball ?
  952. If(BallsRemaining(CurrentPlayer) <= 0) Then
  953. 'debug.print "No More Balls, High Score Entry"
  954.  
  955. ' Submit the currentplayers score to the High Score system
  956. CheckHighScore()
  957. ' you may wish to play some music at this point
  958.  
  959. Else
  960.  
  961. ' not the last ball (for that player)
  962. ' if multiple players are playing then move onto the next one
  963. EndOfBallComplete()
  964. End If
  965. End If
  966. End Sub
  967.  
  968. ' This function is called when the end of bonus display
  969. ' (or high score entry finished) AND it either end the game or
  970. ' move onto the next player (or the next ball of the same player)
  971. '
  972. Sub EndOfBallComplete()
  973. Dim NextPlayer
  974.  
  975. 'debug.print "EndOfBall - Complete"
  976.  
  977. ' are there multiple players playing this game ?
  978. If(PlayersPlayingGame> 1) Then
  979. ' then move to the next player
  980. NextPlayer = CurrentPlayer + 1
  981. ' are we going from the last player back to the first
  982. ' (ie say from player 4 back to player 1)
  983. If(NextPlayer> PlayersPlayingGame) Then
  984. NextPlayer = 1
  985. End If
  986. Else
  987. NextPlayer = CurrentPlayer
  988. End If
  989.  
  990. 'debug.print "Next Player = " & NextPlayer
  991.  
  992. ' is it the end of the game ? (all balls been lost for all players)
  993. If((BallsRemaining(CurrentPlayer) <= 0) AND(BallsRemaining(NextPlayer) <= 0) ) Then
  994. ' you may wish to do some sort of Point Match free game award here
  995. ' generally only done when not in free play mode
  996.  
  997. ' set the machine into game over mode
  998. EndOfGame()
  999.  
  1000. ' you may wish to put a Game Over message on the desktop/backglass
  1001.  
  1002. Else
  1003. ' set the next player
  1004. CurrentPlayer = NextPlayer
  1005.  
  1006. ' make sure the correct display is up to date
  1007. AddScore 0
  1008.  
  1009. ' reset the playfield for the new player (or new ball)
  1010. ResetForNewPlayerBall()
  1011.  
  1012. ' AND create a new ball
  1013. CreateNewBall()
  1014. End If
  1015. End Sub
  1016.  
  1017. ' This function is called at the End of the Game, it should reset all
  1018. ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
  1019.  
  1020. Sub EndOfGame()
  1021. 'debug.print "End Of Game"
  1022. bGameInPLay = False
  1023. ' just ended your game then play the end of game tune
  1024. If NOT bJustStarted Then
  1025. ChangeSong
  1026. End If
  1027. bJustStarted = False
  1028.  
  1029. ' ensure that the flippers are down
  1030. SolLFlipper 0
  1031. SolRFlipper 0
  1032.  
  1033. ' terminate all modes - eject locked balls
  1034.  
  1035. ' set any lights for the attract mode
  1036. GiOff
  1037. StartAttractMode 1
  1038. ' you may wish to light any Game Over Light you may have
  1039. End Sub
  1040.  
  1041. Function Balls
  1042. Dim tmp
  1043. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  1044. If tmp> BallsPerGame Then
  1045. Balls = BallsPerGame
  1046. Else
  1047. Balls = tmp
  1048. End If
  1049. End Function
  1050.  
  1051. ' *********************************************************************
  1052. ' Drain / Plunger Functions
  1053. ' *********************************************************************
  1054.  
  1055. ' lost a ball ;-( check to see how many balls are on the playfield.
  1056. ' if only one then decrement the remaining count AND test for End of game
  1057. ' if more than 1 ball (multi-ball) then kill of the ball but don't create
  1058. ' a new one
  1059. '
  1060. Sub Drain_Hit()
  1061. ' Destroy the ball
  1062. Drain.DestroyBall
  1063. BallsOnPlayfield = BallsOnPlayfield - 1
  1064. ' pretend to knock the ball into the ball storage mech
  1065. PlaySoundAt "fx_drain", Drain
  1066.  
  1067. ' if there is a game in progress AND it is not Tilted
  1068. If(bGameInPLay = True) AND(Tilted = False) Then
  1069.  
  1070. ' is the ball saver active,
  1071. If(bBallSaverActive = True) Then
  1072.  
  1073. ' yep, create a new ball in the shooters lane
  1074. ' we use the Addmultiball in case the multiballs are being ejected
  1075. AddMultiball 1
  1076. ' we kick the ball with the autoplunger
  1077. bAutoPlunger = True
  1078. ' you may wish to put something on a display or play a sound at this point
  1079. DMD "_", CL(1, "BALL SAVED"), "_", eNone, eBlinkfast, eNone, 800, True, ""
  1080. Else
  1081. ' cancel any multiball if on last ball (ie. lost all other balls)
  1082. If(BallsOnPlayfield = 1) Then
  1083. ' AND in a multi-ball??
  1084. If(bMultiBallMode = True) then
  1085. ' not in multiball mode any more
  1086. bMultiBallMode = False
  1087. ChangeGi "white"
  1088. ' you may wish to change any music over at this point and
  1089. ' turn off any multiball specific lights
  1090. ResetJackpotLights
  1091. ChangeSong
  1092. End If
  1093. End If
  1094.  
  1095. ' was that the last ball on the playfield
  1096. If(BallsOnPlayfield = 0) Then
  1097. ChangeSong
  1098. ' handle the end of ball (change player, high score entry etc..)
  1099. EndOfBall()
  1100. ' End Modes and timers
  1101. If bCatchemMode Then StopCatchem_Timer
  1102. If bcoinfrenzy Then StopCoinFrenzyTimer_Timer
  1103. If bPikachuTargetMode Then PikachuTargetTimer_Timer
  1104. If bCharizardMode Then StopCharizardTimer_Timer
  1105. If bRampBonus Then StopRampBonusTimer_Timer
  1106. If bLoopBonus Then StopLoopBonusTimer_Timer
  1107. ReduceBallType
  1108. ChangeGi "white"
  1109. End If
  1110. End If
  1111. End If
  1112. End Sub
  1113.  
  1114. ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane
  1115. ' Check to see if a ball saver mechanism is needed and if so fire it up.
  1116.  
  1117. Sub swPlungerRest_Hit()
  1118. 'debug.print "ball in plunger lane"
  1119. ' some sound according to the ball position
  1120. PlaySoundAt "fx_sensor", swPlungerRest
  1121. bBallInPlungerLane = True
  1122. ' turn on Launch light is there is one
  1123. LaunchLight.State = 2
  1124. ' kick the ball in play if the bAutoPlunger flag is on
  1125. If bAutoPlunger Then
  1126. 'debug.print "autofire the ball"
  1127. PlungerIM.AutoFire:AnimateRattata
  1128. DOF 124, DOFPulse
  1129. DOF 121, DOFPulse
  1130. bAutoPlunger = False
  1131. End If
  1132.  
  1133.  
  1134.  
  1135. ' if there is a need for a ball saver, then start off a timer
  1136. ' only start if it is ready, and it is currently not running, else it will reset the time period
  1137. If(bBallSaverReady = True) AND(BallSaverTime <> 0) And(bBallSaverActive = False) Then
  1138. EnableBallSaver BallSaverTime
  1139. End If
  1140. 'Start the skillshot if ready
  1141. If bSkillShotReady Then
  1142. ResetSkillShotTimer.Interval = 1000 * 5 ' 5 seconds
  1143. ResetSkillShotTimer.Enabled = True
  1144. LightSeqSkillshot.Play SeqAllOff
  1145. LightSeqSkillshotHit.Play SeqBlinking, , 5, 150
  1146. 'PlaySound a sound
  1147. End If
  1148. ' remember last trigger hit by the ball.
  1149. LastSwitchHit = "swPlungerRest"
  1150. End Sub
  1151.  
  1152. ' The ball is released from the plunger turn off some flags and check for skillshot
  1153.  
  1154. Sub swPlungerRest_UnHit()
  1155. bBallInPlungerLane = False
  1156. DOF 141, DOFPulse
  1157. DOF 121, DOFPulse
  1158. ChangeSong
  1159. ' turn off LaunchLight
  1160. LaunchLight.State = 0
  1161.  
  1162. End Sub
  1163.  
  1164. Sub EnableBallSaver(seconds)
  1165. 'debug.print "Ballsaver started"
  1166. ' set our game flag
  1167. bBallSaverActive = True
  1168. bBallSaverReady = False
  1169. ' start the timer
  1170. BallSaverTimer.Interval = 1000 * seconds
  1171. BallSaverTimer.Enabled = True
  1172. BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
  1173. BallSaverSpeedUpTimer.Enabled = True
  1174. ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
  1175. LightShootAgain.BlinkInterval = 160
  1176. LightShootAgain.State = 2
  1177. End Sub
  1178.  
  1179. ' The ball saver timer has expired. Turn it off AND reset the game flag
  1180. '
  1181. Sub BallSaverTimer_Timer()
  1182. 'debug.print "Ballsaver ended"
  1183. BallSaverTimer.Enabled = False
  1184. ' clear the flag
  1185. bBallSaverActive = False
  1186. ' if you have a ball saver light then turn it off at this point
  1187. LightShootAgain.State = 0
  1188. End Sub
  1189.  
  1190. Sub BallSaverSpeedUpTimer_Timer()
  1191. 'debug.print "Ballsaver Speed Up Light"
  1192. BallSaverSpeedUpTimer.Enabled = False
  1193. ' Speed up the blinking
  1194. LightShootAgain.BlinkInterval = 80
  1195. LightShootAgain.State = 2
  1196. End Sub
  1197.  
  1198. ' *********************************************************************
  1199. ' Supporting Score Functions
  1200. ' *********************************************************************
  1201.  
  1202. ' Add points to the score AND update the score board
  1203. '
  1204. Sub AddScore(points)
  1205. If(Tilted = False) Then
  1206. ' add the points to the current players score variable
  1207. Score(CurrentPlayer) = Score(CurrentPlayer) + points * BallType
  1208. End if
  1209. ' you may wish to check to see if the player has gotten a replay
  1210. End Sub
  1211.  
  1212. ' Add bonus to the bonuspoints AND update the score board
  1213. '
  1214. Sub AddBonus(points)
  1215. If(Tilted = False) Then
  1216. ' add the bonus to the current players bonus variable
  1217. BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points
  1218. End if
  1219. ' you may wish to check to see if the player has gotten a replay
  1220. End Sub
  1221.  
  1222. Sub AddCoin(n)
  1223. If(Tilted = False) Then
  1224. ' add the coins to the current players coin variable
  1225. Coins(CurrentPlayer) = Coins(CurrentPlayer) + n
  1226. ' update the score displays
  1227. 'DMDScore
  1228. End if
  1229.  
  1230. ' check if there is enough coins to enable the update ball
  1231. If Coins(CurrentPlayer)> 249 Then
  1232. BallUpdateLight.State = 2
  1233. Else
  1234. BallUpdateLight.State = 0
  1235. End If
  1236. End Sub
  1237.  
  1238. ' Add some points to the current Jackpot.
  1239. '
  1240. Sub AddJackpot(points)
  1241. ' Jackpots only generally increment in multiball mode AND not tilted
  1242. ' but this doesn't have to be the case
  1243. If(Tilted = False) Then
  1244.  
  1245. If(bMultiBallMode = True) Then
  1246. Jackpot = Jackpot + points
  1247. ' you may wish to limit the jackpot to a upper limit, ie..
  1248. ' If (Jackpot >= 6000) Then
  1249. ' Jackpot = 6000
  1250. ' End if
  1251. End if
  1252. End if
  1253. End Sub
  1254.  
  1255. ' Will increment the Bonus Multiplier to the next level
  1256. '
  1257. Sub IncrementBonusMultiplier()
  1258. Dim NewBonusLevel
  1259.  
  1260. ' if not at the maximum bonus level
  1261. if(BonusMultiplier(CurrentPlayer) <MaxMultiplier) then
  1262. ' then set it the next next one AND set the lights
  1263. NewBonusLevel = BonusMultiplier(CurrentPlayer) + 1
  1264. SetBonusMultiplier(NewBonusLevel)
  1265. End if
  1266. End Sub
  1267.  
  1268. ' Set the Bonus Multiplier to the specified level AND set any lights accordingly
  1269. '
  1270. Sub SetBonusMultiplier(Level)
  1271. ' Set the multiplier to the specified level
  1272. BonusMultiplier(CurrentPlayer) = Level
  1273.  
  1274. ' If the multiplier is 1 then turn off all the bonus lights
  1275. If(BonusMultiplier(CurrentPlayer) = 1) Then
  1276. LightBonus2x.State = 0
  1277. LightBonus3x.State = 0
  1278. LightBigBonus.State = 0
  1279. Else
  1280. ' there is a bonus, turn on all the lights upto the current level
  1281. If(BonusMultiplier(CurrentPlayer) >= 2) Then
  1282. If(BonusMultiplier(CurrentPlayer) >= 2) Then
  1283. LightBonus2x.state = 1
  1284. End If
  1285. If(BonusMultiplier(CurrentPlayer) >= 3) Then
  1286. LightBonus3x.state = 1
  1287. End If
  1288. If(BonusMultiplier(CurrentPlayer) >= 4) Then
  1289. LightBigBonus.state = 1
  1290. End If
  1291. End If
  1292. ' etc..
  1293. End If
  1294. End Sub
  1295.  
  1296. Sub IncrementBonus(Amount)
  1297. Dim Value
  1298. AddBonus Amount * 1000
  1299. Bonus = Bonus + Amount
  1300. End Sub
  1301.  
  1302. Sub AwardExtraBall()
  1303. If NOT bExtraBallWonThisBall Then
  1304. DMD "_", CL(1, ("EXTRA BALL WON") ), "_", eNone, eBlink, eNone, 1000, True, SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker)
  1305. DOF 121, DOFPulse
  1306. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  1307. bExtraBallWonThisBall = True
  1308. GiEffect 1
  1309. LightEffect 2
  1310. END If
  1311. End Sub
  1312.  
  1313. Sub AwardSpecial()
  1314. DMD "_", CL(1, ("EXTRA GAME WON") ), "_", eNone, eBlink, eNone, 1000, True, SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker)
  1315. DOF 121, DOFPulse
  1316. Credits = Credits + 1
  1317. DOF 125, DOFOn
  1318. GiEffect 1
  1319. LightEffect 1
  1320. End Sub
  1321.  
  1322. Sub AwardJackpot()
  1323. DMD CL(0, FormatScore(Jackpot) ), CL(1, ("JACKPOT") ), "bkborder", eBlinkFast, eBlinkFast, eNone, 1000, True, ""
  1324. DOF 126, DOFPulse
  1325. PlayFanfare
  1326. AddScore Jackpot
  1327. AddJackpot 100000
  1328. GiEffect 1
  1329. LightEffect 2
  1330. End Sub
  1331.  
  1332. Sub AwardSuperJackpot()
  1333. DMD CL(0, FormatScore(Jackpot * PokemonLevel) ), CL(1, ("SUPERJACKPOT") ), "bkborder", eBlinkFast, eBlinkFast, eNone, 1000, True, ""
  1334. DOF 126, DOFPulse
  1335. PlayFanfare
  1336. AddScore Jackpot * PokemonLevel
  1337. AddJackpot 100000
  1338. GiEffect 1
  1339. LightEffect 2
  1340. End Sub
  1341.  
  1342. Sub AwardSkillshot()
  1343. DMD CL(0, FormatScore(SkillshotValue) ), CL(1, ("SKILLSHOT") ), "bkborder", eBlinkFast, eBlink, eNone, 1000, True, ""
  1344. DOF 127, DOFPulse
  1345. AddScore SkillshotValue
  1346. ResetSkillShotTimer_Timer
  1347. End Sub
  1348.  
  1349. '*****************************
  1350. ' Load / Save / Highscore
  1351. '*****************************
  1352.  
  1353. Sub Loadhs
  1354. Dim x
  1355. x = LoadValue(cGameName, "HighScore1")
  1356. If(x <> "") Then HighScore(0) = CDbl(x) Else HighScore(0) = 100000 End If
  1357. x = LoadValue(cGameName, "HighScore1Name")
  1358. If(x <> "") Then HighScoreName(0) = x Else HighScoreName(0) = "AAA" End If
  1359. x = LoadValue(cGameName, "HighScore2")
  1360. If(x <> "") then HighScore(1) = CDbl(x) Else HighScore(1) = 100000 End If
  1361. x = LoadValue(cGameName, "HighScore2Name")
  1362. If(x <> "") then HighScoreName(1) = x Else HighScoreName(1) = "BBB" End If
  1363. x = LoadValue(cGameName, "HighScore3")
  1364. If(x <> "") then HighScore(2) = CDbl(x) Else HighScore(2) = 100000 End If
  1365. x = LoadValue(cGameName, "HighScore3Name")
  1366. If(x <> "") then HighScoreName(2) = x Else HighScoreName(2) = "CCC" End If
  1367. x = LoadValue(cGameName, "HighScore4")
  1368. If(x <> "") then HighScore(3) = CDbl(x) Else HighScore(3) = 100000 End If
  1369. x = LoadValue(cGameName, "HighScore4Name")
  1370. If(x <> "") then HighScoreName(3) = x Else HighScoreName(3) = "DDD" End If
  1371. x = LoadValue(cGameName, "Credits")
  1372. If(x <> "") then Credits = CInt(x) Else Credits = 0:DOF 125, DOFOff:End If
  1373. 'x = LoadValue(TableName, "Jackpot")
  1374. 'If(x <> "") then Jackpot = CDbl(x) Else Jackpot = 200000 End If
  1375. x = LoadValue(cGameName, "TotalGamesPlayed")
  1376. If(x <> "") then TotalGamesPlayed = CInt(x) Else TotalGamesPlayed = 0 End If
  1377. End Sub
  1378.  
  1379. Sub Savehs
  1380. SaveValue cGameName, "HighScore1", HighScore(0)
  1381. SaveValue cGameName, "HighScore1Name", HighScoreName(0)
  1382. SaveValue cGameName, "HighScore2", HighScore(1)
  1383. SaveValue cGameName, "HighScore2Name", HighScoreName(1)
  1384. SaveValue cGameName, "HighScore3", HighScore(2)
  1385. SaveValue cGameName, "HighScore3Name", HighScoreName(2)
  1386. SaveValue cGameName, "HighScore4", HighScore(3)
  1387. SaveValue cGameName, "HighScore4Name", HighScoreName(3)
  1388. SaveValue cGameName, "Credits", Credits
  1389. 'SaveValue cGameName, "Jackpot", Jackpot
  1390. SaveValue cGameName, "TotalGamesPlayed", TotalGamesPlayed
  1391. End Sub
  1392.  
  1393. ' ***********************************************************
  1394. ' High Score Initals Entry Functions - based on Black's code
  1395. ' ***********************************************************
  1396.  
  1397. Dim hsbModeActive
  1398. Dim hsEnteredName
  1399. Dim hsEnteredDigits(3)
  1400. Dim hsCurrentDigit
  1401. Dim hsValidLetters
  1402. Dim hsCurrentLetter
  1403. Dim hsLetterFlash
  1404.  
  1405. Sub CheckHighscore()
  1406. Dim tmp
  1407. tmp = Score(1)
  1408. If Score(2)> tmp Then tmp = Score(2)
  1409. If Score(3)> tmp Then tmp = Score(3)
  1410. If Score(4)> tmp Then tmp = Score(4)
  1411.  
  1412. If tmp> HighScore(1) Then 'add 1 credit for beating the highscore
  1413. Credits = Credits + 1
  1414. DOF 125, DOFOn
  1415. End If
  1416.  
  1417. If tmp> HighScore(3) Then
  1418. PlaySound SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker)
  1419. DOF 121, DOFPulse
  1420. HighScore(3) = tmp
  1421. 'enter player's name
  1422. HighScoreEntryInit()
  1423. Else
  1424. EndOfBallComplete()
  1425. End If
  1426. End Sub
  1427.  
  1428. Sub HighScoreEntryInit()
  1429. hsbModeActive = True
  1430. ChangeSong
  1431. hsLetterFlash = 0
  1432.  
  1433. hsEnteredDigits(0) = " "
  1434. hsEnteredDigits(1) = " "
  1435. hsEnteredDigits(2) = " "
  1436. hsCurrentDigit = 0
  1437.  
  1438. hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ'<>*+-/=\^0123456789`" ' ` is back arrow
  1439. hsCurrentLetter = 1
  1440. DMDFlush()
  1441. HighScoreDisplayNameNow()
  1442.  
  1443. HighScoreFlashTimer.Interval = 250
  1444. HighScoreFlashTimer.Enabled = True
  1445. End Sub
  1446.  
  1447. Sub EnterHighScoreKey(keycode)
  1448. If keycode = LeftFlipperKey Then
  1449. playsound "fx_Previous"
  1450. hsCurrentLetter = hsCurrentLetter - 1
  1451. if(hsCurrentLetter = 0) then
  1452. hsCurrentLetter = len(hsValidLetters)
  1453. end if
  1454. HighScoreDisplayNameNow()
  1455. End If
  1456.  
  1457. If keycode = RightFlipperKey Then
  1458. playsound "fx_Next"
  1459. hsCurrentLetter = hsCurrentLetter + 1
  1460. if(hsCurrentLetter> len(hsValidLetters) ) then
  1461. hsCurrentLetter = 1
  1462. end if
  1463. HighScoreDisplayNameNow()
  1464. End If
  1465.  
  1466. If keycode = PlungerKey Then
  1467. if(mid(hsValidLetters, hsCurrentLetter, 1) <> "`") then
  1468. playsound "fx_Enter"
  1469. hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
  1470. hsCurrentDigit = hsCurrentDigit + 1
  1471. if(hsCurrentDigit = 3) then
  1472. HighScoreCommitName()
  1473. else
  1474. HighScoreDisplayNameNow()
  1475. end if
  1476. else
  1477. playsound "fx_Esc"
  1478. hsEnteredDigits(hsCurrentDigit) = " "
  1479. if(hsCurrentDigit> 0) then
  1480. hsCurrentDigit = hsCurrentDigit - 1
  1481. end if
  1482. HighScoreDisplayNameNow()
  1483. end if
  1484. end if
  1485. End Sub
  1486.  
  1487. Sub HighScoreDisplayNameNow()
  1488. HighScoreFlashTimer.Enabled = False
  1489. hsLetterFlash = 0
  1490. HighScoreDisplayName()
  1491. HighScoreFlashTimer.Enabled = True
  1492. End Sub
  1493.  
  1494. Sub HighScoreDisplayName()
  1495. Dim i
  1496. Dim TempTopStr
  1497. Dim TempBotStr
  1498.  
  1499. TempTopStr = "YOUR NAME:"
  1500. dLine(0) = ExpandLine(TempTopStr, 0)
  1501. DMDUpdate 0
  1502.  
  1503. TempBotStr = " > "
  1504. if(hsCurrentDigit> 0) then TempBotStr = TempBotStr & hsEnteredDigits(0)
  1505. if(hsCurrentDigit> 1) then TempBotStr = TempBotStr & hsEnteredDigits(1)
  1506. if(hsCurrentDigit> 2) then TempBotStr = TempBotStr & hsEnteredDigits(2)
  1507.  
  1508. if(hsCurrentDigit <> 3) then
  1509. if(hsLetterFlash <> 0) then
  1510. TempBotStr = TempBotStr & "_"
  1511. else
  1512. TempBotStr = TempBotStr & mid(hsValidLetters, hsCurrentLetter, 1)
  1513. end if
  1514. end if
  1515.  
  1516. if(hsCurrentDigit <1) then TempBotStr = TempBotStr & hsEnteredDigits(1)
  1517. if(hsCurrentDigit <2) then TempBotStr = TempBotStr & hsEnteredDigits(2)
  1518.  
  1519. TempBotStr = TempBotStr & " < "
  1520. dLine(1) = ExpandLine(TempBotStr, 1)
  1521. DMDUpdate 1
  1522. End Sub
  1523.  
  1524. Sub HighScoreFlashTimer_Timer()
  1525. HighScoreFlashTimer.Enabled = False
  1526. hsLetterFlash = hsLetterFlash + 1
  1527. if(hsLetterFlash = 2) then hsLetterFlash = 0
  1528. HighScoreDisplayName()
  1529. HighScoreFlashTimer.Enabled = True
  1530. End Sub
  1531.  
  1532. Sub HighScoreCommitName()
  1533. HighScoreFlashTimer.Enabled = False
  1534. hsbModeActive = False
  1535. ChangeSong
  1536. hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
  1537. if(hsEnteredName = " ") then
  1538. hsEnteredName = "YOU"
  1539. end if
  1540.  
  1541. HighScoreName(3) = hsEnteredName
  1542. SortHighscore
  1543. EndOfBallComplete()
  1544. End Sub
  1545.  
  1546. Sub SortHighscore
  1547. Dim tmp, tmp2, i, j
  1548. For i = 0 to 3
  1549. For j = 0 to 2
  1550. If HighScore(j) <HighScore(j + 1) Then
  1551. tmp = HighScore(j + 1)
  1552. tmp2 = HighScoreName(j + 1)
  1553. HighScore(j + 1) = HighScore(j)
  1554. HighScoreName(j + 1) = HighScoreName(j)
  1555. HighScore(j) = tmp
  1556. HighScoreName(j) = tmp2
  1557. End If
  1558. Next
  1559. Next
  1560. End Sub
  1561.  
  1562. ' *************************************************************************
  1563. ' JP's Reduced Display Driver Functions (based on script by Black)
  1564. ' only 5 effects: none, scroll left, scroll right, blink and blinkfast
  1565. ' 3 Lines, treats all 3 lines as text. 3rd line is just 1 character
  1566. ' Example format:
  1567. ' DMD "text1","text2","backpicture", eNone, eNone, eNone, 250, True, "sound"
  1568. ' Short names:
  1569. ' dq = display queue
  1570. ' de = display effect
  1571. ' *************************************************************************
  1572.  
  1573. Const eNone = 0 ' Instantly displayed
  1574. Const eScrollLeft = 1 ' scroll on from the right
  1575. Const eScrollRight = 2 ' scroll on from the left
  1576. Const eBlink = 3 ' Blink (blinks for 'TimeOn')
  1577. Const eBlinkFast = 4 ' Blink (blinks for 'TimeOn') at user specified intervals (fast speed)
  1578.  
  1579. Const dqSize = 64
  1580.  
  1581. Dim dqHead
  1582. Dim dqTail
  1583. Dim deSpeed
  1584. Dim deBlinkSlowRate
  1585. Dim deBlinkFastRate
  1586.  
  1587. Dim dCharsPerLine(2)
  1588. Dim dLine(2)
  1589. Dim deCount(2)
  1590. Dim deCountEnd(2)
  1591. Dim deBlinkCycle(2)
  1592.  
  1593. Dim dqText(2, 64)
  1594. Dim dqEffect(2, 64)
  1595. Dim dqTimeOn(64)
  1596. Dim dqbFlush(64)
  1597. Dim dqSound(64)
  1598.  
  1599. Dim FlexDMD
  1600. Dim DMDScene
  1601.  
  1602. Sub DMD_Init() 'default/startup values
  1603. Set FlexDMD = CreateObject("FlexDMD.FlexDMD")
  1604. If Not FlexDMD is Nothing Then
  1605. FlexDMD.TableFile = Table1.Filename & ".vpx"
  1606. FlexDMD.RenderMode = 2
  1607. FlexDMD.Width = 128
  1608. FlexDMD.Height = 36
  1609. FlexDMD.Clear = True
  1610. FlexDMD.GameName = cGameName
  1611. FlexDMD.Run = True
  1612. Set DMDScene = FlexDMD.NewGroup("Scene")
  1613. DMDScene.AddActor FlexDMD.NewImage("Back", "VPX.bkempty")
  1614. DMDScene.GetImage("Back").SetSize FlexDMD.Width, FlexDMD.Height
  1615. DigitsBack(0).Visible = False
  1616. For i = 0 to 35
  1617. DMDScene.AddActor FlexDMD.NewImage("Dig" & i, "VPX.dempty&dmd=2")
  1618. Digits(i).Visible = False
  1619. Next
  1620. For i = 0 to 19 ' Bottom
  1621. DMDScene.GetImage("Dig" & i).SetBounds 4 + i * 6, 3 + 16 + 2, 8, 8
  1622. Next
  1623. For i = 20 to 35 ' Top
  1624. DMDScene.GetImage("Dig" & i).SetBounds (i - 20) * 8, 3, 8, 16
  1625. Next
  1626. FlexDMD.LockRenderThread
  1627. FlexDMD.Stage.AddActor DMDScene
  1628. FlexDMD.UnlockRenderThread
  1629. End If
  1630.  
  1631. Dim i, j
  1632. DMDFlush()
  1633. deSpeed = 20
  1634. deBlinkSlowRate = 5
  1635. deBlinkFastRate = 2
  1636. dCharsPerLine(0) = 16
  1637. dCharsPerLine(1) = 20
  1638. dCharsPerLine(2) = 1
  1639. For i = 0 to 2
  1640. dLine(i) = Space(dCharsPerLine(i) )
  1641. deCount(i) = 0
  1642. deCountEnd(i) = 0
  1643. deBlinkCycle(i) = 0
  1644. dqTimeOn(i) = 0
  1645. dqbFlush(i) = True
  1646. dqSound(i) = ""
  1647. Next
  1648. For i = 0 to 2
  1649. For j = 0 to 64
  1650. dqText(i, j) = ""
  1651. dqEffect(i, j) = eNone
  1652. Next
  1653. Next
  1654. DMD dLine(0), dLine(1), dLine(2), eNone, eNone, eNone, 25, True, ""
  1655. End Sub
  1656.  
  1657. Sub DMDFlush()
  1658. Dim i
  1659. DMDTimer.Enabled = False
  1660. DMDEffectTimer.Enabled = False
  1661. dqHead = 0
  1662. dqTail = 0
  1663. For i = 0 to 2
  1664. deCount(i) = 0
  1665. deCountEnd(i) = 0
  1666. deBlinkCycle(i) = 0
  1667. Next
  1668. End Sub
  1669.  
  1670. Sub DMDScore()
  1671. Dim tmp, tmp1, tmp2
  1672. if(dqHead = dqTail) Then
  1673. tmp = RL(0, FormatScore(Score(Currentplayer) ) )
  1674. 'tmp = CL(0, FormatScore(Score(Currentplayer) ) )
  1675. tmp1 = CL(1, "PLAYER" & CurrentPlayer & " [" & Balls & " \" & PokemonBonus(CurrentPlayer) & " ]" & Coins(Currentplayer) )
  1676. 'tmp1 = CL(1, "PLAYER " & CurrentPlayer & " BALL " & Balls)
  1677. 'tmp1 = FormatScore(Bonuspoints(Currentplayer) ) & " X" &BonusMultiplier(Currentplayer)
  1678. tmp2 = ""
  1679. If bCatchemMode Then
  1680. tmp1 = RL(1, CatchMaxHits-CatchHits & " HITS LEFT")
  1681. tmp2 = pokemon(CatchID)
  1682. End If
  1683. End If
  1684. DMD tmp, tmp1, tmp2, eNone, eNone, eNone, 25, True, ""
  1685. End Sub
  1686.  
  1687. Sub DMDScoreNow
  1688. DMDFlush
  1689. DMDScore
  1690. End Sub
  1691.  
  1692. Sub DMD(Text0, Text1, Text2, Effect0, Effect1, Effect2, TimeOn, bFlush, Sound)
  1693. if(dqTail <dqSize) Then
  1694. if(Text0 = "_") Then
  1695. dqEffect(0, dqTail) = eNone
  1696. dqText(0, dqTail) = "_"
  1697. Else
  1698. dqEffect(0, dqTail) = Effect0
  1699. dqText(0, dqTail) = ExpandLine(Text0, 0)
  1700. End If
  1701.  
  1702. if(Text1 = "_") Then
  1703. dqEffect(1, dqTail) = eNone
  1704. dqText(1, dqTail) = "_"
  1705. Else
  1706. dqEffect(1, dqTail) = Effect1
  1707. dqText(1, dqTail) = ExpandLine(Text1, 1)
  1708. End If
  1709.  
  1710. if(Text2 = "_") Then
  1711. dqEffect(2, dqTail) = eNone
  1712. dqText(2, dqTail) = "_"
  1713. Else
  1714. dqEffect(2, dqTail) = Effect2
  1715. dqText(2, dqTail) = Text2 'it is always 1 letter in this table
  1716. End If
  1717.  
  1718. dqTimeOn(dqTail) = TimeOn
  1719. dqbFlush(dqTail) = bFlush
  1720. dqSound(dqTail) = Sound
  1721. dqTail = dqTail + 1
  1722. if(dqTail = 1) Then
  1723. DMDHead()
  1724. End If
  1725. End If
  1726. End Sub
  1727.  
  1728. Sub DMDHead()
  1729. Dim i
  1730. deCount(0) = 0
  1731. deCount(1) = 0
  1732. deCount(2) = 0
  1733. DMDEffectTimer.Interval = deSpeed
  1734.  
  1735. For i = 0 to 2
  1736. Select Case dqEffect(i, dqHead)
  1737. Case eNone:deCountEnd(i) = 1
  1738. Case eScrollLeft:deCountEnd(i) = Len(dqText(i, dqHead) )
  1739. Case eScrollRight:deCountEnd(i) = Len(dqText(i, dqHead) )
  1740. Case eBlink:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  1741. deBlinkCycle(i) = 0
  1742. Case eBlinkFast:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  1743. deBlinkCycle(i) = 0
  1744. End Select
  1745. Next
  1746. if(dqSound(dqHead) <> "") Then
  1747. PlaySound(dqSound(dqHead) )
  1748. End If
  1749. DMDEffectTimer.Enabled = True
  1750. End Sub
  1751.  
  1752. Sub DMDEffectTimer_Timer()
  1753. DMDEffectTimer.Enabled = False
  1754. DMDProcessEffectOn()
  1755. End Sub
  1756.  
  1757. Sub DMDTimer_Timer()
  1758. Dim Head
  1759. DMDTimer.Enabled = False
  1760. Head = dqHead
  1761. dqHead = dqHead + 1
  1762. if(dqHead = dqTail) Then
  1763. if(dqbFlush(Head) = True) Then
  1764. DMDScoreNow()
  1765. Else
  1766. dqHead = 0
  1767. DMDHead()
  1768. End If
  1769. Else
  1770. DMDHead()
  1771. End If
  1772. End Sub
  1773.  
  1774. Sub DMDProcessEffectOn()
  1775. Dim i
  1776. Dim BlinkEffect
  1777. Dim Temp
  1778.  
  1779. BlinkEffect = False
  1780.  
  1781. For i = 0 to 2
  1782. if(deCount(i) <> deCountEnd(i) ) Then
  1783. deCount(i) = deCount(i) + 1
  1784.  
  1785. select case(dqEffect(i, dqHead) )
  1786. case eNone:
  1787. Temp = dqText(i, dqHead)
  1788. case eScrollLeft:
  1789. Temp = Right(dLine(i), dCharsPerLine(i) - 1)
  1790. Temp = Temp & Mid(dqText(i, dqHead), deCount(i), 1)
  1791. case eScrollRight:
  1792. Temp = Mid(dqText(i, dqHead), (dCharsPerLine(i) + 1) - deCount(i), 1)
  1793. Temp = Temp & Left(dLine(i), dCharsPerLine(i) - 1)
  1794. case eBlink:
  1795. BlinkEffect = True
  1796. if((deCount(i) MOD deBlinkSlowRate) = 0) Then
  1797. deBlinkCycle(i) = deBlinkCycle(i) xor 1
  1798. End If
  1799.  
  1800. if(deBlinkCycle(i) = 0) Then
  1801. Temp = dqText(i, dqHead)
  1802. Else
  1803. Temp = Space(dCharsPerLine(i) )
  1804. End If
  1805. case eBlinkFast:
  1806. BlinkEffect = True
  1807. if((deCount(i) MOD deBlinkFastRate) = 0) Then
  1808. deBlinkCycle(i) = deBlinkCycle(i) xor 1
  1809. End If
  1810.  
  1811. if(deBlinkCycle(i) = 0) Then
  1812. Temp = dqText(i, dqHead)
  1813. Else
  1814. Temp = Space(dCharsPerLine(i) )
  1815. End If
  1816. End Select
  1817.  
  1818. if(dqText(i, dqHead) <> "_") Then
  1819. dLine(i) = Temp
  1820. DMDUpdate i
  1821. End If
  1822. End If
  1823. Next
  1824.  
  1825. if(deCount(0) = deCountEnd(0) ) and(deCount(1) = deCountEnd(1) ) and(deCount(2) = deCountEnd(2) ) Then
  1826.  
  1827. if(dqTimeOn(dqHead) = 0) Then
  1828. DMDFlush()
  1829. Else
  1830. if(BlinkEffect = True) Then
  1831. DMDTimer.Interval = 10
  1832. Else
  1833. DMDTimer.Interval = dqTimeOn(dqHead)
  1834. End If
  1835.  
  1836. DMDTimer.Enabled = True
  1837. End If
  1838. Else
  1839. DMDEffectTimer.Enabled = True
  1840. End If
  1841. End Sub
  1842.  
  1843. Function ExpandLine(TempStr, id) 'id is the number of the dmd line
  1844. If TempStr = "" Then
  1845. TempStr = Space(dCharsPerLine(id) )
  1846. Else
  1847. if(Len(TempStr)> Space(dCharsPerLine(id) ) ) Then
  1848. TempStr = Left(TempStr, Space(dCharsPerLine(id) ) )
  1849. Else
  1850. if(Len(TempStr) <dCharsPerLine(id) ) Then
  1851. TempStr = TempStr & Space(dCharsPerLine(id) - Len(TempStr) )
  1852. End If
  1853. End If
  1854. End If
  1855. ExpandLine = TempStr
  1856. End Function
  1857.  
  1858. Function FormatScore(ByVal Num) 'it returns a string with commas (as in Black's original font)
  1859. dim i
  1860. dim NumString
  1861.  
  1862. NumString = CStr(abs(Num) )
  1863.  
  1864. For i = Len(NumString) -3 to 1 step -3
  1865. if IsNumeric(mid(NumString, i, 1) ) then
  1866. NumString = left(NumString, i-1) & chr(asc(mid(NumString, i, 1) ) + 48) & right(NumString, Len(NumString) - i)
  1867. end if
  1868. Next
  1869. FormatScore = NumString
  1870. End function
  1871.  
  1872. Function CL(id, NumString)
  1873. Dim Temp, TempStr
  1874. Temp = (dCharsPerLine(id) - Len(NumString) ) \ 2
  1875. TempStr = Space(Temp) & NumString & Space(Temp)
  1876. CL = TempStr
  1877. End Function
  1878.  
  1879. Function RL(id, NumString)
  1880. Dim Temp, TempStr
  1881. Temp = dCharsPerLine(id) - Len(NumString)
  1882. TempStr = Space(Temp) & NumString
  1883. RL = TempStr
  1884. End Function
  1885.  
  1886. '**************
  1887. ' Update DMD
  1888. '**************
  1889.  
  1890. Sub DMDUpdate(id)
  1891. Dim digit, value
  1892.  
  1893. If Not FlexDMD is Nothing Then FlexDMD.LockRenderThread
  1894. Select Case id
  1895. Case 0 'top text line
  1896. For digit = 20 to 35
  1897. DMDDisplayChar mid(dLine(0), digit-19, 1), digit
  1898. Next
  1899. Case 1 'bottom text line
  1900. For digit = 0 to 19
  1901. DMDDisplayChar mid(dLine(1), digit + 1, 1), digit
  1902. Next
  1903. Case 2 ' back image - back animations
  1904. If dLine(2) = "" OR dLine(2) = " " Then dLine(2) = "bkempty"
  1905. DigitsBack(0).ImageA = dLine(2)
  1906. If Not FlexDMD is Nothing Then DMDScene.GetImage("Back").Bitmap = FlexDMD.NewImage("", "VPX." & dLine(2) & "&dmd=2").Bitmap
  1907. End Select
  1908. If Not FlexDMD is Nothing Then FlexDMD.UnlockRenderThread
  1909. End Sub
  1910.  
  1911. Sub DMDDisplayChar(achar, adigit)
  1912. If achar = "" Then achar = " "
  1913. achar = ASC(achar)
  1914. Digits(adigit).ImageA = Chars(achar)
  1915. If Not FlexDMD is Nothing Then DMDScene.GetImage("Dig" & adigit).Bitmap = FlexDMD.NewImage("", "VPX." & Chars(achar) & "&dmd=2&add").Bitmap
  1916. End Sub
  1917.  
  1918. '****************************
  1919. ' JP's new DMD using flashers
  1920. '****************************
  1921.  
  1922. Dim Digits, DigitsBack, Chars(255), Images(255)
  1923.  
  1924. DMDInit
  1925.  
  1926. Sub DMDInit
  1927. Dim i
  1928. Digits = Array(digit0, digit1, digit2, digit3, digit4, digit5, digit6, digit7, digit8, digit9, digit10, digit11, _
  1929. digit12, digit13, digit14, digit15, digit16, digit17, digit18, digit19, digit20, digit21, digit22, digit23, digit24, digit25, _
  1930. digit26, digit27, digit28, digit29, digit30, digit31, digit32, digit33, digit34, digit35)
  1931. DigitsBack = Array(digit36)
  1932.  
  1933. For i = 0 to 255:Chars(i) = "dempty":Images(i) = "dempty":Next
  1934.  
  1935. Chars(32) = "dempty"
  1936. ' Chars(34) = '"
  1937. ' Chars(36) = '$
  1938. ' Chars(39) = ''
  1939. ' Chars(42) = '*
  1940. ' Chars(43) = '+
  1941. ' Chars(45) = '-
  1942. ' Chars(47) = '/
  1943. Chars(48) = "d0" '0
  1944. Chars(49) = "d1" '1
  1945. Chars(50) = "d2" '2
  1946. Chars(51) = "d3" '3
  1947. Chars(52) = "d4" '4
  1948. Chars(53) = "d5" '5
  1949. Chars(54) = "d6" '6
  1950. Chars(55) = "d7" '7
  1951. Chars(56) = "d8" '8
  1952. Chars(57) = "d9" '9
  1953. Chars(60) = "dless" '<
  1954. Chars(61) = "dequal" '=
  1955. Chars(62) = "dmore" '>
  1956. ' Chars(64) = '@
  1957. Chars(65) = "da" 'A
  1958. Chars(66) = "db" 'B
  1959. Chars(67) = "dc" 'C
  1960. Chars(68) = "dd" 'D
  1961. Chars(69) = "de" 'E
  1962. Chars(70) = "df" 'F
  1963. Chars(71) = "dg" 'G
  1964. Chars(72) = "dh" 'H
  1965. Chars(73) = "di" 'I
  1966. Chars(74) = "dj" 'J
  1967. Chars(75) = "dk" 'K
  1968. Chars(76) = "dl" 'L
  1969. Chars(77) = "dm" 'M
  1970. Chars(78) = "dn" 'N
  1971. Chars(79) = "do" 'O
  1972. Chars(80) = "dp" 'P
  1973. Chars(81) = "dq" 'Q
  1974. Chars(82) = "dr" 'R
  1975. Chars(83) = "ds" 'S
  1976. Chars(84) = "dt" 'T
  1977. Chars(85) = "du" 'U
  1978. Chars(86) = "dv" 'V
  1979. Chars(87) = "dw" 'W
  1980. Chars(88) = "dx" 'X
  1981. Chars(89) = "dy" 'Y
  1982. Chars(90) = "dz" 'Z
  1983. Chars(91) = "dball" '[
  1984. Chars(92) = "dcoin" '|
  1985. Chars(93) = "dpika" ']
  1986. ' Chars(94) = '^
  1987. ' Chars(95) = '_
  1988. Chars(96) = "d0a" '0.
  1989. Chars(97) = "d1a" '1.
  1990. Chars(98) = "d2a" '2.
  1991. Chars(99) = "d3a" '3.
  1992. Chars(100) = "d4a" '4.
  1993. Chars(101) = "d5a" '5.
  1994. Chars(102) = "d6a" '6.
  1995. Chars(103) = "d7a" '7.
  1996. Chars(104) = "d8a" '8.
  1997. Chars(105) = "d9a" '9
  1998. End Sub
  1999.  
  2000. '****************************************
  2001. ' Real Time updatess using the GameTimer
  2002. '****************************************
  2003. 'used for all the real time updates
  2004.  
  2005. Sub GameTimer_Timer
  2006. RollingUpdate
  2007. coin.RotX = Spinner.CurrentAngle
  2008. End Sub
  2009.  
  2010. '********************************************************************************************
  2011. ' Only for VPX 10.2 and higher.
  2012. ' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  2013. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  2014. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  2015. '********************************************************************************************
  2016.  
  2017. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first version
  2018.  
  2019. If TypeName(MyLight) = "Light" Then
  2020.  
  2021. If FinalState = 2 Then
  2022. FinalState = MyLight.State 'Keep the current light state
  2023. End If
  2024. MyLight.BlinkInterval = BlinkPeriod
  2025. MyLight.Duration 2, TotalPeriod, FinalState
  2026. ElseIf TypeName(MyLight) = "Flasher" Then
  2027.  
  2028. Dim steps
  2029.  
  2030. If MyLight.Name = "Flasher9" or MyLight.Name = "Flasher8" or MyLight.Name = "Flasher10" or MyLight.Name = "Flasher11" or MyLight.Name = "Flasher12" Then
  2031. Dim flasherNumber
  2032. flasherNumber = Split(MyLight.Name, "r")
  2033. DOF CInt(flasherNumber(1) ) + 200, DOFPulse
  2034. End If
  2035. ' Store all blink information
  2036. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  2037. If FinalState = 2 Then 'Keep the current flasher state
  2038. FinalState = ABS(MyLight.Visible)
  2039. End If
  2040. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  2041.  
  2042. ' Start blink timer and create timer subroutine
  2043. MyLight.TimerInterval = BlinkPeriod
  2044. MyLight.TimerEnabled = 0
  2045. MyLight.TimerEnabled = 1
  2046. 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"
  2047. End If
  2048. End Sub
  2049.  
  2050. '******************************************
  2051. ' Change light color - simulate color leds
  2052. ' changes the light color and state
  2053. ' colors: red, orange, yellow, green, blue, white
  2054. '******************************************
  2055.  
  2056. Sub SetLightColor(n, col, stat)
  2057. Select Case col
  2058. Case "red"
  2059. n.color = RGB(18, 0, 0)
  2060. n.colorfull = RGB(255, 0, 0)
  2061. Case "orange"
  2062. n.color = RGB(18, 3, 0)
  2063. n.colorfull = RGB(255, 64, 0)
  2064. Case "yellow"
  2065. n.color = RGB(18, 18, 0)
  2066. n.colorfull = RGB(255, 255, 0)
  2067. Case "green"
  2068. n.color = RGB(0, 18, 0)
  2069. n.colorfull = RGB(0, 255, 0)
  2070. Case "blue"
  2071. n.color = RGB(0, 18, 18)
  2072. n.colorfull = RGB(0, 255, 255)
  2073. Case "white"
  2074. n.color = RGB(193, 91, 0)
  2075. n.colorfull = RGB(255, 252, 224)
  2076. End Select
  2077. If stat <> -1 Then
  2078. n.State = 0
  2079. n.State = stat
  2080. End If
  2081. End Sub
  2082.  
  2083. ' ********************************
  2084. ' Table info & Attract Mode
  2085. ' ********************************
  2086.  
  2087. Sub ShowTableInfo
  2088. Dim ii
  2089. 'info goes in a loop only stopped by the credits and the startkey
  2090. If Score(1) Then
  2091. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER1 " &FormatScore(Score(1) ) ), "", eNone, eNone, eNone, 3000, False, ""
  2092. If PokemonBonus(1) Then
  2093. DMD "", "EVIDENCE FOUND " & PokemonBonus(1), "", eNone, eNone, eNone, 1000, False, ""
  2094. For ii = 1 to PokemonBonus(1)
  2095. DMD "", "", Pokemon(PokemonCaught(1, ii) ), eNone, eNone, eNone, 1000, False, ""
  2096. Next
  2097. DMD "", "BONUS AWARDED " & EggBonus(1), "", eNone, eNone, eNone, 1000, False, ""
  2098. End If
  2099. End If
  2100. If Score(2) Then
  2101. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER2 " &FormatScore(Score(2) ) ), "", eNone, eNone, eNone, 3000, False, ""
  2102. If PokemonBonus(2) Then
  2103. DMD "", "EVIDENCE FOUND " & PokemonBonus(2), "", eNone, eNone, eNone, 1000, False, ""
  2104. For ii = 1 to PokemonBonus(2)
  2105. DMD "", "", Pokemon(PokemonCaught(2, ii) ), eNone, eNone, eNone, 1000, False, ""
  2106. Next
  2107. DMD "", "BONUS AWARDED " & EggBonus(2), "", eNone, eNone, eNone, 1000, False, ""
  2108. End If
  2109. End If
  2110. If Score(3) Then
  2111. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER3 " &FormatScore(Score(3) ) ), "", eNone, eNone, eNone, 3000, False, ""
  2112. If PokemonBonus(3) Then
  2113. DMD "", "EVIDENCE FOUND " & PokemonBonus(3), "", eNone, eNone, eNone, 1000, False, ""
  2114. For ii = 1 to PokemonBonus(3)
  2115. DMD "", "", Pokemon(PokemonCaught(3, ii) ), eNone, eNone, eNone, 1000, False, ""
  2116. Next
  2117. DMD "", "BONUS AWARDED " & EggBonus(3), "", eNone, eNone, eNone, 1000, False, ""
  2118. End If
  2119. End If
  2120. If Score(4) Then
  2121. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER4 " &FormatScore(Score(4) ) ), "", eNone, eNone, eNone, 3000, False, ""
  2122. If PokemonBonus(4) Then
  2123. DMD "", "EVIDENCE FOUND" & PokemonBonus(4), "", eNone, eNone, eNone, 1000, False, ""
  2124. For ii = 1 to PokemonBonus(4)
  2125. DMD "", "", Pokemon(PokemonCaught(4, ii) ), eNone, eNone, eNone, 1000, False, ""
  2126. Next
  2127. DMD "", "BONUS AWARDED " & EggBonus(4), "", eNone, eNone, eNone, 1000, False, ""
  2128. End If
  2129. End If
  2130. DMD "", "", "gameover", eNone, eNone, eBlink, 2000, False, ""
  2131. If bFreePlay Then
  2132. DMD "", CL(1, "FREE PLAY"), "", eNone, eBlink, eNone, 2000, False, ""
  2133. Else
  2134. If Credits> 0 Then
  2135. DMD CL(0, "CREDITS " & Credits), CL(1, "PRESS START"), "", eNone, eBlink, eNone, 2000, False, ""
  2136. Else
  2137. DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 2000, False, ""
  2138. End If
  2139. End If
  2140. DMD "", "", "jppresents", eNone, eNone, eNone, 3000, False, ""
  2141. DMD "", "", "pokemonpinball", eNone, eNone, eNone, 4000, False, ""
  2142. DMD CL(0, "HIGHSCORES"), Space(dCharsPerLine(1) ), "", eScrollLeft, eScrollLeft, eNone, 20, False, ""
  2143. DMD CL(0, "HIGHSCORES"), "", "", eBlinkFast, eNone, eNone, 1000, False, ""
  2144. DMD CL(0, "HIGHSCORES"), "1> " &HighScoreName(0) & " " &FormatScore(HighScore(0) ), "", eNone, eScrollLeft, eNone, 2000, False, ""
  2145. DMD "_", "2> " &HighScoreName(1) & " " &FormatScore(HighScore(1) ), "", eNone, eScrollLeft, eNone, 2000, False, ""
  2146. DMD "_", "3> " &HighScoreName(2) & " " &FormatScore(HighScore(2) ), "", eNone, eScrollLeft, eNone, 2000, False, ""
  2147. DMD "_", "4> " &HighScoreName(3) & " " &FormatScore(HighScore(3) ), "", eNone, eScrollLeft, eNone, 2000, False, ""
  2148. DMD Space(dCharsPerLine(0) ), Space(dCharsPerLine(1) ), "", eScrollLeft, eScrollLeft, eNone, 500, False, ""
  2149. End Sub
  2150.  
  2151. Sub StartAttractMode(dummy)
  2152. ChangeSong
  2153. StartLightSeq
  2154. DMDFlush
  2155. ShowTableInfo
  2156. End Sub
  2157.  
  2158. Sub StopAttractMode
  2159. Dim bulb
  2160. DMDScoreNow
  2161. LightSeqAttract.StopPlay
  2162. 'StopSong
  2163. End Sub
  2164.  
  2165. Sub StartLightSeq()
  2166. 'lights sequences
  2167. LightSeqAttract.UpdateInterval = 25
  2168. LightSeqAttract.Play SeqBlinking, , 5, 150
  2169. LightSeqAttract.Play SeqRandom, 40, , 4000
  2170. LightSeqAttract.Play SeqAllOff
  2171. LightSeqAttract.UpdateInterval = 8
  2172. LightSeqAttract.Play SeqUpOn, 50, 1
  2173. LightSeqAttract.UpdateInterval = 8
  2174. LightSeqAttract.Play SeqDownOn, 25, 1
  2175. LightSeqAttract.UpdateInterval = 8
  2176. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2177. LightSeqAttract.UpdateInterval = 8
  2178. LightSeqAttract.Play SeqUpOn, 25, 1
  2179. LightSeqAttract.UpdateInterval = 8
  2180. LightSeqAttract.Play SeqDownOn, 25, 1
  2181. LightSeqAttract.UpdateInterval = 8
  2182. LightSeqAttract.Play SeqUpOn, 25, 1
  2183. LightSeqAttract.UpdateInterval = 8
  2184. LightSeqAttract.Play SeqDownOn, 25, 1
  2185. LightSeqAttract.UpdateInterval = 10
  2186. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2187. LightSeqAttract.UpdateInterval = 5
  2188. LightSeqAttract.Play SeqRightOn, 50, 1
  2189. LightSeqAttract.UpdateInterval = 5
  2190. LightSeqAttract.Play SeqLeftOn, 50, 1
  2191. LightSeqAttract.UpdateInterval = 8
  2192. LightSeqAttract.Play SeqRightOn, 50, 1
  2193. LightSeqAttract.UpdateInterval = 8
  2194. LightSeqAttract.Play SeqLeftOn, 50, 1
  2195. LightSeqAttract.UpdateInterval = 8
  2196. LightSeqAttract.Play SeqRightOn, 40, 1
  2197. LightSeqAttract.UpdateInterval = 8
  2198. LightSeqAttract.Play SeqLeftOn, 40, 1
  2199. LightSeqAttract.UpdateInterval = 10
  2200. LightSeqAttract.Play SeqRightOn, 30, 1
  2201. LightSeqAttract.UpdateInterval = 10
  2202. LightSeqAttract.Play SeqLeftOn, 30, 1
  2203. LightSeqAttract.UpdateInterval = 8
  2204. LightSeqAttract.Play SeqRightOn, 25, 1
  2205. LightSeqAttract.UpdateInterval = 8
  2206. LightSeqAttract.Play SeqLeftOn, 25, 1
  2207. LightSeqAttract.UpdateInterval = 8
  2208. LightSeqAttract.Play SeqRightOn, 15, 1
  2209. LightSeqAttract.UpdateInterval = 8
  2210. LightSeqAttract.Play SeqLeftOn, 15, 1
  2211. LightSeqAttract.UpdateInterval = 10
  2212. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2213. LightSeqAttract.UpdateInterval = 8
  2214. LightSeqAttract.Play SeqLeftOn, 25, 1
  2215. LightSeqAttract.UpdateInterval = 8
  2216. LightSeqAttract.Play SeqRightOn, 25, 1
  2217. LightSeqAttract.UpdateInterval = 8
  2218. LightSeqAttract.Play SeqLeftOn, 25, 1
  2219. LightSeqAttract.UpdateInterval = 8
  2220. LightSeqAttract.Play SeqUpOn, 25, 1
  2221. LightSeqAttract.UpdateInterval = 8
  2222. LightSeqAttract.Play SeqDownOn, 25, 1
  2223. LightSeqAttract.UpdateInterval = 8
  2224. LightSeqAttract.Play SeqUpOn, 25, 1
  2225. LightSeqAttract.UpdateInterval = 8
  2226. LightSeqAttract.Play SeqDownOn, 25, 1
  2227. LightSeqAttract.UpdateInterval = 5
  2228. LightSeqAttract.Play SeqStripe1VertOn, 50, 2
  2229. LightSeqAttract.UpdateInterval = 8
  2230. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2231. LightSeqAttract.UpdateInterval = 8
  2232. LightSeqAttract.Play SeqStripe1VertOn, 50, 3
  2233. LightSeqAttract.UpdateInterval = 8
  2234. LightSeqAttract.Play SeqLeftOn, 25, 1
  2235. LightSeqAttract.UpdateInterval = 8
  2236. LightSeqAttract.Play SeqRightOn, 25, 1
  2237. LightSeqAttract.UpdateInterval = 8
  2238. LightSeqAttract.Play SeqLeftOn, 25, 1
  2239. LightSeqAttract.UpdateInterval = 8
  2240. LightSeqAttract.Play SeqUpOn, 25, 1
  2241. LightSeqAttract.UpdateInterval = 8
  2242. LightSeqAttract.Play SeqDownOn, 25, 1
  2243. LightSeqAttract.UpdateInterval = 8
  2244. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2245. LightSeqAttract.UpdateInterval = 8
  2246. LightSeqAttract.Play SeqStripe2VertOn, 50, 3
  2247. LightSeqAttract.UpdateInterval = 8
  2248. LightSeqAttract.Play SeqLeftOn, 25, 1
  2249. LightSeqAttract.UpdateInterval = 8
  2250. LightSeqAttract.Play SeqRightOn, 25, 1
  2251. LightSeqAttract.UpdateInterval = 8
  2252. LightSeqAttract.Play SeqLeftOn, 25, 1
  2253. LightSeqAttract.UpdateInterval = 8
  2254. LightSeqAttract.Play SeqUpOn, 25, 1
  2255. LightSeqAttract.UpdateInterval = 8
  2256. LightSeqAttract.Play SeqDownOn, 25, 1
  2257. LightSeqAttract.UpdateInterval = 8
  2258. LightSeqAttract.Play SeqUpOn, 25, 1
  2259. LightSeqAttract.UpdateInterval = 8
  2260. LightSeqAttract.Play SeqDownOn, 25, 1
  2261. LightSeqAttract.UpdateInterval = 8
  2262. LightSeqAttract.Play SeqStripe1VertOn, 25, 3
  2263. LightSeqAttract.UpdateInterval = 8
  2264. LightSeqAttract.Play SeqStripe2VertOn, 25, 3
  2265. LightSeqAttract.UpdateInterval = 8
  2266. LightSeqAttract.Play SeqUpOn, 15, 1
  2267. LightSeqAttract.UpdateInterval = 8
  2268. LightSeqAttract.Play SeqDownOn, 15, 1
  2269. LightSeqAttract.UpdateInterval = 8
  2270. LightSeqAttract.Play SeqUpOn, 15, 1
  2271. LightSeqAttract.UpdateInterval = 8
  2272. LightSeqAttract.Play SeqDownOn, 15, 1
  2273. LightSeqAttract.UpdateInterval = 8
  2274. LightSeqAttract.Play SeqUpOn, 15, 1
  2275. LightSeqAttract.UpdateInterval = 8
  2276. LightSeqAttract.Play SeqDownOn, 15, 1
  2277. LightSeqAttract.UpdateInterval = 8
  2278. LightSeqAttract.Play SeqRightOn, 15, 1
  2279. LightSeqAttract.UpdateInterval = 8
  2280. LightSeqAttract.Play SeqLeftOn, 15, 1
  2281. LightSeqAttract.UpdateInterval = 8
  2282. LightSeqAttract.Play SeqRightOn, 15, 1
  2283. LightSeqAttract.UpdateInterval = 8
  2284. LightSeqAttract.Play SeqLeftOn, 15, 1
  2285. End Sub
  2286.  
  2287. Sub LightSeqAttract_PlayDone()
  2288. StartLightSeq()
  2289. End Sub
  2290.  
  2291. Sub LightSeqTilt_PlayDone()
  2292. LightSeqTilt.Play SeqAllOff
  2293. End Sub
  2294.  
  2295. '***********************************************************************
  2296. ' *********************************************************************
  2297. ' Table Specific Script Starts Here
  2298. ' *********************************************************************
  2299. '***********************************************************************
  2300.  
  2301. ' tables walls and animations
  2302. Sub VPObjects_Init
  2303. End Sub
  2304.  
  2305. ' tables variables and modes init
  2306.  
  2307. Dim Coins(4)
  2308. Dim BumperBonus, EggBonus(4), HoleBonus, PokemonBonus(4), PokemonBonusAward(4), PokemonCaught(4, 151), TargetBonus
  2309.  
  2310. Sub Game_Init()
  2311. Dim ii, jj
  2312. bExtraBallWonThisBall = False
  2313. TurnOffPlayfieldLights()
  2314. 'Play some Music
  2315. ChangeSong
  2316. 'Init Variables
  2317. Jackpot = 250000
  2318. RattataPos = 0
  2319. bumperHits = 100
  2320. BumperBonus = 0
  2321. PikachuHits = 0
  2322. CatchHits = 0
  2323. BallInHole = 0
  2324. HoleBonus = 0
  2325. For ii = 1 to 4
  2326. PokemonBonus(ii) = 0
  2327. PokemonBonusAward(ii) = 0
  2328. EggBonus(ii) = 0
  2329. For jj = 0 to 151
  2330. PokemonCaught(ii, jj) = 0
  2331. Next
  2332. Next
  2333. TargetBonus = 0
  2334. PikachuTargetValue = 5000
  2335. ResetPokemonLevel
  2336. ResetHoleLights
  2337. BallType = 1:UpdateBallType
  2338. bCatchemMode = False
  2339. bEggTargetsCompleted = False
  2340. bLockEnabled = False
  2341. LockedBalls = 0
  2342. bcoinfrenzy = False
  2343. coinstep = 0
  2344. bPikachuTargetMode = False
  2345. bCharizardMode = False
  2346. bRampBonus = FALSE
  2347. bLoopBonus = FALSE
  2348. 'Init Delays
  2349. 'Skillshot Init
  2350. 'MainModes Init()
  2351. End Sub
  2352.  
  2353. Sub ResetSkillShotTimer_Timer
  2354. End Sub
  2355.  
  2356. Sub TurnOffPlayfieldLights()
  2357. Dim a
  2358. For each a in aLights
  2359. a.State = 0
  2360. Next
  2361. HatchLight1b.Visible = 0
  2362. HatchLight2b.Visible = 0
  2363. HatchLight3b.Visible = 0
  2364. HatchLight4b.Visible = 0
  2365. End Sub
  2366.  
  2367. Sub ResetNewBallLights()
  2368. LightArrow1.State = 2
  2369. LightArrow6.State = 2
  2370. l53.State = 2
  2371. End Sub
  2372.  
  2373. Dim RattataPos
  2374.  
  2375. Sub AnimateRattata()
  2376. RattataPos = 0
  2377. RattataTimer.Enabled = 1
  2378. End Sub
  2379.  
  2380. Sub RattataTimer_Timer()
  2381. Select Case RattataPos
  2382. Case 0:Rattata.TransY = 25:RattataPos = 1
  2383. Case 1:Rattata.TransY = 15:RattataPos = 2
  2384. Case 2:Rattata.TransY = 7:RattataPos = 3
  2385. Case 3:Rattata.TransY = 3:RattataPos = 4
  2386. Case 4:Rattata.TransY = 0:RattataTimer.Enabled = 0
  2387. End Select
  2388. End Sub
  2389.  
  2390. ' *********************************************************************
  2391. ' Table Object Hit Events
  2392. '
  2393. ' Any target hit Sub will follow this:
  2394. ' - play a sound
  2395. ' - do some physical movement
  2396. ' - add a score, bonus
  2397. ' - check some variables/modes this trigger is a member of
  2398. ' - set the "LastSwicthHit" variable in case it is needed later
  2399. ' *********************************************************************
  2400.  
  2401. ' Slingshots has been hit
  2402.  
  2403. Dim LStep, RStep
  2404.  
  2405.  
  2406. Sub LeftSlingShot_Slingshot
  2407. If Tilted Then Exit Sub
  2408. PlaySoundAt SoundFXDOF("fx_slingshot", 103, DOFPulse, DOFcontactors), Lemk
  2409. PlaySoundAt SoundFXDOF("left_slingshot", 103, DOFPulse, DOFcontactors), Lemk
  2410. DOF 105, DOFPulse
  2411. LeftSling4.Visible = 1:LeftSling1.Visible = 0
  2412. Lemk.RotX = 26
  2413. LStep = 0
  2414. LeftSlingShot.TimerEnabled = True
  2415. ' add some points
  2416. AddScore 110
  2417. ' add some effect to the table?
  2418. Bulbasaur.RotY = 26
  2419. Gi2.State = 0
  2420. ' remember last trigger hit by the ball
  2421. LastSwitchHit = "LeftSlingShot"
  2422. End Sub
  2423.  
  2424. Sub LeftSlingShot_Timer
  2425. Select Case LStep
  2426. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14:Bulbasaur.RotY = 14
  2427. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2:Bulbasaur.RotY = 2
  2428. Case 3:LeftSLing2.Visible = 0:LeftSling1.Visible = 1:Lemk.RotX = -10:Bulbasaur.RotY = 0:Gi2.State = 1:LeftSlingShot.TimerEnabled = False
  2429. End Select
  2430. LStep = LStep + 1
  2431. End Sub
  2432.  
  2433. Sub RightSlingShot_Slingshot
  2434. If Tilted Then Exit Sub
  2435. PlaySoundAt SoundFXDOF("fx_slingshot", 104, DOFPulse, DOFcontactors), Remk
  2436. PlaySoundAt SoundFXDOF("right_slingshot", 104, DOFPulse, DOFcontactors), Remk
  2437. DOF 106, DOFPulse
  2438. RightSling4.Visible = 1:RightSling1.Visible = 0
  2439. Remk.RotX = 26
  2440. RStep = 0
  2441. RightSlingShot.TimerEnabled = True
  2442. ' add some points
  2443. AddScore 110
  2444. ' add some effect to the table?
  2445. Squirtle.RotY = -26
  2446. Gi1.State = 0
  2447. ' remember last trigger hit by the ball
  2448. LastSwitchHit = "RightSlingShot"
  2449. End Sub
  2450.  
  2451. Sub RightSlingShot_Timer
  2452. Select Case RStep
  2453. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14:Squirtle.RotY = -14
  2454. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2:Squirtle.RotY = -2
  2455. Case 3:RightSLing2.Visible = 0:RightSLing1.Visible = 1:Remk.RotX = -10:Squirtle.RotY = 0:Gi1.State = 1:RightSlingShot.TimerEnabled = False
  2456. End Select
  2457. RStep = RStep + 1
  2458. End Sub
  2459.  
  2460. ' Hatch Slingshots
  2461.  
  2462. Dim LStep1, RStep1
  2463.  
  2464. Sub LeftSlingShot1_Slingshot
  2465. If Tilted Then Exit Sub
  2466. PlaySoundAt SoundFXDOF("fx_slingshot", 143, DOFPulse, DOFContactors), Lemk1
  2467. PlaySoundAt SoundFXDOF("left_slingshot", 143, DOFPulse, DOFContactors), Lemk1
  2468. Sling3a.Visible = 1:Sling3.Visible = 0
  2469. Lemk1.RotX = 26
  2470. LStep1 = 0
  2471. LeftSlingShot1.TimerEnabled = True
  2472. ' add some points
  2473. AddScore 510
  2474. ' remember last trigger hit by the ball
  2475. LastSwitchHit = "LeftSlingShot1"
  2476. ' add some effect to the table?
  2477. End Sub
  2478.  
  2479. Sub LeftSlingShot1_Timer
  2480. Select Case LStep1
  2481. Case 1:Sling3a.Visible = 0:Sling3b.Visible = 1:Lemk1.RotX = 14
  2482. Case 2:Sling3b.Visible = 0:Sling3c.Visible = 1:Lemk.RotX = 0
  2483. Case 3:Sling3c.Visible = 0:Sling3.Visible = 1:Lemk1.RotX = -20:LeftSlingShot1.TimerEnabled = False
  2484. End Select
  2485. LStep1 = LStep1 + 1
  2486. End Sub
  2487.  
  2488. Sub RightSlingShot1_Slingshot
  2489. If Tilted Then Exit Sub
  2490. PlaySoundAt SoundFXDOF("fx_slingshot", 144, DOFPulse, DOFContactors), Remk1
  2491. PlaySoundAt SoundFXDOF("right_slingshot", 144, DOFPulse, DOFContactors), Remk1
  2492. Sling2a.Visible = 1:Sling2.Visible = 0
  2493. Remk1.RotX = 26
  2494. RStep1 = 0
  2495. RightSlingShot1.TimerEnabled = True
  2496. ' add some points
  2497. AddScore 510
  2498. ' remember last trigger hit by the ball
  2499. LastSwitchHit = "RightSlingShot1"
  2500. ' add some effect to the table?
  2501. End Sub
  2502.  
  2503. Sub RightSlingShot1_Timer
  2504. Select Case RStep1
  2505. Case 1:Sling2a.Visible = 0:Sling2b.Visible = 1:Remk.RotX = 14
  2506. Case 2:Sling2b.Visible = 0:Sling2c.Visible = 1:Remk.RotX = 0
  2507. Case 3:Sling2c.Visible = 0:Sling2.Visible = 1:Remk1.RotX = -20:RightSlingShot1.TimerEnabled = False
  2508. End Select
  2509. RStep1 = RStep1 + 1
  2510. End Sub
  2511.  
  2512.  
  2513. '**********
  2514. ' Spinner
  2515. '**********
  2516.  
  2517. Sub Spinner_Spin()
  2518. If Tilted Then Exit Sub
  2519. PlaySoundAt "fx_spinner", Spinner
  2520. PlaySoundAt "spinner", Spinner
  2521. DOF 136, DOFPulse
  2522. AddScore 1000
  2523. AddCoin 1
  2524. End Sub
  2525.  
  2526. '*********************
  2527. ' Inlanes - Outlanes
  2528. '*********************
  2529.  
  2530. Sub LeftOutlaneTrigger_Hit()
  2531. DOF 132, DOFPulse
  2532. PlaySoundAt "fx_sensor", LeftOutlaneTrigger
  2533. If Tilted Then Exit Sub
  2534. PlaySoundEffect
  2535. AddScore 10000
  2536. Addcoin 50
  2537. FlashForMs Flasher9, 1000, 50, 0
  2538. FlashForMs Flasher8, 1000, 50, 0
  2539. FlashForMs Flasher10, 1000, 50, 0
  2540. TargetBonus = TargetBonus + 1
  2541. LeftOutlane.State = 1
  2542. LastSwitchHit = "LeftOutlaneTrigger"
  2543. CheckMultiplier
  2544. End Sub
  2545.  
  2546. Sub LeftInlaneTrigger1_Hit()
  2547. DOF 133, DOFPulse
  2548. PlaySoundAt "fx_sensor", LeftInlaneTrigger1
  2549. If Tilted Then Exit Sub
  2550. PlaySoundEffect
  2551. AddScore 3000
  2552. Addcoin 10
  2553. TargetBonus = TargetBonus + 1
  2554. LeftInlane1.State = 1
  2555. LastSwitchHit = "LeftInlaneTrigger1"
  2556. CheckMultiplier
  2557. End Sub
  2558.  
  2559. Sub LeftInlaneTrigger2_Hit()
  2560. DOF 133, DOFPulse
  2561. PlaySoundAt "fx_sensor", LeftInlaneTrigger2
  2562. If Tilted Then Exit Sub
  2563. PlaySoundEffect
  2564. AddScore 3000
  2565. Addcoin 10
  2566. TargetBonus = TargetBonus + 1
  2567. LeftInlane2.State = 1
  2568. LastSwitchHit = "LeftInlaneTrigger2"
  2569. CheckMultiplier
  2570. End Sub
  2571.  
  2572. Sub RightInlaneTrigger_Hit()
  2573. DOF 134, DOFPulse
  2574. PlaySoundAt "fx_sensor", RightInlaneTrigger
  2575. If Tilted Then Exit Sub
  2576. PlaySoundEffect
  2577. AddScore 3000
  2578. Addcoin 10
  2579. TargetBonus = TargetBonus + 1
  2580. RightInlane.State = 1
  2581. CheckMultiplier
  2582. LastSwitchHit = "RightInlaneTrigger"
  2583. End Sub
  2584.  
  2585. Sub RightOutlaneTrigger_Hit()
  2586. DOF 135, DOFPulse
  2587. PlaySoundAt "fx_sensor", RightOutlaneTrigger
  2588. If Tilted Then Exit Sub
  2589. PlaySoundEffect
  2590. AddScore 10000
  2591. Addcoin 50
  2592. FlashForMs Flasher9, 1000, 50, 0
  2593. FlashForMs Flasher8, 1000, 50, 0
  2594. FlashForMs Flasher10, 1000, 50, 0
  2595. TargetBonus = TargetBonus + 1
  2596. RightOutlane.State = 1
  2597. CheckMultiplier
  2598. LastSwitchHit = "RightOutlaneTrigger"
  2599. End Sub
  2600.  
  2601. Sub CheckMultiplier
  2602. If(LeftOutlane.State = 1) And(LeftInlane1.State = 1) And(LeftInlane2.State = 1) And(RightInlane.State = 1) And(RightOutlane.State = 1) Then
  2603. AddScore 50000
  2604. PlayFanfare
  2605. LightSeqLanes.Play SeqRandom, 5, , 3000
  2606. IncrementBonusMultiplier()
  2607. LeftOutlane.State = 0
  2608. LeftInlane1.State = 0
  2609. LeftInlane2.State = 0
  2610. RightInlane.State = 0
  2611. RightOutlane.State = 0
  2612. End If
  2613. End Sub
  2614.  
  2615. Sub EggEntrance_Hit() 'diode switch used for catching pokemons & other modes
  2616. If bcoinfrenzy AND CoinLight2.State = 2 Then
  2617. Addcoin 50
  2618. PlaySound "fx_coins"
  2619. FlashForMs Flasher9, 1000, 50, 0
  2620. FlashForMs Flasher8, 1000, 50, 0
  2621. FlashForMs Flasher10, 1000, 50, 0
  2622. CoinFrenzyTimer_Timer
  2623. End If
  2624. If bCatchemMode Then
  2625. If CatchLight2.State = 2 Then
  2626. Addscore 10000 * PokemonLevel
  2627. CatchHits = CatchHits + 1
  2628. CheckCatchHits
  2629. End If
  2630. End If
  2631. End Sub
  2632.  
  2633. '********
  2634. ' Bumper
  2635. '********
  2636.  
  2637. Dim bumperHits
  2638.  
  2639. Sub Bumper1_Hit
  2640. If Tilted Then Exit Sub
  2641. PlaySoundAt SoundFXDOF("fx_bumper", 109, DOFPulse, DOFContactors), Bumper1
  2642. PlaySoundAt SoundFXDOF("bumper1", 109, DOFPulse, DOFContactors), Bumper1
  2643. DOF 138, DOFPulse
  2644. AddScore 500 + 4500 * ABS(Flasher1.Visible) 'a bumper scores 500 points and 5000 points when lit
  2645. bumperHits = bumperHits - 1
  2646. DMDFlush
  2647. DMD RL(0, FormatScore(Score(Currentplayer) ) ), RL(1, bumperHits& " BUMPER HITS LEFT"), "bumper", eNone, eNone, eNone, 300, True, ""
  2648. CheckBumpers
  2649. End Sub
  2650.  
  2651. Sub Bumper2_Hit
  2652. If Tilted Then Exit Sub
  2653. PlaySoundAt SoundFXDOF("fx_bumper", 110, DOFPulse, DOFContactors), Bumper2
  2654. PlaySoundAt SoundFXDOF("bumper2", 110, DOFPulse, DOFContactors), Bumper2
  2655. DOF 140, DOFPulse
  2656. AddScore 500 + 4500 * ABS(Flasher2.Visible) 'a bumper scores 500 points and 5000 points when lit
  2657. bumperHits = bumperHits - 1
  2658. DMDFlush
  2659. DMD RL(0, FormatScore(Score(Currentplayer) ) ), RL(1, bumperHits& " BUMPER HITS LEFT"), "bumper", eNone, eNone, eNone, 300, True, ""
  2660. CheckBumpers
  2661. End Sub
  2662.  
  2663. Sub Bumper3_Hit
  2664. If Tilted Then Exit Sub
  2665. PlaySoundAt SoundFXDOF("fx_bumper", 107, DOFPulse, DOFContactors), Bumper3
  2666. PlaySoundAt SoundFXDOF("bumper3", 107, DOFPulse, DOFContactors), Bumper3
  2667. DOF 137, DOFPulse
  2668. AddScore 500 + 4500 * ABS(Flasher3.Visible) 'a bumper scores 500 points and 5000 points when lit
  2669. bumperHits = bumperHits - 1
  2670. DMDFlush
  2671. DMD RL(0, FormatScore(Score(Currentplayer) ) ), RL(1, bumperHits& " BUMPER HITS LEFT"), "bumper", eNone, eNone, eNone, 300, True, ""
  2672. CheckBumpers
  2673. End Sub
  2674.  
  2675. Sub Bumper4_Hit
  2676. If Tilted Then Exit Sub
  2677. PlaySoundAt SoundFXDOF("fx_bumper", 108, DOFPulse, DOFContactors), Bumper4
  2678. PlaySoundAt SoundFXDOF("bumper4", 108, DOFPulse, DOFContactors), Bumper4
  2679. DOF 139, DOFPulse
  2680. AddScore 500 + 4500 * ABS(Flasher4.Visible) 'a bumper scores 500 points and 5000 points when lit
  2681. bumperHits = bumperHits - 1
  2682. DMDFlush
  2683. DMD RL(0, FormatScore(Score(Currentplayer) ) ), RL(1, bumperHits& " BUMPER HITS LEFT"), "bumper", eNone, eNone, eNone, 300, True, ""
  2684. CheckBumpers
  2685. End Sub
  2686.  
  2687. ' Bumper Bonus
  2688. ' 100000 i bonus after each 100 hits
  2689.  
  2690. Sub CheckBumpers()
  2691. If bumperHits <= 0 Then
  2692. BumperBonus = BumperBonus + 1
  2693. DMD "_", RL(1, "BUMPERS BONUS " & BumperBonus), "", eNone, eBlink, eNone, 500, True, ""
  2694. bumperHits = 100
  2695. ' do something more
  2696. End If
  2697. End Sub
  2698.  
  2699. Sub ResetBumpers()
  2700. bumperHits = 100
  2701. Flasher1.Visible = 0
  2702. Flasher2.Visible = 0
  2703. Flasher3.Visible = 0
  2704. Flasher4.Visible = 0
  2705. End Sub
  2706.  
  2707. '**************************
  2708. ' Upper Lanes & loop switch
  2709. '**************************
  2710.  
  2711. Dim PokemonLevel, HolePos
  2712.  
  2713. Sub RightLoopTrigger_Hit() 'set the pokemon levels
  2714. DOF 131, DOFPulse
  2715. PlaySoundAt "fx_sensor", RightLoopTrigger
  2716. If Tilted Then Exit Sub
  2717. TargetBonus = TargetBonus + 1
  2718. If LastSwitchHit = "LeftInlaneTrigger2" Then 'combo
  2719. DMD "_", CL(1, "COMBO! " & FormatScore("20000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2720. AddScore 20000
  2721. End If
  2722. If bCatchemMode Then
  2723. If CatchLight5.State = 2 Then
  2724. Addscore 10000 * PokemonLevel
  2725. CatchHits = CatchHits + 1
  2726. CheckCatchHits
  2727. End If
  2728. Else
  2729. If PokemonLevel <4 Then
  2730. PokemonLevel = PokemonLevel + 1
  2731. UpdatePokemonLevel
  2732. End If
  2733. AddScore 2500 * PokemonLevel
  2734. End If
  2735. ' remember last trigger hit by the ball
  2736. LastSwitchHit = "RightLoopTrigger"
  2737. End Sub
  2738.  
  2739. Sub LeftLoopTrigger_Hit()
  2740. DOF 130, DOFPulse
  2741. PlaySoundAt "fx_sensor", LeftLoopTrigger
  2742. If Tilted Then Exit Sub
  2743. TargetBonus = TargetBonus + 1
  2744. IncrementHoleLights
  2745. If LastSwitchHit = "RightInlaneTrigger" Then 'combo
  2746. DMD "_", CL(1, "COMBO! " & FormatScore("30000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2747. AddScore 30000
  2748. End If
  2749. If bcoinfrenzy AND CoinLight1.State = 2 Then
  2750. Addcoin 50
  2751. PlaySound "fx_coins"
  2752. FlashForMs Flasher9, 1000, 50, 0
  2753. FlashForMs Flasher8, 1000, 50, 0
  2754. FlashForMs Flasher10, 1000, 50, 0
  2755. CoinFrenzyTimer_Timer
  2756. End If
  2757. If bCatchemMode Then
  2758. If CatchLight1.State = 2 Then
  2759. Addscore 10000 * PokemonLevel
  2760. CatchHits = CatchHits + 1
  2761. CheckCatchHits
  2762. End If
  2763. Else
  2764. AddScore 2500 * PokemonLevel
  2765. End If
  2766. ' remember last trigger hit by the ball
  2767. LastSwitchHit = "LeftLoopTrigger"
  2768. End Sub
  2769.  
  2770. Sub UpdatePokemonLevel
  2771. Select Case PokemonLevel
  2772. Case 0:LightLevel1.State = 0:LightLevel2.State = 0:LightLevel3.State = 0:LightLevel4.State = 0:Flasher1.Visible = 0:Flasher2.Visible = 0:Flasher3.Visible = 0:Flasher4.Visible = 0:LightArrow1.State = 2:LightArrow6.State = 2
  2773. Case 1:LightLevel1.State = 1:LightLevel2.State = 0:LightLevel3.State = 0:LightLevel4.State = 0:Flasher1.Visible = 1:Flasher2.Visible = 0:Flasher3.Visible = 0:Flasher4.Visible = 0:LightArrow5.State = 2
  2774. Case 2:LightLevel1.State = 1:LightLevel2.State = 1:LightLevel3.State = 0:LightLevel4.State = 0:Flasher1.Visible = 1:Flasher2.Visible = 1:Flasher3.Visible = 0:Flasher4.Visible = 0:HoleLight5.State = 2:l53.State = 0
  2775. Case 3:LightLevel1.State = 1:LightLevel2.State = 1:LightLevel3.State = 1:LightLevel4.State = 0:Flasher1.Visible = 1:Flasher2.Visible = 1:Flasher3.Visible = 1:Flasher4.Visible = 0
  2776. Case 4:LightLevel1.State = 1:LightLevel2.State = 1:LightLevel3.State = 1:LightLevel4.State = 1:Flasher1.Visible = 1:Flasher2.Visible = 1:Flasher3.Visible = 1:Flasher4.Visible = 1:LightArrow1.State = 0:LightArrow6.State = 0
  2777. End Select
  2778. End Sub
  2779.  
  2780. Sub ResetPokemonLevel()
  2781. PokemonLevel = 0
  2782. UpdatePokemonLevel
  2783. End Sub
  2784.  
  2785. Sub IncrementHoleLights()
  2786. If HolePos <> 5 Then
  2787. HolePos = HolePos + 1
  2788. If HolePos = 5 Then
  2789. HolePos = 1
  2790. End If
  2791. End If
  2792. UpdateHoleLights
  2793. End Sub
  2794.  
  2795. Sub UpdateHoleLights()
  2796. Select Case HolePos
  2797. Case 0:HoleLight1.State = 0:HoleLight2.State = 0:HoleLight3.State = 0:HoleLight4.State = 0
  2798. Case 1:HoleLight1.State = 2:HoleLight2.State = 0:HoleLight3.State = 0:HoleLight4.State = 0
  2799. Case 2:HoleLight1.State = 0:HoleLight2.State = 2:HoleLight3.State = 0:HoleLight4.State = 0
  2800. Case 3:HoleLight1.State = 0:HoleLight2.State = 0:HoleLight3.State = 2:HoleLight4.State = 0
  2801. Case 4:HoleLight1.State = 0:HoleLight2.State = 0:HoleLight3.State = 0:HoleLight4.State = 2
  2802. End Select
  2803. End Sub
  2804.  
  2805. Sub ResetHoleLights()
  2806. HolePos = 0
  2807. UpdateHoleLights
  2808. End Sub
  2809.  
  2810. '*****************
  2811. ' Pikachu Targets
  2812. '*****************
  2813.  
  2814. Dim bPikachuTargetMode, PikachuHits, PikachuTargetValue
  2815.  
  2816. Sub PikaTarget1_Hit()
  2817. PlaySoundAt SoundFXDOF("fx_target", 115, DOFPulse, DOFTargets), PikaTarget1
  2818. If Tilted Then Exit Sub
  2819. PlaySoundEffect
  2820. PikachuShake
  2821. If LastSwitchHit = "RightInlaneTrigger" Then 'combo
  2822. DMD "_", CL(1, "COMBO! " & FormatScore("10000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2823. AddScore 10000
  2824. End If
  2825. If bPikachuTargetMode Then
  2826. Addscore PikachuTargetValue * 3
  2827. FlashForMs Flasher12, 1000, 50, 0
  2828. Else
  2829. Addscore PikachuTargetValue
  2830. End If
  2831. TargetBonus = TargetBonus + 1
  2832. PikaLight1.State = 1
  2833. CheckTargetLights
  2834. PikachuHits = PikachuHits + 1
  2835. ' remember last trigger hit by the ball
  2836. LastSwitchHit = "PikaTarget1"
  2837. End Sub
  2838.  
  2839. Sub PikaTarget2_Hit()
  2840. PlaySoundAt SoundFXDOF("fx_target", 115, DOFPulse, DOFTargets), PikaTarget2
  2841. If Tilted Then Exit Sub
  2842. PlaySoundEffect
  2843. PikachuShake
  2844. If LastSwitchHit = "RightInlaneTrigger" Then 'combo
  2845. DMD "_", CL(1, "COMBO! " & FormatScore("10000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2846. AddScore 10000
  2847. End If
  2848. If bPikachuTargetMode Then
  2849. Addscore PikachuTargetValue * 3
  2850. FlashForMs Flasher11, 1000, 50, 0
  2851. Else
  2852. Addscore PikachuTargetValue
  2853. End If
  2854. TargetBonus = TargetBonus + 1
  2855. PikaLight2.State = 1
  2856. CheckTargetLights
  2857. PikachuHits = PikachuHits + 1
  2858. ' remember last trigger hit by the ball
  2859. LastSwitchHit = "PikaTarget2"
  2860. End Sub
  2861.  
  2862. Sub PikaTarget3_Hit()
  2863. PlaySoundAt SoundFXDOF("fx_target", 115, DOFPulse, DOFTargets), PikaTarget3
  2864. If Tilted Then Exit Sub
  2865. PlaySoundEffect
  2866. PikachuShake
  2867. If LastSwitchHit = "RightInlaneTrigger" Then 'combo
  2868. DMD "_", CL(1, "COMBO! " & FormatScore("10000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2869. AddScore 10000
  2870. End If
  2871. If bPikachuTargetMode Then
  2872. Addscore PikachuTargetValue * 3
  2873. FlashForMs Flasher11, 1000, 50, 0
  2874. Else
  2875. Addscore PikachuTargetValue
  2876. End If
  2877. TargetBonus = TargetBonus + 1
  2878. PikaLight3.State = 1
  2879. CheckTargetLights
  2880. PikachuHits = PikachuHits + 1
  2881. PlayRandonPikaSound
  2882. ' remember last trigger hit by the ball
  2883. LastSwitchHit = "PikaTarget3"
  2884. End Sub
  2885.  
  2886. Sub PikaTarget4_Hit()
  2887. PlaySoundAt SoundFXDOF("fx_target", 115, DOFPulse, DOFTargets), PikaTarget4
  2888. If Tilted Then Exit Sub
  2889. PlaySoundEffect
  2890. PikachuShake
  2891. If LastSwitchHit = "RightInlaneTrigger" Then 'combo
  2892. DMD "_", CL(1, "COMBO! " & FormatScore("10000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2893. AddScore 10000
  2894. End If
  2895. If bPikachuTargetMode Then
  2896. Addscore PikachuTargetValue * 3
  2897. FlashForMs Flasher11, 1000, 50, 0
  2898. Else
  2899. Addscore PikachuTargetValue
  2900. End If
  2901. TargetBonus = TargetBonus + 1
  2902. PikaLight4.State = 1
  2903. CheckTargetLights
  2904. PikachuHits = PikachuHits + 1
  2905. ' remember last trigger hit by the ball
  2906. LastSwitchHit = "PikaTarget4"
  2907. End Sub
  2908.  
  2909. Sub PikaTarget5_Hit()
  2910. PlaySoundAt SoundFXDOF("fx_target", 116, DOFPulse, DOFTargets), PikaTarget5
  2911. If Tilted Then Exit Sub
  2912. PlaySoundEffect
  2913. If LastSwitchHit = "LeftInlaneTrigger2" Then 'combo
  2914. DMD "_", CL(1, "COMBO! " & FormatScore("10000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2915. AddScore 10000
  2916. End If
  2917. If bPikachuTargetMode Then
  2918. Addscore PikachuTargetValue * 3
  2919. FlashForMs Flasher12, 1000, 50, 0
  2920. Else
  2921. Addscore PikachuTargetValue
  2922. End If
  2923. CharmanderShake
  2924. TargetBonus = TargetBonus + 1
  2925. PikaLight5.State = 1
  2926. CheckTargetLights
  2927. PikachuHits = PikachuHits + 1
  2928. ' remember last trigger hit by the ball
  2929. LastSwitchHit = "PikaTarget5"
  2930. End Sub
  2931.  
  2932. Sub PikaTarget6_Hit()
  2933. PlaySoundAt SoundFXDOF("fx_target", 116, DOFPulse, DOFTargets), PikaTarget6
  2934. If Tilted Then Exit Sub
  2935. PlaySoundEffect
  2936. If LastSwitchHit = "LeftInlaneTrigger2" Then 'combo
  2937. DMD "_", CL(1, "COMBO! " & FormatScore("10000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2938. AddScore 10000
  2939. End If
  2940. CharmanderShake
  2941. If bPikachuTargetMode Then
  2942. Addscore PikachuTargetValue * 3
  2943. FlashForMs Flasher12, 1000, 50, 0
  2944. Else
  2945. Addscore PikachuTargetValue
  2946. End If
  2947. TargetBonus = TargetBonus + 1
  2948. PikaLight6.State = 1
  2949. CheckTargetLights
  2950. PikachuHits = PikachuHits + 1
  2951. ' remember last trigger hit by the ball
  2952. LastSwitchHit = "PikaTarget6"
  2953. End Sub
  2954.  
  2955. Sub PikaTarget7_Hit()
  2956. PlaySoundAt SoundFXDOF("fx_target", 116, DOFPulse, DOFTargets), PikaTarget7
  2957. If Tilted Then Exit Sub
  2958. PlaySoundEffect
  2959. If LastSwitchHit = "LeftInlaneTrigger2" Then 'combo
  2960. DMD "_", CL(1, "COMBO! " & FormatScore("10000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  2961. AddScore 10000
  2962. End If
  2963. CharmanderShake
  2964. If bPikachuTargetMode Then
  2965. Addscore PikachuTargetValue * 3
  2966. FlashForMs Flasher12, 1000, 50, 0
  2967. Else
  2968. Addscore PikachuTargetValue
  2969. End If
  2970. TargetBonus = TargetBonus + 1
  2971. PikaLight7.State = 1
  2972. CheckTargetLights
  2973. PikachuHits = PikachuHits + 1
  2974. ' remember last trigger hit by the ball
  2975. LastSwitchHit = "PikaTarget7"
  2976. End Sub
  2977.  
  2978. Sub CheckTargetLights()
  2979. If(PikaLight1.State + PikaLight2.State + PikaLight3.State + PikaLight4.State + PikaLight5.State + PikaLight6.State + PikaLight7.State) = 7 Then 'turn on Pikachu Multiball: 2 ball multiball
  2980. 'start the target mode
  2981. StartTargetMode
  2982. ' enable the pikachumultiball light
  2983. GiEffect 2
  2984. PikaMultiballLight.State = 2
  2985. PikaLight1.State = 0
  2986. PikaLight2.State = 0
  2987. PikaLight3.State = 0
  2988. PikaLight4.State = 0
  2989. PikaLight5.State = 0
  2990. PikaLight6.State = 0
  2991. PikaLight7.State = 0
  2992. PikachuTargetValue = PikachuTargetValue + 5000
  2993. End If
  2994. End Sub
  2995.  
  2996. Sub PlayRandonPikaSound()
  2997. Dim n
  2998. n = INT(RND * 7) + 1
  2999. PlaySound "vo_pika" &n
  3000. End Sub
  3001.  
  3002. Sub LightSeqPikachu_PlayDone()
  3003. LightSeqPikachu.Play SeqRandom, 7, , 3000
  3004. End Sub
  3005.  
  3006. Sub StartTargetMode()
  3007. DMD "", "", "targetmode", eNone, eNone, eBlink, 800, True, "vo_pikachu1"
  3008. 'do some show with the lights
  3009. LightSeqPikachu.Play SeqRandom, 7, , 3000
  3010. LightEffect 2
  3011. bPikachuTargetMode = True
  3012. 'Starter the timer to turn off the target mode
  3013. PikachuTargetTimer.Enabled = 1
  3014. End Sub
  3015.  
  3016. Sub PikachuTargetTimer_Timer()
  3017. LightSeqPikachu.StopPlay
  3018. bPikachuTargetMode = False
  3019. PikachuTargetTimer.Enabled = 0
  3020. End Sub
  3021.  
  3022. '****************************
  3023. 'Pokemon Center / Coin Frenzy
  3024. '****************************
  3025.  
  3026. Dim BallType
  3027.  
  3028. Sub CenterEnableTrigger_Hit()
  3029. If Tilted Then Exit Sub
  3030. If BallUpdateLight.State = 2 AND BallType <4 Then 'coins are over 250 and ball can be updated
  3031. PokemonCenter.Enabled = True
  3032. Else
  3033. PokemonCenter.Enabled = False
  3034. End If
  3035. End Sub
  3036.  
  3037. Sub PokemonCenter_Hit()
  3038. PokemonCenter.Enabled = False
  3039. IncrementBallType
  3040. vpmtimer.addtimer 1000, "PokemonCenter.kick 270,4 '"
  3041. End Sub
  3042.  
  3043. Sub IncrementBallType()
  3044. If Coins(CurrentPlayer)> 249 AND BallType <4 Then
  3045. PlayFanfare
  3046. AddCoin -250
  3047. BallType = BallType + 1
  3048. FlashForMs Flasher9, 1000, 50, 0
  3049. FlashForMs Flasher8, 1000, 50, 0
  3050. Select case BallType
  3051. Case 1:DMD "", "", "pokeball", eNone, eNone, eBlinkFast, 1000, True, ""
  3052. Case 2:DMD "", "", "greatball", eNone, eNone, eBlinkFast, 1000, True, ""
  3053. Case 3:DMD "", "", "masterball", eNone, eNone, eBlinkFast, 1000, True, ""
  3054. Case 4:DMD "", "", "ultraball", eNone, eNone, eBlinkFast, 1000, True, ""
  3055. End Select
  3056. UpdateBallType
  3057. End If
  3058. End Sub
  3059.  
  3060. Sub ReduceBallType()
  3061. If BallType> 1 Then
  3062. BallType = BallType - 1
  3063. UpdateBallType
  3064. End If
  3065. End Sub
  3066.  
  3067. Sub UpdateBallType()
  3068. Select Case BallType
  3069. Case 1:BallLight1.State = 1:BallLight2.State = 0:BallLight3.State = 0:BallLight4.State = 0
  3070. Case 2:BallLight1.State = 0:BallLight2.State = 1:BallLight3.State = 0:BallLight4.State = 0
  3071. Case 3:BallLight1.State = 0:BallLight2.State = 0:BallLight3.State = 1:BallLight4.State = 0
  3072. Case 4:BallLight1.State = 0:BallLight2.State = 0:BallLight3.State = 0:BallLight4.State = 1
  3073. End Select
  3074. UpdateBallImage
  3075. End Sub
  3076.  
  3077. Sub UpdateBallImage()
  3078. Dim BOT, b
  3079. BOT = GetBalls
  3080. ' exit the Sub if no balls on the table
  3081. If UBound(BOT) = -1 Then Exit Sub
  3082.  
  3083. ' change the image for each ball
  3084. For b = 0 to UBound(BOT)
  3085. Select Case BallType
  3086. Case 1:BOT(b).FrontDecal = "ball1"
  3087. Case 2:BOT(b).FrontDecal = "ball2"
  3088. Case 3:BOT(b).FrontDecal = "ball3"
  3089. Case 4:BOT(b).FrontDecal = "ball4"
  3090. End Select
  3091. Next
  3092. End Sub
  3093.  
  3094. ' Coin Frenzy
  3095. Dim bcoinfrenzy, coinstep
  3096.  
  3097. Sub CheckCoinFrenzy()
  3098. If bcoinfrenzy = False Then
  3099. If coinstep> 2 Then
  3100. StartCoinFrenzy
  3101. End If
  3102. End If
  3103. End Sub
  3104.  
  3105. Sub StartCoinFrenzy()
  3106. bcoinfrenzy = True
  3107. CoinFrenzyTimer.Enabled = True
  3108. StopCoinFrenzyTimer.Enabled = True
  3109. CoinFrenzyTimer_Timer
  3110. End Sub
  3111.  
  3112. Sub CoinFrenzyTimer_Timer() 'blink one catch light for 5 seconds and then change to another light simulating the pokemon movement
  3113. Dim i
  3114. For each i in aCoinFrenzyLights
  3115. i.State = 0
  3116. Next
  3117. i = INT(RND * 5)
  3118. aCoinFrenzyLights(i).State = 2
  3119. End Sub
  3120.  
  3121. Sub StopCoinFrenzyTimer_Timer() 'reset lights & variables
  3122. Dim i
  3123. CoinFrenzyTimer.Enabled = False
  3124. StopCoinFrenzyTimer.Enabled = False
  3125. For each i in aCoinFrenzyLights
  3126. i.State = 0
  3127. Next
  3128. bcoinfrenzy = False
  3129. coinstep = 0
  3130. End Sub
  3131.  
  3132. '***********************************
  3133. 'Venusaur Cave: Lock (software lock)
  3134. '***********************************
  3135.  
  3136. Dim bLockEnabled, LockedBalls
  3137.  
  3138. Sub VenusaurHole_Hit()
  3139. PlaySoundAt "fx_kicker_enter", VenusaurHole
  3140. If Not Tilted Then
  3141. If bcoinfrenzy AND CoinLight4.State = 2 Then
  3142. Addcoin 50
  3143. PlaySound "fx_coins"
  3144. FlashForMs Flasher8, 1000, 50, 0
  3145. FlashForMs Flasher9, 1000, 50, 0
  3146. FlashForMs Flasher10, 1000, 50, 0
  3147. CoinFrenzyTimer_Timer
  3148. End If
  3149. If bCatchemMode Then
  3150. If CatchLight3.State = 2 Then
  3151. Addscore 10000 * PokemonLevel
  3152. CatchHits = CatchHits + 1
  3153. CheckCatchHits
  3154. End If
  3155. Else
  3156. Addscore 10000
  3157. End If
  3158. If bLockEnabled Then
  3159. LockedBalls = LockedBalls + 1
  3160. DMD "_", CL(1, "BALL " & LockedBalls & " IS LOCKED"), "_", eNone, eNone, eNone, 500, True, ""
  3161. If LockedBalls = 2 Then
  3162. MultiLight1.State = 2
  3163. MultiLight2.State = 2
  3164. MultiLight3.State = 2
  3165. MultiLight4.State = 2
  3166. MultiLight5.State = 2
  3167. End If
  3168. If LockedBalls = 3 Then
  3169. VenusaurMultiball
  3170. End IF
  3171. End If
  3172. End If
  3173. vpmtimer.addtimer 1500, "VenusaurKickBall '"
  3174. ' remember last trigger hit by the ball
  3175. LastSwitchHit = "VenusaurHole"
  3176. End Sub
  3177.  
  3178. Sub VenusaurKickBall()
  3179. PlaySoundAt SoundFXDOF("fx_kicker", 129, DOFPulse, DOFContactors), VenusaurHole
  3180. DOF 121, DOFPulse
  3181. AnimateVenusaur
  3182. VenusaurHole.Kick 200, 8
  3183. End Sub
  3184.  
  3185. Sub VenusaurLock1_Hit()
  3186. PlaySoundAt SoundFXDOF("fx_target", 128, DOFPulse, DOFTargets), VenusaurLock1
  3187. If Tilted Then Exit Sub
  3188. PlaySoundEffect
  3189. Addscore 20000
  3190. VenusaurShake
  3191. LockLight1.State = 1
  3192. CheckLock
  3193. End Sub
  3194.  
  3195. Sub VenusaurLock2_Hit()
  3196. PlaySoundAt SoundFXDOF("fx_target", 128, DOFPulse, DOFTargets), VenusaurLock2
  3197. If Tilted Then Exit Sub
  3198. PlaySoundEffect
  3199. Addscore 20000
  3200. VenusaurShake
  3201. LockLight2.State = 1
  3202. CheckLock
  3203. End Sub
  3204.  
  3205. Sub CheckLock()
  3206. If bLockEnabled Then Exit Sub
  3207. If LockLight1.State + LockLight2.State = 2 Then
  3208. bLockEnabled = True
  3209. LockLight.State = 2
  3210. DMD "", "", "lockislit", eNone, eNone, eBlinkFast, 1000, True, ""
  3211. End If
  3212. End Sub
  3213.  
  3214. Sub VenusaurMultiball()
  3215. DMD "", "", "multiball", eNone, eNone, eBlinkFast, 1000, True, ""
  3216. PlayFanfare
  3217. AddMultiball 3
  3218. ' turn off the lock lights
  3219. LockedBalls = 0
  3220. bLockEnabled = False
  3221. MultiLight1.State = 0
  3222. MultiLight2.State = 0
  3223. MultiLight3.State = 0
  3224. MultiLight4.State = 0
  3225. MultiLight5.State = 0
  3226. LockLight1.State = 0
  3227. LockLight2.State = 0
  3228. LockLight.State = 0
  3229. 'Turn On the Super Jackpot lights
  3230. CenterRampLight.State = 2
  3231. RightRampLight.State = 2
  3232. SetLightColor LightArrow4, "red", 2
  3233. SetLightColor LightArrow2, "red", 2
  3234. End Sub
  3235.  
  3236. Sub ResetJackpotLights()
  3237. CenterRampLight.State = 0
  3238. RightRampLight.State = 0
  3239. SetLightColor LightArrow4, "white", 0
  3240. SetLightColor LightArrow2, "white", 0
  3241. LightArrow4.State = 0
  3242. LightArrow2.State = 0
  3243. End Sub
  3244.  
  3245. Dim VenusaurPos
  3246.  
  3247. Sub AnimateVenusaur()
  3248. VenusaurPos = 0
  3249. VenusaurTimer.Enabled = 1
  3250. End Sub
  3251.  
  3252. Sub VenusaurTimer_Timer()
  3253. Select Case VenusaurPos
  3254. Case 0:Venusaur.TransY = 40:VenusaurPos = 1
  3255. Case 1:Venusaur.TransY = 20:VenusaurPos = 2
  3256. Case 2:Venusaur.TransY = 10:VenusaurPos = 3
  3257. Case 3:Venusaur.TransY = 5:VenusaurPos = 4
  3258. Case 4:Venusaur.TransY = 0:VenusaurTimer.Enabled = 0
  3259. End Select
  3260. End Sub
  3261.  
  3262. '***************
  3263. ' Ramp Switches
  3264. '***************
  3265.  
  3266. Sub RightRampDone_Hit
  3267. If Tilted Then Exit Sub
  3268. If LastSwitchHit = "LeftInlaneTrigger1" Then 'combo
  3269. DMD "_", CL(1, "COMBO! " & FormatScore("20000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  3270. AddScore 20000
  3271. End If
  3272. If bcoinfrenzy AND CoinLight5.State = 2 Then
  3273. Addcoin 50
  3274. PlaySound "fx_coins"
  3275. FlashForMs Flasher8, 1000, 50, 0
  3276. FlashForMs Flasher9, 1000, 50, 0
  3277. FlashForMs Flasher10, 1000, 50, 0
  3278. CoinFrenzyTimer_Timer
  3279. End If
  3280. If bRampBonus Then
  3281. AwardJackpot
  3282. End If
  3283. If bMultiBallMode Then
  3284. If CenterRampLight.State = 2 Then
  3285. AwardSuperJackpot
  3286. Else
  3287. AwardJackpot
  3288. End If
  3289. End If
  3290. If PikaMultiballLight.State = 2 Then
  3291. DMD "", "", "a-multiball", eNone, eNone, eBlink, 500, True, "vo_pikachu2"
  3292. AddMultiball 1
  3293. PikaMultiballLight.State = 0
  3294. End If
  3295. If bCatchemMode Then
  3296. If CatchLight4.State = 2 Then
  3297. Addscore 10000 * PokemonLevel
  3298. CatchHits = CatchHits + 1
  3299. CheckCatchHits
  3300. End If
  3301. Else
  3302. Addscore 10000
  3303. End If
  3304. ' remember last trigger hit by the ball
  3305. LastSwitchHit = "RightRampDone"
  3306. End Sub
  3307.  
  3308. Sub CenterRampDone_Hit
  3309. If Tilted Then Exit Sub
  3310. If ExtraBallLight.State = 2 Then
  3311. AwardExtraBall
  3312. ExtraBallLight.State = 0
  3313. End If
  3314. If bcoinfrenzy AND CoinLight3.State = 2 Then
  3315. Addcoin 50
  3316. PlaySound "fx_coins"
  3317. CoinFrenzyTimer_Timer
  3318. FlashForMs Flasher8, 1000, 50, 0
  3319. FlashForMs Flasher9, 1000, 50, 0
  3320. FlashForMs Flasher10, 1000, 50, 0
  3321. Else
  3322. coinstep = coinstep + 1
  3323. CheckCoinFrenzy
  3324. End If
  3325. If bRampBonus Then
  3326. AwardJackpot
  3327. End If
  3328. If bMultiBallMode Then
  3329. If CenterRampLight.State = 2 Then
  3330. AwardSuperJackpot
  3331. Else
  3332. AwardJackpot
  3333. End If
  3334. End If
  3335. If bCatchemMode Then
  3336. If CatchLight6.State = 2 Then
  3337. Addscore 10000 * PokemonLevel
  3338. CatchHits = CatchHits + 1
  3339. CheckCatchHits
  3340. End If
  3341. Else
  3342. Addscore 10000
  3343. End If
  3344. ' remember last trigger hit by the ball
  3345. LastSwitchHit = "CenterRampDone"
  3346. End Sub
  3347.  
  3348. '*****************
  3349. 'Ramp Bonus Mode
  3350. '*****************
  3351. ' only availabe trough the slot machine
  3352.  
  3353. Dim bRampBonus
  3354.  
  3355. Sub StartRampBonus()
  3356. bRampBonus = True
  3357. SetLightColor LightArrow4, "red", 2
  3358. SetLightColor LightArrow2, "red", 2
  3359. StopRampBonusTimer.Enabled = True
  3360. End Sub
  3361.  
  3362. Sub StopRampBonusTimer_Timer()
  3363. bRampBonus = FALSE
  3364. SetLightColor LightArrow4, "white", 0
  3365. SetLightColor LightArrow2, "white", 0
  3366. StopRampBonusTimer.Enabled = False
  3367. End Sub
  3368.  
  3369. '*****************
  3370. ' Loop Bonus Mode
  3371. '*****************
  3372. ' only availabe trough the slot machine
  3373.  
  3374. Dim bLoopBonus
  3375.  
  3376. Sub StartLoopBonus()
  3377. bLoopBonus = True
  3378. SetLightColor LightArrow1, "red", 2
  3379. SetLightColor LightArrow6, "red", 2
  3380. StopLoopBonusTimer.Enabled = True
  3381. End Sub
  3382.  
  3383. Sub StopLoopBonusTimer_Timer()
  3384. bLoopBonus = FALSE
  3385. SetLightColor LightArrow1, "white", 0
  3386. SetLightColor LightArrow6, "white", 0
  3387. StopLoopBonusTimer.Enabled = False
  3388. End Sub
  3389.  
  3390. Sub LoopTrigger_Hit()
  3391. If bLoopBonus Then
  3392. AwardJackpot
  3393. FlashForMs Flasher8, 1000, 50, 0
  3394. FlashForMs Flasher9, 1000, 50, 0
  3395. FlashForMs Flasher10, 1000, 50, 0
  3396. GiEffect 1
  3397. End If
  3398. LastSwitchHit = "LoopTrigger"
  3399. End Sub
  3400.  
  3401. '*******************
  3402. 'Pokemon definitions
  3403. '*******************
  3404.  
  3405. Dim Eggs, Pokemon
  3406. Eggs = Array("pok010", "pok013", "pok011", "pok014", "pok129", "pok041", "pok016", "pok019", "pok039", "pok050", "pok021", "pok032", "pok023", "pok029", _
  3407. "pok046", "pok132", "pok004", "pok037", "pok007", "pok048", "pok052", "pok147", "pok001", "pok043", "pok054", "pok063", "pok035") '26 pokemon level 1
  3408. Pokemon = Array("pok010", "pok013", "pok011", "pok014", "pok129", "pok041", "pok016", "pok019", "pok039", "pok050", "pok021", "pok032", "pok023", "pok029", _
  3409. "pok046", "pok132", "pok004", "pok037", "pok007", "pok048", "pok052", "pok147", "pok001", "pok043", "pok054", "pok063", "pok035", "pok025", _
  3410. "pok056", "pok060", "pok066", "pok069", "pok074", "pok081", "pok104", "pok116", "pok079", "pok084", "pok088", "pok092", "pok100", "pok027", _
  3411. "pok058", "pok086", "pok090", "pok102", "pok133", "pok072", "pok096", "pok118", "pok120", "pok083", "pok109", "pok017", "pok098", "pok138", _
  3412. "pok140", "pok012", "pok015", "pok030", "pok033", "pok108", "pok137", "pok111", "pok044", "pok002", "pok005", "pok008", "pok064", "pok061", _
  3413. "pok095", "pok122", "pok124", "pok020", "pok047", "pok067", "pok070", "pok075", "pok077", "pok105", "pok106", "pok107", "pok040", "pok093", _
  3414. "pok148", "pok051", "pok024", "pok049", "pok053", "pok022", "pok036", "pok057", "pok119", "pok042", "pok045", "pok080", "pok026", "pok082", _
  3415. "pok114", "pok117", "pok125", "pok126", "pok018", "pok085", "pok089", "pok101", "pok028", "pok055", "pok065", "pok087", "pok031", "pok034", _
  3416. "pok062", "pok097", "pok115", "pok113", "pok068", "pok071", "pok076", "pok078", "pok110", "pok123", "pok038", "pok003", "pok006", "pok009", _
  3417. "pok094", "pok099", "pok139", "pok127", "pok134", "pok135", "pok136", "pok141", "pok143", "pok073", "pok121", "pok112", "pok142", "pok128", _
  3418. "pok131", "pok059", "pok103", "pok091", "pok130", "pok144", "pok145", "pok146", "pok149", "pok151", "pok150", "pok150") ' all the 151 Pokémon, Mewtwo, can only be caught from the slotmachine '151
  3419.  
  3420. '***************************
  3421. ' Catch Hole /Catch'em Mode
  3422. '***************************
  3423.  
  3424. ' Start always first the Cath'em mode if the light is blinking other wise gives a random award if one of the other lights are blinking.
  3425. ' Catch'em mode ends after 2 minutes
  3426.  
  3427. Dim bCatchemMode, CatchID, CatchMaxHits, CatchHits, BallInHole
  3428.  
  3429. Dim aBall
  3430.  
  3431. Sub CatchHole_Timer
  3432. Do While aBall.Z> 0
  3433. aBall.Z = aBall.Z -5
  3434. Exit Sub
  3435. Loop
  3436. Me.DestroyBall
  3437. Me.TimerEnabled = 0
  3438. End Sub
  3439.  
  3440. Sub CatchHole_Hit
  3441. PlaySoundAt "fx_hole_enter", CatchHole
  3442. BallInHole = BallInHole + 1
  3443. Set aBall = ActiveBall:Me.TimerEnabled = 1
  3444. If HoleLight5.State = 2 Then 'Start catchem mode
  3445. StartCatchem1
  3446. vpmtimer.addtimer 2000, "FlashForMs FlasherExitHole, 1000, 30, 0 '"
  3447. vpmtimer.addtimer 2500, "CatchHoleExit '"
  3448. Exit Sub
  3449. End If
  3450. If HolePos> 0 Then
  3451. StartSlotmachine
  3452. Else
  3453. vpmtimer.addtimer 500, "FlashForMs FlasherExitHole, 1000, 30, 0 '"
  3454. vpmtimer.addtimer 1000, "CatchHoleExit '"
  3455. End If
  3456. ' remember last trigger hit by the ball
  3457. LastSwitchHit = "CatchHole"
  3458. End Sub
  3459.  
  3460. Sub CatchHoleExit()
  3461. If BallInHole> 0 Then
  3462. BallInHole = BallInHole - 1
  3463. CatchHole.CreateSizedball BallSize / 2
  3464. UpdateBallImage
  3465. PlaySoundAt SoundFXDOF("fx_popper", 120, DOFPulse, DOFContactors), CatchHole
  3466. DOF 121, DOFPulse
  3467. CatchHole.Kick 175, 14, 1
  3468. vpmtimer.addtimer 1000, "CatchHoleExit '" 'repeat until all the balls are kicked out
  3469. End If
  3470. End Sub
  3471.  
  3472. Sub StartCatchem1()
  3473. bCatchemMode = True
  3474. CatchID = 0
  3475. ChangeSong ' change the song
  3476. Select Case PokemonLevel 'limit the numbers of pokemons based on the level
  3477. Case 2:CatchID = INT(RND * 50) ' CatchID the number in the reel of the pokemon to be caught, this are level 2 Pokémon
  3478. Case 3:CatchID = INT(RND * 50) + 50 'level 3 Pokémon
  3479. Case 4:CatchID = INT(RND * 50) + 99 'level 4 Pokémon
  3480. End Select
  3481. debug.print catchid
  3482. CatchMaxHits = PokemonLevel
  3483. StartCatchem2
  3484. End Sub
  3485.  
  3486. Sub StartCatchem2()
  3487. DMD "", RL(1, "READY TO HUNT"), pokemon(CatchID), eNone, eNone, eNone, 1000, True, ""
  3488. CatchHits = 0
  3489. CatchemTimer.Enabled = True ' blink one light
  3490. StopCatchem.Enabled = True ' turn on the timer to stop the mode
  3491. CatchemTimer_Timer
  3492. ' turn off lights
  3493. HoleLight5.State = 0:l53.State = 2
  3494. End Sub
  3495.  
  3496. Sub CatchemTimer_Timer() 'blink one catch light for 5 seconds and then change to another light simulating the pokemon movement
  3497. Dim i
  3498. For each i in aCatchLights
  3499. i.State = 0
  3500. Next
  3501. i = INT(RND * 6)
  3502. aCatchLights(i).State = 2
  3503. End Sub
  3504.  
  3505. Sub StopCatchem_Timer() 'reset lights & variables
  3506. Dim i
  3507. CatchemTimer.Enabled = False
  3508. StopCatchem.Enabled = False
  3509. For each i in aCatchLights
  3510. i.State = 0
  3511. Next
  3512. bCatchemMode = False
  3513. ChangeSong
  3514. ResetPokemonLevel
  3515. End Sub
  3516.  
  3517. Sub CheckCatchHits()
  3518. GiEffect 1
  3519. PlaySoundEffect
  3520. If CatchHits >= CatchMaxHits Then 'stop catch'em mode
  3521. PlayFanfare
  3522. DMD RL(0, FormatScore(50000 * pokemonlevel) ), RL(1, "WAS CAUGHT "), Pokemon(CatchID), eBlinkFast, eBlinkFast, eNone, 1500, True, ""
  3523. Addscore 50000 * pokemonlevel
  3524. PokemonBonusAward(CurrentPlayer) = PokemonBonusAward(CurrentPlayer) + (pokemonlevel * pokemonlevel)
  3525. PokemonBonus(CurrentPlayer) = PokemonBonus(CurrentPlayer) + 1
  3526. PokemonCaught(CurrentPlayer, PokemonBonus(CurrentPlayer) ) = CatchID
  3527. LightEffect 1
  3528. GiEffect 1
  3529. If PokemonBonus(CurrentPlayer) MOD 3 = 0 Then 'turn on the extra ball light after catching 3 pokemons
  3530. ExtraBallLight.State = 2
  3531. End If
  3532. StopCatchem_Timer
  3533. Else 'change to another position
  3534. CatchemTimer.Enabled = 0
  3535. CatchemTimer.Enabled = 1
  3536. CatchemTimer_Timer
  3537. End If
  3538. End Sub
  3539.  
  3540. Sub CatchMewtwo()
  3541. bCatchemMode = True
  3542. CatchID = 150 'the number of Mewtwo in the reel
  3543. PokemonLevel = 5
  3544. CatchMaxHits = 6
  3545. StartCatchem2
  3546. End Sub
  3547.  
  3548. '**************
  3549. ' SlotMachine
  3550. '**************
  3551.  
  3552. Dim BulbasaurAward, PikachuAward, SquirtleAward, CharmanderAward
  3553.  
  3554. PikachuAward = Array("a-smallpoints", "a-bigpoints", "a-30sec", "a-smallpoints", "a-smallpoints", "a-upgradeball", "a-bigpoints", "a-coinfrenzy", "a-multiball", "a-catchmewtwo")
  3555. SquirtleAward = Array("b-smallpoints", "b-bigpoints", "b-30sec", "b-smallpoints", "b-smallpoints", "b-upgradeball", "a-bigpoints", "b-coinfrenzy", "b-rampbonus", "b-litextraball")
  3556. CharmanderAward = Array("c-smallpoints", "c-bigpoints", "c-30sec", "c-smallpoints", "c-smallpoints", "c-upgradeball", "c-bigpoints", "c-coinfrenzy", "c-loopbonus", "c-charizardbonus")
  3557. BulbasaurAward = Array("d-smallpoints", "d-bigpoints", "d-30sec", "d-smallpoints", "d-smallpoints", "d-upgradeball", "d-bigpoints", "d-coinfrenzy", "d-bigpoints", "d-targetbonus")
  3558.  
  3559. Sub StartSlotmachine() ' uses the HolePos variable
  3560. Dim i
  3561. HoleBonus = HoleBonus + 1
  3562. DMDFlush
  3563. Select Case HolePos
  3564. Case 1: 'BulbasaurAward
  3565. For i = 0 to 8
  3566. DMD "", "", BulbasaurAward(i), eNone, eNone, eNone, 50, False, "fx_spinner"
  3567. Next
  3568. Case 2: 'PikachuAward
  3569. For i = 0 to 8
  3570. DMD "", "", PikachuAward(i), eNone, eNone, eNone, 50, False, "fx_spinner"
  3571. Next
  3572. Case 3: 'SquirtleAward
  3573. For i = 0 to 8
  3574. DMD "", "", SquirtleAward(i), eNone, eNone, eNone, 50, False, "fx_spinner"
  3575. Next
  3576. Case 4: 'CharmanderAward
  3577. For i = 0 to 8
  3578. DMD "", "", CharmanderAward(i), eNone, eNone, eNone, 50, False, "fx_spinner"
  3579. Next
  3580. End Select
  3581. DOF 142, DOFPulse
  3582. vpmtimer.AddTimer 2500, "GiveSlotAward '"
  3583. End Sub
  3584.  
  3585. Sub GiveSlotAward()
  3586. Dim tmp
  3587. DMDFlush
  3588. tmp = INT(RND * 10)
  3589.  
  3590. Select Case HolePos
  3591. Case 1: 'BulbasaurAward
  3592. DMD "", "", BulbasaurAward(tmp), eNone, eNone, eBlinkFast, 800, True, "po_fanfare6"
  3593. Case 2: 'PikachuAward
  3594. DMD "", "", PikachuAward(tmp), eNone, eNone, eBlinkFast, 800, True, "po_fanfare6"
  3595. Case 3: 'SquirtleAward
  3596. DMD "", "", SquirtleAward(tmp), eNone, eNone, eBlinkFast, 800, True, "po_fanfare6"
  3597. Case 4: 'CharmanderAward
  3598. DMD "", "", CharmanderAward(tmp), eNone, eNone, eBlinkFast, 800, True, "po_fanfare6"
  3599. End Select
  3600.  
  3601. Select Case tmp
  3602. Case 0:AddScore INT(10000 * RND * 9) 'small points
  3603. Case 1:AddScore INT(100000 * RND * 9) 'big points
  3604. Case 2:EnableBallSaver 30 'ball saver 30 seconds
  3605. Case 3:AddScore INT(10000 * RND * 9) 'small points
  3606. Case 4:AddScore INT(10000 * RND * 9) 'small points
  3607. Case 5:AddCoin 250:IncrementBallType 'upgrade ball
  3608. Case 6:AddScore INT(100000 * RND * 9) 'big points
  3609. Case 7:StartCoinFrenzy 'coin frenzy
  3610. Case 8
  3611. Select Case HolePos
  3612. Case 1:AddScore INT(100000 * RND * 9) 'big points
  3613. Case 2:PikaMultiballLight.State = 2 'enable picachu multiball
  3614. Case 3:StartRampBonus 'Ramp Bonus Mode - Activate Jackpots on the ramps for 2 minutes
  3615. Case 4:StartLoopBonus 'Loop Bonus Mode
  3616. End Select
  3617. Case 9
  3618. Select Case HolePos
  3619. Case 1:StartTargetMode 'Target Bonus Mode
  3620. Case 2:CatchMewtwo 'Catch Mewtwo
  3621. Case 3:ExtraBallLight.State = 2 'Lit Extra Ball
  3622. Case 4:StartCharizardMode 'Charizard Bonus Mode
  3623. End Select
  3624. End Select
  3625. GiEffect 1
  3626. vpmtimer.addtimer 1500, "CatchHoleExit '"
  3627. End Sub
  3628.  
  3629. '**********************
  3630. ' Charizard Bonus Mode
  3631. '**********************
  3632.  
  3633. Dim bCharizardMode
  3634.  
  3635. Sub StartCharizardMode()
  3636. bCharizardMode = True
  3637. EggTarget5.IsDropped = FALSE
  3638. DOF 119, DOFPulse
  3639. SetLightColor LightArrow5, "orange", 2
  3640. StopCharizardTimer.Enabled = True
  3641. End Sub
  3642.  
  3643. Sub StopCharizardTimer_Timer()
  3644. StopCharizardTimer.Enabled = False
  3645. bCharizardMode = False
  3646. SetLightColor LightArrow5, "white", 0
  3647. End Sub
  3648.  
  3649. '******************
  3650. ' Egg/Hatch Mode
  3651. '******************
  3652.  
  3653. Dim bEggTargetsCompleted, EggID
  3654.  
  3655. Sub EggTarget1_Hit()
  3656. PlaySoundAt SoundFXDOF("fx_target", 117, DOFPulse, DOFTargets), EggTarget1
  3657. If Tilted Then Exit Sub
  3658. PlaySoundEffect
  3659. HatchLight1.State = 1:HatchLight1b.Visible = 1
  3660. Addscore 20000
  3661. CheckEggTargets
  3662. ' remember last trigger hit by the ball
  3663. LastSwitchHit = "EggTarget1"
  3664. End Sub
  3665.  
  3666. Sub EggTarget2_Hit()
  3667. PlaySoundAt SoundFXDOF("fx_target", 117, DOFPulse, DOFTargets), EggTarget2
  3668. If Tilted Then Exit Sub
  3669. PlaySoundEffect
  3670. HatchLight2.State = 1:HatchLight2b.Visible = 1
  3671. Addscore 20000
  3672. CheckEggTargets
  3673. ' remember last trigger hit by the ball
  3674. LastSwitchHit = "EggTarget2"
  3675. End Sub
  3676.  
  3677. Sub EggTarget3_Hit()
  3678. PlaySoundAt SoundFXDOF("fx_target", 117, DOFPulse, DOFTargets), EggTarget3
  3679. If Tilted Then Exit Sub
  3680. PlaySoundEffect
  3681. HatchLight3.State = 1:HatchLight3b.Visible = 1
  3682. Addscore 20000
  3683. CheckEggTargets
  3684. ' remember last trigger hit by the ball
  3685. LastSwitchHit = "EggTarget3"
  3686. End Sub
  3687.  
  3688. Sub EggTarget4_Hit()
  3689. PlaySoundAt SoundFXDOF("fx_target", 117, DOFPulse, DOFTargets), EggTarget4
  3690. If Tilted Then Exit Sub
  3691. PlaySoundEffect
  3692. HatchLight4.State = 1:HatchLight4b.Visible = 1
  3693. Addscore 20000
  3694. CheckEggTargets
  3695. ' remember last trigger hit by the ball
  3696. LastSwitchHit = "EggTarget4"
  3697. End Sub
  3698.  
  3699. Sub EggTarget5_Hit()
  3700. PlaySoundAt SoundFXDOF("fx_target", 117, DOFPulse, DOFTargets), EggTarget5
  3701. If Tilted Then Exit Sub
  3702. PlaySoundEffect
  3703. CharizardShake
  3704. If LastSwitchHit = "RightInlaneTrigger" Then 'combo
  3705. DMD "_", CL(1, "COMBO! " & FormatScore("30000") ), "_", eNone, eBlinkFast, eNone, 500, True, ""
  3706. AddScore 30000
  3707. LightEffect 1
  3708. GiEffect 1
  3709. End If
  3710. If bCharizardMode Then
  3711. GiEffect 1
  3712. AddScore 500000
  3713. Else
  3714. Addscore 20000
  3715. End If
  3716. ' remember last trigger hit by the ball
  3717. LastSwitchHit = "EggTarget5"
  3718. End Sub
  3719.  
  3720. Sub EggTarget5_Dropped()
  3721. If bCharizardMode Then
  3722. EggTarget5.Isdropped = False
  3723. DOF 119, DOFPulse
  3724. End If
  3725. End Sub
  3726.  
  3727. Sub CheckEggTargets()
  3728. If bEggTargetsCompleted = False Then
  3729. If(HatchLight1.State + HatchLight2.State + HatchLight3.State + HatchLight4.State) = 4 Then
  3730. bEggTargetsCompleted = True
  3731. HatchReadyLight. State = 2
  3732. EggMagnet.MagnetOn = True
  3733. End If
  3734. End If
  3735. End Sub
  3736.  
  3737. Sub EggHole_Hit()
  3738. PlaySoundAt "fx_hole_enter", EggHole
  3739. BallInHole = BallInHole + 1
  3740. EggHole.DestroyBall
  3741. If bEggTargetsCompleted Then
  3742. EggID = INT(RND * 26)
  3743. DMD RL(0, FormatScore(1000000) ), RL(1, "MEMORIES "), Eggs(EggID), eBlinkFast, eBlinkFast, eNone, 1500, True, ""
  3744. AddScore 1000000
  3745. EggBonus(CurrentPlayer) = EggBonus(CurrentPlayer) + 1
  3746. If EggBonus(CurrentPlayer) MOD 3 = 0 Then 'start the Charizard Bonus Mode after hatching 3 eggs
  3747. StartCharizardMode
  3748. End If
  3749. HatchReadyLight. State = 0
  3750. FlashForMs HatchLight1b, 1000, 50, 0
  3751. FlashForMs HatchLight2b, 1000, 50, 0
  3752. FlashForMs HatchLight3b, 1000, 50, 0
  3753. FlashForMs HatchLight4b, 1000, 50, 0
  3754. FlashForMs Flasher8, 1000, 50, 0
  3755. FlashForMs Flasher9, 1000, 50, 0
  3756. FlashForMs Flasher10, 1000, 50, 0
  3757. Gieffect 1
  3758. vpmtimer.Addtimer 3000, "EndEggMode '"
  3759. Else
  3760. vpmtimer.addtimer 1000, "CatchHoleExit '"
  3761. End If
  3762. ' remember last trigger hit by the ball
  3763. LastSwitchHit = "EggHole"
  3764. End Sub
  3765.  
  3766. Sub EndEggMode()
  3767. HatchLight1.State = 0:HatchLight1b.Visible = 0
  3768. HatchLight2.State = 0:HatchLight2b.Visible = 0
  3769. HatchLight3.State = 0:HatchLight3b.Visible = 0
  3770. HatchLight4.State = 0:HatchLight4b.Visible = 0
  3771. bEggTargetsCompleted = False
  3772. EggMagnet.MagnetOn = False
  3773. EggTarget5.IsDropped = 0
  3774. vpmtimer.addtimer 500, "CatchHoleExit '"
  3775. End Sub
  3776.  
  3777. '*****************
  3778. ' objects shaking
  3779. '*****************
  3780.  
  3781. Dim PikaShake, CharmanShake, ChariShake, VenuShake
  3782.  
  3783. Sub PikachuShake()
  3784. PikaShake = 6
  3785. PikaShakeTimer.Enabled = True
  3786. End Sub
  3787.  
  3788. Sub PikaShakeTimer_Timer()
  3789. Pikachu.Transz = PikaShake / 2
  3790. If PikaShake = 0 Then Me.Enabled = False:Exit Sub
  3791. If PikaShake <0 Then
  3792. PikaShake = ABS(PikaShake) - 0.1
  3793. Else
  3794. PikaShake = - PikaShake + 0.1
  3795. End If
  3796. End Sub
  3797.  
  3798. Sub CharmanderShake()
  3799. CharmanShake = 6
  3800. CharmanShakeTimer.Enabled = True
  3801. End Sub
  3802.  
  3803. Sub CharmanShakeTimer_Timer()
  3804. Charmander.Transz = CharmanShake / 2
  3805. If CharmanShake = 0 Then Me.Enabled = False:Exit Sub
  3806. If CharmanShake <0 Then
  3807. CharmanShake = ABS(CharmanShake) - 0.1
  3808. Else
  3809. CharmanShake = - CharmanShake + 0.1
  3810. End If
  3811. End Sub
  3812.  
  3813. Sub CharizardShake()
  3814. DOF 118, DOFPulse
  3815. ChariShake = 6
  3816. CharizardShakeTimer.Enabled = True
  3817. End Sub
  3818.  
  3819. Sub CharizardShakeTimer_Timer()
  3820. Charizard.Transy = ChariShake / 2
  3821. If ChariShake = 0 Then Me.Enabled = False:Exit Sub
  3822. If ChariShake <0 Then
  3823. ChariShake = ABS(ChariShake) - 0.1
  3824. Else
  3825. ChariShake = - ChariShake + 0.1
  3826. End If
  3827. End Sub
  3828.  
  3829. Sub VenusaurShake()
  3830. DOF 118, DOFPulse
  3831. VenuShake = 6
  3832. VenusaurShakeTimer.Enabled = True
  3833. End Sub
  3834.  
  3835. Sub VenusaurShakeTimer_Timer()
  3836. Venusaur.Transy = VenuShake / 2
  3837. If VenuShake = 0 Then Me.Enabled = False:Exit Sub
  3838. If VenuShake <0 Then
  3839. VenuShake = ABS(VenuShake) - 0.1
  3840. Else
  3841. VenuShake = - VenuShake + 0.1
  3842. End If
  3843. End Sub
  3844.  
  3845. '**********************
  3846. 'Effects only triggers
  3847. '**********************
  3848.  
  3849. Sub EffectTrigger1_Hit()
  3850. FlashForMs Flasher11, 1000, 50, 0
  3851. End Sub
  3852.  
  3853. Sub EffectTrigger2_Hit()
  3854. FlashForMs Flasher12, 1000, 50, 0
  3855. End Sub
  3856.  
  3857. Sub EffectTrigger3_Hit()
  3858. FlashForMs Flasher8, 1000, 50, 0
  3859. End Sub
  3860.  
  3861.  
  3862.  
Add Comment
Please, Sign In to add comment