Arngrim

Mago de Oz DOF

Aug 24th, 2021
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 218.70 KB | None | 0 0
  1. ' ***************************************************************************
  2. ' <<< MAGO DE OZ >>>
  3. ' an original table based on the layout and rules of Stern's Iron Maiden
  4. '
  5. ' VISUAL PINBALL X
  6. ' JPSalas original DMD Pinball Script
  7. ' VPX script using core.vbs for supporting functions
  8. ' and controller.vbs to load B2S server and other controllers
  9. ' Including JP's Arcade Physics 3.0.0
  10. ' ***************************************************************************
  11.  
  12. Option Explicit
  13. Randomize
  14.  
  15. Const BallSize = 50 ' 50 is the normal size used in the core.vbs, VP kicker routines uses this value divided by 2
  16. Const BallMass = 1.7 ' standard ball mass in JP's VPX Physics 3.0
  17. Const SongVolume = 0.3 ' 1 is full volume.
  18.  
  19. ' Load the core.vbs for supporting Subs and functions
  20. LoadCoreFiles
  21.  
  22. Sub LoadCoreFiles
  23. On Error Resume Next
  24. ExecuteGlobal GetTextFile("core.vbs")
  25. If Err Then MsgBox "Can't open core.vbs"
  26. ExecuteGlobal GetTextFile("controller.vbs")
  27. If Err Then MsgBox "Can't open controller.vbs"
  28. On Error Goto 0
  29. End Sub
  30.  
  31. ' Define any Constants
  32. Const cGameName = "magodeoz"
  33. Const myVersion = "1.0.1"
  34. Const MaxPlayers = 4 ' from 1 to 4
  35. Const MaxMultiplier = 3 ' limit playfield multiplier
  36. Const MaxBonusMultiplier = 50 'limit Bonus multiplier
  37. Const BallsPerGame = 3 ' usually 3 or 5
  38. Const MaxMultiballs = 6 ' max number of balls during multiballs
  39. Dim BallSaverTime ' 20 in seconds
  40.  
  41. ' Use FlexDMD if in FS mode
  42. Dim UseFlexDMD
  43. If Table1.ShowDT = True then
  44. UseFlexDMD = False
  45. Else
  46. UseFlexDMD = True
  47. End If
  48.  
  49. ' Define Global Variables
  50. Dim PlayersPlayingGame
  51. Dim CurrentPlayer
  52. Dim Credits
  53. Dim BonusPoints(4)
  54. Dim BonusHeldPoints(4)
  55. Dim BonusMultiplier(4)
  56. Dim PlayfieldMultiplier(4)
  57. Dim PFxSeconds
  58. Dim bBonusHeld
  59. Dim BallsRemaining(4)
  60. Dim ExtraBallsAwards(4)
  61. Dim Score(4)
  62. Dim HighScore(4)
  63. Dim HighScoreName(4)
  64. Dim Jackpot(4)
  65. Dim SuperJackpot(4)
  66. Dim Tilt
  67. Dim TiltSensitivity
  68. Dim Tilted
  69. Dim TotalGamesPlayed
  70. Dim mBalls2Eject
  71. Dim SkillshotValue(4)
  72. Dim SuperSkillshotValue(4)
  73. Dim bAutoPlunger
  74. Dim bInstantInfo
  75. Dim bAttractMode
  76. Dim x
  77.  
  78. ' Define Game Control Variables
  79. Dim LastSwitchHit
  80. Dim BallsOnPlayfield
  81. Dim BallsInLock(4)
  82. Dim BallsInHole
  83.  
  84. ' Define Game Flags
  85. Dim bFreePlay
  86. Dim bGameInPlay
  87. Dim bOnTheFirstBall
  88. Dim bBallInPlungerLane
  89. Dim bBallSaverActive
  90. Dim bBallSaverReady
  91. Dim bMultiBallMode
  92. Dim bMusicOn
  93. Dim bSkillshotReady
  94. Dim bExtraBallWonThisBall
  95. Dim bJustStarted
  96. Dim bJackpot
  97. Dim bSongSelect
  98.  
  99. ' core.vbs variables
  100. Dim plungerIM 'used mostly as an autofire plunger during multiballs
  101. Dim cbRight 'captive ball Clown
  102.  
  103. ' *********************************************************************
  104. ' Visual Pinball Defined Script Events
  105. ' *********************************************************************
  106.  
  107. Sub Table1_Init()
  108. LoadEM
  109. Dim i
  110. Randomize
  111.  
  112. ' core.vbs definitions
  113. 'Impulse Plunger as autoplunger
  114. Const IMPowerSetting = 44 ' Plunger Power
  115. Const IMTime = 0.6 ' Time in seconds for Full Plunge
  116. Set plungerIM = New cvpmImpulseP
  117. With plungerIM
  118. .InitImpulseP swplunger, IMPowerSetting, IMTime
  119. .Random 1.5
  120. .InitExitSnd SoundFXDOF("fx_kicker", 141, DOFPulse, DOFContactors), SoundFXDOF("fx_solenoid", 141, DOFPulse, DOFContactors)
  121. .CreateEvents "plungerIM"
  122. End With
  123.  
  124. Set cbRight = New cvpmCaptiveBall
  125. With cbRight
  126. .InitCaptive CapTrigger2, CapWall2, Array(CapKicker2, CapKicker2a), 0
  127. .NailedBalls = 1
  128. .ForceTrans = .9
  129. .MinForce = 3.5
  130. .CreateEvents "cbRight"
  131. .Start
  132. End With
  133. CapKicker2.CreateSizedBallWithMass BallSize / 2, BallMass
  134. CapKicker1.CreateSizedBallWithMass BallSize / 2, BallMass
  135.  
  136. ' Misc. VP table objects Initialisation, droptargets, animations...
  137. VPObjects_Init
  138.  
  139. ' load saved values, highscore, names, jackpot
  140. Loadhs
  141.  
  142. ' Initalise the DMD display
  143. DMD_Init
  144.  
  145. ' freeplay or coins
  146. bFreePlay = True 'we want coins
  147.  
  148. if bFreePlay Then DOF 125, DOFOn
  149.  
  150. ' Init main variables and any other flags
  151. bAttractMode = False
  152. bOnTheFirstBall = False
  153. bBallInPlungerLane = False
  154. bBallSaverActive = False
  155. bBallSaverReady = False
  156. bMultiBallMode = False
  157. PFxSeconds = 0
  158. bGameInPlay = False
  159. bAutoPlunger = False
  160. bMusicOn = True
  161. BallsOnPlayfield = 0
  162. BallsInLock(1) = 0
  163. BallsInLock(2) = 0
  164. BallsInLock(3) = 0
  165. BallsInLock(4) = 0
  166. BallsInHole = 0
  167. LastSwitchHit = ""
  168. Tilt = 0
  169. TiltSensitivity = 6
  170. Tilted = False
  171. bBonusHeld = False
  172. bJustStarted = True
  173. bJackpot = False
  174. bInstantInfo = False
  175. bSongSelect = False
  176. ' set any lights for the attract mode
  177. StartAttractMode
  178.  
  179. ' Start the RealTime timer
  180. RealTime.Enabled = 1
  181.  
  182. ' Load table color
  183. LoadLut
  184. End Sub
  185.  
  186. '******
  187. ' Keys
  188. '******
  189.  
  190. Sub Table1_KeyDown(ByVal Keycode)
  191. If keycode = LeftMagnaSave Then bLutActive = True
  192. If keycode = RightMagnaSave Then
  193. If bLutActive Then NextLUT:End If
  194. End If
  195.  
  196. If Keycode = AddCreditKey Then
  197. Credits = Credits + 1
  198. if bFreePlay = False Then DOF 125, DOFOn
  199. If(Tilted = False)Then
  200. DMDFlush
  201. DMD "_", CL(1, "CREDITS: " & Credits), "", eNone, eNone, eNone, 500, True, "fx_coin"
  202. If NOT bGameInPlay Then ShowTableInfo
  203. End If
  204. End If
  205.  
  206. If keycode = PlungerKey Then
  207. Plunger.Pullback
  208. PlaySoundAt "fx_plungerpull", plunger
  209. End If
  210.  
  211. If hsbModeActive Then
  212. EnterHighScoreKey(keycode)
  213. Exit Sub
  214. End If
  215.  
  216. ' Table specific
  217.  
  218. If bsongSelect Then
  219. SelectSong(keycode)
  220. End If
  221.  
  222. ' Normal flipper action
  223.  
  224. If bGameInPlay AND NOT Tilted Then
  225.  
  226. If keycode = LeftTiltKey Then Nudge 90, 8:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt
  227. If keycode = RightTiltKey Then Nudge 270, 8:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt
  228. If keycode = CenterTiltKey Then Nudge 0, 9:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt
  229.  
  230. If keycode = LeftFlipperKey Then SolLFlipper 1:InstantInfoTimer.Enabled = True:RotateActivateX
  231. If keycode = RightFlipperKey Then SolRFlipper 1:InstantInfoTimer.Enabled = True:RotateActivateX
  232.  
  233. If keycode = StartGameKey Then
  234. If((PlayersPlayingGame <MaxPlayers)AND(bOnTheFirstBall = True))Then
  235.  
  236. If(bFreePlay = True)Then
  237. PlayersPlayingGame = PlayersPlayingGame + 1
  238. TotalGamesPlayed = TotalGamesPlayed + 1
  239. DMD "_", CL(1, PlayersPlayingGame & " PLAYERS"), "", eNone, eBlink, eNone, 1000, True, ""
  240. Else
  241. If(Credits> 0)then
  242. PlayersPlayingGame = PlayersPlayingGame + 1
  243. TotalGamesPlayed = TotalGamesPlayed + 1
  244. Credits = Credits - 1
  245. DMD "_", CL(1, PlayersPlayingGame & " PLAYERS"), "", eNone, eBlink, eNone, 1000, True, ""
  246. If Credits <1 And bFreePlay = False Then DOF 125, DOFOff
  247. Else
  248. ' Not Enough Credits to start a game.
  249. DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 1000, True, "vo_nocredits"
  250. End If
  251. End If
  252. End If
  253. End If
  254. Else ' If (GameInPlay)
  255.  
  256. If keycode = StartGameKey Then
  257. If(bFreePlay = True)Then
  258. PlaySound "vo_freeplay"
  259. If(BallsOnPlayfield = 0)Then
  260. ResetForNewGame()
  261. End If
  262. Else
  263. If(Credits> 0)Then
  264. If(BallsOnPlayfield = 0)Then
  265. Credits = Credits - 1
  266. If Credits <1 And bFreePlay = False Then DOF 125, DOFOff
  267. ResetForNewGame()
  268. End If
  269. Else
  270. ' Not Enough Credits to start a game.
  271. DMDFlush
  272. DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 1000, True, "vo_nocredits"
  273. ShowTableInfo
  274. End If
  275. End If
  276. End If
  277. End If ' If (GameInPlay)
  278. End Sub
  279.  
  280. Sub Table1_KeyUp(ByVal keycode)
  281.  
  282. If keycode = LeftMagnaSave Then bLutActive = False
  283.  
  284. If keycode = PlungerKey Then
  285. Plunger.Fire
  286. PlaySoundAt "fx_plunger", plunger
  287. End If
  288.  
  289. If hsbModeActive Then
  290. Exit Sub
  291. End If
  292.  
  293. ' Table specific
  294.  
  295. If bGameInPLay AND NOT Tilted Then
  296.  
  297. If keycode = LeftFlipperKey Then
  298. SolLFlipper 0
  299. InstantInfoTimer.Enabled = False
  300. If bInstantInfo Then
  301. DMDScoreNow
  302. bInstantInfo = False
  303. End If
  304. End If
  305. If keycode = RightFlipperKey Then
  306. SolRFlipper 0
  307. InstantInfoTimer.Enabled = False
  308. If bInstantInfo Then
  309. DMDScoreNow
  310. bInstantInfo = False
  311. End If
  312. End If
  313. End If
  314. End Sub
  315.  
  316. Sub InstantInfoTimer_Timer
  317. InstantInfoTimer.Enabled = False
  318. If NOT hsbModeActive Then
  319. bInstantInfo = True
  320. DMDFlush
  321. InstantInfo
  322. End If
  323. End Sub
  324.  
  325. '*************
  326. ' Pause Table
  327. '*************
  328.  
  329. Sub table1_Paused
  330. End Sub
  331.  
  332. Sub table1_unPaused
  333. End Sub
  334.  
  335. Sub Table1_Exit
  336. Savehs
  337. If UseFlexDMD Then FlexDMD.Run = False
  338. If B2SOn = True Then Controller.Stop
  339. End Sub
  340.  
  341. '********************
  342. ' Flippers
  343. '********************
  344.  
  345. Sub SolLFlipper(Enabled)
  346. If Enabled Then
  347. PlaySoundAt SoundFXDOF("fx_flipperup2", 101, DOFOn, DOFFlippers), LeftFlipper
  348. LeftFlipper.EOSTorque = 0.75:LeftFlipper.RotateToEnd
  349. LeftFlipper1.EOSTorque = 0.75:LeftFlipper1.RotateToEnd
  350. Else
  351. PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
  352. LeftFlipper.EOSTorque = 0.2:LeftFlipper.RotateToStart
  353. LeftFlipper1.EOSTorque = 0.2:LeftFlipper1.RotateToStart
  354. End If
  355. End Sub
  356.  
  357. Sub SolRFlipper(Enabled)
  358. If Enabled Then
  359. PlaySoundAt SoundFXDOF("fx_flipperup2", 102, DOFOn, DOFFlippers), RightFlipper
  360. RightFlipper.EOSTorque = 0.75:RightFlipper.RotateToEnd
  361. RightFlipper1.EOSTorque = 0.75:RightFlipper1.RotateToEnd
  362. Else
  363. PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
  364. RightFlipper.EOSTorque = 0.2:RightFlipper.RotateToStart
  365. RightFlipper1.EOSTorque = 0.2:RightFlipper1.RotateToStart
  366. End If
  367. End Sub
  368.  
  369. ' flippers hit Sound
  370.  
  371. Sub LeftFlipper_Collide(parm)
  372. PlaySound "fx_rubber_flipper", 0, parm / 60, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  373. End Sub
  374.  
  375. Sub RightFlipper_Collide(parm)
  376. PlaySound "fx_rubber_flipper", 0, parm / 60, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  377. End Sub
  378.  
  379. '*********
  380. ' TILT
  381. '*********
  382.  
  383. 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
  384.  
  385. Sub CheckTilt 'Called when table is nudged
  386. Tilt = Tilt + TiltSensitivity 'Add to tilt count
  387. TiltDecreaseTimer.Enabled = True
  388. If(Tilt> TiltSensitivity)AND(Tilt <15)Then 'show a warning
  389. DMD "_", CL(1, "CAREFUL!"), "", eNone, eBlinkFast, eNone, 1000, True, "vo_dontshakethegame"
  390. End if
  391. If Tilt> 15 Then 'If more that 15 then TILT the table
  392. 'display Tilt
  393. DMDFlush
  394. DMD "", "", "TILT", eNone, eNone, eBlink, 2000, True, "vo_tilt"
  395. Tilted = True
  396. DisableTable True
  397. TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
  398. End If
  399. End Sub
  400.  
  401. Sub TiltDecreaseTimer_Timer
  402. ' DecreaseTilt
  403. If Tilt> 0 Then
  404. Tilt = Tilt - 0.1
  405. Else
  406. TiltDecreaseTimer.Enabled = False
  407. End If
  408. End Sub
  409.  
  410. Sub DisableTable(Enabled)
  411. If Enabled Then
  412. 'turn off GI and turn off all the lights
  413. GiOff
  414. LightSeqTilt.Play SeqAllOff
  415. 'Disable slings, bumpers etc
  416. LeftFlipper.RotateToStart
  417. RightFlipper.RotateToStart
  418. Bumper1.Threshold = 100
  419. Bumper2.Threshold = 100
  420. Bumper3.Threshold = 100
  421. LeftSlingshot.Disabled = 1
  422. RightSlingshot.Disabled = 1
  423. Else
  424. 'turn back on GI and the lights
  425. GiOn
  426. LightSeqTilt.StopPlay
  427. Bumper1.Threshold = 1
  428. Bumper2.Threshold = 1
  429. Bumper3.Threshold = 1
  430. LeftSlingshot.Disabled = 0
  431. RightSlingshot.Disabled = 0
  432. 'clean up the buffer display
  433. DMDFlush
  434. End If
  435. End Sub
  436.  
  437. Sub TiltRecoveryTimer_Timer()
  438. ' if all the balls have been drained then..
  439. If(BallsOnPlayfield = 0)Then
  440. ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
  441. vpmtimer.Addtimer 2000, "EndOfBall() '"
  442. TiltRecoveryTimer.Enabled = False
  443. End If
  444. ' else retry (checks again in another second or so)
  445. End Sub
  446.  
  447. '*****************************************
  448. ' Music as wav sounds
  449. ' in VPX 10.7 you may use also mp3 or ogg
  450. '*****************************************
  451.  
  452. Dim Song, Songnr
  453. Song = ""
  454. Songnr = INT(RND * 12)
  455.  
  456. Sub PlaySong(name)
  457. If bMusicOn Then
  458. If Song <> name Then
  459. StopSound Song
  460. Song = name
  461. PlaySound Song, -1, SongVolume
  462. End If
  463. End If
  464. End Sub
  465.  
  466. Sub PlayRandomSong
  467. Songnr = INT(RND * 12)
  468. PLaySelectedSong
  469. End Sub
  470.  
  471. Sub PLaySelectedSong
  472. Select Case Songnr
  473. Case 0:PlaySong "mu_1"
  474. Case 1:PlaySong "mu_2"
  475. Case 2:PlaySong "mu_3"
  476. Case 3:PlaySong "mu_4"
  477. Case 4:PlaySong "mu_5"
  478. Case 5:PlaySong "mu_6"
  479. Case 6:PlaySong "mu_7"
  480. Case 7:PlaySong "mu_8"
  481. Case 8:PlaySong "mu_9"
  482. Case 9:PlaySong "mu_10"
  483. Case 10:PlaySong "mu_11"
  484. Case 11:PlaySong "mu_12"
  485. Case 12:PlaySong "mu_13"
  486. Case 13:PlaySong "mu_14"
  487. End Select
  488. End Sub
  489.  
  490. Sub SelectSong(keycode)
  491. If keycode = PlungerKey OR keycode = StartGameKey Then
  492. bsongSelect = False
  493. End If
  494. If keycode = LeftFlipperKey Then
  495. Songnr = (Songnr - 1)
  496. If Songnr <0 Then Songnr = 13
  497. UpdateDMDSong
  498. End If
  499. If keycode = RightFlipperKey Then
  500. Songnr = (Songnr + 1)MOD 14
  501. UpdateDMDSong
  502. End If
  503. End Sub
  504.  
  505. Sub UpdateDMDSong() 'Updates the DMD with the chosen song
  506. DMDFlush
  507. Select Case Songnr
  508. Case 0:DMD "", "", "deja", eNone, eNone, eNone, 2000, True, ""
  509. Case 1:DMD "", "", "libro", eNone, eNone, eNone, 2000, True, ""
  510. Case 2:DMD "", "", "fiesta", eNone, eNone, eNone, 2000, True, ""
  511. Case 3:DMD "", "", "hasta", eNone, eNone, eNone, 2000, True, ""
  512. Case 4:DMD "", "", "hoy", eNone, eNone, eNone, 2000, True, ""
  513. Case 5:DMD "", "", "leyenda", eNone, eNone, eNone, 2000, True, ""
  514. Case 6:DMD "", "", "posada", eNone, eNone, eNone, 2000, True, ""
  515. Case 7:DMD "", "", "viuda", eNone, eNone, eNone, 2000, True, ""
  516. Case 8:DMD "", "", "voz", eNone, eNone, eNone, 2000, True, ""
  517. Case 9:DMD "", "", "molinos", eNone, eNone, eNone, 2000, True, ""
  518. Case 10:DMD "", "", "traere", eNone, eNone, eNone, 2000, True, ""
  519. Case 11:DMD "", "", "seras", eNone, eNone, eNone, 2000, True, ""
  520. Case 12:DMD "", "", "mercado", eNone, eNone, eNone, 2000, True, ""
  521. Case 13:DMD "", "", "brujas", eNone, eNone, eNone, 2000, True, "vo_lovethissong"
  522. End Select
  523. PLaySelectedSong
  524. End Sub
  525.  
  526. '**********************
  527. ' GI effects
  528. ' independent routine
  529. ' it turns on the gi
  530. ' when there is a ball
  531. ' in play
  532. '**********************
  533.  
  534. Dim OldGiState
  535. OldGiState = -1 'start witht the Gi off
  536.  
  537. Sub ChangeGi(col) 'changes the gi color
  538. Dim bulb
  539. For each bulb in aGILights
  540. SetLightColor bulb, col, -1
  541. Next
  542. End Sub
  543.  
  544. Sub GIUpdateTimer_Timer 'not used in this table
  545. Dim tmp, obj
  546. tmp = Getballs
  547. If UBound(tmp) <> OldGiState Then
  548. OldGiState = Ubound(tmp)
  549. If UBound(tmp) = 1 Then '-1 means no balls, 0 is the first captive ball, 1 is the second captive ball...)
  550. GiOff ' turn off the gi if no active balls on the table, we could also have used the variable ballsonplayfield.
  551. Else
  552. Gion
  553. End If
  554. End If
  555. End Sub
  556.  
  557. Sub GiOn
  558. DOF 118, DOFOn
  559. Dim bulb
  560. For each bulb in aGiLights
  561. bulb.State = 1
  562. Next
  563. For each bulb in aGiFlashers
  564. bulb.Visible = 1
  565. Next
  566. End Sub
  567.  
  568. Sub GiOff
  569. DOF 118, DOFOff
  570. Dim bulb
  571. For each bulb in aGiLights
  572. bulb.State = 0
  573. Next
  574. For each bulb in aGiFlashers
  575. bulb.Visible = 0
  576. Next
  577. End Sub
  578.  
  579. ' GI, light & flashers sequence effects
  580.  
  581. Sub GiEffect(n)
  582. Dim ii
  583. Select Case n
  584. Case 0 'all off
  585. LightSeqGi.Play SeqAlloff
  586. Case 1 'all blink
  587. LightSeqGi.UpdateInterval = 15
  588. LightSeqGi.Play SeqBlinking, , 20, 10
  589. Case 2 'random
  590. LightSeqGi.UpdateInterval = 15
  591. LightSeqGi.Play SeqRandom, 50, , 1000
  592. Case 3 'all blink fast
  593. LightSeqGi.UpdateInterval = 10
  594. LightSeqGi.Play SeqBlinking, , 10, 10
  595. Case 4 'seq up
  596. LightSeqGi.UpdateInterval = 3
  597. LightSeqGi.Play SeqUpOn, 25, 3
  598. Case 5 'seq down
  599. LightSeqGi.UpdateInterval = 3
  600. LightSeqGi.Play SeqDownOn, 25, 3
  601. End Select
  602. End Sub
  603.  
  604. Sub LightEffect(n)
  605. Select Case n
  606. Case 0 ' all off
  607. LightSeqInserts.Play SeqAlloff
  608. Case 1 'all blink
  609. LightSeqInserts.UpdateInterval = 15
  610. LightSeqInserts.Play SeqBlinking, , 20, 10
  611. PlaySound "thunder1"
  612. Case 2 'random
  613. LightSeqInserts.UpdateInterval = 10
  614. LightSeqInserts.Play SeqRandom, 50, , 1000
  615. PlaySound "thunder2"
  616. Case 3 'all blink fast
  617. LightSeqInserts.UpdateInterval = 10
  618. LightSeqInserts.Play SeqBlinking, , 10, 10
  619. PlaySound "thunder3"
  620. Case 4 ' seq up
  621. LightSeqInserts.UpdateInterval = 3
  622. LightSeqInserts.Play SeqUpOn, 15, 3
  623. PlaySound "thunder1"
  624. Case 5 'seq down
  625. LightSeqInserts.UpdateInterval = 3
  626. LightSeqInserts.Play SeqDownOn, 15, 3
  627. PlaySound "thunder1"
  628. End Select
  629. End Sub
  630.  
  631. Sub FlashEffect(n) 'adjusted for this table
  632. Select Case n
  633. Case 1: ' all blink
  634. SetFlash Flasher004, 4, 2000, 50
  635. SetFlash Flasher005, 5, 2000, 50
  636. SetFlash Flasher003, 3, 2000, 50
  637. SetFlash Flasher002, 2, 2000, 50
  638. SetFlash Flasher001, 1, 2000, 50
  639. SetFlash Flasher009, 9, 2000, 50
  640. SetFlash Flasher010, 10, 2000, 50
  641. case 2: 'random
  642. SetFlash Flasher004, 4, 2000, 50
  643. vpmtimer.addtimer 200, "SetFlash Flasher005,5,2000,50 '"
  644. vpmtimer.addtimer 1200, "SetFlash Flasher003,3,2000,50 '"
  645. vpmtimer.addtimer 400, "SetFlash Flasher002,2,2000,50 '"
  646. vpmtimer.addtimer 800, "SetFlash Flasher001,1,2000,50 '"
  647. vpmtimer.addtimer 600, "SetFlash Flasher009,9,2000,50 '"
  648. vpmtimer.addtimer 1000, "SetFlash Flasher010,10,2000,50 '"
  649. Case 1: ' all blink fast
  650. SetFlash Flasher004, 4, 1000, 50
  651. SetFlash Flasher005, 5, 1000, 50
  652. SetFlash Flasher003, 3, 1000, 50
  653. SetFlash Flasher002, 2, 1000, 50
  654. SetFlash Flasher001, 1, 1000, 50
  655. SetFlash Flasher009, 9, 1000, 50
  656. SetFlash Flasher010, 10, 1000, 50
  657. Case 4 ' seq up
  658. vpmtimer.addtimer 400, "SetFlash Flasher004,4,2000,50 '"
  659. vpmtimer.addtimer 400, "SetFlash Flasher005,5,2000,50 '"
  660. vpmtimer.addtimer 300, "SetFlash Flasher003,3,2000,50 '"
  661. vpmtimer.addtimer 200, "SetFlash Flasher002,2,2000,50 '"
  662. vpmtimer.addtimer 200, "SetFlash Flasher001,1,2000,50 '"
  663. vpmtimer.addtimer 10, "SetFlash Flasher009,9,2000,50 '"
  664. vpmtimer.addtimer 10, "SetFlash Flasher010,10,2000,50 '"
  665. Case 5 'seq down
  666. vpmtimer.addtimer 10, "SetFlash Flasher004,4,2000,50 '"
  667. vpmtimer.addtimer 10, "SetFlash Flasher005,5,2000,50 '"
  668. vpmtimer.addtimer 200, "SetFlash Flasher003,3,2000,50 '"
  669. vpmtimer.addtimer 300, "SetFlash Flasher002,2,2000,50 '"
  670. vpmtimer.addtimer 300, "SetFlash Flasher001,1,2000,50 '"
  671. vpmtimer.addtimer 400, "SetFlash Flasher009,9,2000,50 '"
  672. vpmtimer.addtimer 400, "SetFlash Flasher010,10,2000,50 '"
  673. End Select
  674. End Sub
  675.  
  676. '***************************************************************
  677. ' Supporting Ball & Sound Functions v3.0
  678. ' includes random pitch in PlaySoundAt and PlaySoundAtBall
  679. '***************************************************************
  680.  
  681. Dim TableWidth, TableHeight
  682.  
  683. TableWidth = Table1.width
  684. TableHeight = Table1.height
  685.  
  686. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  687. Vol = Csng(BallVel(ball) ^2 / 2000)
  688. End Function
  689.  
  690. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  691. Dim tmp
  692. tmp = ball.x * 2 / TableWidth-1
  693. If tmp> 0 Then
  694. Pan = Csng(tmp ^10)
  695. Else
  696. Pan = Csng(-((- tmp) ^10))
  697. End If
  698. End Function
  699.  
  700. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  701. Pitch = BallVel(ball) * 20
  702. End Function
  703.  
  704. Function BallVel(ball) 'Calculates the ball speed
  705. BallVel = (SQR((ball.VelX ^2) + (ball.VelY ^2)))
  706. End Function
  707.  
  708. Function AudioFade(ball) 'only on VPX 10.4 and newer
  709. Dim tmp
  710. tmp = ball.y * 2 / TableHeight-1
  711. If tmp> 0 Then
  712. AudioFade = Csng(tmp ^10)
  713. Else
  714. AudioFade = Csng(-((- tmp) ^10))
  715. End If
  716. End Function
  717.  
  718. Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
  719. PlaySound soundname, 0, 1, Pan(tableobj), 0.1, 0, 0, 0, AudioFade(tableobj)
  720. End Sub
  721.  
  722. Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets, metals, plastics
  723. PlaySound soundname, 0, Vol(ActiveBall), pan(ActiveBall), 0.4, 0, 0, 0, AudioFade(ActiveBall)
  724. End Sub
  725.  
  726. '***********************************************
  727. ' JP's VP10 Rolling Sounds + Ballshadow v3.0
  728. ' uses a collection of shadows, aBallShadow
  729. '***********************************************
  730.  
  731. Const tnob = 19 'total number of balls, 20 balls, from 0 to 19
  732. Const lob = 3 'number of locked balls
  733. Const maxvel = 42 'max ball velocity
  734. ReDim rolling(tnob)
  735. InitRolling
  736.  
  737. Sub InitRolling
  738. Dim i
  739. For i = 0 to tnob
  740. rolling(i) = False
  741. Next
  742. End Sub
  743.  
  744. Sub RollingUpdate()
  745. Dim BOT, b, ballpitch, ballvol, speedfactorx, speedfactory
  746. BOT = GetBalls
  747.  
  748. ' stop the sound of deleted balls and hide the shadow
  749. For b = UBound(BOT) + 1 to tnob
  750. rolling(b) = False
  751. StopSound("fx_ballrolling" & b)
  752. aBallShadow(b).Y = 3000
  753. Next
  754.  
  755. ' exit the sub if no balls on the table
  756. If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table
  757.  
  758. ' play the rolling sound for each ball and draw the shadow
  759. For b = lob to UBound(BOT)
  760. aBallShadow(b).X = BOT(b).X
  761. aBallShadow(b).Y = BOT(b).Y
  762. aBallShadow(b).Height = BOT(b).Z -24
  763.  
  764. If BallVel(BOT(b))> 1 Then
  765. If BOT(b).z <30 Then
  766. ballpitch = Pitch(BOT(b))
  767. ballvol = Vol(BOT(b))
  768. Else
  769. ballpitch = Pitch(BOT(b)) + 25000 'increase the pitch on a ramp
  770. ballvol = Vol(BOT(b)) * 10
  771. End If
  772. rolling(b) = True
  773. PlaySound("fx_ballrolling" & b), -1, ballvol, Pan(BOT(b)), 0, ballpitch, 1, 0, AudioFade(BOT(b))
  774. Else
  775. If rolling(b) = True Then
  776. StopSound("fx_ballrolling" & b)
  777. rolling(b) = False
  778. End If
  779. End If
  780.  
  781. ' rothbauerw's Dropping Sounds
  782. If BOT(b).VelZ <-1 and BOT(b).z <55 and BOT(b).z> 27 Then 'height adjust for ball drop sounds
  783. PlaySound "fx_balldrop", 0, ABS(BOT(b).velz) / 17, Pan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  784. End If
  785.  
  786. ' jps ball speed control
  787. If BOT(b).VelX AND BOT(b).VelY <> 0 Then
  788. speedfactorx = ABS(maxvel / BOT(b).VelX)
  789. speedfactory = ABS(maxvel / BOT(b).VelY)
  790. If speedfactorx <1 Then
  791. BOT(b).VelX = BOT(b).VelX * speedfactorx
  792. BOT(b).VelY = BOT(b).VelY * speedfactorx
  793. End If
  794. If speedfactory <1 Then
  795. BOT(b).VelX = BOT(b).VelX * speedfactory
  796. BOT(b).VelY = BOT(b).VelY * speedfactory
  797. End If
  798. End If
  799. Next
  800. End Sub
  801.  
  802. '**********************
  803. ' Ball Collision Sound
  804. '**********************
  805.  
  806. Sub OnBallBallCollision(ball1, ball2, velocity)
  807. PlaySound "fx_collide", 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  808. End Sub
  809.  
  810. '************************************
  811. ' Diverse Collection Hit Sounds v3.0
  812. '************************************
  813.  
  814. Sub aMetals_Hit(idx):PlaySoundAtBall "fx_MetalHit":End Sub
  815. Sub aMetalWires_Hit(idx):PlaySoundAtBall "fx_MetalWire":End Sub
  816. Sub aRubber_Bands_Hit(idx):PlaySoundAtBall "fx_rubber_band":End Sub
  817. Sub aRubber_LongBands_Hit(idx):PlaySoundAtBall "fx_rubber_longband":End Sub
  818. Sub aRubber_Posts_Hit(idx):PlaySoundAtBall "fx_rubber_post":End Sub
  819. Sub aRubber_Pins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub
  820. Sub aRubber_Pegs_Hit(idx):PlaySoundAtBall "fx_rubber_peg":End Sub
  821. Sub aPlastics_Hit(idx):PlaySoundAtBall "fx_PlasticHit":End Sub
  822. Sub aGates_Hit(idx):PlaySoundAtBall "fx_Gate":End Sub
  823. Sub aWoods_Hit(idx):PlaySoundAtBall "fx_Woodhit":End Sub
  824. Sub aTargets_Hit(idx):ActiveBall.VelZ = BallVel(Activeball) * (RND / 2):End Sub
  825.  
  826. ' *********************************************************************
  827. ' User Defined Script Events
  828. ' *********************************************************************
  829.  
  830. ' Initialise the Table for a new Game
  831. '
  832. Sub ResetForNewGame()
  833. Dim i
  834.  
  835. bGameInPLay = True
  836.  
  837. 'resets the score display, and turn off attract mode
  838. StopAttractMode
  839.  
  840. TotalGamesPlayed = TotalGamesPlayed + 1
  841. CurrentPlayer = 1
  842. PlayersPlayingGame = 1
  843. bOnTheFirstBall = True
  844. For i = 1 To MaxPlayers
  845. Score(i) = 0
  846. BonusPoints(i) = 0
  847. BonusHeldPoints(i) = 0
  848. BonusMultiplier(i) = 1
  849. PlayfieldMultiplier(i) = 1
  850. BallsRemaining(i) = BallsPerGame
  851. ExtraBallsAwards(i) = 0
  852. Next
  853.  
  854. ' initialise any other flags
  855. Tilt = 0
  856.  
  857. ' initialise Game variables
  858. Game_Init()
  859.  
  860. ' you may wish to start some music, play a sound, do whatever at this point
  861.  
  862. vpmtimer.addtimer 1500, "FirstBall '"
  863. End Sub
  864.  
  865. ' This is used to delay the start of a game to allow any attract sequence to
  866. ' complete. When it expires it creates a ball for the player to start playing with
  867.  
  868. Sub FirstBall
  869. ' reset the table for a new ball
  870. ResetForNewPlayerBall()
  871. ' create a new ball in the shooters lane
  872. CreateNewBall()
  873. End Sub
  874.  
  875. ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
  876. ' lost one or we have moved onto the next player (if multiple are playing))
  877.  
  878. Sub ResetForNewPlayerBall()
  879. ' make sure the correct display is upto date
  880. AddScore 0
  881.  
  882. ' set the current players bonus multiplier back down to 1X
  883. BonusMultiplier(CurrentPlayer) = 1:UpdateBonusxLights
  884.  
  885. ' set the playfield multiplier
  886. ' reset any drop targets, lights, game Mode etc..
  887.  
  888. BonusPoints(CurrentPlayer) = 0
  889. bBonusHeld = False
  890. bExtraBallWonThisBall = False
  891.  
  892. 'Reset any table specific
  893. ResetNewBallVariables
  894. ResetNewBallLights()
  895.  
  896. 'This is a new ball, so activate the ballsaver
  897. bBallSaverReady = True
  898.  
  899. 'and the skillshot
  900. bSkillShotReady = True
  901.  
  902. 'Change the music ?
  903. End Sub
  904.  
  905. ' Create a new ball on the Playfield
  906.  
  907. Sub CreateNewBall()
  908. ' create a ball in the plunger lane kicker.
  909. BallRelease.CreateSizedBallWithMass BallSize / 2, BallMass
  910.  
  911. ' There is a (or another) ball on the playfield
  912. BallsOnPlayfield = BallsOnPlayfield + 1
  913.  
  914. ' kick it out..
  915. PlaySoundAt SoundFXDOF("fx_Ballrel", 123, DOFPulse, DOFContactors), BallRelease
  916. BallRelease.Kick 90, 4
  917.  
  918. ' if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations)
  919. ' set the bAutoPlunger flag to kick the ball in play automatically
  920. If BallsOnPlayfield> 1 Then
  921. DOF 143, DOFPulse
  922. bMultiBallMode = True
  923. bAutoPlunger = True
  924. End If
  925. End Sub
  926.  
  927. ' Add extra balls to the table with autoplunger
  928. ' Use it as AddMultiball 4 to add 4 extra balls to the table
  929.  
  930. Sub AddMultiball(nballs)
  931. mBalls2Eject = mBalls2Eject + nballs
  932. CreateMultiballTimer.Enabled = True
  933. 'and eject the first ball
  934. CreateMultiballTimer_Timer
  935. End Sub
  936.  
  937. ' Eject the ball after the delay, AddMultiballDelay
  938. Sub CreateMultiballTimer_Timer()
  939. ' wait if there is a ball in the plunger lane
  940. If bBallInPlungerLane Then
  941. Exit Sub
  942. Else
  943. If BallsOnPlayfield <MaxMultiballs Then
  944. CreateNewBall()
  945. mBalls2Eject = mBalls2Eject -1
  946. If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
  947. CreateMultiballTimer.Enabled = False
  948. End If
  949. Else 'the max number of multiballs is reached, so stop the timer
  950. mBalls2Eject = 0
  951. CreateMultiballTimer.Enabled = False
  952. End If
  953. End If
  954. End Sub
  955.  
  956. ' The Player has lost his ball (there are no more balls on the playfield).
  957. ' Handle any bonus points awarded
  958.  
  959. Sub EndOfBall()
  960. Dim AwardPoints, TotalBonus, ii
  961. AwardPoints = 0
  962. TotalBonus = 0
  963. ' the first ball has been lost. From this point on no new players can join in
  964. bOnTheFirstBall = False
  965.  
  966. ' only process any of this if the table is not tilted. (the tilt recovery
  967. ' mechanism will handle any extra balls or end of game)
  968.  
  969. If NOT Tilted Then
  970.  
  971. 'Count the bonus. This table uses several bonus
  972. DMD CL(0, "BONUS COUNT"), "", "", eNone, eNone, eNone, 1000, True, ""
  973.  
  974. 'Switch Bonus
  975. AwardPoints = SwitchBonusCount * 3500
  976. TotalBonus = AwardPoints
  977. DMD CL(0, "SWITCHES X " & SwitchBonusCount), CL(1, FormatScore(AwardPoints)), "", eNone, eNone, eNone, 1000, True, ""
  978.  
  979. 'Ilussia letters
  980. AwardPoints = IlussiaBonusCount * 25000
  981. TotalBonus = TotalBonus + AwardPoints
  982. DMD CL(0, "ILUSSIA LETTERS X " & IlussiaBonusCount), CL(1, FormatScore(AwardPoints)), "", eNone, eNone, eNone, 1000, True, ""
  983.  
  984. 'Deathblows
  985. AwardPoints = DeathblowBonusCount * 45000
  986. TotalBonus = TotalBonus + AwardPoints
  987. DMD CL(0, "DEATHBLOWS X " & DeathblowBonusCount), CL(1, FormatScore(AwardPoints)), "", eNone, eNone, eNone, 1000, True, ""
  988.  
  989. 'Loops
  990. AwardPoints = LoopsBonusCount * 50000
  991. TotalBonus = TotalBonus + AwardPoints
  992. DMD CL(0, "LOOPS X " & LoopsBonusCount), CL(1, FormatScore(AwardPoints)), "", eNone, eNone, eNone, 1000, True, ""
  993.  
  994. 'Pyramid awards completed
  995. AwardPoints = PyramidBonusCount * 75000
  996. TotalBonus = TotalBonus + AwardPoints
  997. DMD CL(0, "PYRAMIDS X " & PyramidBonusCount), CL(1, FormatScore(AwardPoints)), "", eNone, eNone, eNone, 1000, True, ""
  998.  
  999. 'Mancha Xanandra completed
  1000. AwardPoints = ManchaXBonusCount * 250000
  1001. TotalBonus = TotalBonus + AwardPoints
  1002. DMD CL(0, "MANCHA XANANDRA " & ManchaXBonusCount), CL(1, FormatScore(AwardPoints)), "", eNone, eNone, eNone, 1000, True, ""
  1003.  
  1004. ' calculate the totalbonus
  1005. TotalBonus = TotalBonus * BonusMultiplier(CurrentPlayer)
  1006.  
  1007. ' handle the bonus held
  1008. ' reset the bonus held value since it has been already added to the bonus
  1009. 'BonusHeldPoints(CurrentPlayer) = 0
  1010.  
  1011. ' the player has won the bonus held award so do something with it :)
  1012. 'If bBonusHeld Then
  1013. ' If Balls = BallsPerGame Then ' this is the last ball, so if bonus held has been awarded then double the bonus
  1014. ' TotalBonus = TotalBonus * 2
  1015. ' End If
  1016. 'Else ' this is not the last ball so save the bonus for the next ball
  1017. ' BonusHeldPoints(CurrentPlayer) = TotalBonus
  1018. 'End If
  1019. bBonusHeld = False
  1020.  
  1021. ' Add the bonus to the score
  1022. DMD CL(0, "TOTAL BONUS " & " X" & BonusMultiplier(CurrentPlayer)), CL(1, FormatScore(TotalBonus)), "", eNone, eNone, eNone, 2000, True, ""
  1023.  
  1024. AddScore TotalBonus
  1025.  
  1026. ' add a bit of a delay to allow for the bonus points to be shown & added up
  1027. vpmtimer.addtimer 9500, "EndOfBall2 '"
  1028. Else 'if tilted then only add a short delay and go to the next end of ball routine.
  1029. vpmtimer.addtimer 200, "EndOfBall2 '"
  1030. End If
  1031. End Sub
  1032.  
  1033. ' The Timer which delays the machine to allow any bonus points to be added up
  1034. ' has expired. Check to see if there are any extra balls for this player.
  1035. ' if not, then check to see if this was the last ball (of the CurrentPlayer)
  1036. '
  1037. Sub EndOfBall2()
  1038. ' if were tilted, reset the internal tilted flag (this will also
  1039. ' set TiltWarnings back to zero) which is useful if we are changing player LOL
  1040. Tilted = False
  1041. Tilt = 0
  1042. DisableTable False 'enable again bumpers and slingshots
  1043.  
  1044. ' has the player won an extra-ball ? (might be multiple outstanding)
  1045. If(ExtraBallsAwards(CurrentPlayer) <> 0)Then
  1046. 'debug.print "Extra Ball"
  1047.  
  1048. ' yep got to give it to them
  1049. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer)- 1
  1050.  
  1051. ' if no more EB's then turn off any shoot again light
  1052. If(ExtraBallsAwards(CurrentPlayer) = 0)Then
  1053. LightShootAgain.State = 0
  1054. End If
  1055.  
  1056. ' You may wish to do a bit of a song AND dance at this point
  1057. DMD CL(0, "EXTRA BALL"), CL(1, "SHOOT AGAIN"), "", eNone, eNone, eBlink, 1000, True, ""
  1058.  
  1059. ' In this table an extra ball will have the skillshot and ball saver, so we reset the playfield for the new ball
  1060. ResetForNewPlayerBall()
  1061.  
  1062. ' Create a new ball in the shooters lane
  1063. CreateNewBall()
  1064. Else ' no extra balls
  1065.  
  1066. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer)- 1
  1067.  
  1068. ' was that the last ball ?
  1069. If(BallsRemaining(CurrentPlayer) <= 0)Then
  1070. 'debug.print "No More Balls, High Score Entry"
  1071.  
  1072. ' Submit the CurrentPlayers score to the High Score system
  1073. CheckHighScore()
  1074. ' you may wish to play some music at this point
  1075.  
  1076. Else
  1077.  
  1078. ' not the last ball (for that player)
  1079. ' if multiple players are playing then move onto the next one
  1080. EndOfBallComplete()
  1081. End If
  1082. End If
  1083. End Sub
  1084.  
  1085. ' This function is called when the end of bonus display
  1086. ' (or high score entry finished) AND it either end the game or
  1087. ' move onto the next player (or the next ball of the same player)
  1088. '
  1089. Sub EndOfBallComplete()
  1090. Dim NextPlayer
  1091.  
  1092. 'debug.print "EndOfBall - Complete"
  1093.  
  1094. ' are there multiple players playing this game ?
  1095. If(PlayersPlayingGame> 1)Then
  1096. ' then move to the next player
  1097. NextPlayer = CurrentPlayer + 1
  1098. ' are we going from the last player back to the first
  1099. ' (ie say from player 4 back to player 1)
  1100. If(NextPlayer> PlayersPlayingGame)Then
  1101. NextPlayer = 1
  1102. End If
  1103. Else
  1104. NextPlayer = CurrentPlayer
  1105. End If
  1106.  
  1107. 'debug.print "Next Player = " & NextPlayer
  1108.  
  1109. ' is it the end of the game ? (all balls been lost for all players)
  1110. If((BallsRemaining(CurrentPlayer) <= 0)AND(BallsRemaining(NextPlayer) <= 0))Then
  1111. ' you may wish to do some sort of Point Match free game award here
  1112. ' generally only done when not in free play mode
  1113.  
  1114. ' set the machine into game over mode
  1115. EndOfGame()
  1116.  
  1117. ' you may wish to put a Game Over message on the desktop/backglass
  1118.  
  1119. Else
  1120. ' set the next player
  1121. CurrentPlayer = NextPlayer
  1122.  
  1123. ' make sure the correct display is up to date
  1124. AddScore 0
  1125.  
  1126. ' reset the playfield for the new player (or new ball)
  1127. ResetForNewPlayerBall()
  1128.  
  1129. ' AND create a new ball
  1130. CreateNewBall()
  1131.  
  1132. ' play a sound if more than 1 player
  1133. If PlayersPlayingGame> 1 Then
  1134. Select Case CurrentPlayer
  1135. Case 1:DMD "", "", "player1", eNone, eNone, eNone, 1000, True, "vo_player1"
  1136. Case 2:DMD "", "", "player2", eNone, eNone, eNone, 1000, True, "vo_player2"
  1137. Case 3:DMD "", "", "player3", eNone, eNone, eNone, 1000, True, "vo_player3"
  1138. Case 4:DMD "", "", "player4", eNone, eNone, eNone, 1000, True, "vo_player4"
  1139. End Select
  1140. Else
  1141. DMD "", "", "player1", eNone, eNone, eNone, 1000, True, "vo_youareup"
  1142. End If
  1143. End If
  1144. End Sub
  1145.  
  1146. ' This function is called at the End of the Game, it should reset all
  1147. ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
  1148.  
  1149. Sub EndOfGame()
  1150. 'debug.print "End Of Game"
  1151. bGameInPLay = False
  1152. ' just ended your game then play the end of game tune
  1153. If NOT bJustStarted Then
  1154.  
  1155. End If
  1156. bJustStarted = False
  1157. ' ensure that the flippers are down
  1158. SolLFlipper 0
  1159. SolRFlipper 0
  1160.  
  1161. ' terminate all Mode - eject locked balls
  1162. ' most of the Mode/timers terminate at the end of the ball
  1163.  
  1164. ' set any lights for the attract mode
  1165. StartAttractMode
  1166. ' you may wish to light any Game Over Light you may have
  1167. End Sub
  1168.  
  1169. Function Balls
  1170. Dim tmp
  1171. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  1172. If tmp> BallsPerGame Then
  1173. Balls = BallsPerGame
  1174. Else
  1175. Balls = tmp
  1176. End If
  1177. End Function
  1178.  
  1179. ' *********************************************************************
  1180. ' Drain / Plunger Functions
  1181. ' *********************************************************************
  1182.  
  1183. ' lost a ball ;-( check to see how many balls are on the playfield.
  1184. ' if only one then decrement the remaining count AND test for End of game
  1185. ' if more than 1 ball (multi-ball) then kill of the ball but don't create
  1186. ' a new one
  1187. '
  1188. Sub Drain_Hit()
  1189. ' Destroy the ball
  1190. Drain.DestroyBall
  1191. If bGameInPLay = False Then Exit Sub 'don't do anything, just delete the ball
  1192. ' Exit Sub ' only for debugging - this way you can add balls from the debug window
  1193.  
  1194. BallsOnPlayfield = BallsOnPlayfield - 1
  1195.  
  1196. ' pretend to knock the ball into the ball storage mech
  1197. PlaySoundAt "fx_drain", Drain
  1198. 'if Tilted the end Ball Mode
  1199. If Tilted Then
  1200. StopEndOfBallMode
  1201. End If
  1202.  
  1203. ' if there is a game in progress AND it is not Tilted
  1204. If(bGameInPLay = True)AND(Tilted = False)Then
  1205.  
  1206. ' is the ball saver active,
  1207. If(bBallSaverActive = True)Then
  1208.  
  1209. ' yep, create a new ball in the shooters lane
  1210. ' we use the Addmultiball in case the multiballs are being ejected
  1211. AddMultiball 1
  1212. ' we kick the ball with the autoplunger
  1213. bAutoPlunger = True
  1214. ' you may wish to put something on a display or play a sound at this point
  1215. DMD "_", CL(1, "BALL SAVED"), "", eNone, eBlinkfast, eNone, 800, True, "vo_playagain"
  1216. Else
  1217. ' cancel any multiball if on last ball (ie. lost all other balls)
  1218. If(BallsOnPlayfield = 1)Then
  1219. ' AND in a multi-ball??
  1220. If(bMultiBallMode = True)then
  1221. ' not in multiball mode any more
  1222. bMultiBallMode = False
  1223. ' you may wish to change any music over at this point and
  1224.  
  1225. ' turn off any multiball specific lights
  1226. ChangeGi white
  1227. 'stop any multiball modes
  1228. StopMultiballModes
  1229. End If
  1230. End If
  1231.  
  1232. ' was that the last ball on the playfield
  1233. If(BallsOnPlayfield = 0)Then
  1234. ' End Mode and timers
  1235.  
  1236. ChangeGi white
  1237. ' Show the end of ball animation
  1238. ' and continue with the end of ball
  1239. ' DMD something?
  1240. StopEndOfBallMode
  1241. vpmtimer.addtimer 200, "EndOfBall '" 'the delay is depending of the animation of the end of ball, if there is no animation then move to the end of ball
  1242. End If
  1243. End If
  1244. End If
  1245. End Sub
  1246.  
  1247. ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane
  1248. ' Check to see if a ball saver mechanism is needed and if so fire it up.
  1249.  
  1250. Sub swPlungerRest_Hit()
  1251. 'debug.print "ball in plunger lane"
  1252. ' some sound according to the ball position
  1253. PlaySoundAt "fx_sensor", swPlungerRest
  1254. bBallInPlungerLane = True
  1255. ' turn on Launch light is there is one
  1256.  
  1257. 'be sure to update the Scoreboard after the animations, if any
  1258.  
  1259. ' kick the ball in play if the bAutoPlunger flag is on
  1260. If bAutoPlunger Then
  1261. 'debug.print "autofire the ball"
  1262. PlungerIM.AutoFire
  1263. PlaySoundAt SoundFXDOF("fx_kicker",141,DOFPulse,DOFContactors), swPlungerRest
  1264. bAutoPlunger = False
  1265. End If
  1266. ' if there is a need for a ball saver, then start off a timer
  1267. ' only start if it is ready, and it is currently not running, or else it will reset the time period
  1268. If(bBallSaverReady = True)AND(BallSaverTime <> 0)And(bBallSaverActive = False)Then
  1269. EnableBallSaver BallSaverTime
  1270. End If
  1271. 'Start the Selection of the song and skillshot if ready
  1272. If bSkillShotReady Then
  1273. UpdateSkillshot()
  1274. 'If Balls = 1 Then PlaySound "vo_changetrack"play
  1275. bSongSelect = True
  1276. vpmtimer.addtimer 2000, "UpdateDMDSong '"
  1277. End If
  1278. ' show the message to shoot the ball in case the player has fallen sleep :)
  1279. swPlungerRest.TimerEnabled = 1
  1280. ' remember last trigger hit by the ball.
  1281. LastSwitchHit = "swPlungerRest"
  1282. End Sub
  1283.  
  1284. ' The ball is released from the plunger turn off some flags and check for skillshot
  1285.  
  1286. Sub swPlungerRest_UnHit()
  1287. swPlungerRest.TimerEnabled = 0
  1288. DMDScorenow
  1289. bBallInPlungerLane = False
  1290. bsongSelect = False
  1291. swPlungerRest.TimerEnabled = 0 'stop the launch ball timer if active
  1292. If bSkillShotReady Then
  1293. ResetSkillShotTimer.Enabled = 1
  1294. End If
  1295. LightEffect 4
  1296. ' turn off LaunchLight
  1297. ' LaunchLight.State = 0
  1298. End Sub
  1299.  
  1300. ' swPlungerRest timer to show the "launch ball" if the player has not shot the ball during 6 seconds
  1301.  
  1302. Sub swPlungerRest_Timer
  1303. Dim tmp
  1304. DMDFlush
  1305. tmp = INT(RND * 4)
  1306. Select case tmp
  1307. case 0:DMD "_", CL(1, "SHOOT THE BALL"), "", eNone, eNone, eNone, 1500, True, "vo_punchtheball"
  1308. case 1:DMD "_", CL(1, "SHOOT THE BALL"), "", eNone, eNone, eNone, 1500, True, "vo_itsgotime"
  1309. case 2:DMD "_", CL(1, "SHOOT THE BALL"), "", eNone, eNone, eNone, 1500, True, "vo_letsball"
  1310. case 3:DMD "_", CL(1, "SHOOT THE BALL"), "", eNone, eNone, eNone, 1500, True, "vo_showwhatyougot"
  1311. End Select
  1312. End Sub
  1313.  
  1314. Sub EnableBallSaver(seconds)
  1315. 'debug.print "Ballsaver started"
  1316. ' set our game flag
  1317. bBallSaverActive = True
  1318. bBallSaverReady = False
  1319. ' start the timer
  1320. BallSaverTimerExpired.Interval = 1000 * seconds
  1321. BallSaverTimerExpired.Enabled = True
  1322. BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
  1323. BallSaverSpeedUpTimer.Enabled = True
  1324. ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
  1325. LightShootAgain.BlinkInterval = 160
  1326. LightShootAgain.State = 2
  1327. End Sub
  1328.  
  1329. ' The ball saver timer has expired. Turn it off AND reset the game flag
  1330. '
  1331. Sub BallSaverTimerExpired_Timer()
  1332. 'debug.print "Ballsaver ended"
  1333. BallSaverTimerExpired.Enabled = False
  1334. ' clear the flag
  1335. bBallSaverActive = False
  1336. ' if you have a ball saver light then turn it off at this point
  1337. LightShootAgain.State = 0
  1338. End Sub
  1339.  
  1340. Sub BallSaverSpeedUpTimer_Timer()
  1341. 'debug.print "Ballsaver Speed Up Light"
  1342. BallSaverSpeedUpTimer.Enabled = False
  1343. ' Speed up the blinking
  1344. LightShootAgain.BlinkInterval = 80
  1345. LightShootAgain.State = 2
  1346. End Sub
  1347.  
  1348. ' *********************************************************************
  1349. ' Supporting Score Functions
  1350. ' *********************************************************************
  1351.  
  1352. ' Add points to the score AND update the score board
  1353.  
  1354. Sub AddScore(points)
  1355. If Tilted Then Exit Sub
  1356. ' add the points to the current players score variable
  1357. If PFxActivated Then
  1358. Score(CurrentPlayer) = Score(CurrentPlayer) + points * PlayfieldMultiplier(CurrentPlayer)
  1359. Else
  1360. Score(CurrentPlayer) = Score(CurrentPlayer) + points
  1361. End if
  1362. ' you may wish to check to see if the player has gotten a replay
  1363. End Sub
  1364.  
  1365. ' Add bonus to the bonuspoints AND update the score board
  1366.  
  1367. Sub AddBonus(points) 'not used in this table, since there are many different bonus items.
  1368. If Tilted Then Exit Sub
  1369. ' add the bonus to the current players bonus variable
  1370. BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points
  1371. End Sub
  1372.  
  1373. ' Add some points to the current Jackpot.
  1374. '
  1375. Sub AddJackpot(points)
  1376. ' Jackpots only generally increment in multiball mode AND not tilted, but this doesn't have to be the case
  1377. If Tilted Then Exit Sub
  1378. ' If(bMultiBallMode = True) Then
  1379. Jackpot(CurrentPlayer) = Jackpot(CurrentPlayer) + points
  1380. 'DMD "_", CL(1, "INCREASED JACKPOT"), "", eNone, eNone, eNone, 800, True, ""
  1381. ' you may wish to limit the jackpot to a upper limit, ie..
  1382. ' If (Jackpot >= 6000) Then
  1383. ' Jackpot = 6000
  1384. ' End if
  1385. 'End if
  1386. End Sub
  1387.  
  1388. Sub AddSuperJackpot(points) 'not used in this table
  1389. If(Tilted = False)Then
  1390. End if
  1391. SuperJackpot(CurrentPlayer) = SuperJackpot(CurrentPlayer) + points
  1392. End Sub
  1393.  
  1394. Sub AddBonusMultiplier(n)
  1395. ' if not at the maximum bonus level
  1396. if(BonusMultiplier(CurrentPlayer) + n <= MaxBonusMultiplier)then
  1397. ' then add and set the lights
  1398. BonusMultiplier(CurrentPlayer) = BonusMultiplier(CurrentPlayer) + n
  1399. UPdateBonusXLights
  1400. DMD "_", CL(1, "BONUS X IS " &BonusMultiplier(CurrentPlayer)), "", eNone, eNone, eNone, 1500, True, "fanfare8"
  1401. Else
  1402. AddScore 50000
  1403. DMD "_", CL(1, "50000 POINTS"), "", eNone, eNone, eNone, 1500, True, ""
  1404. End if
  1405. End Sub
  1406.  
  1407. Sub UpdateBonusXLights
  1408. ' Update the lights
  1409. 'Select Case BonusMultiplier(CurrentPlayer)
  1410. 'Case 1:light54.State = 0:light55.State = 0:light56.State = 0:light57.State = 0
  1411. 'Case 2:light54.State = 1:light55.State = 0:light56.State = 0:light57.State = 0
  1412. 'Case 3:light54.State = 0:light55.State = 1:light56.State = 0:light57.State = 0
  1413. 'Case 4:light54.State = 0:light55.State = 0:light56.State = 1:light57.State = 0
  1414. 'Case 5:light54.State = 0:light55.State = 0:light56.State = 0:light57.State = 1
  1415. 'End Select
  1416. End Sub
  1417.  
  1418. Sub AddPlayfieldMultiplier(n)
  1419. ' if not at the maximum level x
  1420. if(PlayfieldMultiplier(CurrentPlayer) + n <= MaxMultiplier)then
  1421. ' then add and set the lights
  1422. PlayfieldMultiplier(CurrentPlayer) = PlayfieldMultiplier(CurrentPlayer) + n
  1423. PFxSeconds = PFxSeconds + 30 * n
  1424. UpdatePFXLights
  1425. DMD "_", CL(1, "PLAYFIELD X " &PlayfieldMultiplier(CurrentPlayer)), "", eNone, eNone, eNone, 1500, True, ""
  1426. If PlayfieldMultiplier(CurrentPlayer)> 1 Then PlaySound "Fanfare5"
  1427. End if
  1428. 'Start the timer to reduce the playfield x every 30 seconds
  1429. 'in this table this timer is activated from the inlanes
  1430. 'pfxtimer.Enabled = 1
  1431. End Sub
  1432.  
  1433. Sub pfxtimer_Timer
  1434. debug.print PFxSeconds
  1435. PFxSeconds = PFxSeconds - 1
  1436. Select Case PFxSeconds
  1437. Case 29:PlayfieldMultiplier(CurrentPlayer) = 2:UpdatePFxLights
  1438. Case 10:light013.blinkinterval = 125
  1439. Case 0:
  1440. PlayfieldMultiplier(CurrentPlayer) = 1
  1441. PFxActivated = 0
  1442. Me.Enabled = 0
  1443. UpdatePFxLights
  1444. End Select
  1445. End Sub
  1446.  
  1447. Sub UpdatePFxLights
  1448. ' Update the lights
  1449. Select Case PlayfieldMultiplier(CurrentPlayer)
  1450. Case 1:light013.State = 0:light012.State = 0
  1451. light001.State = 0
  1452. light002.State = 0
  1453. light013.blinkinterval = 250
  1454. light012.blinkinterval = 250
  1455. Case 2:light013.State = 1 + PFxActivated:light012.State = 0
  1456. If light001.State = 0 AND light002.State = 0 Then light001.State = 1
  1457. Case 3:light013.State = 0:light012.State = 1 + PFxActivated
  1458. If light001.State = 0 AND light002.State = 0 Then light001.State = 1
  1459. End Select
  1460. ' show the multiplier in the DMD?
  1461. End Sub
  1462.  
  1463. Sub AwardExtraBall()
  1464. If NOT bExtraBallWonThisBall Then
  1465. DMD "_", CL(1, ("EXTRA BALL WON")), "", eNone, eBlink, eNone, 1000, True, SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker)
  1466. DOF 121, DOFPulse
  1467. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  1468. bExtraBallWonThisBall = True
  1469. LightShootAgain.State = 1 'light the shoot again lamp
  1470. GiEffect 2
  1471. LightEffect 2
  1472. END If
  1473. End Sub
  1474.  
  1475. Sub AwardSpecial()
  1476. DMD "_", CL(1, ("EXTRA GAME WON")), "", eNone, eBlink, eNone, 1000, True, SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker)
  1477. DOF 121, DOFPulse
  1478. Credits = Credits + 1
  1479. If bFreePlay = False Then DOF 125, DOFOn
  1480. LightEffect 2
  1481. Flasheffect 2
  1482. End Sub
  1483.  
  1484. Sub AwardJackpot() 'award a normal jackpot,
  1485. Dim tmp
  1486. DOF 126, DOFPulse
  1487. tmp = INT(RND * 2)
  1488. Select Case tmp
  1489. Case 0:DMD CL(0, FormatScore(Jackpot(CurrentPlayer))), CL(1, "JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_jackpot"
  1490. Case 1:DMD CL(0, FormatScore(Jackpot(CurrentPlayer))), CL(1, "JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_jackpot2"
  1491. End Select
  1492. AddScore Jackpot(CurrentPlayer)
  1493. AddJackpot 150000
  1494. LightEffect 2
  1495. Flasheffect 2
  1496. End Sub
  1497.  
  1498. Sub AwardDoubleJackpot() 'award a double jackpot
  1499. Dim tmp
  1500. tmp = Jackpot(CurrentPlayer) * 2
  1501. DMD CL(0, FormatScore(tmp)), CL(1, "DOUBLE JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_doublejackpot"
  1502. DOF 126, DOFPulse
  1503. AddScore Jackpot(CurrentPlayer) * 2
  1504. AddJackpot 300000
  1505. LightEffect 2
  1506. Flasheffect 2
  1507. End Sub
  1508.  
  1509. Sub AwardSuperJackpot()
  1510. AddBonusMultiplier 1
  1511. DMD CL(0, FormatScore(SuperJackpot(CurrentPlayer))), CL(1, "SUPER JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_superjackpot"
  1512. DOF 126, DOFPulse
  1513. AddScore SuperJackpot(CurrentPlayer)
  1514. AddSuperJackpot 250000
  1515. LightEffect 2
  1516. Flasheffect 2
  1517. End Sub
  1518.  
  1519. Sub AwardSuperJackpot_Witch()
  1520. Dim tmp
  1521. tmp = SuperJackpot(CurrentPlayer) * WitchMultiplier
  1522. DOF 126, DOFPulse
  1523. If WitchMultiplier> 1 Then
  1524. DMD CL(0, FormatScore(tmp)), CL(1, "SUPER JACKPOT X" & WitchMultiplier), "", eBlinkFast, eNone, eNone, 1500, True, "vo_superduperjackpot"
  1525. Else
  1526. DMD CL(0, FormatScore(tmp)), CL(1, "SUPER JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_superjackpot"
  1527. End If
  1528. AddScore tmp
  1529. AddSuperJackpot 250000
  1530. LightEffect 2
  1531. Flasheffect 2
  1532. End Sub
  1533.  
  1534. Sub AwardJackpot_WitchTarget() 'target hit
  1535. Dim tmp
  1536. tmp = Jackpot(CurrentPlayer) * WitchMultiplier
  1537. DOF 126, DOFPulse
  1538. Select Case WitchMultiplier
  1539. Case 1:DMD CL(0, FormatScore(tmp)), CL(1, "JACKPOT X" & WitchMultiplier), "", eBlinkFast, eNone, eNone, 1500, True, "vo_jackpot"
  1540. Case 2:DMD CL(0, FormatScore(tmp)), CL(1, "DOUBLE JACKPOT X" & WitchMultiplier), "", eBlinkFast, eNone, eNone, 1500, True, "vo_doublejackpot"
  1541. Case 3:DMD CL(0, FormatScore(tmp)), CL(1, "TRIPLE JACKPOT X" & WitchMultiplier), "", eBlinkFast, eNone, eNone, 1500, True, "vo_triplejackpot"
  1542. End Select
  1543. AddScore tmp
  1544. LightEffect 2
  1545. Flasheffect 2
  1546. End Sub
  1547.  
  1548. Sub AwardJackpot_WitchArrow(n) 'Jackpot Arrow hit
  1549. Dim tmp
  1550. tmp = Jackpot(CurrentPlayer) * WitchMBMultiplier(n)
  1551. DOF 126, DOFPulse
  1552. Select Case WitchMBMultiplier(n)
  1553. Case 1:DMD CL(0, FormatScore(tmp)), CL(1, "JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_jackpot"
  1554. Case 2:DMD CL(0, FormatScore(tmp)), CL(1, "DOUBLE JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_doublejackpot"
  1555. Case 3:DMD CL(0, FormatScore(tmp)), CL(1, "TRIPLE JACKPOT"), "", eBlinkFast, eNone, eNone, 1500, True, "vo_triplejackpot"
  1556. Case Else DMD CL(0, FormatScore(tmp)), CL(1, "JACKPOT X" & WitchMBMultiplier(n)), "", eBlinkFast, eNone, eNone, 1500, True, "Fanfare9"
  1557. End Select
  1558. AddScore tmp
  1559. AddJackpot 150000
  1560. LightEffect 2
  1561. Flasheffect 2
  1562. End Sub
  1563.  
  1564. Sub AwardSkillshot()
  1565. ResetSkillShotTimer_Timer
  1566. 'show dmd animation
  1567. DMD CL(0, FormatScore(SkillshotValue(CurrentPlayer))), CL(1, ("SKILLSHOT")), "", eBlinkFast, eNone, eNone, 1500, True, "fanfare2"
  1568. DOF 127, DOFPulse
  1569. Addscore SkillShotValue(CurrentPlayer)
  1570. ' increment the skillshot value with 1 Million
  1571. SkillShotValue(CurrentPlayer) = SkillShotValue(CurrentPlayer) + 1000000
  1572. 'do some light show
  1573. GiEffect 2
  1574. LightEffect 2
  1575. End Sub
  1576.  
  1577. Sub AwardSuperSkillshot()
  1578. ResetSkillShotTimer_Timer
  1579. 'show dmd animation
  1580. DMD CL(0, FormatScore(SuperSkillshotValue(CurrentPlayer))), CL(1, ("SUPER SKILLSHOT")), "", eBlinkFast, eNone, eNone, 1500, True, "fanfare3"
  1581. DOF 127, DOFPulse
  1582. Addscore SuperSkillShotValue(CurrentPlayer)
  1583. ' increment the superskillshot value with 5 Million
  1584. SuperSkillShotValue(CurrentPlayer) = SuperSkillShotValue(CurrentPlayer) + 5000000
  1585. 'do some light show
  1586. GiEffect 2
  1587. LightEffect 2
  1588. Flasheffect 2
  1589. End Sub
  1590.  
  1591. Sub AwardSecretSkillshot(points)
  1592. ResetSkillShotTimer_Timer
  1593. 'show dmd animation
  1594. DMD CL(0, FormatScore(points)), CL(1, ("SECRET SKILLSHOT")), "", eBlinkFast, eNone, eNone, 1500, True, "fanfare3"
  1595. DOF 127, DOFPulse
  1596. Addscore points
  1597. 'do some light show
  1598. GiEffect 2
  1599. LightEffect 2
  1600. Flasheffect 2
  1601. End Sub
  1602.  
  1603. '*****************************
  1604. ' Load / Save / Highscore
  1605. '*****************************
  1606.  
  1607. Sub Loadhs
  1608. Dim x
  1609. x = LoadValue(cGameName, "HighScore1")
  1610. If(x <> "")Then HighScore(0) = CDbl(x)Else HighScore(0) = 100000 End If
  1611. x = LoadValue(cGameName, "HighScore1Name")
  1612. If(x <> "")Then HighScoreName(0) = x Else HighScoreName(0) = "AAA" End If
  1613. x = LoadValue(cGameName, "HighScore2")
  1614. If(x <> "")then HighScore(1) = CDbl(x)Else HighScore(1) = 100000 End If
  1615. x = LoadValue(cGameName, "HighScore2Name")
  1616. If(x <> "")then HighScoreName(1) = x Else HighScoreName(1) = "BBB" End If
  1617. x = LoadValue(cGameName, "HighScore3")
  1618. If(x <> "")then HighScore(2) = CDbl(x)Else HighScore(2) = 100000 End If
  1619. x = LoadValue(cGameName, "HighScore3Name")
  1620. If(x <> "")then HighScoreName(2) = x Else HighScoreName(2) = "CCC" End If
  1621. x = LoadValue(cGameName, "HighScore4")
  1622. If(x <> "")then HighScore(3) = CDbl(x)Else HighScore(3) = 100000 End If
  1623. x = LoadValue(cGameName, "HighScore4Name")
  1624. If(x <> "")then HighScoreName(3) = x Else HighScoreName(3) = "DDD" End If
  1625. x = LoadValue(cGameName, "Credits")
  1626. If(x <> "")then Credits = CInt(x)Else Credits = 0:If bFreePlay = False Then DOF 125, DOFOff:End If
  1627. x = LoadValue(cGameName, "TotalGamesPlayed")
  1628. If(x <> "")then TotalGamesPlayed = CInt(x)Else TotalGamesPlayed = 0 End If
  1629. End Sub
  1630.  
  1631. Sub Savehs
  1632. SaveValue cGameName, "HighScore1", HighScore(0)
  1633. SaveValue cGameName, "HighScore1Name", HighScoreName(0)
  1634. SaveValue cGameName, "HighScore2", HighScore(1)
  1635. SaveValue cGameName, "HighScore2Name", HighScoreName(1)
  1636. SaveValue cGameName, "HighScore3", HighScore(2)
  1637. SaveValue cGameName, "HighScore3Name", HighScoreName(2)
  1638. SaveValue cGameName, "HighScore4", HighScore(3)
  1639. SaveValue cGameName, "HighScore4Name", HighScoreName(3)
  1640. SaveValue cGameName, "Credits", Credits
  1641. SaveValue cGameName, "TotalGamesPlayed", TotalGamesPlayed
  1642. End Sub
  1643.  
  1644. Sub Reseths
  1645. HighScoreName(0) = "AAA"
  1646. HighScoreName(1) = "BBB"
  1647. HighScoreName(2) = "CCC"
  1648. HighScoreName(3) = "DDD"
  1649. HighScore(0) = 150000
  1650. HighScore(1) = 140000
  1651. HighScore(2) = 130000
  1652. HighScore(3) = 120000
  1653. Savehs
  1654. End Sub
  1655.  
  1656. ' ***********************************************************
  1657. ' High Score Initals Entry Functions - based on Black's code
  1658. ' ***********************************************************
  1659.  
  1660. Dim hsbModeActive
  1661. Dim hsEnteredName
  1662. Dim hsEnteredDigits(3)
  1663. Dim hsCurrentDigit
  1664. Dim hsValidLetters
  1665. Dim hsCurrentLetter
  1666. Dim hsLetterFlash
  1667.  
  1668. Sub CheckHighscore()
  1669. Dim tmp
  1670. tmp = Score(1)
  1671. If Score(2)> tmp Then tmp = Score(2)
  1672. If Score(3)> tmp Then tmp = Score(3)
  1673. If Score(4)> tmp Then tmp = Score(4)
  1674.  
  1675. If tmp> HighScore(1)Then 'add 1 credit for beating the highscore
  1676. Credits = Credits + 1
  1677. DOF 125, DOFOn
  1678. End If
  1679.  
  1680. If tmp> HighScore(3)Then
  1681. PlaySound SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker)
  1682. DOF 121, DOFPulse
  1683. HighScore(3) = tmp
  1684. 'enter player's name
  1685. HighScoreEntryInit()
  1686. Else
  1687. EndOfBallComplete()
  1688. End If
  1689. End Sub
  1690.  
  1691. Sub HighScoreEntryInit()
  1692. hsbModeActive = True
  1693. PlaySound "vo_enterinitials"
  1694. hsLetterFlash = 0
  1695.  
  1696. hsEnteredDigits(0) = " "
  1697. hsEnteredDigits(1) = " "
  1698. hsEnteredDigits(2) = " "
  1699. hsCurrentDigit = 0
  1700.  
  1701. hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<" ' ` is back arrow
  1702. hsCurrentLetter = 1
  1703. DMDFlush()
  1704. HighScoreDisplayNameNow()
  1705.  
  1706. HighScoreFlashTimer.Interval = 250
  1707. HighScoreFlashTimer.Enabled = True
  1708. End Sub
  1709.  
  1710. Sub EnterHighScoreKey(keycode)
  1711. If keycode = LeftFlipperKey Then
  1712. playsound "fx_Previous"
  1713. hsCurrentLetter = hsCurrentLetter - 1
  1714. if(hsCurrentLetter = 0)then
  1715. hsCurrentLetter = len(hsValidLetters)
  1716. end if
  1717. HighScoreDisplayNameNow()
  1718. End If
  1719.  
  1720. If keycode = RightFlipperKey Then
  1721. playsound "fx_Next"
  1722. hsCurrentLetter = hsCurrentLetter + 1
  1723. if(hsCurrentLetter> len(hsValidLetters))then
  1724. hsCurrentLetter = 1
  1725. end if
  1726. HighScoreDisplayNameNow()
  1727. End If
  1728.  
  1729. If keycode = PlungerKey OR keycode = StartGameKey Then
  1730. if(mid(hsValidLetters, hsCurrentLetter, 1) <> "<")then
  1731. playsound "fx_Enter"
  1732. hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
  1733. hsCurrentDigit = hsCurrentDigit + 1
  1734. if(hsCurrentDigit = 3)then
  1735. HighScoreCommitName()
  1736. else
  1737. HighScoreDisplayNameNow()
  1738. end if
  1739. else
  1740. playsound "fx_Esc"
  1741. hsEnteredDigits(hsCurrentDigit) = " "
  1742. if(hsCurrentDigit> 0)then
  1743. hsCurrentDigit = hsCurrentDigit - 1
  1744. end if
  1745. HighScoreDisplayNameNow()
  1746. end if
  1747. end if
  1748. End Sub
  1749.  
  1750. Sub HighScoreDisplayNameNow()
  1751. HighScoreFlashTimer.Enabled = False
  1752. hsLetterFlash = 0
  1753. HighScoreDisplayName()
  1754. HighScoreFlashTimer.Enabled = True
  1755. End Sub
  1756.  
  1757. Sub HighScoreDisplayName()
  1758. Dim i
  1759. Dim TempTopStr
  1760. Dim TempBotStr
  1761.  
  1762. TempTopStr = "YOUR NAME:"
  1763. dLine(0) = ExpandLine(TempTopStr, 0)
  1764. DMDUpdate 0
  1765.  
  1766. TempBotStr = " > "
  1767. if(hsCurrentDigit> 0)then TempBotStr = TempBotStr & hsEnteredDigits(0)
  1768. if(hsCurrentDigit> 1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
  1769. if(hsCurrentDigit> 2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
  1770.  
  1771. if(hsCurrentDigit <> 3)then
  1772. if(hsLetterFlash <> 0)then
  1773. TempBotStr = TempBotStr & "_"
  1774. else
  1775. TempBotStr = TempBotStr & mid(hsValidLetters, hsCurrentLetter, 1)
  1776. end if
  1777. end if
  1778.  
  1779. if(hsCurrentDigit <1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
  1780. if(hsCurrentDigit <2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
  1781.  
  1782. TempBotStr = TempBotStr & " < "
  1783. dLine(1) = ExpandLine(TempBotStr, 1)
  1784. DMDUpdate 1
  1785. End Sub
  1786.  
  1787. Sub HighScoreFlashTimer_Timer()
  1788. HighScoreFlashTimer.Enabled = False
  1789. hsLetterFlash = hsLetterFlash + 1
  1790. if(hsLetterFlash = 2)then hsLetterFlash = 0
  1791. HighScoreDisplayName()
  1792. HighScoreFlashTimer.Enabled = True
  1793. End Sub
  1794.  
  1795. Sub HighScoreCommitName()
  1796. HighScoreFlashTimer.Enabled = False
  1797. hsbModeActive = False
  1798.  
  1799. hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
  1800. if(hsEnteredName = " ")then
  1801. hsEnteredName = "YOU"
  1802. end if
  1803.  
  1804. HighScoreName(3) = hsEnteredName
  1805. SortHighscore
  1806. EndOfBallComplete()
  1807. End Sub
  1808.  
  1809. Sub SortHighscore
  1810. Dim tmp, tmp2, i, j
  1811. For i = 0 to 3
  1812. For j = 0 to 2
  1813. If HighScore(j) <HighScore(j + 1)Then
  1814. tmp = HighScore(j + 1)
  1815. tmp2 = HighScoreName(j + 1)
  1816. HighScore(j + 1) = HighScore(j)
  1817. HighScoreName(j + 1) = HighScoreName(j)
  1818. HighScore(j) = tmp
  1819. HighScoreName(j) = tmp2
  1820. End If
  1821. Next
  1822. Next
  1823. End Sub
  1824.  
  1825. '*********
  1826. ' LUT
  1827. '*********
  1828.  
  1829. Dim bLutActive, LUTImage
  1830. Sub LoadLUT
  1831. bLutActive = False
  1832. x = LoadValue(cGameName, "LUTImage")
  1833. If(x <> "")Then LUTImage = x Else LUTImage = 0
  1834. UpdateLUT
  1835. End Sub
  1836.  
  1837. Sub SaveLUT
  1838. SaveValue cGameName, "LUTImage", LUTImage
  1839. End Sub
  1840.  
  1841. Sub NextLUT:LUTImage = (LUTImage + 1)MOD 10:UpdateLUT:SaveLUT:End Sub
  1842.  
  1843. Sub UpdateLUT
  1844. Select Case LutImage
  1845. Case 0:table1.ColorGradeImage = "LUT0"
  1846. Case 1:table1.ColorGradeImage = "LUT1"
  1847. Case 2:table1.ColorGradeImage = "LUT2"
  1848. Case 3:table1.ColorGradeImage = "LUT3"
  1849. Case 4:table1.ColorGradeImage = "LUT4"
  1850. Case 5:table1.ColorGradeImage = "LUT5"
  1851. Case 6:table1.ColorGradeImage = "LUT6"
  1852. Case 7:table1.ColorGradeImage = "LUT7"
  1853. Case 8:table1.ColorGradeImage = "LUT8"
  1854. Case 9:table1.ColorGradeImage = "LUT9"
  1855. End Select
  1856. End Sub
  1857.  
  1858. ' *************************************************************************
  1859. ' JP's Reduced Display Driver Functions (based on script by Black)
  1860. ' only 5 effects: none, scroll left, scroll right, blink and blinkfast
  1861. ' 3 Lines, treats all 3 lines as text. 3rd line is just 1 character
  1862. ' Example format:
  1863. ' DMD "text1","text2","backpicture", eNone, eNone, eNone, 250, True, "sound"
  1864. ' Short names:
  1865. ' dq = display queue
  1866. ' de = display effect
  1867. ' *************************************************************************
  1868.  
  1869. Const eNone = 0 ' Instantly displayed
  1870. Const eScrollLeft = 1 ' scroll on from the right
  1871. Const eScrollRight = 2 ' scroll on from the left
  1872. Const eBlink = 3 ' Blink (blinks for 'TimeOn')
  1873. Const eBlinkFast = 4 ' Blink (blinks for 'TimeOn') at user specified intervals (fast speed)
  1874.  
  1875. Const dqSize = 64
  1876.  
  1877. Dim dqHead
  1878. Dim dqTail
  1879. Dim deSpeed
  1880. Dim deBlinkSlowRate
  1881. Dim deBlinkFastRate
  1882.  
  1883. Dim dCharsPerLine(2)
  1884. Dim dLine(2)
  1885. Dim deCount(2)
  1886. Dim deCountEnd(2)
  1887. Dim deBlinkCycle(2)
  1888.  
  1889. Dim dqText(2, 64)
  1890. Dim dqEffect(2, 64)
  1891. Dim dqTimeOn(64)
  1892. Dim dqbFlush(64)
  1893. Dim dqSound(64)
  1894.  
  1895. Dim FlexDMD
  1896. Dim DMDScene
  1897.  
  1898. Sub DMD_Init() 'default/startup values
  1899. If UseFlexDMD Then
  1900. Set FlexDMD = CreateObject("FlexDMD.FlexDMD")
  1901. If Not FlexDMD is Nothing Then
  1902. FlexDMD.TableFile = Table1.Filename & ".vpx"
  1903. FlexDMD.RenderMode = 2
  1904. FlexDMD.Width = 128
  1905. FlexDMD.Height = 32
  1906. FlexDMD.Clear = True
  1907. FlexDMD.GameName = cGameName
  1908. FlexDMD.Run = True
  1909. Set DMDScene = FlexDMD.NewGroup("Scene")
  1910. DMDScene.AddActor FlexDMD.NewImage("Back", "VPX.bkempty")
  1911. DMDScene.GetImage("Back").SetSize FlexDMD.Width, FlexDMD.Height
  1912. For i = 0 to 40
  1913. DMDScene.AddActor FlexDMD.NewImage("Dig" & i, "VPX.dempty&dmd=2")
  1914. Digits(i).Visible = False
  1915. Next
  1916. digitgrid.Visible = False
  1917. For i = 0 to 19 ' Top
  1918. DMDScene.GetImage("Dig" & i).SetBounds 4 + i * 6, 3, 7, 10
  1919. Next
  1920. For i = 20 to 39 ' Bottom
  1921. DMDScene.GetImage("Dig" & i).SetBounds 4 + (i - 20) * 6, 3 + 12 + 2, 7, 10
  1922. Next
  1923. FlexDMD.LockRenderThread
  1924. FlexDMD.Stage.AddActor DMDScene
  1925. FlexDMD.UnlockRenderThread
  1926. End If
  1927. End If
  1928.  
  1929. Dim i, j
  1930. DMDFlush()
  1931. deSpeed = 30
  1932. deBlinkSlowRate = 5
  1933. deBlinkFastRate = 2
  1934. dCharsPerLine(0) = 20 'characters lower line
  1935. dCharsPerLine(1) = 20 'characters top line
  1936. dCharsPerLine(2) = 1 'characters back line
  1937. For i = 0 to 2
  1938. dLine(i) = Space(dCharsPerLine(i))
  1939. deCount(i) = 0
  1940. deCountEnd(i) = 0
  1941. deBlinkCycle(i) = 0
  1942. dqTimeOn(i) = 0
  1943. dqbFlush(i) = True
  1944. dqSound(i) = ""
  1945. Next
  1946. For i = 0 to 2
  1947. For j = 0 to 64
  1948. dqText(i, j) = ""
  1949. dqEffect(i, j) = eNone
  1950. Next
  1951. Next
  1952. DMD dLine(0), dLine(1), dLine(2), eNone, eNone, eNone, 25, True, ""
  1953. End Sub
  1954.  
  1955. Sub DMDFlush()
  1956. Dim i
  1957. DMDTimer.Enabled = False
  1958. DMDEffectTimer.Enabled = False
  1959. dqHead = 0
  1960. dqTail = 0
  1961. For i = 0 to 2
  1962. deCount(i) = 0
  1963. deCountEnd(i) = 0
  1964. deBlinkCycle(i) = 0
  1965. Next
  1966. End Sub
  1967.  
  1968. Sub DMDScore()
  1969. Dim tmp, tmp1, tmp2
  1970. if(dqHead = dqTail)Then
  1971. tmp = FL(0, "PL " &CurrentPlayer, FormatScore(Score(Currentplayer)))
  1972. tmp1 = CL(1, "CREDITS " & Credits & " BALL " & Balls)
  1973. If bskillshotready Then
  1974. tmp1 = " HIT THE SKILLSHOT"
  1975. ElseIf LoopCount> 0 Then
  1976. tmp1 = CL(1, "SHOOT THE LOOP")
  1977. ElseIf Light050.State then
  1978. tmp1 = CL(1, "SHOOT THE HOLE")
  1979. ElseIf Light008.State then
  1980. tmp1 = CL(1, "LOCK THE BALL")
  1981. ElseIf bTombTreasureReady Then
  1982. tmp1 = "TOMB TREASURE IS LIT"
  1983. ELSE
  1984. Select Case Mode(CurrentPlayer, 0)
  1985. Case 1:tmp1 = " ILUSSIA MULTIBALL"
  1986. Case 2:tmp1 = " WITCH MULTIBALL"
  1987. Case 3:tmp1 = "FINISTERRA MULTIBALL"
  1988. Case 4:tmp1 = " CELTIC LAND"
  1989. Case 5:tmp1 = " HECHIZOS POZIMAS"
  1990. Case 6:tmp1 = " FOLTERGEIST"
  1991. Case 7:tmp1 = " ATLANTIA"
  1992. Case 8:tmp1 = " CIUDAD DE ARBOLES"
  1993. Case 9:tmp1 = " MANCHA XANANDRA"
  1994. Case 10:tmp1 = "COLLECT BRUJA LETTER"
  1995. Case 11:tmp1 = " FELIZ NAVIDAD CAB."
  1996. Case 12:tmp1 = " LA DANZA DEL FUEGO"
  1997. End Select
  1998. tmp2 = ""
  1999. End If
  2000. End If
  2001. DMD tmp, tmp1, tmp2, eNone, eNone, eNone, 25, True, ""
  2002. End Sub
  2003.  
  2004. Sub DMDScoreNow
  2005. DMDFlush
  2006. DMDScore
  2007. End Sub
  2008.  
  2009. Sub DMD(Text0, Text1, Text2, Effect0, Effect1, Effect2, TimeOn, bFlush, Sound)
  2010. if(dqTail <dqSize)Then
  2011. if(Text0 = "_")Then
  2012. dqEffect(0, dqTail) = eNone
  2013. dqText(0, dqTail) = "_"
  2014. Else
  2015. dqEffect(0, dqTail) = Effect0
  2016. dqText(0, dqTail) = ExpandLine(Text0, 0)
  2017. End If
  2018.  
  2019. if(Text1 = "_")Then
  2020. dqEffect(1, dqTail) = eNone
  2021. dqText(1, dqTail) = "_"
  2022. Else
  2023. dqEffect(1, dqTail) = Effect1
  2024. dqText(1, dqTail) = ExpandLine(Text1, 1)
  2025. End If
  2026.  
  2027. if(Text2 = "_")Then
  2028. dqEffect(2, dqTail) = eNone
  2029. dqText(2, dqTail) = "_"
  2030. Else
  2031. dqEffect(2, dqTail) = Effect2
  2032. dqText(2, dqTail) = Text2 'it is always 1 letter in this table
  2033. End If
  2034.  
  2035. dqTimeOn(dqTail) = TimeOn
  2036. dqbFlush(dqTail) = bFlush
  2037. dqSound(dqTail) = Sound
  2038. dqTail = dqTail + 1
  2039. if(dqTail = 1)Then
  2040. DMDHead()
  2041. End If
  2042. End If
  2043. End Sub
  2044.  
  2045. Sub DMDHead()
  2046. Dim i
  2047. deCount(0) = 0
  2048. deCount(1) = 0
  2049. deCount(2) = 0
  2050. DMDEffectTimer.Interval = deSpeed
  2051.  
  2052. For i = 0 to 2
  2053. Select Case dqEffect(i, dqHead)
  2054. Case eNone:deCountEnd(i) = 1
  2055. Case eScrollLeft:deCountEnd(i) = Len(dqText(i, dqHead))
  2056. Case eScrollRight:deCountEnd(i) = Len(dqText(i, dqHead))
  2057. Case eBlink:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  2058. deBlinkCycle(i) = 0
  2059. Case eBlinkFast:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  2060. deBlinkCycle(i) = 0
  2061. End Select
  2062. Next
  2063. if(dqSound(dqHead) <> "")Then
  2064. PlaySound(dqSound(dqHead))
  2065. End If
  2066. DMDEffectTimer.Enabled = True
  2067. End Sub
  2068.  
  2069. Sub DMDEffectTimer_Timer()
  2070. DMDEffectTimer.Enabled = False
  2071. DMDProcessEffectOn()
  2072. End Sub
  2073.  
  2074. Sub DMDTimer_Timer()
  2075. Dim Head
  2076. DMDTimer.Enabled = False
  2077. Head = dqHead
  2078. dqHead = dqHead + 1
  2079. if(dqHead = dqTail)Then
  2080. if(dqbFlush(Head) = True)Then
  2081. DMDScoreNow()
  2082. Else
  2083. dqHead = 0
  2084. DMDHead()
  2085. End If
  2086. Else
  2087. DMDHead()
  2088. End If
  2089. End Sub
  2090.  
  2091. Sub DMDProcessEffectOn()
  2092. Dim i
  2093. Dim BlinkEffect
  2094. Dim Temp
  2095.  
  2096. BlinkEffect = False
  2097.  
  2098. For i = 0 to 2
  2099. if(deCount(i) <> deCountEnd(i))Then
  2100. deCount(i) = deCount(i) + 1
  2101.  
  2102. select case(dqEffect(i, dqHead))
  2103. case eNone:
  2104. Temp = dqText(i, dqHead)
  2105. case eScrollLeft:
  2106. Temp = Right(dLine(i), dCharsPerLine(i)- 1)
  2107. Temp = Temp & Mid(dqText(i, dqHead), deCount(i), 1)
  2108. case eScrollRight:
  2109. Temp = Mid(dqText(i, dqHead), (dCharsPerLine(i) + 1)- deCount(i), 1)
  2110. Temp = Temp & Left(dLine(i), dCharsPerLine(i)- 1)
  2111. case eBlink:
  2112. BlinkEffect = True
  2113. if((deCount(i)MOD deBlinkSlowRate) = 0)Then
  2114. deBlinkCycle(i) = deBlinkCycle(i)xor 1
  2115. End If
  2116.  
  2117. if(deBlinkCycle(i) = 0)Then
  2118. Temp = dqText(i, dqHead)
  2119. Else
  2120. Temp = Space(dCharsPerLine(i))
  2121. End If
  2122. case eBlinkFast:
  2123. BlinkEffect = True
  2124. if((deCount(i)MOD deBlinkFastRate) = 0)Then
  2125. deBlinkCycle(i) = deBlinkCycle(i)xor 1
  2126. End If
  2127.  
  2128. if(deBlinkCycle(i) = 0)Then
  2129. Temp = dqText(i, dqHead)
  2130. Else
  2131. Temp = Space(dCharsPerLine(i))
  2132. End If
  2133. End Select
  2134.  
  2135. if(dqText(i, dqHead) <> "_")Then
  2136. dLine(i) = Temp
  2137. DMDUpdate i
  2138. End If
  2139. End If
  2140. Next
  2141.  
  2142. if(deCount(0) = deCountEnd(0))and(deCount(1) = deCountEnd(1))and(deCount(2) = deCountEnd(2))Then
  2143.  
  2144. if(dqTimeOn(dqHead) = 0)Then
  2145. DMDFlush()
  2146. Else
  2147. if(BlinkEffect = True)Then
  2148. DMDTimer.Interval = 10
  2149. Else
  2150. DMDTimer.Interval = dqTimeOn(dqHead)
  2151. End If
  2152.  
  2153. DMDTimer.Enabled = True
  2154. End If
  2155. Else
  2156. DMDEffectTimer.Enabled = True
  2157. End If
  2158. End Sub
  2159.  
  2160. Function ExpandLine(TempStr, id) 'id is the number of the dmd line
  2161. If TempStr = "" Then
  2162. TempStr = Space(dCharsPerLine(id))
  2163. Else
  2164. if(Len(TempStr)> Space(dCharsPerLine(id)))Then
  2165. TempStr = Left(TempStr, Space(dCharsPerLine(id)))
  2166. Else
  2167. if(Len(TempStr) <dCharsPerLine(id))Then
  2168. TempStr = TempStr & Space(dCharsPerLine(id)- Len(TempStr))
  2169. End If
  2170. End If
  2171. End If
  2172. ExpandLine = TempStr
  2173. End Function
  2174.  
  2175. Function FormatScore(ByVal Num) 'it returns a string with commas (as in Black's original font)
  2176. dim i
  2177. dim NumString
  2178.  
  2179. NumString = CStr(abs(Num))
  2180.  
  2181. For i = Len(NumString)-3 to 1 step -3
  2182. if IsNumeric(mid(NumString, i, 1))then
  2183. NumString = left(NumString, i-1) & chr(asc(mid(NumString, i, 1)) + 48) & right(NumString, Len(NumString)- i)
  2184. end if
  2185. Next
  2186. FormatScore = NumString
  2187. End function
  2188.  
  2189. Function FL(id, NumString1, NumString2) 'Fill line
  2190. Dim Temp, TempStr
  2191. Temp = dCharsPerLine(id)- Len(NumString1)- Len(NumString2)
  2192. TempStr = NumString1 & Space(Temp) & NumString2
  2193. FL = TempStr
  2194. End Function
  2195.  
  2196. Function CL(id, NumString) 'center line
  2197. Dim Temp, TempStr
  2198. Temp = (dCharsPerLine(id)- Len(NumString)) \ 2
  2199. TempStr = Space(Temp) & NumString & Space(Temp)
  2200. CL = TempStr
  2201. End Function
  2202.  
  2203. Function RL(id, NumString) 'right line
  2204. Dim Temp, TempStr
  2205. Temp = dCharsPerLine(id)- Len(NumString)
  2206. TempStr = Space(Temp) & NumString
  2207. RL = TempStr
  2208. End Function
  2209.  
  2210. '**************
  2211. ' Update DMD
  2212. '**************
  2213.  
  2214. Sub DMDUpdate(id)
  2215. Dim digit, value
  2216. If UseFlexDMD Then FlexDMD.LockRenderThread
  2217. Select Case id
  2218. Case 0 'top text line
  2219. For digit = 0 to 19
  2220. DMDDisplayChar mid(dLine(0), digit + 1, 1), digit
  2221. Next
  2222. Case 1 'bottom text line
  2223. For digit = 20 to 39
  2224. DMDDisplayChar mid(dLine(1), digit -19, 1), digit
  2225. Next
  2226. Case 2 ' back image - back animations
  2227. If dLine(2) = "" OR dLine(2) = " " Then dLine(2) = "bkempty"
  2228. Digits(40).ImageA = dLine(2)
  2229. If UseFlexDMD Then DMDScene.GetImage("Back").Bitmap = FlexDMD.NewImage("", "VPX." & dLine(2) & "&dmd=2").Bitmap
  2230. End Select
  2231. If UseFlexDMD Then FlexDMD.UnlockRenderThread
  2232. End Sub
  2233.  
  2234. Sub DMDDisplayChar(achar, adigit)
  2235. If achar = "" Then achar = " "
  2236. achar = ASC(achar)
  2237. Digits(adigit).ImageA = Chars(achar)
  2238. If UseFlexDMD Then DMDScene.GetImage("Dig" & adigit).Bitmap = FlexDMD.NewImage("", "VPX." & Chars(achar) & "&dmd=2&add").Bitmap
  2239. End Sub
  2240.  
  2241. '****************************
  2242. ' JP's new DMD using flashers
  2243. '****************************
  2244.  
  2245. Dim Digits, Chars(255), Images(255)
  2246.  
  2247. DMDInit
  2248.  
  2249. Sub DMDInit
  2250. Dim i
  2251. Digits = Array(digit001, digit002, digit003, digit004, digit005, digit006, digit007, digit008, digit009, digit010, _
  2252. digit011, digit012, digit013, digit014, digit015, digit016, digit017, digit018, digit019, digit020, _
  2253. digit021, digit022, digit023, digit024, digit025, digit026, digit027, digit028, digit029, digit030, _
  2254. digit031, digit032, digit033, digit034, digit035, digit036, digit037, digit038, digit039, digit040, _
  2255. digit041)
  2256. For i = 0 to 255:Chars(i) = "dempty":Next
  2257.  
  2258. Chars(43) = "dplus" '+
  2259. Chars(46) = "ddot" '.
  2260. Chars(48) = "d0" '0
  2261. Chars(49) = "d1" '1
  2262. Chars(50) = "d2" '2
  2263. Chars(51) = "d3" '3
  2264. Chars(52) = "d4" '4
  2265. Chars(53) = "d5" '5
  2266. Chars(54) = "d6" '6
  2267. Chars(55) = "d7" '7
  2268. Chars(56) = "d8" '8
  2269. Chars(57) = "d9" '9
  2270. Chars(60) = "dless" '<
  2271. Chars(61) = "dequal" '=
  2272. Chars(62) = "dmore" '>
  2273. Chars(64) = "bkempty" '@
  2274. Chars(65) = "da" 'A
  2275. Chars(66) = "db" 'B
  2276. Chars(67) = "dc" 'C
  2277. Chars(68) = "dd" 'D
  2278. Chars(69) = "de" 'E
  2279. Chars(70) = "df" 'F
  2280. Chars(71) = "dg" 'G
  2281. Chars(72) = "dh" 'H
  2282. Chars(73) = "di" 'I
  2283. Chars(74) = "dj" 'J
  2284. Chars(75) = "dk" 'K
  2285. Chars(76) = "dl" 'L
  2286. Chars(77) = "dm" 'M
  2287. Chars(78) = "dn" 'N
  2288. Chars(79) = "do" 'O
  2289. Chars(80) = "dp" 'P
  2290. Chars(81) = "dq" 'Q
  2291. Chars(82) = "dr" 'R
  2292. Chars(83) = "ds" 'S
  2293. Chars(84) = "dt" 'T
  2294. Chars(85) = "du" 'U
  2295. Chars(86) = "dv" 'V
  2296. Chars(87) = "dw" 'W
  2297. Chars(88) = "dx" 'X
  2298. Chars(89) = "dy" 'Y
  2299. Chars(90) = "dz" 'Z
  2300. Chars(94) = "dup" '^
  2301. ' Chars(95) = '_
  2302. Chars(96) = "d0a" '0.
  2303. Chars(97) = "d1a" '1. 'a
  2304. Chars(98) = "d2a" '2. 'b
  2305. Chars(99) = "d3a" '3. 'c
  2306. Chars(100) = "d4a" '4. 'd
  2307. Chars(101) = "d5a" '5. 'e
  2308. Chars(102) = "d6a" '6. 'f
  2309. Chars(103) = "d7a" '7. 'g
  2310. Chars(104) = "d8a" '8. 'h
  2311. Chars(105) = "d9a" '9 'i
  2312. End Sub
  2313.  
  2314. '********************
  2315. ' Real Time updates
  2316. '********************
  2317. 'used for all the real time updates
  2318.  
  2319. Sub Realtime_Timer
  2320. RollingUpdate
  2321. ramp007.heightbottom = Witchflipper.currentangle
  2322. ' add any other real time update subs, like gates or diverters, flippers
  2323. End Sub
  2324.  
  2325. '**********************************************************
  2326. ' JP's Flasher Fading for VPX original tables
  2327. ' (Based on Pacdude's Fading Light System)
  2328. '**********************************************************
  2329.  
  2330. Dim FadingState(100), FlashLevel(100)
  2331.  
  2332. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  2333.  
  2334. Sub LampTimer_Timer()
  2335. Lampm 1, LFlasher001
  2336. Flash 1, flasher001
  2337. Lampm 2, LFlasher002
  2338. Flashm 2, flasher002a
  2339. Flash 2, flasher002
  2340. Lampm 3, LFlasher003
  2341. Flash 3, flasher003
  2342. Lampm 4, LFlasher004
  2343. Flashm 4, flasher004a
  2344. Flashm 4, flasher004b
  2345. Flash 4, flasher004
  2346. Lampm 5, LFlasher005
  2347. Flashm 5, flasher005a
  2348. Flashm 5, flasher005b
  2349. Flash 5, flasher005
  2350. Flash 6, flasher006
  2351. Lampm 7, LFlasher006
  2352. Lampm 7, LFlasher007
  2353. Flashm 7, flasher007
  2354. Flash 7, flasher008
  2355. Lampm 9, LFlasher009
  2356. Flash 9, flasher009
  2357. Lampm 10, LFlasher010
  2358. Flash 10, flasher010
  2359. Lamp 11, ORBLight
  2360. Flashm 12, flasher012a
  2361. Flashm 12, flasher012b
  2362. Flash 12, flasher012
  2363. Flash 13, flasher013
  2364. Flash 14, flasher014
  2365. End Sub
  2366. Sub InitLamps()
  2367. Dim x
  2368. LampTimer.Interval = 40 ' flasher fading speed
  2369. LampTimer.Enabled = 1
  2370. For x = 0 to 100
  2371. FadingState(x) = 3 ' used to track the fading state
  2372. FlashLevel(x) = 0
  2373. Next
  2374. End Sub
  2375.  
  2376. Sub SetLamp(nr, value) ' 0 is off, 1 is on
  2377. FadingState(nr) = abs(value) + 3
  2378. End Sub
  2379.  
  2380. Sub SetFlash(MyLamp, nr, TotalPeriod, BlinkPeriod) 'similar to FlashForms, works on all kind of objects with the fading light systems
  2381. Dim steps
  2382. ' Store all blink information
  2383. steps = (TotalPeriod / BlinkPeriod + .5) \ 2 'Number of ON/OFF steps to perform
  2384. steps = steps + nr / 100 'steps + fading lights number
  2385. MyLamp.UserValue = steps 'Store # of blinks & Lamp number
  2386.  
  2387. ' Start the flasher timer
  2388. MyLamp.TimerInterval = BlinkPeriod
  2389. MyLamp.TimerEnabled = 0
  2390. MyLamp.TimerEnabled = 1
  2391. ExecuteGlobal "Sub " & MyLamp.Name & "_Timer:" & "SetLamp (me.UserValue - INT(me.UserValue))*100, me.UserValue MOD 2:me.UserValue= me.UserValue -1:If me.UserValue < 0 then Me.TimerEnabled=0:End If:End Sub"
  2392. End Sub
  2393.  
  2394. ' standard VPX objects
  2395.  
  2396. ' Lights: used for VPX standard lights,
  2397. ' the fading is handled by VPX itself,
  2398. ' they are here to be able to make them work together with the flashers
  2399.  
  2400. Sub Lamp(nr, object)
  2401. Select Case FadingState(nr)
  2402. Case 4:object.state = 1:FadingState(nr) = 0
  2403. Case 3:object.state = 0:FadingState(nr) = 0
  2404. End Select
  2405. End Sub
  2406.  
  2407. Sub Lampm(nr, object) ' used for multiple lights, it doesn't change the fading state
  2408. Select Case FadingState(nr)
  2409. Case 4:object.state = 1
  2410. Case 3:object.state = 0
  2411. End Select
  2412. End Sub
  2413.  
  2414. ' Flashers: 4 is on,3,2,1 fade steps. 0 is off
  2415.  
  2416. Sub Flash(nr, object)
  2417. Select Case FadingState(nr)
  2418. Case 4:Object.IntensityScale = 1:FadingState(nr) = 0
  2419. Case 3:Object.IntensityScale = 0.66:FadingState(nr) = 2
  2420. Case 2:Object.IntensityScale = 0.33:FadingState(nr) = 1
  2421. Case 1:Object.IntensityScale = 0:FadingState(nr) = 0
  2422. End Select
  2423. End Sub
  2424.  
  2425. Sub Flashm(nr, object) 'multiple flashers, it doesn't change the fading state
  2426. Select Case FadingState(nr)
  2427. Case 4:Object.IntensityScale = 1
  2428. Case 3:Object.IntensityScale = 0.66
  2429. Case 2:Object.IntensityScale = 0.33
  2430. Case 1:Object.IntensityScale = 0
  2431. End Select
  2432. End Sub
  2433.  
  2434. ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
  2435.  
  2436. ' Reels
  2437.  
  2438. Sub Reel(nr, object)
  2439. Select Case FadingState(nr)
  2440. Case 4:object.SetValue 1:FadingState(nr) = 0
  2441. Case 3:object.SetValue 2:FadingState(nr) = 2
  2442. Case 2:object.SetValue 3:FadingState(nr) = 1
  2443. Case 1:object.SetValue 0:FadingState(nr) = 0
  2444. End Select
  2445. End Sub
  2446.  
  2447. Sub Reelm(nr, object)
  2448. Select Case FadingState(nr)
  2449. Case 4:object.SetValue 1
  2450. Case 3:object.SetValue 2
  2451. Case 2:object.SetValue 3
  2452. Case 1:object.SetValue 0
  2453. End Select
  2454. End Sub
  2455.  
  2456. 'Texts
  2457.  
  2458. Sub Text(nr, object, message)
  2459. Select Case FadingState(nr)
  2460. Case 4:object.Text = message:FadingState(nr) = 0
  2461. Case 3:object.Text = "":FadingState(nr) = 0
  2462. End Select
  2463. End Sub
  2464.  
  2465. Sub Textm(nr, object, message)
  2466. Select Case FadingState(nr)
  2467. Case 4:object.Text = message
  2468. Case 3:object.Text = ""
  2469. End Select
  2470. End Sub
  2471.  
  2472. 'Walls and mostly Primitives used as 4 step fading lights
  2473. 'a,b,c,d are the images used from on to off
  2474.  
  2475. Sub FadeObj(nr, object, a, b, c, d)
  2476. Select Case FadingState(nr)
  2477. Case 4:object.image = a:FadingState(nr) = 0 'fading to off...
  2478. Case 3:object.image = b:FadingState(nr) = 2
  2479. Case 2:object.image = c:FadingState(nr) = 1
  2480. Case 1:object.image = d:FadingState(nr) = 0
  2481. End Select
  2482. End Sub
  2483.  
  2484. Sub FadeObjm(nr, object, a, b, c, d)
  2485. Select Case FadingState(nr)
  2486. Case 4:object.image = a
  2487. Case 3:object.image = b
  2488. Case 2:object.image = c
  2489. Case 1:object.image = d
  2490. End Select
  2491. End Sub
  2492.  
  2493. Sub NFadeObj(nr, object, a, b)
  2494. Select Case FadingState(nr)
  2495. Case 4:object.image = a:FadingState(nr) = 0 'off
  2496. Case 3:object.image = b:FadingState(nr) = 0 'on
  2497. End Select
  2498. End Sub
  2499.  
  2500. Sub NFadeObjm(nr, object, a, b)
  2501. Select Case FadingState(nr)
  2502. Case 4:object.image = a
  2503. Case 3:object.image = b
  2504. End Select
  2505. End Sub
  2506.  
  2507. '********************************************************************************************
  2508. ' Only for VPX 10.2 and higher.
  2509. ' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  2510. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  2511. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  2512. ' the flashers do not work if are using the fading lights system, use SetFlash instead
  2513. '********************************************************************************************
  2514.  
  2515. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first version
  2516.  
  2517. If TypeName(MyLight) = "Light" Then
  2518.  
  2519. If FinalState = 2 Then
  2520. FinalState = MyLight.State 'Keep the current light state
  2521. End If
  2522. MyLight.BlinkInterval = BlinkPeriod
  2523. MyLight.Duration 2, TotalPeriod, FinalState
  2524. ElseIf TypeName(MyLight) = "Flasher" Then
  2525.  
  2526. Dim steps
  2527.  
  2528. ' Store all blink information
  2529. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  2530. If FinalState = 2 Then 'Keep the current flasher state
  2531. FinalState = ABS(MyLight.Visible)
  2532. End If
  2533. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  2534.  
  2535. ' Start blink timer and create timer subroutine
  2536. MyLight.TimerInterval = BlinkPeriod
  2537. MyLight.TimerEnabled = 0
  2538. MyLight.TimerEnabled = 1
  2539. 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"
  2540. End If
  2541. End Sub
  2542.  
  2543. '******************************************
  2544. ' Change light color - simulate color leds
  2545. ' changes the light color and state
  2546. ' 10 colors: red, orange, amber, yellow...
  2547. '******************************************
  2548.  
  2549. Dim red, orange, amber, yellow, darkgreen, green, blue, darkblue, purple, white
  2550.  
  2551. red = 10
  2552. orange = 9
  2553. amber = 8
  2554. yellow = 7
  2555. darkgreen = 6
  2556. green = 5
  2557. blue = 4
  2558. darkblue = 3
  2559. purple = 2
  2560. white = 1
  2561.  
  2562. Sub SetLightColor(n, col, stat) ' n = light, col = color, stat 0, 1, 2 or -1 to do not change the light state
  2563. Select Case col
  2564. Case 0
  2565. n.color = RGB(18, 0, 0)
  2566. n.colorfull = RGB(255, 0, 0)
  2567. Case red
  2568. n.color = RGB(32, 0, 0)
  2569. n.colorfull = RGB(224, 0, 0)
  2570. Case orange
  2571. n.color = RGB(18, 3, 0)
  2572. n.colorfull = RGB(255, 64, 0)
  2573. Case amber
  2574. n.color = RGB(193, 49, 0)
  2575. n.colorfull = RGB(255, 153, 0)
  2576. Case yellow
  2577. n.color = RGB(18, 18, 0)
  2578. n.colorfull = RGB(255, 255, 0)
  2579. Case darkgreen
  2580. n.color = RGB(0, 8, 0)
  2581. n.colorfull = RGB(0, 64, 0)
  2582. Case green
  2583. n.color = RGB(0, 16, 0)
  2584. n.colorfull = RGB(0, 128, 0)
  2585. Case blue
  2586. n.color = RGB(0, 18, 18)
  2587. n.colorfull = RGB(0, 255, 255)
  2588. Case darkblue
  2589. n.color = RGB(0, 4, 18)
  2590. n.colorfull = RGB(0, 64, 64)
  2591. Case purple
  2592. n.color = RGB(64, 0, 96)
  2593. n.colorfull = RGB(128, 0, 192)
  2594. Case white
  2595. n.color = RGB(255, 252, 224)
  2596. n.colorfull = RGB(193, 91, 0)
  2597. End Select
  2598. If stat <> -1 Then
  2599. n.State = 0
  2600. n.State = stat
  2601. End If
  2602. End Sub
  2603.  
  2604. '*************************
  2605. ' Rainbow Changing Lights
  2606. '*************************
  2607.  
  2608. Dim RGBStep, RGBFactor, rRed, rGreen, rBlue, RainbowLights
  2609.  
  2610. Sub StartRainbow(n) 'uses a collection as parameter
  2611. set RainbowLights = n
  2612. RGBStep = 0
  2613. RGBFactor = 5
  2614. rRed = 255
  2615. rGreen = 0
  2616. rBlue = 0
  2617. RainbowTimer.Enabled = 1
  2618. End Sub
  2619.  
  2620. Sub StopRainbow()
  2621. RainbowTimer.Enabled = 0
  2622. For each x in aLightArrows
  2623. SetLightColor x, white, 0
  2624. Next
  2625. End Sub
  2626.  
  2627. Sub RainbowTimer_Timer 'rainbow led light color changing
  2628. Dim obj
  2629. Select Case RGBStep
  2630. Case 0 'Green
  2631. rGreen = rGreen + RGBFactor
  2632. If rGreen> 255 then
  2633. rGreen = 255
  2634. RGBStep = 1
  2635. End If
  2636. Case 1 'Red
  2637. rRed = rRed - RGBFactor
  2638. If rRed <0 then
  2639. rRed = 0
  2640. RGBStep = 2
  2641. End If
  2642. Case 2 'Blue
  2643. rBlue = rBlue + RGBFactor
  2644. If rBlue> 255 then
  2645. rBlue = 255
  2646. RGBStep = 3
  2647. End If
  2648. Case 3 'Green
  2649. rGreen = rGreen - RGBFactor
  2650. If rGreen <0 then
  2651. rGreen = 0
  2652. RGBStep = 4
  2653. End If
  2654. Case 4 'Red
  2655. rRed = rRed + RGBFactor
  2656. If rRed> 255 then
  2657. rRed = 255
  2658. RGBStep = 5
  2659. End If
  2660. Case 5 'Blue
  2661. rBlue = rBlue - RGBFactor
  2662. If rBlue <0 then
  2663. rBlue = 0
  2664. RGBStep = 0
  2665. End If
  2666. End Select
  2667. For each obj in RainbowLights
  2668. obj.color = RGB(rRed \ 10, rGreen \ 10, rBlue \ 10)
  2669. obj.colorfull = RGB(rRed, rGreen, rBlue)
  2670. Next
  2671. End Sub
  2672.  
  2673. ' ********************************
  2674. ' Table info & Attract Mode
  2675. ' ********************************
  2676.  
  2677. Sub ShowTableInfo
  2678. Dim ii
  2679. 'info goes in a loop only stopped by the credits and the startkey
  2680. If Score(1)Then
  2681. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER 1 " &FormatScore(Score(1))), "", eNone, eNone, eNone, 3000, False, ""
  2682. End If
  2683. If Score(2)Then
  2684. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER 2 " &FormatScore(Score(2))), "", eNone, eNone, eNone, 3000, False, ""
  2685. End If
  2686. If Score(3)Then
  2687. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER 3 " &FormatScore(Score(3))), "", eNone, eNone, eNone, 3000, False, ""
  2688. End If
  2689. If Score(4)Then
  2690. DMD CL(0, "LAST SCORE"), CL(1, "PLAYER 4 " &FormatScore(Score(4))), "", eNone, eNone, eNone, 3000, False, ""
  2691. End If
  2692. DMD "", "", "gameover", eNone, eNone, eBlink, 1500, False, ""
  2693. If bFreePlay Then
  2694. DMD "", CL(1, "FREE PLAY"), "", eNone, eBlink, eNone, 1500, False, ""
  2695. Else
  2696. If Credits> 0 Then
  2697. DMD CL(0, "CREDITS " & Credits), CL(1, "PRESS START"), "", eNone, eBlink, eNone, 1500, False, ""
  2698. Else
  2699. DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 1500, False, ""
  2700. End If
  2701. End If
  2702. DMD "", "", "jppresents", eNone, eNone, eNone, 3000, False, ""
  2703. DMD "", "", "magodeoz", eNone, eNone, eNone, 4000, False, ""
  2704. DMD CL(0, "HIGHSCORES"), Space(dCharsPerLine(1)), "", eScrollLeft, eScrollLeft, eNone, 20, False, ""
  2705. DMD CL(0, "HIGHSCORES"), "", "", eBlinkFast, eNone, eNone, 1000, False, ""
  2706. DMD CL(0, "HIGHSCORES"), "1> " &HighScoreName(0) & " " &FormatScore(HighScore(0)), "", eNone, eScrollLeft, eNone, 1500, False, ""
  2707. DMD "_", "2> " &HighScoreName(1) & " " &FormatScore(HighScore(1)), "", eNone, eScrollLeft, eNone, 1500, False, ""
  2708. DMD "_", "3> " &HighScoreName(2) & " " &FormatScore(HighScore(2)), "", eNone, eScrollLeft, eNone, 1500, False, ""
  2709. DMD "_", "4> " &HighScoreName(3) & " " &FormatScore(HighScore(3)), "", eNone, eScrollLeft, eNone, 1500, False, ""
  2710. DMD Space(dCharsPerLine(0)), Space(dCharsPerLine(1)), "", eScrollLeft, eScrollLeft, eNone, 500, False, ""
  2711. End Sub
  2712.  
  2713. Sub StartAttractMode
  2714. GiOff
  2715. StartLightSeq
  2716. DMDFlush
  2717. ShowTableInfo
  2718. StartRainbow aLightArrows
  2719. AttractTimer.Enabled = 1
  2720. End Sub
  2721.  
  2722. Sub AttractTimer_Timer
  2723. Dim tmp
  2724. tmp = INT(RND * 5)
  2725. Select Case tmp
  2726. Case 0:PlaySound "vo_itsgotime"
  2727. Case 1:PlaySound "vo_pushplay"
  2728. Case 2:PlaySound "vo_pushstart"
  2729. Case 3:PlaySound "vo_pushstartbutton"
  2730. Case 4:PlaySound "vo_comeon"
  2731. End Select
  2732. End Sub
  2733.  
  2734. Sub StopAttractMode
  2735. GiOn
  2736. DMDScoreNow
  2737. LightSeqAttract.StopPlay
  2738. StopRainbow
  2739. AttractTimer.Enabled = 0
  2740. End Sub
  2741.  
  2742. Sub StartLightSeq()
  2743. 'lights sequences
  2744. LightSeqAttract.UpdateInterval = 25
  2745. LightSeqAttract.Play SeqBlinking, , 5, 150
  2746. LightSeqAttract.Play SeqRandom, 40, , 4000
  2747. LightSeqAttract.Play SeqAllOff
  2748. LightSeqAttract.UpdateInterval = 8
  2749. LightSeqAttract.Play SeqUpOn, 50, 1
  2750. LightSeqAttract.UpdateInterval = 8
  2751. LightSeqAttract.Play SeqDownOn, 25, 1
  2752. LightSeqAttract.UpdateInterval = 8
  2753. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2754. LightSeqAttract.UpdateInterval = 8
  2755. LightSeqAttract.Play SeqUpOn, 25, 1
  2756. LightSeqAttract.UpdateInterval = 8
  2757. LightSeqAttract.Play SeqDownOn, 25, 1
  2758. LightSeqAttract.UpdateInterval = 8
  2759. LightSeqAttract.Play SeqUpOn, 25, 1
  2760. LightSeqAttract.UpdateInterval = 8
  2761. LightSeqAttract.Play SeqDownOn, 25, 1
  2762. LightSeqAttract.UpdateInterval = 10
  2763. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2764. LightSeqAttract.UpdateInterval = 5
  2765. LightSeqAttract.Play SeqRightOn, 50, 1
  2766. LightSeqAttract.UpdateInterval = 5
  2767. LightSeqAttract.Play SeqLeftOn, 50, 1
  2768. LightSeqAttract.UpdateInterval = 8
  2769. LightSeqAttract.Play SeqRightOn, 50, 1
  2770. LightSeqAttract.UpdateInterval = 8
  2771. LightSeqAttract.Play SeqLeftOn, 50, 1
  2772. LightSeqAttract.UpdateInterval = 8
  2773. LightSeqAttract.Play SeqRightOn, 40, 1
  2774. LightSeqAttract.UpdateInterval = 8
  2775. LightSeqAttract.Play SeqLeftOn, 40, 1
  2776. LightSeqAttract.UpdateInterval = 10
  2777. LightSeqAttract.Play SeqRightOn, 30, 1
  2778. LightSeqAttract.UpdateInterval = 10
  2779. LightSeqAttract.Play SeqLeftOn, 30, 1
  2780. LightSeqAttract.UpdateInterval = 8
  2781. LightSeqAttract.Play SeqRightOn, 25, 1
  2782. LightSeqAttract.UpdateInterval = 8
  2783. LightSeqAttract.Play SeqLeftOn, 25, 1
  2784. LightSeqAttract.UpdateInterval = 8
  2785. LightSeqAttract.Play SeqRightOn, 15, 1
  2786. LightSeqAttract.UpdateInterval = 8
  2787. LightSeqAttract.Play SeqLeftOn, 15, 1
  2788. LightSeqAttract.UpdateInterval = 10
  2789. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2790. LightSeqAttract.UpdateInterval = 8
  2791. LightSeqAttract.Play SeqLeftOn, 25, 1
  2792. LightSeqAttract.UpdateInterval = 8
  2793. LightSeqAttract.Play SeqRightOn, 25, 1
  2794. LightSeqAttract.UpdateInterval = 8
  2795. LightSeqAttract.Play SeqLeftOn, 25, 1
  2796. LightSeqAttract.UpdateInterval = 8
  2797. LightSeqAttract.Play SeqUpOn, 25, 1
  2798. LightSeqAttract.UpdateInterval = 8
  2799. LightSeqAttract.Play SeqDownOn, 25, 1
  2800. LightSeqAttract.UpdateInterval = 8
  2801. LightSeqAttract.Play SeqUpOn, 25, 1
  2802. LightSeqAttract.UpdateInterval = 8
  2803. LightSeqAttract.Play SeqDownOn, 25, 1
  2804. LightSeqAttract.UpdateInterval = 5
  2805. LightSeqAttract.Play SeqStripe1VertOn, 50, 2
  2806. LightSeqAttract.UpdateInterval = 8
  2807. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2808. LightSeqAttract.UpdateInterval = 8
  2809. LightSeqAttract.Play SeqStripe1VertOn, 50, 3
  2810. LightSeqAttract.UpdateInterval = 8
  2811. LightSeqAttract.Play SeqLeftOn, 25, 1
  2812. LightSeqAttract.UpdateInterval = 8
  2813. LightSeqAttract.Play SeqRightOn, 25, 1
  2814. LightSeqAttract.UpdateInterval = 8
  2815. LightSeqAttract.Play SeqLeftOn, 25, 1
  2816. LightSeqAttract.UpdateInterval = 8
  2817. LightSeqAttract.Play SeqUpOn, 25, 1
  2818. LightSeqAttract.UpdateInterval = 8
  2819. LightSeqAttract.Play SeqDownOn, 25, 1
  2820. LightSeqAttract.UpdateInterval = 8
  2821. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2822. LightSeqAttract.UpdateInterval = 8
  2823. LightSeqAttract.Play SeqStripe2VertOn, 50, 3
  2824. LightSeqAttract.UpdateInterval = 8
  2825. LightSeqAttract.Play SeqLeftOn, 25, 1
  2826. LightSeqAttract.UpdateInterval = 8
  2827. LightSeqAttract.Play SeqRightOn, 25, 1
  2828. LightSeqAttract.UpdateInterval = 8
  2829. LightSeqAttract.Play SeqLeftOn, 25, 1
  2830. LightSeqAttract.UpdateInterval = 8
  2831. LightSeqAttract.Play SeqUpOn, 25, 1
  2832. LightSeqAttract.UpdateInterval = 8
  2833. LightSeqAttract.Play SeqDownOn, 25, 1
  2834. LightSeqAttract.UpdateInterval = 8
  2835. LightSeqAttract.Play SeqUpOn, 25, 1
  2836. LightSeqAttract.UpdateInterval = 8
  2837. LightSeqAttract.Play SeqDownOn, 25, 1
  2838. LightSeqAttract.UpdateInterval = 8
  2839. LightSeqAttract.Play SeqStripe1VertOn, 25, 3
  2840. LightSeqAttract.UpdateInterval = 8
  2841. LightSeqAttract.Play SeqStripe2VertOn, 25, 3
  2842. LightSeqAttract.UpdateInterval = 8
  2843. LightSeqAttract.Play SeqUpOn, 15, 1
  2844. LightSeqAttract.UpdateInterval = 8
  2845. LightSeqAttract.Play SeqDownOn, 15, 1
  2846. LightSeqAttract.UpdateInterval = 8
  2847. LightSeqAttract.Play SeqUpOn, 15, 1
  2848. LightSeqAttract.UpdateInterval = 8
  2849. LightSeqAttract.Play SeqDownOn, 15, 1
  2850. LightSeqAttract.UpdateInterval = 8
  2851. LightSeqAttract.Play SeqUpOn, 15, 1
  2852. LightSeqAttract.UpdateInterval = 8
  2853. LightSeqAttract.Play SeqDownOn, 15, 1
  2854. LightSeqAttract.UpdateInterval = 8
  2855. LightSeqAttract.Play SeqRightOn, 15, 1
  2856. LightSeqAttract.UpdateInterval = 8
  2857. LightSeqAttract.Play SeqLeftOn, 15, 1
  2858. LightSeqAttract.UpdateInterval = 8
  2859. LightSeqAttract.Play SeqRightOn, 15, 1
  2860. LightSeqAttract.UpdateInterval = 8
  2861. LightSeqAttract.Play SeqLeftOn, 15, 1
  2862. End Sub
  2863.  
  2864. Sub LightSeqAttract_PlayDone()
  2865. StartLightSeq()
  2866. End Sub
  2867.  
  2868. Sub LightSeqTilt_PlayDone()
  2869. LightSeqTilt.Play SeqAllOff
  2870. End Sub
  2871.  
  2872. Sub LightSeqSkillshot_PlayDone()
  2873. LightSeqSkillshot.Play SeqAllOff
  2874. End Sub
  2875.  
  2876. '***********************************************************************
  2877. ' *********************************************************************
  2878. ' Table Specific Script Starts Here
  2879. ' *********************************************************************
  2880. '***********************************************************************
  2881.  
  2882. ' droptargets, animations, etc
  2883. Sub VPObjects_Init
  2884. post001.IsDropped = 1
  2885. post002.IsDropped = 1
  2886. post003.IsDropped = 1
  2887. post004.IsDropped = 1
  2888. post005.IsDropped = 1
  2889. bruja_target1.IsDropped = 1
  2890. End Sub
  2891.  
  2892. ' tables variables and Mode init
  2893. Dim Mode(4, 15) '4 players, 15 posible modes
  2894. Dim WitchMultiplier
  2895. Dim BrujaLetter(4)
  2896. Dim NewMode
  2897. Dim bILUSSIASJP
  2898. Dim ILUSSIATimes(4)
  2899. Dim ILUSSIACount(4)
  2900. Dim bAddaBall
  2901. Dim AddaBallCount
  2902. Dim AddaBallLevel
  2903. Dim bAddaBallActivated
  2904. Dim DropCount
  2905. Dim DropPos(4)
  2906. Dim DropValue(4)
  2907. Dim DropBankValue(4)
  2908. Dim bMystery
  2909. Dim MysteryLevel(4)
  2910. Dim BallsLocked(4)
  2911. Dim bLockActive(4)
  2912. Dim bWitchMBJackpotReady
  2913. Dim bWitchMBFirstHit
  2914. Dim WitchMBMultiplier(8)
  2915. Dim WitchMBArrowCount
  2916. Dim SuperSpinnersCount(4)
  2917. Dim SuperPopsCount(4)
  2918. Dim SuperRampsCount(4)
  2919. Dim SuperTargetsCount(4)
  2920. Dim SuperOrbitsCount(4)
  2921. Dim bSuperSpinners(4)
  2922. Dim bSuperPops(4)
  2923. Dim bSuperRamps(4)
  2924. Dim bSuperTargets(4)
  2925. Dim bSuperOrbits(4)
  2926. Dim SuperPyramidValue
  2927. Dim SuperPyramidMultiplier
  2928. Dim bSPJActivated
  2929. Dim bFinisterraMBReady
  2930. Dim FinisterraSJPValue(4)
  2931. Dim bFinisterraSJPActivated
  2932. Dim FinisterraSJPMultiplier
  2933. Dim FinisterraSJPCount
  2934. Dim FinisterraDifficulty
  2935. Dim PFxCount
  2936. Dim PFxActivated
  2937. Dim FolkCount
  2938. Dim HechizoCount
  2939. Dim HechizoSpinnerValue
  2940. Dim ArbolesCount
  2941. Dim ArbolesJPValue
  2942. Dim ArbolesSJPCount
  2943. Dim ArbolesStep
  2944. Dim AtlantiaCount
  2945. Dim AtlantiaTimerCount
  2946. Dim CelticValue
  2947. Dim CelticMultiplier
  2948. Dim CelticTimerCount
  2949. Dim ManchaXanandraHitCount
  2950. Dim ManchaXanandraTimerCount
  2951. Dim LoopValue
  2952. Dim LoopJackpot(4)
  2953. Dim LoopJackpotMulti
  2954. Dim LoopCount
  2955. Dim ExtraBallCount(4)
  2956. Dim MiniLoopMulti
  2957. Dim BallSaveCount
  2958. Dim bComboActivated
  2959. Dim Combo(6)
  2960. Dim ComboCount
  2961. Dim ComboValue
  2962. Dim bSuperCombo
  2963. Dim SwitchBonusCount 'to bonus
  2964. Dim IlussiaBonusCount
  2965. Dim DeathblowBonusCount
  2966. Dim LoopsBonusCount
  2967. Dim PyramidBonusCount
  2968. Dim ManchaXBonusCount
  2969. Dim SlingshotValue
  2970. Dim TombTreasureCount
  2971. Dim bTombTreasureReady
  2972. Dim LeftTombHits(4)
  2973. Dim LeftTombHits2(4)
  2974. Dim RightTombHits(4)
  2975. Dim FNCStep
  2976. Dim bLDDFSJPEnabled
  2977.  
  2978. Sub Game_Init() 'called at the start of a new game
  2979. Dim i, j
  2980. bExtraBallWonThisBall = False
  2981. TurnOffPlayfieldLights()
  2982. 'Play some Music
  2983.  
  2984. 'Init Variables
  2985. For i = 0 to 4
  2986. For j = 0 to 15
  2987. Mode(i, j) = 0
  2988. Next
  2989. Next
  2990. For i = 0 to 4
  2991. Jackpot(i) = 1000000
  2992. SuperJackpot(i) = 5000000
  2993. SkillshotValue(i) = 1000000
  2994. SuperSkillshotValue(i) = 5000000
  2995. BrujaLetter(i) = 0
  2996. ILUSSIATimes(i) = 0
  2997. ILUSSIACount(i) = 4
  2998. BallsLocked(i) = 0
  2999. bLockActive(i) = False
  3000. DropPos(i) = 1
  3001. SuperSpinnersCount(i) = 0
  3002. SuperPopsCount(i) = 0
  3003. SuperRampsCount(i) = 0
  3004. SuperTargetsCount(i) = 0
  3005. SuperOrbitsCount(i) = 0
  3006. bSuperSpinners(i) = 0 '0 not started, 2 started, 1 completed, corresponds to the light states
  3007. bSuperPops(i) = 0
  3008. bSuperRamps(i) = 0
  3009. bSuperTargets(i) = 0
  3010. bSuperOrbits(i) = 0
  3011. FinisterraSJPValue(i) = 4000000
  3012. ExtraBallCount(i) = 0
  3013. LoopJackpot(i) = 1000000
  3014. DropValue(i) = 50000
  3015. DropBankValue(i) = 250000
  3016. MysteryLevel(i) = 1
  3017. LeftTombHits(i) = 0
  3018. LeftTombHits2(i) = 0
  3019. RightTombHits(i) = 0
  3020. Next
  3021. For i = 0 to 8
  3022. WitchMBMultiplier(i) = 1
  3023. Next
  3024. WitchMultiplier = 1
  3025. BallSaverTime = 20
  3026. bILUSSIASJP = False
  3027. bAddaBall = False
  3028. AddaBallCount = 0
  3029. AddaBallLevel = 0
  3030. bAddaBallActivated = False
  3031. ResetDrop
  3032. bMystery = False
  3033. CheckLockedBalls
  3034. bWitchMBJackpotReady = False
  3035. WitchMBArrowCount = 0
  3036. bWitchMBFirstHit = True
  3037. SuperPyramidValue = 0
  3038. SuperPyramidMultiplier = 0
  3039. bSPJActivated = False
  3040. bFinisterraMBReady = false
  3041. bFinisterraSJPActivated = false
  3042. FinisterraSJPMultiplier = 1
  3043. FinisterraSJPCount = 0
  3044. FinisterraDifficulty = 1
  3045. PFxCount = 0
  3046. PFxActivated = 0
  3047. NewMode = INT(RND * 5) + 4
  3048. FolkCount = 0
  3049. HechizoCount = 0
  3050. HechizoSpinnerValue = 0
  3051. ArbolesCount = 0
  3052. ArbolesJPValue = 1000000
  3053. ArbolesSJPCount = 0
  3054. ArbolesStep = 0
  3055. CelticValue = 2000000
  3056. LoopValue = 250000
  3057. LoopCount = 0
  3058. MiniLoopMulti = 1
  3059. LoopJackpotMulti = 1
  3060. BallSaveCount = 0
  3061. bComboActivated = False
  3062. Combo(1) = 0
  3063. Combo(2) = 0
  3064. Combo(3) = 0
  3065. Combo(4) = 0
  3066. Combo(5) = 0
  3067. Combo(6) = 0
  3068. ComboCount = 0
  3069. ComboValue = 500000
  3070. bSuperCombo = False
  3071. TombTreasureCount = 0
  3072. bTombTreasureReady = False
  3073. FNCStep = 0
  3074. bLDDFSJPEnabled = False
  3075.  
  3076. 'Init Delays/Timers
  3077. 'MainMode Init()
  3078. 'Init lights
  3079. End Sub
  3080.  
  3081. Sub InstantInfo
  3082. Dim tmp
  3083. DMD CL(0, "INSTANT INFO"), "", "", eNone, eNone, eNone, 800, False, ""
  3084. DMD CL(0, "JACKPOT VALUE"), CL(1, Jackpot(CurrentPlayer)), "", eNone, eNone, eNone, 800, False, ""
  3085. DMD CL(0, "SPR JACKPOT VALUE"), CL(1, SuperJackpot(CurrentPlayer)), "", eNone, eNone, eNone, 800, False, ""
  3086. DMD CL(0, "FINISTERRA JACKPOT"), CL(1, FinisterraSJPValue(Currentplayer)), "", eNone, eNone, eNone, 800, False, ""
  3087. tmp = FormatScore(SuperPyramidValue) & " X " & SuperPyramidMultiplier
  3088. DMD CL(0, "SPR PYRAMID VALUE"), CL(1, tmp), "", eNone, eNone, eNone, 800, False, ""
  3089. DMD CL(0, "BONUS X"), CL(1, BonusMultiplier(CurrentPlayer)), "", eNone, eNone, eNone, 800, False, ""
  3090. DMD CL(0, "PLAYFIELD X"), CL(1, PlayfieldMultiplier(CurrentPlayer)), "", eNone, eNone, eNone, 800, False, ""
  3091. DMD CL(0, "HIGHEST SCORE"), CL(1, HighScoreName(0) & " " & HighScore(0)), "", eNone, eNone, eNone, 800, False, ""
  3092. End Sub
  3093.  
  3094. Sub StopMultiballModes 'called at the end of multiball
  3095. Select case Mode(CurrentPLayer, 0)
  3096. Case 1:StopILUSSIA:StartBRUJAletter
  3097. Case 2:StopWitchMultiball:StartBRUJAletter
  3098. Case 3:StopFinisterra:StartBRUJALEtter
  3099. Case 4: 'no multi-ball
  3100. Case 5: 'no multi-ball
  3101. Case 6:StopFoltergeist:ResetBRUJALetter:StartBRUJAletter
  3102. Case 7: 'no multi-ball
  3103. Case 8:StopArboles:ResetBRUJALetter:StartBRUJALetter
  3104. Case 9: 'no multi-ball
  3105. Case 11:StopFNC:StartBRUJALetter
  3106. Case 12:StartBRUJALetter
  3107. End Select
  3108. End Sub
  3109.  
  3110. Sub StopEndOfBallMode() 'this sub is called after the last ball is drained, reset skillshot, modes, timers
  3111. Dim tmp
  3112. tmp = INT(RND * 16)
  3113. Select Case tmp
  3114. Case 0:PlaySound "vo_dobetterthanthat"
  3115. Case 1:PlaySound "vo_hahaha"
  3116. Case 2, 12:PlaySound "vo_hahaha2"
  3117. Case 3, 13:PlaySound "vo_hahaha3"
  3118. Case 4, 14:PlaySound "vo_hohoho"
  3119. Case 5, 15:PlaySound "vo_hohoho2"
  3120. Case 6:PlaySound "vo_keepitup"
  3121. Case 7:PlaySound "vo_firsttime"
  3122. Case 8:PlaySound "vo_lookatthatscore"
  3123. Case 9:PlaySound "vo_notbad"
  3124. Case 10:PlaySound "vo_notbad2"
  3125. Case 11:PlaySound "vo_flippers"
  3126. case 12:PlaySound "vo_notagoodplayer"
  3127. End Select
  3128. If bSkillShotReady Then ResetSkillShotTimer_Timer
  3129. If bAddaBallActivated Then StopAddaBall
  3130. Select case Mode(CurrentPLayer, 0)
  3131. Case 4:StopCelticLand:ResetBRUJALetter
  3132. Case 5:StopHechizo:ResetBRUJALetter
  3133. Case 7:StopAtlantia:ResetBRUJALetter
  3134. Case 9:StopManchaXanandra:ResetBRUJALetter
  3135. End Select
  3136. BrujaFlasher.Enabled = 0
  3137. StopSuperPyramid
  3138. post005_Timer
  3139. End Sub
  3140.  
  3141. Sub StopCurrentMode 'called during Tomb awards
  3142. Select case Mode(CurrentPLayer, 0)
  3143. Case 1:StopILUSSIA
  3144. Case 2:StopWitchMultiball
  3145. Case 3:StopFinisterra
  3146. Case 4:StopCelticLand
  3147. Case 5:StopHechizo
  3148. Case 6:StopFoltergeist
  3149. Case 7:StopAtlantia
  3150. Case 8:StopArboles
  3151. Case 9:StopManchaXanandra
  3152. End Select
  3153. End Sub
  3154.  
  3155. Sub ResetNewBallVariables() 'reset variables for a new ball or player
  3156. 'reset the Super features if all are completed
  3157. If(bSuperPops(CurrentPlayer) = 1)AND(bSuperSpinners(CurrentPlayer) = 1)AND(bSuperRamps(CurrentPlayer) = 1)AND(bSuperTargets(CurrentPlayer) = 1)AND(bSuperOrbits(CurrentPlayer) = 1)Then
  3158. ResetPyramid
  3159. Else
  3160. UpdateSuperPyramid
  3161. End If
  3162. StopCombo
  3163. 'bonus counts
  3164. SwitchBonusCount = 0
  3165. IlussiaBonusCount = 0
  3166. DeathblowBonusCount = 0
  3167. LoopsBonusCount = 0
  3168. PyramidBonusCount = 0
  3169. ManchaXBonusCount = 0
  3170. SlingshotValue = 10210
  3171. bSuperCombo = False
  3172. bTombTreasureReady = False
  3173. post003.IsDropped = 1
  3174. post004.IsDropped = 1
  3175. post005.IsDropped = 1
  3176. End Sub
  3177.  
  3178. Sub ResetNewBallLights() 'turn on or off the needed lights before a new ball is released
  3179. StopRainbow ' Set Arrow lights to white and turn them off
  3180. UpdatePFXLights 'ensure the multiplier is displayed right
  3181. UpdateBrujaLetter
  3182. UpdateILUSSIA
  3183. SetLightColor Light057, white, 0
  3184. Light058.State = 0
  3185. Light050.State = 0
  3186. Light008.State = 0
  3187. Light005.State = 2
  3188. RampDown
  3189. ResetPFxTargetLights
  3190. CheckLockedBalls
  3191. If ExtraBallCount(CurrentPlayer) >= 30 then 'lit Extra Ball
  3192. light047.State = 1
  3193. End If
  3194. End Sub
  3195.  
  3196. Sub TurnOffPlayfieldLights()
  3197. Dim a
  3198. For each a in aLights
  3199. a.State = 0
  3200. Next
  3201. End Sub
  3202.  
  3203. Sub UpdateSkillShot() 'Setup and updates the skillshot lights
  3204. LightSeqSkillshot.Play SeqAllOff
  3205. Light048.State = 2
  3206. Light051.State = 2
  3207. End Sub
  3208.  
  3209. Sub ResetSkillShotTimer_Timer 'timer to reset the skillshot lights & variables
  3210. ResetSkillShotTimer.Enabled = 0
  3211. bSkillShotReady = False
  3212. LightSeqSkillshot.StopPlay
  3213. Light048.State = 0
  3214. Light051.State = 0
  3215. DMDScoreNow
  3216. StartBRUJAletter
  3217. End Sub
  3218.  
  3219. '***********************
  3220. ' Crows follow the ball
  3221. '***********************
  3222. ' they do not move during multiball
  3223.  
  3224. Sub CrowPos_Hit(idx)
  3225. If NOT bMultiBallMode Then
  3226. CrowLeft.Rotz = -(idx * 2)-16
  3227. CrowRight.RotZ = idx * 2 + 16
  3228. End If
  3229. End Sub
  3230.  
  3231. ' *********************************************************************
  3232. ' Table Object Hit Events
  3233. '
  3234. ' Any target hit Sub will follow this:
  3235. ' - play a sound
  3236. ' - do some physical movement
  3237. ' - add a score, bonus
  3238. ' - check some variables/Mode this trigger is a member of
  3239. ' - set the "LastSwitchHit" variable in case it is needed later
  3240. ' *********************************************************************
  3241.  
  3242. '*********************************************************
  3243. ' Slingshots has been hit
  3244.  
  3245. Dim LStep, RStep
  3246.  
  3247. Sub LeftSlingShot_Slingshot
  3248. If Tilted Then Exit Sub
  3249. If bSkillShotReady Then
  3250. ResetSkillShotTimer_Timer
  3251. End If
  3252. PlaySoundAt SoundFXDOF("fx_slingshot", 103, DOFPulse, DOFcontactors), Lemk
  3253. DOF 105, DOFPulse
  3254. LeftSling004.Visible = 1
  3255. Lemk.RotX = 26
  3256. LStep = 0
  3257. LeftSlingShot.TimerEnabled = True
  3258. ' add some points
  3259. AddScore SlingshotValue
  3260. ' add some effect to the table?
  3261. SetFlash Flasher009, 9, 2000, 50
  3262. ' check modes
  3263. StopCombo
  3264. ' remember last trigger hit by the ball
  3265. LastSwitchHit = "LeftSlingShot"
  3266. End Sub
  3267.  
  3268. Sub LeftSlingShot_Timer
  3269. Select Case LStep
  3270. Case 1:LeftSLing004.Visible = 0:LeftSLing003.Visible = 1:Lemk.RotX = 14
  3271. Case 2:LeftSLing003.Visible = 0:LeftSLing002.Visible = 1:Lemk.RotX = 2
  3272. Case 3:LeftSLing002.Visible = 0:Lemk.RotX = -10:LeftSlingShot.TimerEnabled = 0
  3273. End Select
  3274. LStep = LStep + 1
  3275. End Sub
  3276.  
  3277. Sub RightSlingShot_Slingshot
  3278. If Tilted Then Exit Sub
  3279. If bSkillShotReady Then
  3280. ResetSkillShotTimer_Timer
  3281. End If
  3282. PlaySoundAt SoundFXDOF("fx_slingshot", 104, DOFPulse, DOFcontactors), Remk
  3283. DOF 106, DOFPulse
  3284. RightSling004.Visible = 1
  3285. Remk.RotX = 26
  3286. RStep = 0
  3287. RightSlingShot.TimerEnabled = True
  3288. ' add some points
  3289. AddScore SlingshotValue
  3290. ' add some effect to the table?
  3291. SetFlash Flasher010, 10, 2000, 50
  3292. ' check modes
  3293. StopCombo
  3294. ' remember last trigger hit by the ball
  3295. LastSwitchHit = "RightSlingShot"
  3296. End Sub
  3297.  
  3298. Sub RightSlingShot_Timer
  3299. Select Case RStep
  3300. Case 1:RightSLing004.Visible = 0:RightSLing003.Visible = 1:Remk.RotX = 14
  3301. Case 2:RightSLing003.Visible = 0:RightSLing002.Visible = 1:Remk.RotX = 2
  3302. Case 3:RightSLing002.Visible = 0:Remk.RotX = -10:RightSlingShot.TimerEnabled = 0
  3303. End Select
  3304. RStep = RStep + 1
  3305. End Sub
  3306.  
  3307. '*********
  3308. ' Bumpers
  3309. '*********
  3310.  
  3311. Sub Bumper1_Hit
  3312. If Tilted Then Exit Sub
  3313. PlaySoundAt SoundFXDOF("fx_bumper",113,DOFPulse,DOFContactors), Bumper1
  3314. DOF 128, DOFPulse
  3315. Flashforms LBumper1, 2000, 50, 0
  3316. ' add some points
  3317. Addscore 125000 + 125000 * bSuperPops(CurrentPlayer)
  3318. ' check for modes
  3319. StopCombo
  3320. Select Case Mode(CurrentPlayer, 0)
  3321. Case 3 'simply lit the super bumpers light
  3322. light024.State = 1
  3323. CheckFinisterra
  3324. End Select
  3325. If Mode(CurrentPlayer, 0) <> 3 AND bSuperPops(CurrentPlayer) <> 1 Then 'this if it is not finished
  3326. SuperPopsCount(CurrentPlayer) = SuperPopsCount(CurrentPlayer) + 1
  3327. If SuperPopsCount(CurrentPlayer) = 30 * FinisterraDifficulty Then
  3328. bSuperPops(CurrentPlayer) = 2 'this means it is activated
  3329. Select case Balls
  3330. Case 1:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_bumpers"
  3331. Case 2:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_superbumperarelit"
  3332. Case 3:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_superbumperarelit2"
  3333. End Select
  3334. UpdateSuperPyramid
  3335. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  3336. ElseIf SuperPopsCount(CurrentPlayer)> 30 * FinisterraDifficulty Then 'add more points to the SP jackpot
  3337. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  3338. End If
  3339. End If
  3340.  
  3341. ' remember last trigger hit by the ball
  3342. LastSwitchHit = "Bumper1"
  3343. End Sub
  3344.  
  3345. Sub Bumper2_Hit
  3346. If Tilted Then Exit Sub
  3347. PlaySoundAt SoundFXDOF("fx_bumper",115,DOFPulse,DOFContactors), Bumper2
  3348. DOF 130, DOFPulse
  3349. Flashforms LBumper2, 2000, 50, 0
  3350. ' add some points
  3351. Addscore 125000 + 125000 * bSuperPops(CurrentPlayer)
  3352. ' check for modes
  3353. StopCombo
  3354. Select Case Mode(CurrentPlayer, 0)
  3355. Case 3 'simply lit the super bumpers light
  3356. light024.State = 1
  3357. CheckFinisterra
  3358. End Select
  3359. If Mode(CurrentPlayer, 0) <> 3 AND bSuperPops(CurrentPlayer) <> 1 Then 'this if it is not finished
  3360. SuperPopsCount(CurrentPlayer) = SuperPopsCount(CurrentPlayer) + 1
  3361. If SuperPopsCount(CurrentPlayer) = 30 * FinisterraDifficulty Then
  3362. bSuperPops(CurrentPlayer) = 2 'this means it is activated
  3363. Select case Balls
  3364. Case 1:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_bumpers"
  3365. Case 2:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_superbumperarelit"
  3366. Case 3:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_superbumperarelit2"
  3367. End Select
  3368. UpdateSuperPyramid
  3369. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  3370. ElseIf SuperPopsCount(CurrentPlayer)> 30 * FinisterraDifficulty Then 'add more points to the SP jackpot
  3371. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  3372. End If
  3373. End If
  3374.  
  3375. ' remember last trigger hit by the ball
  3376. LastSwitchHit = "Bumper2"
  3377. End Sub
  3378.  
  3379. Sub Bumper3_Hit
  3380. If Tilted Then Exit Sub
  3381. PlaySoundAt SoundFXDOF("fx_bumper",114,DOFPulse,DOFContactors), Bumper3
  3382. DOF 129, DOFPulse
  3383. Flashforms LBumper3, 2000, 50, 0
  3384. ' add some points
  3385. Addscore 125000 + 125000 * bSuperPops(CurrentPlayer)
  3386. ' check for modes
  3387. StopCombo
  3388. Select Case Mode(CurrentPlayer, 0)
  3389. Case 3 'simply lit the super bumpers light
  3390. light024.State = 1
  3391. CheckFinisterra
  3392. End Select
  3393. If Mode(CurrentPlayer, 0) <> 3 AND bSuperPops(CurrentPlayer) <> 1 Then 'this if it is not finished
  3394. SuperPopsCount(CurrentPlayer) = SuperPopsCount(CurrentPlayer) + 1
  3395. If SuperPopsCount(CurrentPlayer) = 30 * FinisterraDifficulty Then
  3396. bSuperPops(CurrentPlayer) = 2 'this means it is activated
  3397. Select case Balls
  3398. Case 1:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_bumpers"
  3399. Case 2:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_superbumperarelit"
  3400. Case 3:DMD "", "", "superpopsislit", eNone, eNone, eBlink, 1500, True, "vo_superbumperarelit2"
  3401. End Select
  3402. UpdateSuperPyramid
  3403. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  3404. ElseIf SuperPopsCount(CurrentPlayer)> 30 * FinisterraDifficulty Then 'add more points to the SP jackpot
  3405. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  3406. End If
  3407. End If
  3408.  
  3409. ' remember last trigger hit by the ball
  3410. LastSwitchHit = "Bumper3"
  3411. End Sub
  3412.  
  3413. '*************************
  3414. ' Triggers
  3415. '*************************
  3416.  
  3417. Sub aSwitches_Hit(idx) 'stop skillshot if any switch is hit
  3418. 'debug.print idx
  3419. If bSkillShotReady Then
  3420. ResetSkillShotTimer_Timer
  3421. End If
  3422. End Sub
  3423.  
  3424. Sub Trigger001_Hit 'Left outlane
  3425. PlaySoundAt "fx_sensor", Trigger001
  3426. If Tilted Then Exit Sub
  3427. Addscore 25000
  3428. ' check for modes
  3429. StopCombo
  3430. If bSkillShotReady Then
  3431. AwardSecretSkillshot 20000000
  3432. AddPlayfieldMultiplier 2
  3433. BallSaverTime = BallSaverTime + 10
  3434. End If
  3435. ' remember last trigger hit by the ball
  3436. LastSwitchHit = "Trigger001"
  3437. End Sub
  3438.  
  3439. Sub Trigger002_Hit 'Left inlane
  3440. PlaySoundAt "fx_sensor", Trigger002
  3441. If Tilted Then Exit Sub
  3442. Addscore 25000
  3443. 'PFx
  3444. If light001.State Then
  3445. PFxActivated = 1
  3446. pfxtimer.Enabled = 1
  3447. UpdatePFxLights
  3448. light001.State = 0
  3449. End If
  3450. ' check for modes
  3451. If bSkillShotReady Then
  3452. AwardSecretSkillshot 5000000
  3453. AddPlayfieldMultiplier 2
  3454. BallSaverTime = BallSaverTime + 10
  3455. End If
  3456. ' remember last trigger hit by the ball
  3457. LastSwitchHit = "Trigger002"
  3458. End Sub
  3459.  
  3460. Sub Trigger003_Hit 'Right inlane
  3461. PlaySoundAt "fx_sensor", Trigger003
  3462. If Tilted Then Exit Sub
  3463. Addscore 25000
  3464. 'PFx
  3465. If light002.State Then
  3466. PFxActivated = 1
  3467. pfxtimer.Enabled = 1
  3468. UpdatePFxLights
  3469. light002.State = 0
  3470. End If
  3471. ' check for modes
  3472. ' remember last trigger hit by the ball
  3473. LastSwitchHit = "Trigger003"
  3474. End Sub
  3475.  
  3476. Sub Trigger004_Hit 'Right outlane
  3477. PlaySoundAt "fx_sensor", Trigger004
  3478. If Tilted Then Exit Sub
  3479. Addscore 25000
  3480. ' check for modes
  3481. StopCombo
  3482. ' remember last trigger hit by the ball
  3483. LastSwitchHit = "Trigger004"
  3484. End Sub
  3485.  
  3486. Sub Trigger005_Hit 'Start Right Orbit
  3487. PlaySoundAt "fx_sensor", Trigger005
  3488. If Tilted Then Exit Sub
  3489. SetFlash Flasher002, 2, 2000, 100
  3490. DOF 203, DOFPulse
  3491. Addscore 330
  3492. ' check for modes
  3493. ' remember last trigger hit by the ball
  3494. LastSwitchHit = "Trigger005"
  3495. End Sub
  3496.  
  3497. Sub Trigger012_Hit 'Mini Loop
  3498. PlaySoundAt "fx_sensor", Trigger012
  3499. If Tilted Then Exit Sub
  3500. Addscore 330
  3501. ' check for modes
  3502. ' remember last trigger hit by the ball
  3503. LastSwitchHit = "Trigger012"
  3504. End Sub
  3505.  
  3506. Sub Trigger006_Hit 'Right Orbit, opto
  3507. If Tilted Then Exit Sub
  3508. GiEffect 1
  3509. MiniLoopMulti = 1
  3510. Addscore 125000
  3511. 'loops, skillshots, addaballs
  3512. LoopsBonusCount = LoopsBonusCount + 1
  3513. If LastSwitchHit = "Trigger005" Then
  3514. CheckCombo 6
  3515. If bSkillShotReady Then
  3516. AwardSecretSkillshot 6000000
  3517. AddPlayfieldMultiplier 2
  3518. BallSaverTime = BallSaverTime + 10
  3519. End If
  3520. If bAddaBall AND Light052.State = 2 Then
  3521. AddaBallCount = AddaBallCount + 1
  3522. Light052.State = 0
  3523. CheckAddaBall
  3524. End If
  3525. CheckLoop
  3526. End If
  3527. If LastSwitchHit = "Trigger012" Then
  3528. CheckCombo 4
  3529. If bAddaBall AND Light049.State = 2 Then
  3530. AddaBallCount = AddaBallCount + 1
  3531. Light049.State = 0
  3532. CheckAddaBall
  3533. End If
  3534. MiniLoopMulti = 3
  3535. CheckLoop
  3536. End If
  3537. If LastSwitchHit = "Trigger007" Then
  3538. CheckCombo 3
  3539. If bAddaBall AND Light056.State = 2 Then
  3540. AddaBallCount = AddaBallCount + 1
  3541. Light056.State = 0
  3542. CheckAddaBall
  3543. End If
  3544. End If
  3545. If LastSwitchHit = "Trigger013" Then
  3546. CheckCombo 2
  3547. If bAddaBall AND Light055.State = 2 Then
  3548. AddaBallCount = AddaBallCount + 1
  3549. Light055.State = 0
  3550. CheckAddaBall
  3551. End If
  3552. CheckLoop
  3553. End If
  3554. ' check for modes
  3555. Select Case Mode(CurrentPlayer, 0)
  3556. Case 10
  3557. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3558. Light052.State = 0
  3559. AddBRUJALetter 1
  3560. End If
  3561. If LastSwitchHit = "Trigger012" AND Light049.State Then
  3562. Light049.State = 0
  3563. AddBRUJALetter 1
  3564. End If
  3565. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3566. Light056.State = 0
  3567. AddBRUJALetter 1
  3568. End If
  3569. If LastSwitchHit = "Trigger013" AND Light055.State Then
  3570. Light055.State = 0
  3571. AddBRUJALetter 1
  3572. End If
  3573. Case 2
  3574. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3575. AwardJackpot_WitchArrow 7
  3576. Light052.State = 0
  3577. If WitchMBMultiplier(7) <5 Then
  3578. WitchMBMultiplier(7) = WitchMBMultiplier(7) + 1
  3579. End If
  3580. WitchMBArrowCount = WitchMBArrowCount + 1
  3581. If WitchMBArrowCount> 2 Then
  3582. light051.State = 2
  3583. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  3584. End If
  3585. End If
  3586. If LastSwitchHit = "Trigger012" AND Light049.State Then
  3587. AwardJackpot_WitchArrow 5
  3588. Light049.State = 0
  3589. If WitchMBMultiplier(5) <5 Then
  3590. WitchMBMultiplier(5) = WitchMBMultiplier(5) + 1
  3591. End If
  3592. WitchMBArrowCount = WitchMBArrowCount + 1
  3593. If WitchMBArrowCount> 2 Then
  3594. light051.State = 2
  3595. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  3596. End If
  3597. End If
  3598. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3599. AwardJackpot_WitchArrow 3
  3600. Light056.State = 0
  3601. If WitchMBMultiplier(3) <5 Then
  3602. WitchMBMultiplier(3) = WitchMBMultiplier(3) + 1
  3603. End If
  3604. WitchMBArrowCount = WitchMBArrowCount + 1
  3605. If WitchMBArrowCount> 2 Then
  3606. light051.State = 2
  3607. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  3608. End If
  3609. End If
  3610. If LastSwitchHit = "Trigger013" AND Light055.State Then
  3611. AwardJackpot_WitchArrow 2
  3612. Light055.State = 0
  3613. If WitchMBMultiplier(2) <5 Then
  3614. WitchMBMultiplier(2) = WitchMBMultiplier(2) + 1
  3615. End If
  3616. WitchMBArrowCount = WitchMBArrowCount + 1
  3617. If WitchMBArrowCount> 2 Then
  3618. light051.State = 2
  3619. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  3620. End If
  3621. End if
  3622. Case 3
  3623. 'simply lit the super light
  3624. light027.State = 1
  3625. CheckFinisterra
  3626. Case 5
  3627. If LastSwitchHit = "Trigger013" AND Light055.State Then
  3628. HechizoSpinnerValue = 350000
  3629. CheckHechizo
  3630. End If
  3631. If LastSwitchHit = "Trigger012" AND Light049.State Then
  3632. HechizoSpinnerValue = 500000
  3633. CheckHechizo
  3634. End If
  3635. Case 6
  3636. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3637. Light052.State = 0
  3638. CheckFolkCount
  3639. End If
  3640. If LastSwitchHit = "Trigger012" AND Light049.State Then
  3641. Light049.State = 0
  3642. CheckFolkCount
  3643. End If
  3644. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3645. Light056.State = 0
  3646. CheckFolkCount
  3647. End If
  3648. If LastSwitchHit = "Trigger013" AND Light055.State Then
  3649. Light055.State = 0
  3650. CheckFolkCount
  3651. End If
  3652. Case 7
  3653. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3654. Light056.State = 0
  3655. Addscore 3000000
  3656. AtlantiaCount = AtlantiaCount + 1
  3657. CheckAtlantia
  3658. End If
  3659. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3660. Light052.State = 0
  3661. Addscore 3000000
  3662. AtlantiaCount = AtlantiaCount + 1
  3663. CheckAtlantia
  3664. End If
  3665. Case 8
  3666. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3667. Light052.State = 0
  3668. Addscore ArbolesJPValue
  3669. ArbolesCount = ArbolesCount + 1
  3670. CheckArboles
  3671. End If
  3672. If LastSwitchHit = "Trigger013" AND Light055.State Then
  3673. Light055.State = 0
  3674. Addscore ArbolesJPValue
  3675. ArbolesCount = ArbolesCount + 1
  3676. CheckArboles
  3677. End If
  3678. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3679. Light056.State = 0
  3680. Addscore ArbolesJPValue
  3681. ArbolesCount = ArbolesCount + 1
  3682. CheckArboles
  3683. End If
  3684. Case 9
  3685. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3686. Light056.State = 0
  3687. Addscore 1000000
  3688. DMD "", "", "1million", eNone, eNone, eBlink, 1500, True, "vo_1million"
  3689. CheckManchaXanandra
  3690. End If
  3691. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3692. Light052.State = 0
  3693. Addscore 1000000
  3694. DMD "", "", "1million", eNone, eNone, eBlink, 1500, True, "vo_1million"
  3695. CheckManchaXanandra
  3696. End If
  3697. Case 11
  3698. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3699. If Light052.State = 2 Then 'change blinking red to lit green
  3700. SetLightColor Light052, Green, 1
  3701. CheckFNC
  3702. ElseIf Light052.State = 1 Then 'Change from green to blinking red
  3703. SetLightColor Light052, Red, 2
  3704. End If
  3705. End If
  3706. If LastSwitchHit = "Trigger012" AND Light049.State Then
  3707. If Light049.State = 2 Then 'change blinking red to lit green
  3708. SetLightColor Light049, Green, 1
  3709. CheckFNC
  3710. ElseIf Light049.State = 1 Then 'Change from green to blinking red
  3711. SetLightColor Light049, Red, 2
  3712. End If
  3713. End If
  3714. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3715. If Light056.State = 2 Then 'change blinking red to lit green
  3716. SetLightColor Light056, Green, 1
  3717. CheckFNC
  3718. ElseIf Light056.State = 1 Then 'Change from green to blinking red
  3719. SetLightColor Light056, Red, 2
  3720. End If
  3721. End If
  3722. If LastSwitchHit = "Trigger013" AND Light055.State Then
  3723. If Light055.State = 2 Then 'change blinking red to lit green
  3724. SetLightColor Light055, Green, 1
  3725. CheckFNC
  3726. ElseIf Light055.State = 1 Then 'Change from green to blinking red
  3727. SetLightColor Light055, Red, 2
  3728. End If
  3729. End If
  3730. Case 12
  3731. If LastSwitchHit = "Trigger005" AND Light052.State Then
  3732. Light052.State = 0
  3733. AwardJackpot
  3734. CheckLDDF
  3735. End If
  3736. If LastSwitchHit = "Trigger012" AND Light049.State Then
  3737. Light049.State = 0
  3738. AwardJackpot
  3739. CheckLDDF
  3740. End If
  3741. If LastSwitchHit = "Trigger007" AND Light056.State Then
  3742. Light056.State = 0
  3743. AwardJackpot
  3744. CheckLDDF
  3745. End If
  3746. If LastSwitchHit = "Trigger013" AND Light055.State Then
  3747. Light055.State = 0
  3748. AwardJackpot
  3749. CheckLDDF
  3750. End If
  3751. End Select
  3752. ' active on all modes but Finisterra
  3753. If Mode(CurrentPlayer, 0) <> 3 AND bSuperOrbits(CurrentPlayer) <> 1 Then 'this if it is not finished
  3754. SuperOrbitsCount(CurrentPlayer) = SuperOrbitsCount(CurrentPlayer) + 1
  3755. If SuperOrbitsCount(CurrentPlayer) = 10 * FinisterraDifficulty Then
  3756. bSuperOrbits(CurrentPlayer) = 2 'this means it is activated
  3757. DMD "", "", "superorbitsislit", eNone, eNone, eBlink, 1500, True, "vo_superorbitsarelit"
  3758. UpdateSuperPyramid
  3759. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  3760. ElseIf SuperOrbitsCount(CurrentPlayer)> 10 * FinisterraDifficulty Then 'add more points to the SP jackpot
  3761. SuperPyramidValue = SuperPyramidValue + 125000 * FinisterraDifficulty
  3762. End If
  3763. End If
  3764.  
  3765. ' remember last trigger hit by the ball
  3766. LastSwitchHit = "Trigger006"
  3767. End Sub
  3768.  
  3769. Sub Trigger007_Hit 'Center Orbit, opto
  3770. If Tilted Then Exit Sub
  3771. Addscore 330
  3772. ' check for modes
  3773. ' remember last trigger hit by the ball
  3774. LastSwitchHit = "Trigger007"
  3775. End Sub
  3776.  
  3777. Sub Trigger008_Hit 'Left ramp done
  3778. If Tilted Then Exit Sub
  3779. Addscore 125000
  3780. SetFlash flasher004, 4, 3000, 60
  3781. DOF 205, DOFPulse
  3782. ' check for modes
  3783. CheckCombo 1
  3784. ' Tomb Treasure
  3785. If bTombTreasureReady = False Then
  3786. LeftTombHits(CurrentPlayer) = (LeftTombHits(CurrentPlayer) + 1)MOD 5
  3787. If LeftTombHits(CurrentPlayer) = 0 Then StartTombTreasure
  3788. Else
  3789. AwardTombTreasure
  3790. End If
  3791. 'Modes
  3792. Select Case Mode(CurrentPlayer, 0)
  3793. Case 10
  3794. If light054.State Then
  3795. light054.State = 0
  3796. AddBRUJALetter 1
  3797. End If
  3798. If bLockActive(CurrentPlayer)Then
  3799. DMD "", "", "lockislit", eNone, eNone, eBlink, 1500, True, "vo_lockislit"
  3800. light008.State = 2
  3801. RampUp
  3802. End If
  3803. Case 1
  3804. If bAddaBall AND Light054.State = 2 Then
  3805. AddaBallCount = AddaBallCount + 1
  3806. Light054.State = 0
  3807. CheckAddaBall
  3808. End If
  3809. Case 2
  3810. If Light054.State Then
  3811. AwardJackpot_WitchArrow 1
  3812. Light054.State = 0
  3813. If WitchMBMultiplier(1) <5 Then
  3814. WitchMBMultiplier(1) = WitchMBMultiplier(1) + 1
  3815. End If
  3816. WitchMBArrowCount = WitchMBArrowCount + 1
  3817. If WitchMBArrowCount> 2 Then
  3818. light051.State = 2
  3819. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  3820. End If
  3821. End If
  3822. Case 3 'simply lit the super light
  3823. light028.State = 1
  3824. CheckFinisterra
  3825. Case 4
  3826. If Light054.State Then
  3827. DMD " CELTIC LAND COMBO", CL(1, FormatScore(CelticValue) & " X " & CelticMultiplier), "", eNone, eBlink, eNone, 1500, True, ""
  3828. light054.State = 0
  3829. light053.State = 2
  3830. AddScore CelticValue * CelticMultiplier
  3831. CelticValue = CelticValue + 150000
  3832. CelticMultiplier = CelticMultiplier + 1
  3833. CelticCombo.Enabled = 0
  3834. CelticCombo.Enabled = 1
  3835. Else
  3836. DMD "CELTIC LAND RAMPSHOT", CL(1, FormatScore(CelticValue)), "", eNone, eBlink, eNone, 1500, True, ""
  3837. AddScore CelticValue
  3838. CelticValue = CelticValue + 150000
  3839. End If
  3840. Case 5
  3841. If Light054.State Then
  3842. HechizoSpinnerValue = 250000
  3843. CheckHechizo
  3844. End If
  3845. Case 6
  3846. If Light054.State Then
  3847. Light054.State = 0
  3848. CheckFolkCount
  3849. End If
  3850. Case 7
  3851. If Light054.State Then
  3852. Light054.State = 0
  3853. Addscore 3000000
  3854. AtlantiaCount = AtlantiaCount + 1
  3855. CheckAtlantia
  3856. End If
  3857. Case 8
  3858. If Light054.State Then
  3859. Light054.State = 0
  3860. Addscore ArbolesJPValue
  3861. ArbolesCount = ArbolesCount + 1
  3862. CheckArboles
  3863. End If
  3864. Case 9
  3865. If Light054.State Then
  3866. Light054.State = 0
  3867. Addscore 1000000
  3868. DMD "", "", "1million", eNone, eNone, eBlink, 1500, True, "vo_1million"
  3869. CheckManchaXanandra
  3870. End If
  3871. Case 11
  3872. If Light054.State = 2 Then 'change blinking red to lit green
  3873. SetLightColor Light054, Green, 1
  3874. CheckFNC
  3875. ElseIf Light054.State = 1 Then 'Change from green to blinking red
  3876. SetLightColor Light054, Red, 2
  3877. End If
  3878. Case 12
  3879. If Light054.State = 2 Then
  3880. light054.State = 0
  3881. AwardJackpot
  3882. CheckLDDF
  3883. End If
  3884. End Select
  3885. If Mode(CurrentPlayer, 0) <> 3 AND bSuperRamps(CurrentPlayer) <> 1 Then 'this if it is not finished
  3886. SuperRampsCount(CurrentPlayer) = SuperRampsCount(CurrentPlayer) + 1
  3887. If SuperRampsCount(CurrentPlayer) = 10 * FinisterraDifficulty Then
  3888. bSuperRamps(CurrentPlayer) = 2 'this means it is activated
  3889. DMD "", "", "superampsislit", eNone, eNone, eBlink, 1500, True, "vo_superrampsarelit"
  3890. UpdateSuperPyramid
  3891. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  3892. ElseIf SuperRampsCount(CurrentPlayer)> 10 * FinisterraDifficulty Then 'add more points to the SP jackpot
  3893. SuperPyramidValue = SuperPyramidValue + 125000 * FinisterraDifficulty
  3894. End If
  3895. End If
  3896.  
  3897. ' remember last trigger hit by the ball
  3898. LastSwitchHit = "Trigger008"
  3899. End Sub
  3900.  
  3901. Sub Trigger009_Hit 'Right ramp done
  3902. If Tilted Then Exit Sub
  3903. SetFlash flasher005, 5, 3000, 60
  3904. DOF 207, DOFPulse
  3905. Addscore 125000
  3906. ' check for modes
  3907. CheckCombo 5
  3908. Select Case Mode(CurrentPlayer, 0)
  3909. Case 10:
  3910. If light053.State Then
  3911. light053.State = 0
  3912. AddBRUJALetter 1
  3913. End If
  3914. If bLockActive(CurrentPlayer)Then
  3915. DMD "", "", "lockislit", eNone, eNone, eBlink, 1500, True, "vo_lockislit"
  3916. light008.State = 2
  3917. RampUp
  3918. End If
  3919. Case 1:
  3920. If bAddaBall AND Light053.State = 2 Then
  3921. AddaBallCount = AddaBallCount + 1
  3922. Light053.State = 0
  3923. CheckAddaBall
  3924. End If
  3925. Case 2:
  3926. If Light053.State Then
  3927. AwardJackpot_WitchArrow 6
  3928. Light053.State = 0
  3929. If WitchMBMultiplier(6) <5 Then
  3930. WitchMBMultiplier(6) = WitchMBMultiplier(6) + 1
  3931. End If
  3932. WitchMBArrowCount = WitchMBArrowCount + 1
  3933. If WitchMBArrowCount> 2 Then
  3934. light051.State = 2
  3935. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  3936. End If
  3937. End If
  3938. Case 3: 'simply lit the super light
  3939. light028.State = 1
  3940. CheckFinisterra
  3941. Case 4
  3942. If Light053.State Then
  3943. DMD " CELTIC LAND COMBO", CL(1, FormatScore(CelticValue) & " X " & CelticMultiplier), "", eNone, eBlink, eNone, 1500, True, ""
  3944. light053.State = 0
  3945. light054.State = 2
  3946. AddScore CelticValue * CelticMultiplier
  3947. CelticValue = CelticValue + 150000
  3948. CelticMultiplier = CelticMultiplier + 1
  3949. CelticCombo.Enabled = 0
  3950. CelticCombo.Enabled = 1
  3951. Else
  3952. DMD "CELTIC LAND RAMPSHOT", CL(1, FormatScore(CelticValue)), "", eNone, eBlink, eNone, 1500, True, "vo_nicerampshot"
  3953. AddScore CelticValue
  3954. CelticValue = CelticValue + 150000
  3955. End If
  3956. Case 5
  3957. If Light053.State Then
  3958. HechizoSpinnerValue = 250000
  3959. CheckHechizo
  3960. ElseIf light044.State Then
  3961. HechizoSpinnerValue = HechizoSpinnerValue * 2
  3962. DMD CL(0, "SPINNER VALUE"), CL(1, FormatScore(HechizoSpinnerValue)), "", eNone, eNone, eNone, 1500, True, ""
  3963. End If
  3964. Case 6
  3965. If Light053.State Then
  3966. Light053.State = 0
  3967. CheckFolkCount
  3968. End If
  3969. Case 7
  3970. If Light053.State Then
  3971. Light053.State = 0
  3972. Addscore 3000000
  3973. AtlantiaCount = AtlantiaCount + 1
  3974. CheckAtlantia
  3975. End If
  3976. Case 8
  3977. If Light053.State Then
  3978. Light053.State = 0
  3979. Addscore ArbolesJPValue
  3980. ArbolesCount = ArbolesCount + 1
  3981. CheckArboles
  3982. End If
  3983. Case 9
  3984. If Light053.State Then
  3985. Light053.State = 0
  3986. Addscore 1000000
  3987. DMD "", "", "1million", eNone, eNone, eBlink, 1500, True, "vo_1million"
  3988. CheckManchaXanandra
  3989. End If
  3990. Case 11
  3991. If Light053.State = 2 Then 'change blinking red to lit green
  3992. SetLightColor Light053, Green, 1
  3993. CheckFNC
  3994. ElseIf Light053.State = 1 Then 'Change from green to blinking red
  3995. SetLightColor Light053, Red, 2
  3996. End If
  3997. Case 12
  3998. If Light053.State = 2 Then
  3999. light053.State = 0
  4000. AwardJackpot
  4001. CheckLDDF
  4002. End If
  4003. End Select
  4004. If Mode(CurrentPlayer, 0) <> 3 AND bSuperRamps(CurrentPlayer) <> 1 Then 'this if it is not finished
  4005. SuperRampsCount(CurrentPlayer) = SuperRampsCount(CurrentPlayer) + 1
  4006. If SuperRampsCount(CurrentPlayer) = 10 * FinisterraDifficulty Then
  4007. bSuperRamps(CurrentPlayer) = 2 'this means it is activated
  4008. DMD "", "", "superampsislit", eNone, eNone, eBlink, 1500, True, "vo_superrampsarelit"
  4009. UpdateSuperPyramid
  4010. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  4011. ElseIf SuperRampsCount(CurrentPlayer)> 10 * FinisterraDifficulty Then 'add more points to the SP jackpot
  4012. SuperPyramidValue = SuperPyramidValue + 125000 * FinisterraDifficulty
  4013. End If
  4014. End If
  4015.  
  4016. ' remember last trigger hit by the ball
  4017. LastSwitchHit = "Trigger007"
  4018. End Sub
  4019.  
  4020. Sub Trigger013_Hit 'Left Orbit, opto
  4021. If Tilted Then Exit Sub
  4022. Addscore 330
  4023. ' check for modes
  4024. ' remember last trigger hit by the ball
  4025. LastSwitchHit = "Trigger013"
  4026. End Sub
  4027.  
  4028. '***************
  4029. ' Targets
  4030. '***************
  4031.  
  4032. Sub Target001_hit 'skillshot, X
  4033. PlaySoundAtBall SoundFXDOF("fx_target",107,DOFPulse,DOFTargets)
  4034. If Tilted Then Exit Sub
  4035. CheckDeathblow 1
  4036. Addscore 75000
  4037. If bSkillShotReady Then
  4038. AwardSkillshot
  4039. AddBrujaLetter 1
  4040. BallSaverTime = BallSaverTime + 5
  4041. Exit Sub
  4042. End If
  4043. If light047.State then 'give Extra Ball
  4044. ExtraBallCount(CurrentPLayer) = 0
  4045. light047.State = 0
  4046. AwardExtraBall
  4047. End If
  4048. ' PFx
  4049. If PFxActivated Then PFxSeconds = PFxSeconds + 5
  4050. If light015.State Then
  4051. light015.State = 0
  4052. CheckPFx
  4053. End If
  4054. ' check for modes
  4055. Select Case Mode(CurrentPlayer, 0)
  4056. Case 3
  4057. 'simply lit the super light
  4058. light025.State = 1
  4059. CheckFinisterra
  4060. End Select
  4061. If Mode(CurrentPlayer, 0) <> 3 AND bSuperTargets(CurrentPlayer) <> 1 Then 'this if it is not finished
  4062. SuperTargetsCount(CurrentPlayer) = SuperTargetsCount(CurrentPlayer) + 1
  4063. If SuperTargetsCount(CurrentPlayer) = 20 * FinisterraDifficulty Then
  4064. bSuperTargets(CurrentPlayer) = 2 'this means it is activated
  4065. DMD "", "", "supertargetsislit", eNone, eNone, eBlink, 1500, True, "vo_supertargetsarelit"
  4066. UpdateSuperPyramid
  4067. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  4068. ElseIf SuperTargetsCount(CurrentPlayer)> 20 * FinisterraDifficulty Then 'add more points to the SP jackpot
  4069. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  4070. End If
  4071. End If
  4072.  
  4073. ' remember last trigger hit by the ball
  4074. LastSwitchHit = "Target001"
  4075. End Sub
  4076.  
  4077. Sub Target002_hit 'gravestone
  4078. PlaySoundAtBall SoundFXDOF("fx_target",108,DOFPulse,DOFTargets)
  4079. If Tilted Then Exit Sub
  4080. Addscore 75000
  4081. GiEffect 3
  4082. ' Tomb Treasure
  4083. If bTombTreasureReady = False Then
  4084. LeftTombHits2(CurrentPlayer) = (LeftTombHits2(CurrentPlayer) + 1)MOD 5
  4085. If LeftTombHits2(CurrentPlayer) = 0 Then StartTombTreasure
  4086. End If
  4087. 'Spot an X is comming from the left inlane (alley pass)
  4088. If LastSwitchHit = "Trigger002" then
  4089. If light015.State = 2 Then
  4090. light015.State = 0:CheckPFx
  4091. ElseIf light016.State = 2 Then
  4092. light016.State = 0:CheckPFx
  4093. ElseIf light017.State = 2 Then
  4094. light017.State = 0:CheckPFx
  4095. ElseIf light018.State = 2 Then
  4096. light018.State = 0:CheckPFx
  4097. End If
  4098. End If
  4099.  
  4100. ' check for modes
  4101. StopCombo
  4102. Select Case Mode(CurrentPlayer, 0)
  4103. Case 3
  4104. 'simply lit the super light
  4105. light025.State = 1
  4106. CheckFinisterra
  4107. End Select
  4108. If Mode(CurrentPlayer, 0) <> 3 AND bSuperTargets(CurrentPlayer) <> 1 Then 'this if it is not finished
  4109. SuperTargetsCount(CurrentPlayer) = SuperTargetsCount(CurrentPlayer) + 1
  4110. If SuperTargetsCount(CurrentPlayer) = 20 * FinisterraDifficulty Then
  4111. bSuperTargets(CurrentPlayer) = 2 'this means it is activated
  4112. DMD "", "", "supertargetsislit", eNone, eNone, eBlink, 1500, True, "vo_supertargetsarelit"
  4113. UpdateSuperPyramid
  4114. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  4115. ElseIf SuperTargetsCount(CurrentPlayer)> 20 * FinisterraDifficulty Then 'add more points to the SP jackpot
  4116. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  4117. End If
  4118. End If
  4119.  
  4120. ' remember last trigger hit by the ball
  4121. LastSwitchHit = "Target002"
  4122. End Sub
  4123.  
  4124. Sub Target003_hit 'bumpers, X target
  4125. PlaySoundAtBall SoundFXDOF("fx_target",109,DOFPulse,DOFTargets)
  4126. If Tilted Then Exit Sub
  4127. Addscore 75000
  4128. ' PFx
  4129. If PFxActivated Then PFxSeconds = PFxSeconds + 5
  4130. If light016.State Then
  4131. light016.State = 0
  4132. CheckPFx
  4133. End If
  4134. ' check for modes
  4135. StopCombo
  4136. Select Case Mode(CurrentPlayer, 0)
  4137. Case 2
  4138. If Light044.State Then
  4139. AwardJackpot_WitchArrow 0
  4140. Light044.State = 0
  4141. If WitchMBMultiplier(0) <5 Then
  4142. WitchMBMultiplier(0) = WitchMBMultiplier(0) + 1
  4143. End If
  4144. WitchMBArrowCount = WitchMBArrowCount + 1
  4145. If WitchMBArrowCount> 2 Then
  4146. light051.State = 2
  4147. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  4148. End If
  4149. End If
  4150. Case 3
  4151. 'simply lit the super light
  4152. light025.State = 1
  4153. CheckFinisterra
  4154. Case 6
  4155. If Light044.State Then
  4156. Light044.State = 0
  4157. CheckFolkCount
  4158. End If
  4159. End Select
  4160. If Mode(CurrentPlayer, 0) <> 3 AND bSuperTargets(CurrentPlayer) <> 1 Then 'this if it is not finished
  4161. SuperTargetsCount(CurrentPlayer) = SuperTargetsCount(CurrentPlayer) + 1
  4162. If SuperTargetsCount(CurrentPlayer) = 20 * FinisterraDifficulty Then
  4163. bSuperTargets(CurrentPlayer) = 2 'this means it is activated
  4164. DMD "", "", "supertargetsislit", eNone, eNone, eBlink, 1500, True, "vo_supertargetsarelit"
  4165. UpdateSuperPyramid
  4166. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  4167. ElseIf SuperTargetsCount(CurrentPlayer)> 20 * FinisterraDifficulty Then 'add more points to the SP jackpot
  4168. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  4169. End If
  4170. End If
  4171.  
  4172. ' remember last trigger hit by the ball
  4173. LastSwitchHit = "Target003"
  4174. End Sub
  4175.  
  4176. Sub Target004_hit 'drop top
  4177. PlaySoundAt SoundFXDOF("fx_droptarget",110,DOFPulse,DOFDropTargets), Target004
  4178. If Tilted Then Exit Sub
  4179. ' check for modes
  4180. StopCombo
  4181. If Mode(CurrentPlayer, 0) = 7 Then
  4182. If Light009.State Then
  4183. Light009.State = 0
  4184. Addscore 3000000
  4185. AtlantiaCount = AtlantiaCount + 1
  4186. CheckAtlantia
  4187. End If
  4188. Else
  4189. Addscore DropValue(CurrentPLayer)
  4190. If DropValue(CurrentPLayer) <100000 Then
  4191. DropValue(CurrentPLayer) = DropValue(CurrentPLayer) + 5000
  4192. End If
  4193. DropCount = DropCount + 1
  4194. CheckDrops
  4195. ' remember last trigger hit by the ball
  4196. LastSwitchHit = "Target004"
  4197. End If
  4198. End Sub
  4199.  
  4200. Sub Target005_hit 'drop center
  4201. PlaySoundAt SoundFXDOF("fx_droptarget",110,DOFPulse,DOFDropTargets), Target005
  4202. If Tilted Then Exit Sub
  4203. ' check for modes
  4204. StopCombo
  4205. If Mode(CurrentPlayer, 0) = 7 Then
  4206. If Light010.State Then
  4207. Light010.State = 0
  4208. Addscore 3000000
  4209. AtlantiaCount = AtlantiaCount + 1
  4210. CheckAtlantia
  4211. End If
  4212. Else
  4213. Addscore DropValue(CurrentPLayer)
  4214. If DropValue(CurrentPLayer) <100000 Then
  4215. DropValue(CurrentPLayer) = DropValue(CurrentPLayer) + 5000
  4216. End If
  4217. DropCount = DropCount + 1
  4218. CheckDrops
  4219. ' remember last trigger hit by the ball
  4220. LastSwitchHit = "Target005"
  4221. End If
  4222. End Sub
  4223.  
  4224. Sub Target006_hit 'drop bottom
  4225. PlaySoundAt SoundFXDOF("fx_droptarget",110,DOFPulse,DOFDropTargets), Target006
  4226. If Tilted Then Exit Sub
  4227. ' check for modes
  4228. StopCombo
  4229. If Mode(CurrentPlayer, 0) = 7 Then
  4230. If Light011.State Then
  4231. Light011.State = 0
  4232. Addscore 3000000
  4233. AtlantiaCount = AtlantiaCount + 1
  4234. CheckAtlantia
  4235. End If
  4236. Else
  4237. Addscore DropValue(CurrentPLayer)
  4238. If DropValue(CurrentPLayer) <100000 Then
  4239. DropValue(CurrentPLayer) = DropValue(CurrentPLayer) + 5000
  4240. End If
  4241. DropCount = DropCount + 1
  4242. CheckDrops
  4243. ' remember last trigger hit by the ball
  4244. LastSwitchHit = "Target006"
  4245. End If
  4246. End Sub
  4247.  
  4248. Sub Target007_hit 'mini loop target, X
  4249. PlaySoundAtBall SoundFXDOF("fx_target",111,DOFPulse,DOFTargets)
  4250. If Tilted Then Exit Sub
  4251. Addscore 75000
  4252. ' PFx
  4253. If PFxActivated Then PFxSeconds = PFxSeconds + 5
  4254. If light017.State Then
  4255. light017.State = 0
  4256. CheckPFx
  4257. End If
  4258. ' check for modes
  4259. StopCombo
  4260. Select Case Mode(CurrentPlayer, 0)
  4261. Case 3
  4262. 'simply lit the super light
  4263. light025.State = 1
  4264. CheckFinisterra
  4265. End Select
  4266. If Mode(CurrentPlayer, 0) <> 3 AND bSuperTargets(CurrentPlayer) <> 1 Then 'this if it is not finished
  4267. SuperTargetsCount(CurrentPlayer) = SuperTargetsCount(CurrentPlayer) + 1
  4268. If SuperTargetsCount(CurrentPlayer) = 20 * FinisterraDifficulty Then
  4269. bSuperTargets(CurrentPlayer) = 2 'this means it is activated
  4270. DMD "", "", "supertargetsislit", eNone, eNone, eBlink, 1500, True, "vo_supertargetsarelit"
  4271. UpdateSuperPyramid
  4272. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  4273. ElseIf SuperTargetsCount(CurrentPlayer)> 20 * FinisterraDifficulty Then 'add more points to the SP jackpot
  4274. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  4275. End If
  4276. End If
  4277.  
  4278. ' remember last trigger hit by the ball
  4279. LastSwitchHit = "Target007"
  4280. End Sub
  4281.  
  4282. Sub Target008_hit 'Superskillshot, X
  4283. PlaySoundAtBall SoundFXDOF("fx_target",111,DOFPulse,DOFTargets)
  4284. If Tilted Then Exit Sub
  4285. Addscore 75000
  4286. SetFlash flasher013, 13, 6000, 50
  4287. DOF 212, DOFPulse
  4288. LightEffect 3
  4289. ' Tomb Treasure
  4290. If bTombTreasureReady = False Then
  4291. RightTombHits(CurrentPlayer) = (RightTombHits(CurrentPlayer) + 1)MOD 5
  4292. If RightTombHits(CurrentPlayer) = 0 Then StartTombTreasure
  4293. End If
  4294. ' PFx
  4295. If PFxActivated Then PFxSeconds = PFxSeconds + 5
  4296. If light018.State Then
  4297. light018.State = 0
  4298. CheckPFx
  4299. End If
  4300. ' check for modes
  4301. CheckDeathblow 5
  4302. If bSkillShotReady Then
  4303. AwardSuperSkillshot
  4304. AddPlayfieldMultiplier 1
  4305. BallSaverTime = BallSaverTime + 10
  4306. Exit Sub
  4307. End If
  4308. Select Case Mode(CurrentPlayer, 0)
  4309. Case 2
  4310. If WitchMBArrowCount> 2 AND Light051.State = 2 Then 'award SJP
  4311. AwardSuperJackpot
  4312. Light051.State = 0
  4313. WitchMBArrowCount = 0
  4314. UpdateArrowColors
  4315. End If
  4316. Case 3
  4317. 'simply lit the super light
  4318. light025.State = 1
  4319. CheckFinisterra
  4320. Case 9
  4321. If Light051.State Then
  4322. Light051.State = 0
  4323. AwardSuperJackpot
  4324. End If
  4325. End Select
  4326. If Mode(CurrentPlayer, 0) <> 3 AND bSuperTargets(CurrentPlayer) <> 1 Then 'this if it is not finished
  4327. SuperTargetsCount(CurrentPlayer) = SuperTargetsCount(CurrentPlayer) + 1
  4328. If SuperTargetsCount(CurrentPlayer) = 20 * FinisterraDifficulty Then
  4329. bSuperTargets(CurrentPlayer) = 2 'this means it is activated
  4330. DMD "", "", "supertargetsislit", eNone, eNone, eBlink, 1500, True, "vo_supertargetsarelit"
  4331. UpdateSuperPyramid
  4332. SuperPyramidValue = SuperPyramidValue + 1500000 * FinisterraDifficulty
  4333. ElseIf SuperTargetsCount(CurrentPlayer)> 20 * FinisterraDifficulty Then 'add more points to the SP jackpot
  4334. SuperPyramidValue = SuperPyramidValue + 75000 * FinisterraDifficulty
  4335. End If
  4336. End If
  4337.  
  4338. ' remember last trigger hit by the ball
  4339. LastSwitchHit = "Target008"
  4340. End Sub
  4341.  
  4342. Sub Target009_hit 'captive ball target
  4343. PlaySoundAtBall SoundFXDOF("fx_target",112,DOFPulse,DOFTargets)
  4344. If Tilted Then Exit Sub
  4345. SetFlash flasher014, 14, 2000, 60
  4346. DOF 213, DOFPulse
  4347. SetFlash flasher004, 4, 2000, 60
  4348. DOF 206, DOFPulse
  4349. SetFlash flasher005, 5, 2000, 60
  4350. DOF 208, DOFPulse
  4351. GiEffect 3
  4352. ' check for modes
  4353. CheckDeathblow 3
  4354. Addscore 25330
  4355. Select Case Mode(CurrentPlayer, 0)
  4356. Case 10, 1:AddILUSSIAletter
  4357. Case 7
  4358. If Light019.State Then
  4359. Light019.State = 0
  4360. Addscore 5000000
  4361. AtlantiaCount = AtlantiaCount + 1
  4362. CheckAtlantia
  4363. End If
  4364. End Select
  4365. ' remember last trigger hit by the ball
  4366. LastSwitchHit = "Target009"
  4367. End Sub
  4368.  
  4369. Sub CapWall1_Hit 'Newton ball
  4370. PlaySoundAtBall "fx_collide"
  4371. If Tilted Then Exit Sub
  4372. FlashForms ORBLight, 3000, 60, 0
  4373. CheckDeathblow 2
  4374. Addscore 25000
  4375. ' check for modes
  4376. If bMystery then
  4377. AwardMystery
  4378. ElseIf bAddaBallActivated Then
  4379. AwardAddaBall
  4380. ElseIf bSPJActivated Then
  4381. AwardSPJackpot
  4382. End If
  4383. ' remember last trigger hit by the ball
  4384. LastSwitchHit = "CapWall1"
  4385. End Sub
  4386.  
  4387. Sub bruja_target_Hit
  4388. PlaySoundAtBall SoundFXDOF("fx_target",124,DOFPulse,DOFShaker)
  4389. If Tilted Then Exit Sub
  4390. Dim tmp
  4391. tmp = INT(RND * 15)
  4392. Select Case WitchMultiplier
  4393. Case 0 'weak hit
  4394. Select case tmp
  4395. Case 0, 8, 12:PlaySound "vo_ow"
  4396. Case 1, 9, 13:PlaySound "vo_ow2"
  4397. Case 2, 7, 14:PlaySound "vo_ow4"
  4398. Case 3, 8:PlaySound "vo_terribleaim"
  4399. Case 4, 9:PlaySound "vo_tryscorenow"
  4400. Case 5, 10:PlaySound "vo_youmissedme"
  4401. Case 6, 11:PlaySound "vo_youmissme"
  4402. End Select
  4403. Case 1: 'normal hit
  4404. Select Case tmp
  4405. Case 0, 8, 9:PlaySound "vo_ow3"
  4406. Case 1, 10:PlaySound "vo_blinkinglights"
  4407. Case 2, 11:PlaySound "vo_ohyeah"
  4408. Case 3:PlaySound "vo_sesational"
  4409. Case 4, 12:PlaySound "vo_sweet"
  4410. Case 5:PlaySound "vo_watchwhereyoushoot"
  4411. Case 6, 13:PlaySound "vo_wow2"
  4412. Case 7, 14:PlaySound "vo_younailit"
  4413. End Select
  4414. Case 2: 'Strong hit
  4415. Select Case tmp
  4416. Case 0:PlaySound "vo_blinkinglights2"
  4417. Case 1:PlaySound "vo_breakneck"
  4418. Case 2:PlaySound "vo_rightintheface"
  4419. Case 3:PlaySound "vo_stopdoingthat"
  4420. Case 4:PlaySound "vo_wow"
  4421. Case 5:PlaySound "vo_youaregood"
  4422. Case 6:PlaySound "vo_youareawizard"
  4423. Case 7:PlaySound "vo_youareonfire"
  4424. Case 8:PlaySound "vo_youarethegreatest"
  4425. Case 9:PlaySound "vo_yourule"
  4426. Case 10:PlaySound "vo_dontshootballsatmyface"
  4427. Case 11:PlaySound "vo_dontshootballsatme"
  4428. Case 12:PlaySound "vo_leaveamark"
  4429. Case 13:PlaySound "vo_leaveamark2"
  4430. Case 14:PlaySound "vo_wow"
  4431. End Select
  4432. End Select
  4433. Addscore 25000 * WitchMultiplier
  4434. FlashEffect 1
  4435. 'target animation
  4436. bruja_target.IsDropped = 1
  4437. bruja_target1.IsDropped = 0
  4438. bruja_target.TimerEnabled = 1
  4439. ' light show
  4440. Select Case WitchMultiplier
  4441. Case 1:flasher006.Color = RGB(255, 252, 224):SetFlash flasher006, 6, 2000, 100:DOF 209, DOFPulse
  4442. Case 2:flasher006.Color = RGB(255, 128, 0):SetFlash flasher006, 6, 4000, 75:DOF 210, DOFPulse
  4443. Case 3:flasher006.Color = RGB(255, 0, 255):SetFlash flasher006, 6, 6000, 50:DOF 211, DOFPulse
  4444. End Select
  4445. ' check for modes
  4446. CheckDeathblow 4
  4447. Select Case Mode(CurrentPlayer, 0)
  4448. Case 10
  4449. If bSkillShotReady Then
  4450. AwardSecretSkillshot 6000000
  4451. AddPlayfieldMultiplier 2
  4452. BallSaverTime = BallSaverTime + 10
  4453. End If
  4454. If light057.State Then AddBRUJALetter 1
  4455. Case 1
  4456. If bILUSSIASJP Then AwardSuperJackpot_Witch
  4457. If bAddaBall AND Light057.State = 2 Then
  4458. AddaBallCount = AddaBallCount + 1
  4459. Light057.State = 0
  4460. Light058.State = 0
  4461. CheckAddaBall
  4462. End If
  4463. Case 2
  4464. If bWitchMBJackpotReady Then 'droptarget activated jackpot
  4465. AwardJackpot_WitchTarget
  4466. bWitchMBJackpotReady = False
  4467. ' light - flash show
  4468. SetFlash flasher007, 7, 5000, 50
  4469. DOF 214, DOFPulse
  4470. Light058.State = 0
  4471. If bWitchMBFirstHit Then 'if the first hit award add-a-ball
  4472. bWitchMBFirstHit = False
  4473. vpmtimer.addtimer 2000, "bruja_AddaBall '"
  4474. End if
  4475. ElseIf Light057.State Then 'arrow jackpot
  4476. AwardJackpot_WitchArrow 4
  4477. Light057.State = 0
  4478. Light058.State = 0
  4479. If WitchMBMultiplier(4) <5 Then
  4480. WitchMBMultiplier(4) = WitchMBMultiplier(4) + 1
  4481. End If
  4482. WitchMBArrowCount = WitchMBArrowCount + 1
  4483. If WitchMBArrowCount> 2 Then
  4484. light051.State = 2
  4485. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  4486. End If
  4487. End If
  4488. Case 3
  4489. If bFinisterraMBReady Then
  4490. SetFlash flasher007, 7, 6000, 50
  4491. DOF 214, DOFPulse
  4492. Flashforms light058, 6000, 50, 0
  4493. Flashforms light057, 6000, 50, 0
  4494. StartFinisterra
  4495. End If
  4496. Case 6
  4497. If Light057.State Then
  4498. Light057.State = 0
  4499. LastSwitchHit = "bruja_target"
  4500. CheckFolkCount
  4501. End If
  4502. Case 7
  4503. If Light057.State Then
  4504. Light057.State = 0
  4505. WinAtlantia
  4506. End If
  4507. Case 8
  4508. If ArbolesCount = 0 Then
  4509. BrujaFlasher.Enabled = 0
  4510. 'stop the counter and lock the value to the Jackpot
  4511. ArbolesTimer1.Enabled = 0
  4512. DMD " JACKPOT VALUE IS", CL(1, FormatScore(ArbolesJPValue)), "", eNone, eBlink, eNone, 1500, True, ""
  4513. ArbolesCount = ArbolesCount + 1
  4514. DMD "_", " ADDABALL IS LIT", "", eNone, eBlink, eNone, 1500, True, ""
  4515. bAddaBallActivated = True
  4516. Light046.State = 2
  4517. AddMultiball 1
  4518. LightEffect 5
  4519. post001.IsDropped = 0:PlaySoundAt "fx_SolenoidOn", Trigger010
  4520. post002.IsDropped = 0
  4521. vpmtimer.addtimer 2500, "PlaySoundAt""fx_SolenoidOff"", Trigger010: post001.IsDropped = 1:post002.IsDropped = 1 '"
  4522. CheckArboles
  4523. End If
  4524. If ArbolesCount = 6 OR ArbolesCount = 12 Then
  4525. AwardSuperJackpot_Witch
  4526. BrujaFlasher.Enabled = 0
  4527. ArbolesCount = ArbolesCount + 1
  4528. CheckArboles
  4529. End If
  4530. Case 9
  4531. If Light057.State Then
  4532. Light057.State = 0
  4533. Addscore 1000000
  4534. DMD "", "", "1million", eNone, eNone, eBlink, 1500, True, "vo_1million"
  4535. CheckManchaXanandra
  4536. End If
  4537. Case 11
  4538. If Light057.State = 2 Then 'change blinking red to lit green
  4539. SetLightColor Light057, Green, 1
  4540. CheckFNC
  4541. ElseIf Light057.State = 1 Then 'Change from green to blinking red
  4542. SetLightColor Light057, Red, 2
  4543. End If
  4544. Case 12
  4545. If Light057.State = 2 Then
  4546. light057.State = 0
  4547. AwardJackpot_WitchTarget
  4548. CheckLDDF
  4549. End If
  4550. If bLDDFSJPEnabled Then
  4551. AwardSuperJackpot_Witch
  4552. BrujaFlasher.Enabled = 0
  4553. RestartLDDF
  4554. End If
  4555. End Select
  4556. ' remember last trigger hit by the ball
  4557. LastSwitchHit = "bruja_target"
  4558. End Sub
  4559.  
  4560. Sub Bruja_AddaBall
  4561. DMD "_", CL(1, ("ADD A BALL")), "", eNone, eBlink, eNone, 1500, True, "vo_addaball"
  4562. AddMultiball 1
  4563. LightEffect 5
  4564. End Sub
  4565.  
  4566. Sub bruja_target_Timer
  4567. Me.TimerEnabled = 0
  4568. bruja_target1.IsDropped = 1
  4569. bruja_target.IsDropped = 0
  4570. End Sub
  4571.  
  4572. Sub Trigger010_Hit 'check the ball speed for Bruja/Witch hit scoring
  4573. Dim tmp
  4574. tmp = ABS(INT(activeball.velY))
  4575. 'debug.print tmp
  4576. If tmp <18 Then
  4577. WitchMultiplier = 1
  4578. ElseIf tmp <29 Then
  4579. WitchMultiplier = 2
  4580. Else
  4581. WitchMultiplier = 3
  4582. End If
  4583. End Sub
  4584.  
  4585. '*****************
  4586. ' kickers
  4587. '*****************
  4588.  
  4589. Sub WitchNest_Hit
  4590. PlaySoundAt "fx_hole_enter", WitchNest
  4591. LightEffect 4
  4592. GiEffect 0
  4593. FlashEffect 4
  4594. If Tilted Then
  4595. vpmtimer.addtimer 1000, "Exit_WitchNest '"
  4596. Exit Sub
  4597. End If
  4598. Addscore 330
  4599. If light050.State Then
  4600. StartBRUJAMode
  4601. Else
  4602. If light008.State Then 'lock is lit
  4603. BallsLocked(CurrentPlayer) = BallsLocked(CurrentPlayer) + 1
  4604. CheckLockedBalls
  4605. End If
  4606. End If
  4607. End Sub
  4608.  
  4609. Sub Exit_WitchNest
  4610. RampUp 'ensure the ramps is up
  4611. PlaySoundAt "fx_kicker", WitchNest
  4612. WitchNest.kick 179, 18
  4613. vpmtimer.addtimer 800, "RampDown '"
  4614. LightEffect 5
  4615. End Sub
  4616.  
  4617. '******************************
  4618. ' MODES: Battles & Multi-balls
  4619. '******************************
  4620. ' Modes(CurrentPlayer), x)
  4621. ' x being
  4622. '0 current running mode number
  4623. 'values 0: not started, 1 finished, 2 ready to start
  4624.  
  4625. '1 Ilussia MB
  4626. '2 Witch MB
  4627. '3 Finisterra MB - Wizard mode after the Super festures are finished (pops, spinner, ramps...)
  4628. '4 Celtic Land
  4629. '5 Hechizos Pozimas y Brujerias
  4630. '6 Folktergeist
  4631. '7 Atlantia
  4632. '8 La ciudad de los arboles
  4633. '9 Mancha Xanandra - final Wizard mode after Modes 4 to 8 are finished
  4634. '10 Bruja letters ' default mode
  4635. '11 Feliz Navidad Cabrones - 3rd Tomb Award
  4636. '12 La Danza del Fuego - 10th Tomb Award
  4637.  
  4638. '********************************
  4639. ' Digital clock
  4640. '********************************
  4641.  
  4642. Dim ClockDigits(4), ClockChars(10)
  4643.  
  4644. ClockDigits(0) = Array(a00, a02, a05, a06, a04, a01, a03) 'clock left digit
  4645. ClockDigits(1) = Array(a10, a12, a15, a16, a14, a11, a13)
  4646. ClockChars(0) = Array(1, 1, 1, 1, 1, 1, 0) '0
  4647. ClockChars(1) = Array(0, 1, 1, 0, 0, 0, 0) '1
  4648. ClockChars(2) = Array(1, 1, 0, 1, 1, 0, 1) '2
  4649. ClockChars(3) = Array(1, 1, 1, 1, 0, 0, 1) '3
  4650. ClockChars(4) = Array(0, 1, 1, 0, 0, 1, 1) '4
  4651. ClockChars(5) = Array(1, 0, 1, 1, 0, 1, 1) '5
  4652. ClockChars(6) = Array(1, 0, 1, 1, 1, 1, 1) '6
  4653. ClockChars(7) = Array(1, 1, 1, 0, 0, 0, 0) '7
  4654. ClockChars(8) = Array(1, 1, 1, 1, 1, 1, 1) '8
  4655. ClockChars(9) = Array(1, 1, 1, 1, 0, 1, 1) '9
  4656.  
  4657. Sub UpdateClock(myTime)
  4658. Dim a, b, i
  4659. a = myTime \ 10
  4660. b = myTime MOD 10
  4661. For i = 0 to 6
  4662. ClockDigits(0)(i).State = ClockChars(a)(i)
  4663. ClockDigits(1)(i).State = ClockChars(b)(i)
  4664. Next
  4665. End Sub
  4666.  
  4667. Sub TurnOffClock
  4668. Dim i
  4669. For i = 0 to 6
  4670. ClockDigits(0)(i).State = 0
  4671. ClockDigits(1)(i).State = 0
  4672. Next
  4673. End Sub
  4674. '************************
  4675. ' Collect BRUJA letters
  4676. '************************
  4677. ' Mode 10, starts as default
  4678. ' shoot white arrows
  4679. ' mini loop spots also a letter
  4680. ' shoot the Witch's Nest to start the battle modes
  4681.  
  4682. Sub StartBRUJAletter
  4683. Dim tmp
  4684. Mode(CurrentPlayer, 0) = 10
  4685. SetLightColor light044, White, 1 'spinner
  4686. SetLightColor light054, White, 0 'arrows
  4687. SetLightColor light055, White, 0
  4688. SetLightColor light056, White, 0
  4689. SetLightColor light057, White, 0
  4690. SetLightColor light049, White, 0
  4691. SetLightColor light053, White, 0
  4692. SetLightColor light052, White, 0
  4693. tmp = INT(RND * 7)
  4694. Select Case tmp
  4695. Case 0:light054.State = 2:light052.State = 2
  4696. Case 1:light055.State = 2:light054.State = 2
  4697. Case 2:light056.State = 2:light055.State = 2
  4698. Case 3:light057.State = 2:light056.State = 2:PlaySound "vo_shootflashingarrows"
  4699. Case 4:light049.State = 2:light057.State = 2
  4700. Case 5:light053.State = 2:light049.State = 2
  4701. Case 6:light052.State = 2:light053.State = 2
  4702. End Select
  4703. SelectMode
  4704. End Sub
  4705.  
  4706. Sub StopBRUJALetter 'turn off the Mode and the arrow lights
  4707. Mode(CurrentPlayer, 0) = 0
  4708. light044.State = 0
  4709. light054.State = 0
  4710. light055.State = 0
  4711. light056.State = 0
  4712. light057.State = 0
  4713. light049.State = 0
  4714. light053.State = 0
  4715. light052.State = 0
  4716. End Sub
  4717.  
  4718. Sub AddBrujaLetter(n)
  4719. ' if not at the maximum letters
  4720. if(BrujaLetter(CurrentPlayer) + n <= 5)then
  4721. ' then add and set the lights
  4722. BrujaLetter(CurrentPlayer) = BrujaLetter(CurrentPlayer) + n
  4723. DMD "_", "BRUJA LETTER AWARDED", "", eNone, eBlink, eNone, 1500, True, "Fanfare4"
  4724. StartBRUJAletter ' lit two new lights
  4725. End if
  4726. UpdateBrujaLetter
  4727. End Sub
  4728.  
  4729. Sub UpdateBrujaLetter
  4730. ' Update the BRUJA lights
  4731. Select Case BrujaLetter(CurrentPlayer)
  4732. Case 0:light064.State = 0:light065.State = 0:light066.State = 0:light067.State = 0:light068.State = 0
  4733. Case 1:light064.State = 1:light065.State = 0:light066.State = 0:light067.State = 0:light068.State = 0
  4734. Case 2:light064.State = 1:light065.State = 1:light066.State = 0:light067.State = 0:light068.State = 0
  4735. Case 3:light064.State = 1:light065.State = 1:light066.State = 1:light067.State = 0:light068.State = 0
  4736. Case 4:light064.State = 1:light065.State = 1:light066.State = 1:light067.State = 1:light068.State = 0
  4737. Case 5:light064.State = 2:light065.State = 2:light066.State = 2:light067.State = 2:light068.State = 2
  4738. Light050.State = 2:Rampup 'ready to start the mode at the Witch's Nest
  4739. ' Stop the Arrows
  4740. light044.State = 0
  4741. light054.State = 0
  4742. light055.State = 0
  4743. light056.State = 0
  4744. light057.State = 0
  4745. light049.State = 0
  4746. light053.State = 0
  4747. light052.State = 0
  4748. End Select
  4749. End Sub
  4750.  
  4751. Sub ResetBRUJALetter
  4752. BrujaLetter(CurrentPlayer) = 0
  4753. UpdateBrujaLetter
  4754. End Sub
  4755.  
  4756. Sub SelectMode
  4757. 'check if all BRUJA modes are completed
  4758. If Mode(CurrentPLayer, 4) = 1 AND Mode(CurrentPLayer, 5) = 1 AND Mode(CurrentPLayer, 6) = 1 AND Mode(CurrentPLayer, 7) = 1 AND Mode(CurrentPLayer, 8) = 1 Then
  4759. StartManchaXanandra
  4760. Else
  4761. NextMode
  4762. End If
  4763. End Sub
  4764.  
  4765. Sub NextMode
  4766. 'If the last mode was "ready" then release it and go to the next one
  4767. For x = 4 to 8
  4768. If Mode(CurrentPlayer, x) = 2 Then Mode(CurrentPlayer, x) = 0
  4769. Next
  4770. NewMode = ((NewMode -4 + 1)MOD 5) + 4
  4771. 'check if the mode is completed and if it is then go to the next mode
  4772. do while Mode(CurrentPlayer, NewMode) <> 0
  4773. NewMode = ((NewMode -4 + 1)MOD 5) + 4
  4774. Loop
  4775. Mode(CurrentPlayer, NewMode) = 2
  4776. UpdateModeLights
  4777. End Sub
  4778.  
  4779. Sub UpdateModeLights
  4780. light059.State = Mode(CurrentPlayer, 4)
  4781. light060.State = Mode(CurrentPlayer, 5)
  4782. light061.State = Mode(CurrentPlayer, 6)
  4783. light063.State = Mode(CurrentPlayer, 7)
  4784. light062.State = Mode(CurrentPlayer, 8)
  4785. End Sub
  4786.  
  4787. Sub StartBRUJAMode
  4788. StopBRUJALetter
  4789. Light050.State = 0
  4790. BrujaFlasher.Enabled = 0
  4791. Mode(CurrentPLayer, 0) = NewMode
  4792. Select Case NewMode
  4793. Case 4:StartCelticLand ' Celtic Land
  4794. Case 5:StartHechizos ' Hechizos Pozimas y Brujerias
  4795. Case 6:StartFolktergeist ' Folktergeist
  4796. Case 7:StartAtlantia ' Atlantia
  4797. Case 8:StartArboles ' La ciudad de los Arboles
  4798. End Select
  4799. vpmtimer.addtimer 2500, "Exit_WitchNest '"
  4800. End Sub
  4801.  
  4802. Sub BrujaFlasher_Timer
  4803. SetFlash flasher007, 7, 1000, 50
  4804. DOF 215, DOFPulse
  4805. Flashforms light058, 1000, 50, 0
  4806. Flashforms light057, 1000, 50, 0
  4807. End Sub
  4808.  
  4809. '*******************************
  4810. ' Mancha Xanandra - wizard mode
  4811. '*******************************
  4812. ' Mode 9
  4813. ' 60 seconds timed mode, X targets increase time
  4814. ' complete 5 targets to lit SJP at the witch's pot... and repeat
  4815.  
  4816. Sub StartManchaXanandra
  4817. ManchaXBonusCount = ManchaXBonusCount + 1
  4818. DMD "", "", "mancha", eNone, eNone, eBlink, 1500, True, ""
  4819. Mode(CurrentPLayer, 0) = 9
  4820. For X = 0 to 7
  4821. SetLightColor aLightArrows(x), Purple, 0
  4822. Next
  4823. ' 5 arrows
  4824. Light054.State = 2
  4825. Light056.State = 2
  4826. Light057.State = 2
  4827. Light053.State = 2
  4828. Light052.State = 2
  4829. 'SJP
  4830. Light051.State = 0
  4831. ManchaXanandraHitCount = 0
  4832. ManchaXanandraTimerCount = 60
  4833. ManchaXanandraTimer.Enabled = 1
  4834. EnableBallSaver 30
  4835. 'turn on X lights
  4836. Light016.State = 2
  4837. Light015.State = 2
  4838. Light017.State = 2
  4839. Light018.State = 2
  4840. 'Mancha lights
  4841. Light069.State = 1
  4842. Light059.State = 2
  4843. Light060.State = 2
  4844. Light061.State = 2
  4845. Light062.State = 2
  4846. Light063.State = 2
  4847. Light065.State = 2
  4848. Light067.State = 2
  4849. Light066.State = 2
  4850. Light068.State = 2
  4851. Light064.State = 2
  4852. End Sub
  4853.  
  4854. Sub CheckManchaXanandra
  4855. ManchaXanandraHitCount = ManchaXanandraHitCount + 1
  4856. If ManchaXanandraHitCount MOD 5 = 0 then
  4857. Light051.State = 2 'SJP
  4858. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  4859. 'turn on back the arrows
  4860. Light054.State = 2
  4861. Light056.State = 2
  4862. Light057.State = 2
  4863. Light053.State = 2
  4864. Light052.State = 2
  4865. End If
  4866. End Sub
  4867.  
  4868. Sub StopManchaXanandra 'timer runs out or you lose the ball
  4869. ManchaXanandraTimer.Enabled = 0
  4870. TurnOffClock
  4871. 'Mancha lights
  4872. Light069.State = 0
  4873. Light059.State = 0
  4874. Light060.State = 0
  4875. Light061.State = 0
  4876. Light062.State = 0
  4877. Light063.State = 0
  4878. Light065.State = 0
  4879. Light067.State = 0
  4880. Light066.State = 0
  4881. Light068.State = 0
  4882. Light064.State = 0
  4883. 'turn on X lights
  4884. Light016.State = 2
  4885. Light015.State = 2
  4886. Light017.State = 2
  4887. Light018.State = 2
  4888. 'Reset Modes
  4889. For X = 4 to 9
  4890. Mode(CurrentPLayer, x) = 0
  4891. Next
  4892. ResetBRUJALetter
  4893. End Sub
  4894.  
  4895. Sub ManchaXanandraTimer_Timer
  4896. ManchaXanandraTimerCount = ManchaXanandraTimerCount - 1
  4897. UpdateClock ManchaXanandraTimerCount
  4898. If ManchaXanandraTimerCount = 10 Then PlaySound "vo_timerunningout"
  4899. If ManchaXanandraTimerCount = 0 Then
  4900. PlaySound "vo_timeisup"
  4901. StopManchaXanandra
  4902. ResetBRUJALetter
  4903. StartBRUJALetter
  4904. End If
  4905. End Sub
  4906.  
  4907. '*******************
  4908. ' Celtic Land
  4909. '*******************
  4910. ' Mode 4 - Ramp Combo mode
  4911. ' shoot as many ramp combos in 40 seconds
  4912. ' both ramps lit, shoot one to start, shoot as many combos
  4913. ' each combo add a 1X and 150k to the combo value
  4914. ' if the combo time runs out you start with 1x, but the value keep increasing with each shot
  4915.  
  4916. Sub StartCelticLand
  4917. Dim tmp
  4918. tmp = INT(RND * 4)
  4919. Select Case tmp
  4920. case 0:DMD "", "", "celticland", eNone, eNone, eBlinkFast, 1500, True, "vo_ramps"
  4921. case 1:DMD "", "", "celticland", eNone, eNone, eBlinkFast, 1500, True, "vo_ramps2"
  4922. case 2:DMD "", "", "celticland", eNone, eNone, eBlinkFast, 1500, True, "vo_ramps3"
  4923. case 3:DMD "", "", "celticland", eNone, eNone, eBlinkFast, 1500, True, "vo_ramps4"
  4924. End Select
  4925. CelticValue = 2000000 '2 Mill
  4926. CelticMultiplier = 1
  4927. CelticTimerCount = 40 'seconds
  4928. CelticTimer.Enabled = 1
  4929. SetLightColor Light054, Red, 2
  4930. SetLightColor Light053, Red, 2
  4931. End Sub
  4932.  
  4933. Sub StopCelticLand
  4934. Mode(CurrentPLayer, 4) = 1
  4935. TurnOffClock
  4936. CelticTimer.Enabled = 0
  4937. CelticCombo.Enabled = 0
  4938. light053.State = 0
  4939. light054.State = 0
  4940. End Sub
  4941.  
  4942. Sub CelticCombo_Timer 'reset the combo shots
  4943. light053.State = 2
  4944. light054.State = 2
  4945. CelticMultiplier = 1
  4946. End Sub
  4947.  
  4948. Sub CelticTimer_Timer '40 seconds
  4949. CelticTimerCount = CelticTimerCount - 1
  4950. UpdateClock CelticTimerCount
  4951. If CelticTimerCount = 0 Then
  4952. StopCelticLand
  4953. ResetBRUJALetter
  4954. StartBRUJALEtter
  4955. End If
  4956. End Sub
  4957.  
  4958. '*************
  4959. ' Atlantia
  4960. '*************
  4961. ' Mode 7 ' hurry up, shoot all orange arrows, the captive ball and the 3 droptargets fisish with a shot to the witch
  4962. ' 40 seconds, the end score is 1M per second left.
  4963.  
  4964. Sub StartAtlantia
  4965. DMD "", "", "atlantia", eNone, eNone, eBlinkFast, 1500, True, ""
  4966. For X = 0 to 7
  4967. SetLightColor aLightArrows(x), Orange, 0
  4968. Next
  4969. light054.State = 2
  4970. light053.State = 2
  4971. light056.State = 2
  4972. light052.State = 2
  4973. light009.State = 2
  4974. light010.State = 2
  4975. light011.State = 2
  4976. light019.State = 2
  4977. PlaySoundAt "fx_resetdrop", Target005
  4978. Target004.IsDropped = 0
  4979. Target005.IsDropped = 0
  4980. Target006.IsDropped = 0
  4981. AtlantiaCount = 0
  4982. AtlantiaTimerCount = 41 'seconds
  4983. AtlantiaTimer.Enabled = 1
  4984. End Sub
  4985.  
  4986. Sub CheckAtlantia
  4987. If AtlantiaCount = 8 Then
  4988. BrujaFlasher.Enabled = 1
  4989. End If
  4990. End Sub
  4991.  
  4992. Sub WinAtlantia
  4993. Dim tmp
  4994. tmp = 10000000 + AtlantiaTimerCount * 1000000
  4995. AtlantiaTimer.Enabled = 0
  4996. DMD " YOU WON ATLANTIA", CL(1, FormatScore(tmp)), "", eNone, eBlink, eNone, 1500, True, "fanfare3"
  4997. Addscore tmp
  4998. StopAtlantia
  4999. ResetBRUJALetter
  5000. StartBRUJALEtter
  5001. End Sub
  5002.  
  5003. Sub StopAtlantia
  5004. Mode(CurrentPLayer, 7) = 1
  5005. Light063.State = 1
  5006. AtlantiaTimer.Enabled = 0
  5007. BrujaFlasher.Enabled = 0
  5008. TurnOffClock
  5009. light054.State = 0
  5010. light053.State = 0
  5011. light056.State = 0
  5012. light052.State = 0
  5013. light009.State = 0
  5014. light010.State = 0
  5015. light011.State = 0
  5016. light019.State = 0
  5017. PlaySoundAt "fx_resetdrop", Target005
  5018. Target004.IsDropped = 0
  5019. Target005.IsDropped = 0
  5020. Target006.IsDropped = 0
  5021. DropCount = 0
  5022. End Sub
  5023.  
  5024. Sub AtlantiaTimer_Timer
  5025. AtlantiaTimerCount = AtlantiaTimerCount - 1
  5026. UpdateClock AtlantiaTimerCount
  5027. If AtlantiaTimerCount = 0 Then
  5028. StopAtlantia
  5029. ResetBRUJALetter
  5030. StartBRUJALEtter
  5031. End If
  5032. End Sub
  5033. '*******************************
  5034. ' La ciudad de los Arboles
  5035. '*******************************
  5036. ' Mode 8, 2 ball multiball, one add-a-ball available
  5037. ' Hurry up, count from 1 Million down, shoot Witch to lock on
  5038. ' Hit alternate shots until you the witch, each shot increases 500k
  5039. ' Hit the Witch Nest for a Super Jackpot
  5040. ' Collect 2 super Jackpots to end the mode
  5041.  
  5042. Sub StartArboles
  5043. DMD "", "", "arboles", eNone, eNone, eBlinkFast, 1500, True, "vo_hurryupislit"
  5044. SetLightColor light054, Green, 0 'arrows
  5045. SetLightColor light055, Green, 0
  5046. SetLightColor light056, Green, 0
  5047. SetLightColor light057, Green, 0
  5048. SetLightColor light049, Green, 0
  5049. SetLightColor light053, Green, 0
  5050. SetLightColor light052, Green, 0
  5051. ArbolesCount = 0
  5052. ArbolesSJPCount = 0
  5053. ArbolesJPValue = 1000000
  5054. ArbolesTimer1.Enabled = 1
  5055. BrujaFlasher.Enabled = 1
  5056. End Sub
  5057.  
  5058. Sub StopArboles
  5059. Mode(CurrentPLayer, 8) = 1
  5060. ArbolesTimer1.Enabled = 0
  5061. ArbolesTimer2.Enabled = 0
  5062. BrujaFlasher.Enabled = 0
  5063. End Sub
  5064.  
  5065. Sub CheckArboles
  5066. Select Case ArbolesCount
  5067. Case 0
  5068. Case 1 'left ramp shot
  5069. Light054.State = 2
  5070. light052.State = 0
  5071. ArbolesTimer2.Enabled = 0
  5072. ArbolesTimer2.Enabled = 1
  5073. Case 2 'right orbit
  5074. light052.State = 2
  5075. Light055.State = 0
  5076. ArbolesTimer2.Enabled = 0
  5077. ArbolesTimer2.Enabled = 1
  5078. Case 3 'left orbit
  5079. Light055.State = 2
  5080. Light053.State = 0
  5081. ArbolesTimer2.Enabled = 0
  5082. ArbolesTimer2.Enabled = 1
  5083. Case 4 'right ramp
  5084. Light053.State = 2
  5085. light056.State = 0
  5086. ArbolesTimer2.Enabled = 0
  5087. ArbolesTimer2.Enabled = 1
  5088. Case 5 'left mini loop
  5089. light056.State = 2
  5090. ArbolesTimer2.Enabled = 0
  5091. ArbolesTimer2.Enabled = 1
  5092. Case 6 ' shoot the witch for SJP
  5093. ArbolesTimer2.Enabled = 0
  5094. BrujaFlasher.Enabled = 1
  5095. ArbolesSJPCount = 1
  5096. ' from now on the shots don't go back
  5097. Case 7 'left ramp shot
  5098. Light054.State = 2
  5099. light052.State = 0
  5100. Case 8 'right orbit
  5101. light052.State = 2
  5102. Light055.State = 0
  5103. Case 9 'left orbit
  5104. Light055.State = 2
  5105. Light053.State = 0
  5106. Case 10 'right ramp
  5107. Light053.State = 2
  5108. light056.State = 0
  5109. Case 11 'left mini loop
  5110. light056.State = 2
  5111. Case 12 ' shoot the witch for SJP 2nd time
  5112. BrujaFlasher.Enabled = 1
  5113. ArbolesSJPCount = 2
  5114. Case 13 ' won Arboles
  5115. BrujaFlasher.Enabled = 0
  5116. StopArboles
  5117. ResetBRUJALetter
  5118. StartBRUJALetter
  5119. End Select
  5120. End Sub
  5121.  
  5122. Sub ArbolesTimer1_Timer 'countdown JP value
  5123. ArbolesJPValue = ArbolesJPValue - 10000
  5124. DMD " SHOOT THE WITCH", CL(1, FormatScore(ArbolesJPValue)), "", eNone, eNone, eNone, 200, True, ""
  5125. If ArbolesJPValue = 50000 Then
  5126. ArbolesCount = 0
  5127. Me.Enabled = 0
  5128. light058.State = 0
  5129. CheckArboles
  5130. End If
  5131. End Sub
  5132.  
  5133. Sub ArbolesTimer2_Timer 'reduces the count towards the Super Jackpot
  5134. If ArbolesCount> 1 then
  5135. ArbolesCount = ArbolesCount -1
  5136. CheckArboles
  5137. End If
  5138. End Sub
  5139.  
  5140. '*******************************
  5141. ' Hechizos, Pozimas y Brujerias
  5142. '*******************************
  5143. ' Mode 5
  5144. ' spinners :)
  5145. ' timed mode 40 seconds
  5146. ' shoot 1 purple light to activate spinners
  5147. ' shoot spinner and repeat until the 40 seconds run out or you loose the ball.
  5148.  
  5149. Sub StartHechizos
  5150. DMD "", "", "hechizos", eNone, eNone, eBlinkFast, 1500, True, ""
  5151. HechizoCount = 0
  5152. CheckHechizo
  5153. HechizoTimer.Enabled = 1
  5154. End Sub
  5155.  
  5156. Sub CheckHechizo
  5157. Select Case HechizoCount
  5158. Case 0:
  5159. DMD "_", "SHOOT RAMPS OR LOOPS", "", eNone, eBlink, eNone, 1500, True, "vo_ramps2"
  5160. SetLightColor light054, purple, 2
  5161. SetLightColor light053, purple, 2
  5162. SetLightColor light055, purple, 2
  5163. SetLightColor light049, purple, 2
  5164. SetLightColor light044, purple, 0
  5165. SetLightColor light056, purple, 0
  5166. HechizoCount = 1
  5167. Case 1:
  5168. DMD "_", "SHOOT THE SPINNERS", "", eNone, eBlink, eNone, 1500, True, "vo_spinner"
  5169. SetLightColor light054, purple, 0
  5170. SetLightColor light053, purple, 0
  5171. SetLightColor light055, purple, 0
  5172. SetLightColor light049, purple, 0
  5173. SetLightColor light044, purple, 2
  5174. SetLightColor light056, purple, 2
  5175. HechizoCount = 0
  5176. End Select
  5177. End Sub
  5178.  
  5179. Sub HechizoTimer_Timer '40 seconds
  5180. Me.Enabled = 0
  5181. StopHechizo
  5182. ResetBRUJALetter
  5183. StartBRUJALetter
  5184. End Sub
  5185.  
  5186. Sub StopHechizo
  5187. HechizoTimer.Enabled = 0
  5188. Trigger011.TimerEnabled = 0
  5189. Trigger014.TimerEnabled = 0
  5190. Mode(CurrentPlayer, 5) = 1
  5191. Light060.State = 1
  5192. End Sub
  5193.  
  5194. Sub Trigger011_Hit
  5195. StopCombo
  5196. If Mode(CurrentPLayer, 0) = 5 AND light044.State Then
  5197. Me.TimerEnabled = 1
  5198. End If
  5199. End Sub
  5200.  
  5201. Sub Trigger011_Timer:Me.TimerEnabled = 0:CheckHechizo:End Sub
  5202.  
  5203. Sub Trigger014_Hit
  5204. If Mode(CurrentPLayer, 0) = 5 AND light056.State Then
  5205. Me.TimerEnabled = 1
  5206. End If
  5207. End Sub
  5208.  
  5209. Sub Trigger014_Timer:Me.TimerEnabled = 0:CheckHechizo:End Sub
  5210.  
  5211. '*****************
  5212. ' Folktergeist
  5213. '*****************
  5214. ' Mode 6
  5215. ' 2 ball multiball with add-a-ball
  5216. ' shoot the blue arrows, defeat 4 witches
  5217. ' ramp + witchtarget - defeat 2 ghosts
  5218. ' lock on target and shoot the witch
  5219.  
  5220. Sub StartFolktergeist
  5221. DMD "", "", "folktegeist", eNone, eNone, eBlinkFast, 1500, True, ""
  5222. For X = 0 to 7
  5223. SetLightColor aLightArrows(x), DarkBlue, 2
  5224. Next
  5225. FolkCount = 0
  5226. Addmultiball 1
  5227. post001.IsDropped = 0:PlaySoundAt "fx_SolenoidOn", Trigger010
  5228. post002.IsDropped = 0
  5229. vpmtimer.addtimer 2500, "PlaySoundAt""fx_SolenoidOff"", Trigger010: post001.IsDropped = 1:post002.IsDropped = 1 '"
  5230. End Sub
  5231.  
  5232. Sub CheckFolkCount
  5233. FolkCount = FolkCount + 1
  5234. Select Case FolkCount
  5235. Case 1:DMD "_", "DEFEATED " &FolkCount& " WITCH", "", eNone, eBlink, eNone, 1500, True, ""
  5236. Case 2, 3:DMD "_", "DEFEATED " &FolkCount& " WITCHES", "", eNone, eBlink, eNone, 1500, True, ""
  5237. Case 4:DMD "_", "DEFEATED " &FolkCount& " WITCHES", "", eNone, eBlink, eNone, 1500, True, ""
  5238. For X = 0 to 7
  5239. aLightArrows(x).State = 0
  5240. Next
  5241. Light054.State = 2
  5242. Light053.State = 2
  5243. DMD "_", " ADDABALL IS LIT", "", eNone, eBlink, eNone, 1500, True, "Fanfare7"
  5244. bAddaBallActivated = True
  5245. Light046.State = 2
  5246. Case 5:DMD "_", "SHOOT WITCH TARGET", "", eNone, eBlink, eNone, 1500, True, ""
  5247. Light054.State = 0
  5248. Light053.State = 0
  5249. Light057.State = 2
  5250. Case 6:
  5251. If LastSwitchHit = "bruja_target" Then
  5252. DMD "_", CL(1, "CAPTURED 1 GHOST"), "", eNone, eBlink, eNone, 1500, True, ""
  5253. Light057.State = 0
  5254. Light054.State = 2
  5255. Light053.State = 2
  5256. Else
  5257. FolkCount = FolkCount -1
  5258. Light054.State = 0
  5259. Light053.State = 0
  5260. Light057.State = 2
  5261. End If
  5262. DMD "_", " ADDABALL IS LIT", "", eNone, eBlink, eNone, 1500, True, "Fanfare7"
  5263. bAddaBallActivated = True
  5264. Light046.State = 2
  5265. Case 7:DMD "_", "SHOOT WITCH TARGET", "", eNone, eBlink, eNone, 1500, True, ""
  5266. Light054.State = 0
  5267. Light053.State = 0
  5268. Light057.State = 2
  5269. Case 8:
  5270. If LastSwitchHit = "bruja_target" Then
  5271. DMD "_", CL(1, "CAPTURED 2 GHOSTS"), "", eNone, eBlink, eNone, 1500, True, ""
  5272. Light057.State = 0
  5273. DMD "_", "LOCK ON TO THE WITCH", "", eNone, eBlink, eNone, 1500, True, ""
  5274. FolkTimer.Enabled = 1
  5275. Else
  5276. FolkCount = FolkCount -1
  5277. Light054.State = 2
  5278. Light053.State = 2
  5279. Light057.State = 0
  5280. End If
  5281. Case 9:DMD "_", CL(1, "SHOOT WITCH TARGET"), "", eNone, eBlink, eNone, 1500, True, ""
  5282. FolkTimer.Enabled = 0
  5283. For X = 0 to 7
  5284. aLightArrows(x).State = 0
  5285. Next
  5286. Light057.State = 2
  5287. Case 10:DMD "_", " DEFEATED THE WITCH", "", eNone, eBlink, eNone, 1500, False, ""
  5288. DMD "_", "YOU WON FOLKTERGEIST", "", eNone, eBlink, eNone, 1500, True, ""
  5289. StopFoltergeist
  5290. ResetBRUJALetter
  5291. StartBRUJALetter
  5292. End Select
  5293. End Sub
  5294.  
  5295. Sub FolkTimer_Timer 'a kind of "follow the lights" changes the lit arrow after 5 seconds
  5296. For X = 0 to 7
  5297. aLightArrows(x).State = 0
  5298. Next
  5299. x = INT(RND * 8)
  5300. aLightArrows(x).State = 2
  5301. End Sub
  5302.  
  5303. Sub StopFoltergeist 'called at the end of the multiball or when completed
  5304. FolkTimer.Enabled = 0 'if it was on
  5305. For X = 0 to 7
  5306. aLightArrows(x).State = 0
  5307. Next
  5308. Mode(CurrentPLayer, 6) = 1
  5309. Light061.State = 1
  5310. End Sub
  5311.  
  5312. '********************
  5313. ' I-L-U-S-S-I-A
  5314. '********************
  5315. ' Mode 1
  5316. ' Light the ILUSSIA letters
  5317. ' variables used:
  5318. ' ILUSSIATimes(CurrentPlayer) how many times you have started multiball
  5319. ' ILUSSIACount(CurrentPlayer) used in light status update
  5320. ' bILUSSIASJP SuperJackpot True or False
  5321.  
  5322. Sub AddILUSSIAletter
  5323. IlussiaBonusCount = IlussiaBonusCount + 1
  5324. ILUSSIACount(CurrentPlayer) = ILUSSIACount(CurrentPlayer) + 1
  5325. If ILUSSIACount(CurrentPlayer) <8 Then
  5326. Addscore 10000
  5327. ElseIf ILUSSIACount(CurrentPlayer) <15 Then
  5328. AwardJackpot
  5329. Else
  5330. AwardDoubleJackpot
  5331. End If
  5332. UpdateILUSSIA
  5333. End Sub
  5334.  
  5335. Sub UpdateILUSSIA
  5336. Select Case ILUSSIACount(CurrentPlayer)
  5337. Case 0:light019.State = 0:light039.State = 0:light038.State = 0:light037.State = 0:light036.State = 0:light035.State = 0:light034.State = 0:light033.State = 0
  5338. Case 1:light019.State = 0:light039.State = 1:light038.State = 0:light037.State = 0:light036.State = 0:light035.State = 0:light034.State = 0:light033.State = 0
  5339. Case 2:light019.State = 0:light039.State = 1:light038.State = 1:light037.State = 0:light036.State = 0:light035.State = 0:light034.State = 0:light033.State = 0
  5340. Case 3:light019.State = 0:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 0:light035.State = 0:light034.State = 0:light033.State = 0
  5341. Case 4:light019.State = 0:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 1:light035.State = 0:light034.State = 0:light033.State = 0
  5342. Case 5:light019.State = 0:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 1:light035.State = 1:light034.State = 0:light033.State = 0
  5343. Case 6:light019.State = 0:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 1:light035.State = 1:light034.State = 1:light033.State = 0
  5344. 'If Mode(CurrentPlayer, 0) = 10 Then PlaySound "vo_multiballisready"
  5345. Case 7:light019.State = 2:light039.State = 2:light038.State = 2:light037.State = 2:light036.State = 2:light035.State = 2:light034.State = 2:light033.State = 2
  5346. If Mode(CurrentPlayer, 0) = 10 Then
  5347. StartIlussiaMUltiball
  5348. Else
  5349. ILUSSIACount(CurrentPlayer) = 6
  5350. End If
  5351. Case 8:light019.State = 2:light039.State = 1:light038.State = 2:light037.State = 2:light036.State = 2:light035.State = 2:light034.State = 2:light033.State = 2
  5352. Case 9:light019.State = 2:light039.State = 1:light038.State = 1:light037.State = 2:light036.State = 2:light035.State = 2:light034.State = 2:light033.State = 2
  5353. Case 10:light019.State = 2:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 2:light035.State = 2:light034.State = 2:light033.State = 2
  5354. Case 11:light019.State = 2:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 1:light035.State = 2:light034.State = 2:light033.State = 2
  5355. Case 12:light019.State = 2:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 1:light035.State = 1:light034.State = 2:light033.State = 2
  5356. Case 13:light019.State = 2:light039.State = 1:light038.State = 1:light037.State = 1:light036.State = 1:light035.State = 1:light034.State = 1:light033.State = 2
  5357. Case 14:light019.State = 1:light039.State = 2:light038.State = 2:light037.State = 2:light036.State = 2:light035.State = 2:light034.State = 2:light033.State = 2:ActivateSJP_Witch
  5358. End Select
  5359. End Sub
  5360.  
  5361. Sub StartIlussiaMUltiball
  5362. StopBRUJALetter
  5363. DMD CL(0, "ILUSSIA"), CL(1, "MULTIBALL"), "", eBlink, eBlink, eNone, 1500, True, "vo_multiball2"
  5364. AddMultiball 1
  5365. post001.IsDropped = 0:PlaySoundAt "fx_SolenoidOn", Trigger010
  5366. post002.IsDropped = 0
  5367. vpmtimer.addtimer 2500, "PlaySoundAt""fx_SolenoidOff"", Trigger010: post001.IsDropped = 1:post002.IsDropped = 1 '"
  5368. ILUSSIATimes(CurrentPlayer) = ILUSSIATimes(CurrentPlayer) + 1
  5369. StartAddaBall
  5370. Mode(CurrentPlayer, 0) = 1
  5371. EnableBallSaver 15
  5372. End Sub
  5373.  
  5374. Sub ActivateSJP_Witch 'setup for superjackpot at the witch target
  5375. bILUSSIASJP = True
  5376. SetLightColor Light057, red, 0
  5377. BrujaFlasher.Enabled = 1
  5378. End Sub
  5379.  
  5380. Sub StopILUSSIA 'only CurrentPlayer when the last multiball is lost
  5381. IF ILUSSIATimes(CurrentPlayer) = 1 Then
  5382. ILUSSIACount(CurrentPlayer) = 2 'two lights are already lit
  5383. Else
  5384. ILUSSIACount(CurrentPlayer) = 0 'after 2 Ilussia MB all 7 lights need to be lit
  5385. End If
  5386. UpdateILUSSIA
  5387. bILUSSIASJP = False
  5388. SetLightColor Light057, white, 0
  5389. BrujaFlasher.Enabled = 0
  5390. StopAddaBall
  5391. End Sub
  5392.  
  5393. '**************************
  5394. ' Add-a-Ball for Ilussia
  5395. '**************************
  5396. ' during ILUSSIA multiball you may get up to 3 add-a-balls by hitting the yellow targets:
  5397. ' 1. both ramps, 2 targets
  5398. ' 2. both ramps and orbits, 4 targets
  5399. ' 3. both ramps, orbits, loops, and bruja target, 7 targets
  5400.  
  5401. Sub StartAddaBall
  5402. ' setup for first add-a-ball
  5403. bAddaBall = True
  5404. bAddaBallActivated = False
  5405. AddaBallCount = 0
  5406. AddaBallLevel = 1
  5407. bAddaBallActivated = False
  5408. UpDateAddaBall
  5409. End Sub
  5410.  
  5411. Sub UpDateAddaBall 'Lights
  5412. Select case AddaBallLevel
  5413. Case 1: 'both ramps
  5414. SetLightColor Light053, yellow, 2
  5415. SetLightColor Light054, yellow, 2
  5416. Case 2: 'both ramps and orbits
  5417. SetLightColor Light053, yellow, 2
  5418. SetLightColor Light054, yellow, 2
  5419. SetLightColor Light052, yellow, 2
  5420. SetLightColor Light055, yellow, 2
  5421. Case 3: 'both ramps, orbits, loops, bruja target and super jackpot target
  5422. SetLightColor Light053, yellow, 2
  5423. SetLightColor Light054, yellow, 2
  5424. SetLightColor Light052, yellow, 2
  5425. SetLightColor Light055, yellow, 2
  5426. SetLightColor Light056, yellow, 2
  5427. SetLightColor Light049, yellow, 2
  5428. SetLightColor Light057, yellow, 2
  5429. End Select
  5430. End Sub
  5431.  
  5432. Sub CheckAddaBall '3 levels with 2, 4 or 7 hits to qualify
  5433. Select case AddaBallLevel
  5434. Case 1:
  5435. If AddaBallCount = 2 Then
  5436. DMD "_", " ADDABALL IS LIT", "", eNone, eBlink, eNone, 1500, True, "Fanfare7"
  5437. bAddaBallActivated = True
  5438. Light046.State = 2
  5439. End If
  5440. Case 2
  5441. If AddaBallCount = 4 Then
  5442. DMD "_", " ADDABALL IS LIT", "", eNone, eBlink, eNone, 1500, True, "Fanfare8"
  5443. bAddaBallActivated = True
  5444. Light046.State = 2
  5445. End If
  5446. Case 3
  5447. If AddaBallCount = 7 Then
  5448. DMD "_", " ADDABALL IS LIT", "", eNone, eBlink, eNone, 1500, True, "Fanfare9"
  5449. bAddaBallActivated = True
  5450. Light046.State = 2
  5451. End If
  5452. End Select
  5453. End Sub
  5454.  
  5455. Sub StopAddaBall
  5456. bAddaBall = False
  5457. bAddaBallActivated = False
  5458. Light046.State = 0
  5459. SetLightColor Light053, white, 0
  5460. SetLightColor Light054, white, 0
  5461. SetLightColor Light052, white, 0
  5462. SetLightColor Light055, white, 0
  5463. SetLightColor Light056, white, 0
  5464. SetLightColor Light049, white, 0
  5465. SetLightColor Light057, white, 0
  5466. End Sub
  5467.  
  5468. Sub AwardAddaBall()
  5469. DMD "_", CL(1, ("ADD A BALL")), "", eNone, eBlink, eNone, 1500, True, "vo_addaball"
  5470. AddMultiball 1
  5471. LightEffect 5
  5472. AddaBallLevel = AddaBallLevel + 1
  5473. AddaBallCount = 0
  5474. bAddaBallActivated = False
  5475. Light046.State = 0
  5476. UpdateAddaBall
  5477. End Sub
  5478.  
  5479. '*********************
  5480. ' WITCH Multiball
  5481. '*********************
  5482.  
  5483. ' Witch's Nest Ramp
  5484.  
  5485. Sub RampUp
  5486. PlaySoundAt SoundFXDOF("fx_solenoidOn",123,DOFPulse,DOFContactors), WitchNest
  5487. Witchflipper.RotatetoEnd
  5488. Light058.blinkinterval = 125:light058.State = 2
  5489. Ramp007inv.Collidable = False
  5490. End Sub
  5491.  
  5492. Sub RampDown
  5493. PlaySoundAt SoundFXDOF("fx_solenoidOff",123,DOFPulse,DOFContactors), WitchNest
  5494. Witchflipper.RotatetoStart
  5495. Light058.blinkinterval = 400:light058.State = 0
  5496. Ramp007inv.Collidable = True
  5497. light008.State = 0
  5498. light050.State = 0
  5499. End Sub
  5500.  
  5501. ' Witch's Nest Locked Balls
  5502.  
  5503. Sub CheckLockedBalls 'updates also the lights
  5504. Select Case BallsLocked(CurrentPlayer)
  5505. Case 0:light007.State = 0:light006.State = 0:light070.State = 0
  5506. Case 1:light007.State = 1:light006.State = 0:light070.State = 0
  5507. LightEffect 1
  5508. DMD CL(0, "WITCHS NEST"), CL(1, "BALL 1 LOCKED"), "", eNone, eBlink, eNone, 1500, True, "vo_ball1locked"
  5509. vpmtimer.addtimer 2500, "Exit_WitchNest '"
  5510. Case 2:light007.State = 1:light006.State = 1:light070.State = 0
  5511. LightEffect 1
  5512. DMD CL(0, "WITCHS NEST"), CL(1, "BALL 2 LOCKED"), "", eNone, eBlink, eNone, 1500, True, "vo_ball2locked"
  5513. vpmtimer.addtimer 2500, "Exit_WitchNest '"
  5514. Case 3:
  5515. If Mode(CurrentPlayer, 0) = 10 Then
  5516. DMD CL(0, "WITCHS NEST"), CL(1, "BALL 3 LOCKED"), "", eNone, eBlink, eNone, 1500, True, "vo_ball3locked"
  5517. light007.State = 2:light006.State = 2:light070.State = 2
  5518. LightEffect 1
  5519. light058.State = 2
  5520. bLockActive(CurrentPlayer) = False
  5521. bLockActive(CurrentPlayer) = False
  5522. DMD CL(0, "WITCH"), CL(1, "MULTIBALL IS READY"), "", eNone, eBlink, eNone, 5000, True, ""
  5523. vpmtimer.addtimer 2500, "PlaySound""vo_multiballstarting321"" '"
  5524. vpmtimer.addtimer 7000, "StartWitchMultiball '"
  5525. vpmtimer.addtimer 9000, "light007.State = 0:light006.State = 0:light070.State = 0 '"
  5526. Else
  5527. vpmtimer.addtimer 2000, "Exit_WitchNest '"
  5528. End If
  5529. End Select
  5530. End Sub
  5531.  
  5532. Sub StartWitchMultiball
  5533. StopBRUJALetter
  5534. Mode(CurrentPlayer, 0) = 2
  5535. ' flash show
  5536. DMD CL(0, "WITCH"), CL(1, "MULTIBALL"), "", eNone, eBlink, eNone, 1500, True, "vo_multiball3"
  5537. Exit_WitchNest
  5538. post001.IsDropped = 0:PlaySoundAt "fx_SolenoidOn", Trigger010
  5539. post002.IsDropped = 0
  5540. vpmtimer.addtimer 5000, "PlaySoundAt""fx_SolenoidOff"", Trigger010: post001.IsDropped = 1:post002.IsDropped = 1 '"
  5541. AddMultiball 2
  5542. LightEffect 5
  5543. BallsLocked(CurrentPlayer) = 0
  5544. Light008.State = 0
  5545. 'setup arrow colors
  5546. For X = 0 to 7
  5547. WitchMBMultiplier(x) = 1
  5548. Next
  5549. UpdateArrowColors
  5550. bWitchMBFirstHit = True
  5551. EnableBallSaver 15
  5552. End Sub
  5553.  
  5554. ' turns on all arrows in the color of the multiplier
  5555. ' aLightsArrows is a collection and must be in the right order
  5556. Sub UpdateArrowColors
  5557. For X = 0 to 7
  5558. Select case WitchMBMultiplier(x)
  5559. Case 1:SetLightColor aLightArrows(x), Blue, 1
  5560. Case 2:SetLightColor aLightArrows(x), Green, 1
  5561. Case 3:SetLightColor aLightArrows(x), Yellow, 1
  5562. Case 4:SetLightColor aLightArrows(x), Orange, 1
  5563. Case 5:SetLightColor aLightArrows(x), Red, 1
  5564. End Select
  5565. Next
  5566. End Sub
  5567.  
  5568. Sub StopWitchMultiball
  5569. bWitchMBJackpotReady = False
  5570. BrujaFlasher.Enabled = 0
  5571. Light051.State = 0
  5572. ' turn off jackpot lights
  5573. For each x in aLightArrows:x.State = 0:Next
  5574. End Sub
  5575.  
  5576. '**************************
  5577. ' Droptargets: extra subs
  5578. '**************************
  5579.  
  5580. Sub CheckDrops
  5581. If DropCount = 3 Then
  5582. LightEffect 1
  5583. Addscore DropBankValue(CurrentPlayer)
  5584. DMD CL(0, "3 BANK VALUE"), CL(1, FormatScore(DropBankValue(CurrentPlayer))), "", eNone, eBlink, eNone, 1500, True, ""
  5585. If DropBankValue(CurrentPlayer) <750000 Then
  5586. DropBankValue(CurrentPlayer) = DropBankValue(CurrentPlayer) + 25000
  5587. End If
  5588. If Mode(CurrentPlayer, 0) = 2 AND Light051.State = 0 Then 'activate the witch for a Jackpot shot only when the SJP light is off
  5589. BrujaFlasher.Enabled = 1
  5590. bWitchMBJackpotReady = True
  5591. Else 'do the normal droptarget awards
  5592. Select Case DropPos(CurrentPlayer) 'lit award
  5593. Case 0:AddBonusMultiplier 1
  5594. Case 1:light046.State = 2:bMystery = True:Flashforms ORBLight, 5000, 50, 0
  5595. Case 2:
  5596. If Mode(CurrentPLayer, 0) = 10 Then
  5597. light008.State = 2
  5598. bLockActive(CurrentPlayer) = True
  5599. RampUp
  5600. DMD "", "", "lockislit", eNone, eNone, eBlink, 1500, True, "vo_lockislit"
  5601. End If
  5602. End Select
  5603. DropPos(CurrentPlayer) = (DropPos(CurrentPlayer) + 1)MOD 3
  5604. End If
  5605. vpmtimer.addtimer 1000, "ResetDrop '"
  5606. End If
  5607. End Sub
  5608.  
  5609. Sub ResetDrop
  5610. PlaySoundAt "fx_resetdrop", Target005
  5611. Target004.IsDropped = 0
  5612. Target005.IsDropped = 0
  5613. Target006.IsDropped = 0
  5614. DropCount = 0
  5615. UpdateDrop
  5616. End Sub
  5617.  
  5618. Sub UpdateDrop 'lights
  5619. Select Case DropPos(CurrentPlayer)
  5620. Case 0:light009.State = 0:light010.State = 0:light011.State = 2 'Bonus X
  5621. Case 1:light009.State = 0:light010.State = 2:light011.State = 0 'lit ORB for mystery award
  5622. Case 2:light009.State = 2:light010.State = 0:light011.State = 0 'lit lock
  5623. End Select
  5624. End Sub
  5625.  
  5626. '********************
  5627. ' Mystery ORB awards
  5628. '********************
  5629. ' ORG lits up for mystery awards
  5630. ' the award increases for each time you obtain it
  5631.  
  5632. Sub AwardMystery
  5633. Dim tmp
  5634. bMystery = False
  5635. Light046.State = 0
  5636. LightEffect 1
  5637. DMD "", "", "mystery", eNone, eNone, eBlink, 1500, True, ""
  5638. tmp = INT(RND * 7 + MysteryLevel(CurrentPlayer)) * 150000
  5639. DMD CL(0, "MYSTERY AWARD"), CL(1, FormatScore(tmp)), "", eNone, eBlink, eNone, 1500, True, ""
  5640. Addscore tmp
  5641. MysteryLevel(CurrentPlayer) = MysteryLevel(CurrentPlayer) + 1
  5642. End Sub
  5643.  
  5644. '*************
  5645. ' Spinners
  5646. '*************
  5647.  
  5648. Sub Spinner001_Spin
  5649. If Tilted Then Exit Sub
  5650. PlaySoundAt "fx_spinner", Spinner001
  5651. SetFlash flasher001, 1, 100, 50
  5652. DOF 201, DOFPulse
  5653. Select Case Mode(CurrentPlayer, 0)
  5654. Case 10
  5655. Addscore 50000
  5656. If BrujaLetter(CurrentPlayer) <5 Then
  5657. NextMode
  5658. End If
  5659. Case 3 'simply lit the super light
  5660. Addscore 50000
  5661. light026.State = 1
  5662. CheckFinisterra
  5663. Case 5
  5664. If light044.State Then
  5665. Addscore HechizoSpinnerValue
  5666. End If
  5667. Case Else
  5668. Addscore 50000
  5669. End Select
  5670. ' run during the whole game
  5671. If bSuperSpinners(CurrentPlayer) <> 1 Then
  5672. SuperSpinnersCount(CurrentPlayer) = SuperSpinnersCount(CurrentPlayer) + 1
  5673. If SuperSpinnersCount(CurrentPlayer) = 60 Then
  5674. bSuperSpinners(CurrentPlayer) = 2
  5675. UpdateSuperPyramid
  5676. SuperPyramidValue = SuperPyramidValue + 1500000
  5677. ElseIf SuperSpinnersCount(CurrentPlayer)> 60 Then
  5678. SuperPyramidValue = SuperPyramidValue + 25000
  5679. End If
  5680. End If
  5681. 'Ball Saver
  5682. BallSaveCount = (BallSaveCount + 1)MOD 30
  5683. If BallSaveCount = 29 Then
  5684. EnableSidePosts
  5685. End If
  5686. End Sub
  5687.  
  5688. Sub Spinner002_Spin
  5689. If Tilted Then Exit Sub
  5690. PlaySoundAt "fx_spinner", Spinner002
  5691. SetFlash flasher003, 3, 100, 50
  5692. DOF 204, DOFPulse
  5693. Select Case Mode(CurrentPlayer, 0)
  5694. Case 3 'simply lit the super light
  5695. Addscore 25000
  5696. light026.State = 1
  5697. CheckFinisterra
  5698. Case 5
  5699. If light056.State Then
  5700. Addscore HechizoSpinnerValue
  5701. End If
  5702. Case Else
  5703. Addscore 25000
  5704. End Select
  5705. ' run during the whole game
  5706. If bSuperSpinners(CurrentPlayer) <> 1 Then 'this if it is not finished
  5707. SuperSpinnersCount(CurrentPlayer) = SuperSpinnersCount(CurrentPlayer) + 1
  5708. If SuperSpinnersCount(CurrentPlayer) = 60 Then
  5709. bSuperSpinners(CurrentPlayer) = 2 'this means it is activated
  5710. UpdateSuperPyramid
  5711. SuperPyramidValue = SuperPyramidValue + 1500000
  5712. ElseIf SuperSpinnersCount(CurrentPlayer)> 60 Then 'add more points to the SP jackpot
  5713. SuperPyramidValue = SuperPyramidValue + 25000
  5714. End If
  5715. End If
  5716. End Sub
  5717.  
  5718. '***********************
  5719. 'Ball saver: side Posts
  5720. '***********************
  5721. ' 20 seconds ball saver
  5722.  
  5723. Sub EnableSidePosts
  5724. post005.IsDropped = 0:PlaySoundAt "fx_solenoidOn", gi006
  5725. light004.State = 1
  5726. post003.IsDropped = 0:PlaySoundAt "fx_solenoidOn", gi043
  5727. light003.State = 1
  5728. IF Balls = 3 Then post004.IsDropped = 0 'on the last ball you also get the center post
  5729. Post005.TimerEnabled = 1
  5730. Light005.State = 0
  5731. End Sub
  5732.  
  5733. Sub post005_Timer
  5734. post005.TimerEnabled = 0
  5735. post005.IsDropped = 1:PlaySoundAt "fx_solenoidOff", gi006
  5736. light004.State = 0
  5737. post003.IsDropped = 1:PlaySoundAt "fx_solenoidOff", gi043
  5738. post004.IsDropped = 1
  5739. light003.State = 0
  5740. Light005.State = 2
  5741. End Sub
  5742.  
  5743. '********************
  5744. ' Super Pyramid
  5745. '********************
  5746. ' shoot POPS, SPINNERS, RAMPS, TARGETS and ORBITS to power-up the Pyramid.
  5747. ' once a super feature is activated it builds the Super Pyramid Jackpot
  5748.  
  5749. Sub UpdateSuperPyramid
  5750. 'super POPS
  5751. Light024.State = bSuperPops(CurrentPlayer)
  5752. 'super SPINNERS
  5753. Light026.State = bSuperSpinners(CurrentPlayer)
  5754. If bSuperSpinners(CurrentPlayer) = 2 Then
  5755. Light023.state = 2
  5756. Light031.State = 2
  5757. Else
  5758. Light023.state = 0
  5759. Light031.State = 0
  5760. End If
  5761. 'super RAMPS
  5762. Light028.State = bSuperRamps(CurrentPlayer)
  5763. If bSuperRamps(CurrentPlayer) = 2 Then
  5764. Light029.state = 2
  5765. Else
  5766. Light029.state = 0
  5767. End If
  5768. 'super TARGETS
  5769. Light025.State = bSuperTargets(CurrentPlayer)
  5770. 'super ORBITS
  5771. Light027.State = bSuperOrbits(CurrentPlayer)
  5772. If bSuperOrbits(CurrentPlayer) = 2 Then
  5773. Light030.state = 2
  5774. Else
  5775. Light030.state = 0
  5776. End If
  5777. 'super pyramid jackpot - only the active pyramids count the X
  5778. SuperPyramidMultiplier = 0
  5779. If bSuperPops(CurrentPlayer) = 2 Then
  5780. SuperPyramidMultiplier = SuperPyramidMultiplier + 1
  5781. End If
  5782. If bSuperSpinners(CurrentPlayer) = 2 Then
  5783. SuperPyramidMultiplier = SuperPyramidMultiplier + 1
  5784. End If
  5785. If bSuperRamps(CurrentPlayer) = 2 Then
  5786. SuperPyramidMultiplier = SuperPyramidMultiplier + 1
  5787. End If
  5788. If bSuperTargets(CurrentPlayer) = 2 Then
  5789. SuperPyramidMultiplier = SuperPyramidMultiplier + 1
  5790. End If
  5791. If bSuperOrbits(CurrentPlayer) = 2 Then
  5792. SuperPyramidMultiplier = SuperPyramidMultiplier + 1
  5793. End If
  5794. If SuperPyramidMultiplier> 0 Then 'at least one super feature is activated
  5795. bSPJActivated = True
  5796. DMD "", "", "superjackpotislit", eNone, eNone, eBlink, 1500, True, "vo_superjackpotislit" 'enabled SJP
  5797. Light045.State = 2
  5798. Else
  5799. bSPJActivated = False
  5800. Light045.State = 0
  5801. End If
  5802. End Sub
  5803.  
  5804. Sub StopSuperPyramid 'called at the end of the ball or after the SPJ award
  5805. SuperPyramidMultiplier = 0
  5806. SuperPyramidValue = 0
  5807. bSPJActivated = 0
  5808. Light045.State = 0
  5809. 'pops
  5810. If bSuperPops(CurrentPlayer) = 2 Then
  5811. PyramidBonusCount = PyramidBonusCount + 1
  5812. bSuperPops(CurrentPlayer) = 1
  5813. Light024.State = 1
  5814. End If
  5815. ' spinners
  5816. If bSuperSpinners(CurrentPlayer) = 2 Then
  5817. PyramidBonusCount = PyramidBonusCount + 1
  5818. bSuperSpinners(CurrentPlayer) = 1
  5819. Light026.State = 1
  5820. Light023.state = 0
  5821. Light031.State = 0
  5822. End If
  5823. 'ramps
  5824. If bSuperRamps(CurrentPlayer) = 2 Then
  5825. PyramidBonusCount = PyramidBonusCount + 1
  5826. bSuperRamps(CurrentPlayer) = 1
  5827. Light028.State = 1
  5828. Light029.State = 0
  5829. End If
  5830. 'targets
  5831. If bSuperTargets(CurrentPlayer) = 2 Then
  5832. PyramidBonusCount = PyramidBonusCount + 1
  5833. bSuperTargets(CurrentPlayer) = 1
  5834. Light025.State = 1
  5835. End If
  5836. 'orbits
  5837. If bSuperOrbits(CurrentPlayer) = 2 Then
  5838. PyramidBonusCount = PyramidBonusCount + 1
  5839. bSuperOrbits(CurrentPlayer) = 1
  5840. Light027.State = 1
  5841. Light030.State = 0
  5842. End If
  5843. If(bSuperPops(CurrentPlayer) = 1)AND(bSuperSpinners(CurrentPlayer) = 1)AND(bSuperRamps(CurrentPlayer) = 1)AND(bSuperTargets(CurrentPlayer) = 1)AND(bSuperOrbits(CurrentPlayer) = 1)Then
  5844. ResetPyramid
  5845. End If
  5846. End Sub
  5847.  
  5848. Sub ResetPyramid
  5849. for x = 0 to 4
  5850. SuperSpinnersCount(x) = 0
  5851. SuperPopsCount(x) = 0
  5852. SuperRampsCount(x) = 0
  5853. SuperTargetsCount(x) = 0
  5854. SuperOrbitsCount(x) = 0
  5855. bSuperSpinners(x) = 0 '0 not started, 2 started, 1 completed, corresponds to the light states
  5856. bSuperPops(x) = 0
  5857. bSuperRamps(x) = 0
  5858. bSuperTargets(x) = 0
  5859. bSuperOrbits(x) = 0
  5860. Next
  5861. UpdateSuperPyramid
  5862. End Sub
  5863.  
  5864. Sub AwardSPJackpot
  5865. If bSPJActivated Then
  5866. AddBonusMultiplier 1
  5867. Dim tmp
  5868. tmp = SuperPyramidValue * SuperPyramidMultiplier
  5869. DMD CL(0, FormatScore(tmp)), "SUPR PYRAMID JACKPOT", "", eNone, eBlinkFast, eNone, 1500, True, "vo_superjackpot2"
  5870. DOF 126, DOFPulse
  5871. Addscore tmp
  5872. LightEffect 2
  5873. StopSuperPyramid
  5874. ' only when you collect the SPJackpot you may start Finisterra
  5875. If(bSuperPops(CurrentPlayer) = 1)AND(bSuperSpinners(CurrentPlayer) = 1)AND(bSuperRamps(CurrentPlayer) = 1)AND(bSuperTargets(CurrentPlayer) = 1)AND(bSuperOrbits(CurrentPlayer) = 1)Then
  5876. StartFinisterra
  5877. End If
  5878. End If
  5879. End Sub
  5880.  
  5881. '***********************************
  5882. ' Finisterra Multiball - Wizard Mode
  5883. '***********************************
  5884. 'starts after finishing the Super Pyramid
  5885. ' Mode 3
  5886. Sub EnableFinisterra
  5887. DMD "HIT THE WITCH STARTS", "FINISTERRA MULTIBALL", "", eBlink, eBlink, eNone, 1500, True, ""
  5888. bFinisterraMBReady = True
  5889. SetLightColor Light057, red, 2
  5890. BrujaFlasher.Enabled = 1
  5891. End Sub
  5892.  
  5893. Sub StartFinisterra
  5894. StopBRUJALetter
  5895. DMD CL(0, "FINISTERRA"), " MULTIBALL", "", eNone, eBlink, eNone, 1500, True, "vo_multiball"
  5896. light045.State = 0
  5897. light024.State = 0
  5898. light025.State = 0
  5899. light026.State = 0
  5900. light027.State = 0
  5901. light028.State = 0
  5902. light014.State = 2
  5903. light058.State = 2
  5904. Light023.State = 2
  5905. Light030.State = 2
  5906. Light029.State = 2
  5907. Light031.State = 2
  5908. Light032.State = 2
  5909. bFinisterraMBReady = False
  5910. Mode(CurrentPLayer, 0) = 3
  5911. EnableBallSaver 30
  5912. AddMultiball 1
  5913. LightEffect 5
  5914. post001.IsDropped = 0:PlaySoundAt "fx_SolenoidOn", Trigger010
  5915. post002.IsDropped = 0
  5916. vpmtimer.addtimer 2500, "PlaySoundAt""fx_SolenoidOff"", Trigger010: post001.IsDropped = 1:post002.IsDropped = 1 '"
  5917. End Sub
  5918.  
  5919. Sub CheckFinisterra 'pops, spinners, orbits, ramps and targets must be hit 1 to activate SJP at ORB
  5920. 'can just check the lights :)
  5921. FinisterraSJPValue(Currentplayer) = FinisterraSJPValue(Currentplayer) + 250000 * FinisterraDifficulty
  5922. If light024.State = 1 AND light025.State = 1 AND light026.State = 1 AND light027.State = 1 AND light028.State = 1 Then
  5923. light045.State = 2
  5924. bFinisterraSJPActivated = True
  5925. AwardExtraBall
  5926. End If
  5927. End Sub
  5928.  
  5929. Sub AwardFinisterraSJP
  5930. Dim tmp
  5931. AddBonusMultiplier 1
  5932. tmp = FinisterraSJPValue(Currentplayer) * FinisterraSJPMultiplier
  5933. DMD CL(0, FormatScore(tmp)), "FINISTERRA SJACKPOT", "", eNone, eBlinkFast, eNone, 1500, True, "vo_superjackpot"
  5934. bFinisterraSJPActivated = False
  5935. light045.State = 0
  5936. light024.State = 0
  5937. light025.State = 0
  5938. light026.State = 0
  5939. light027.State = 0
  5940. light028.State = 0
  5941. FinisterraSJPMultiplier = FinisterraSJPMultiplier + 1
  5942. FinisterraSJPCount = FinisterraSJPCount + 1
  5943. If FinisterraSJPCount <3 Then Bruja_AddaBall 'just add add a ball
  5944. FinisterraDifficulty = FinisterraDifficulty + 0.2
  5945. End Sub
  5946.  
  5947. Sub StopFinisterra
  5948. bFinisterraSJPActivated = False
  5949. light014.State = 0
  5950. light058.State = 0
  5951. light057.State = 0
  5952. light045.State = 0
  5953. light024.State = 0
  5954. light025.State = 0
  5955. light026.State = 0
  5956. light027.State = 0
  5957. light028.State = 0
  5958. Light023.State = 0
  5959. Light030.State = 0
  5960. Light029.State = 0
  5961. Light031.State = 0
  5962. Light032.State = 0
  5963. BrujaFlasher.Enabled = 0
  5964. End Sub
  5965.  
  5966. '*********************
  5967. ' Playfield Multiplier
  5968. '*********************
  5969.  
  5970. Sub CheckPFx 'check target hits to activate the playfield multiplier
  5971. PFxCount = PFxCount + 1
  5972. Select Case PfxCount
  5973. Case 4:AddPlayfieldMultiplier 1:ResetPFxTargetLights
  5974. Case 8:AddPlayfieldMultiplier 1:ResetPFxTargetLights:PFxCount = 0
  5975. End Select
  5976. End Sub
  5977.  
  5978. Sub ResetPFxTargetLights
  5979. PFxCount = 0
  5980. light015.State = 2
  5981. light016.State = 2
  5982. light017.State = 2
  5983. light018.State = 2
  5984. End Sub
  5985.  
  5986. Sub RotateActivateX
  5987. Dim tmp
  5988. tmp = light001.State
  5989. light001.State = light002.State
  5990. light002.State = tmp
  5991. End Sub
  5992.  
  5993. '******************
  5994. ' LOOP feature
  5995. '******************
  5996. ' available during all modes
  5997. ' shoot loops with upper flippers
  5998. ' LoopValue = 250000
  5999. ' LoopJackpot = 1000000
  6000. ' LoopCount = 0
  6001.  
  6002. Sub CheckLoop 'count the loops, increases LoopValue, increases LoopJackpot
  6003. If MiniLoopMulti = 3 Then
  6004. LoopCount = LoopCount + 2
  6005. Else
  6006. LoopCount = LoopCount + 1
  6007. End If
  6008. ' loop jackpots are lit
  6009. If light021.State Then
  6010. AddScore LoopJackpot(CurrentPlayer) * MiniLoopMulti
  6011. LoopJackpotMulti = LoopJackpotMulti + 1
  6012. If NOT LoopJackpotTimer.Enabled Then
  6013. LoopJackpotTimer.Enabled = 1
  6014. End If
  6015. End If
  6016. IF LoopCount >= 5 Then
  6017. LoopCount = 5
  6018. 'enable loop jackpots
  6019. DMD "", "", "superloopsislit", eNone, eNone, eBlink, 1500, True, "vo_superloopsarelit"
  6020. light021.State = 2
  6021. light022.State = 2
  6022. End If
  6023. ' Add normal Loop score
  6024. If light021.State = 0 Then
  6025. LoopValue = LoopCount * 250000 * MiniLoopMulti + (LoopCount * 250000 * light020.State)
  6026. AddScore LoopValue
  6027. End If
  6028. If LoopJackpot(CurrentPlayer) <25000000 Then
  6029. LoopJackpot(CurrentPlayer) = LoopJackpot(CurrentPlayer) + 250000
  6030. End If
  6031. ExtraBallCount(CurrentPlayer) = ExtraBallCount(CurrentPlayer) + 1
  6032. If ExtraBallCount(CurrentPlayer) >= 30 then 'lit Extra Ball
  6033. light047.State = 1
  6034. End If
  6035. UpdateLoopLights
  6036. End Sub
  6037.  
  6038. Sub LoopTimer_Timer 'decreases the LoopValue and after 6 seconds is back to 250k
  6039. LoopCount = LoopCount -1
  6040. UpdateLoopLights
  6041. IF LoopCount = 0 Then
  6042. Me.Enabled = 0
  6043. End If
  6044. End Sub
  6045.  
  6046. Sub LoopJackpotTimer_Timer 'turns off the loop jackpots after 12 seconds
  6047. light021.State = 0
  6048. light022.State = 0
  6049. LoopJackpotMulti = 1
  6050. Me.Enabled = 0
  6051. End Sub
  6052.  
  6053. Sub UpdateLoopLights
  6054. Select case LoopCount
  6055. Case 0:light040.State = 0:light041.State = 0:light042.State = 0:light043.State = 0:light020.State = 0:LoopTimer.Enabled = 0:LoopTimer.Enabled = 1
  6056. Case 1:light040.State = 1:light041.State = 0:light042.State = 0:light043.State = 0:light020.State = 0:LoopTimer.Enabled = 0:LoopTimer.Enabled = 1
  6057. Case 2:light040.State = 1:light041.State = 1:light042.State = 0:light043.State = 0:light020.State = 0:LoopTimer.Enabled = 0:LoopTimer.Enabled = 1
  6058. Case 3:light040.State = 1:light041.State = 1:light042.State = 1:light043.State = 0:light020.State = 0:LoopTimer.Enabled = 0:LoopTimer.Enabled = 1
  6059. Case 4:light040.State = 1:light041.State = 1:light042.State = 1:light043.State = 1:light020.State = 0:LoopTimer.Enabled = 0:LoopTimer.Enabled = 1
  6060. Case 5:light040.State = 1:light041.State = 1:light042.State = 1:light043.State = 1:light020.State = 1:LoopTimer.Enabled = 0:LoopTimer.Enabled = 1
  6061. End Select
  6062. End Sub
  6063.  
  6064. '*******************
  6065. ' COMBOS
  6066. '*******************
  6067. ' don't time out (unlike in the Celtic Land ramp mode)
  6068. ' starts at 500K for a 2 way combo and it is doubled on each combo
  6069. ' shots that count as combos:
  6070. ' Left Ramp 1
  6071. ' Big Loop 2
  6072. ' Left Orbit 3
  6073. ' Mini Loop 4
  6074. ' Right Ramp 5
  6075. ' Right Orbit 6
  6076. ' 6 targets up to a max of 5 combos
  6077.  
  6078. Sub CheckCombo(n)
  6079. If Mode(CurrentPlayer, 0) = 4 then Exit Sub 'no combos during Celtic Land Mode
  6080.  
  6081. If Combo(n) = 1 Then 'repeated shot so stop the combos
  6082. StopCombo
  6083. Exit Sub
  6084. End If
  6085.  
  6086. Combo(n) = 1
  6087. ComboCount = 0
  6088. For x = 1 to 6
  6089. ComboCount = ComboCount + Combo(x)
  6090. Next
  6091. If ComboCount = 2 AND bSuperCombo Then 'awarded by the 4th Tomb Treasure
  6092. For x = 1 to 6
  6093. Combo(x) = 1
  6094. Next
  6095. ComboCount = 6
  6096. End If
  6097. Select Case ComboCount
  6098. Case 1 'just starting
  6099. Case 2 'first Combo
  6100. bComboActivated = True
  6101. DMD "", "", "combo", eNone, eNone, eBlink, 1500, True, "vo_combo"
  6102. ComboFlashTimer.Enabled = 1
  6103. Case 3:DMD "", "", "combo2", eNone, eNone, eBlink, 1500, True, "vo_combo2"
  6104. Case 4:DMD "", "", "combo3", eNone, eNone, eBlink, 1500, True, "vo_combo3"
  6105. Case 5:DMD "", "", "combo4", eNone, eNone, eBlink, 1500, True, "vo_combo4"
  6106. Case 6:DMD "", "", "combo5", eNone, eNone, eBlink, 1500, True, "vo_combo5"
  6107. End Select
  6108. AddScore ComboValue * ComboCount
  6109. End Sub
  6110.  
  6111. Sub StopCombo
  6112. bComboActivated = False
  6113. ComboCount = 0
  6114. For X = 1 to 6
  6115. Combo(x) = 0
  6116. Next
  6117. ComboFlashTimer.Enabled = 0
  6118. End Sub
  6119.  
  6120. Sub ComboFlashTimer_Timer
  6121. SetFlash flasher002, 2, 1400, 50
  6122. DOF 202, DOFPulse
  6123. End Sub
  6124.  
  6125. '*******************
  6126. ' Deathblow
  6127. '*******************
  6128. ' end a combo with a special shot to award a deathblow
  6129. ' posible targets
  6130. ' Skillshot Target
  6131. ' ORB target
  6132. ' Ilussia Captive Ball
  6133. ' Witch target (SUPER)
  6134. ' SJP Target (SUPER)
  6135.  
  6136. Sub CheckDeathblow(n)
  6137. If bComboActivated Then
  6138. DeathblowBonusCount = DeathblowBonusCount + 1
  6139. Select case n
  6140. case 1, 2, 3 'normal deathblow
  6141. DMD "", "", "deathblow", eNone, eNone, eBlink, 1500, True, "Fanfare2"
  6142. DMD "", CL(1, FormatScore(ComboValue * ComboCount)), "", eNone, eBlink, eNone, 1500, True, ""
  6143. AddScore ComboValue * ComboCount
  6144. case 4, 5 'super deathblow
  6145. DMD "", "", "superdeathblow", eNone, eNone, eBlink, 1500, True, "Fanfare3"
  6146. DMD "", CL(1, FormatScore(ComboValue * ComboCount * 3)), "", eNone, eBlink, eNone, 1500, True, ""
  6147. AddScore ComboValue * ComboCount * 3
  6148. End Select
  6149. StopCombo
  6150. End If
  6151. End Sub
  6152.  
  6153. '*******************
  6154. ' Extra Bonus Subs
  6155. '*******************
  6156.  
  6157. Sub aBonusSwitches_Hit(idx)
  6158. SwitchBonusCount = SwitchBonusCount + 1
  6159. End Sub
  6160.  
  6161. '*********************
  6162. ' Tomb Treasures
  6163. '*********************
  6164. ' Collecting Super Jackpot hits, spinner hits and other shots will turn on a Tomb Treasure
  6165. ' collect at the left ramp
  6166. '1. 15 Million
  6167. '2. Super Slings (slingshots worth 250k + 1K increment for rest of ball)
  6168. '3. Adds additional 15M to current Super Pyramid Jackpot and starts !! Feliz Navidad Cabrones !!
  6169. '4. Super Combos (5x combos and deathblows for rest of ball)
  6170. '5. Light Extra Ball
  6171. '6. Light Ball Save.
  6172. '7. Collect 2X Bonus - This 2X is multiplied by the current PF multiplier AND your current bonus multiplier so very large collects are possible here!
  6173. '8. +5x Super Pyramid Jackpot multiplier
  6174. '9. 50 Million
  6175. '10.Start La danza del Fuego (super-wizard mode)
  6176.  
  6177. Sub StartTombTreasure
  6178. SetLamp 12, 1
  6179. bTombTreasureReady = True
  6180. If balls = 1 then
  6181. DMD "", "", "treasure", eNone, eNone, eBlink, 1500, True, "vo_shoottheleftramp"
  6182. Else
  6183. DMD "", "", "treasure", eNone, eNone, eBlink, 1500, True, "vo_shoottheleftramp2"
  6184. End if
  6185. End Sub
  6186.  
  6187. Sub AwardTombTreasure
  6188. SetLamp 12, 0
  6189. LightEffect 2
  6190. Select Case TombTreasureCount
  6191. Case 0:
  6192. DMD CL(0, "TOMB AWARD"), CL(1, "15 MILLION"), "", eNone, eBlink, eNone, 1500, True, ""
  6193. Addscore 15000000
  6194. Case 1:
  6195. DMD CL(0, "TOMB AWARD"), CL(1, "SUPER SLINGSHOTS"), "", eNone, eBlink, eNone, 1500, True, ""
  6196. SlingshotValue = 250000
  6197. Case 2:
  6198. DMD CL(0, "TOMB AWARD"), CL(1, "+15MILL SPJ PYRAMID"), "", eNone, eBlink, eNone, 1500, True, ""
  6199. SuperPyramidValue = SuperPyramidValue + 15000000
  6200. StartFelizNavidadCabrones
  6201. Case 3:
  6202. DMD CL(0, "TOMB AWARD"), CL(1, "SUPER 5X COMBO"), "", eNone, eBlink, eNone, 1500, True, ""
  6203. bSuperCombo = True
  6204. Case 4:
  6205. DMD CL(0, "TOMB AWARD"), CL(1, "EXTRA BALL IS LIT"), "", eNone, eBlink, eNone, 1500, True, ""
  6206. Light047.State = 1
  6207. Case 5:
  6208. DMD CL(0, "TOMB AWARD"), CL(1, "BALL SAVE 60 SEC"), "", eNone, eBlink, eNone, 1500, True, ""
  6209. EnableBallSaver 60
  6210. Case 6:
  6211. DMD CL(0, "TOMB AWARD"), CL(1, "COLLECT 2X BONUS"), "", eNone, eBlink, eNone, 1500, True, ""
  6212. BonusMultiplier(CurrentPlayer) = BonusMultiplier(CurrentPlayer) + 2
  6213. Case 7:
  6214. DMD CL(0, "TOMB AWARD"), CL(1, "SUPER PYRAMID 5X SPJ"), "", eNone, eBlink, eNone, 1500, True, ""
  6215. SuperPyramidMultiplier = SuperPyramidMultiplier + 5
  6216. Case 8:
  6217. DMD CL(0, "TOMB AWARD"), CL(1, "50 MILLION"), "", eNone, eBlink, eNone, 1500, True, ""
  6218. Addscore 50000000
  6219. Case 9:
  6220. DMD CL(0, "TOMB AWARD"), CL(1, "EXTRA BALL IS LIT"), "", eNone, eBlink, eNone, 1500, True, ""
  6221. StartLaDanzaDelFuego
  6222. End Select
  6223. TombTreasureCount = (TombTreasureCount + 1)MOD 10
  6224. bTombTreasureReady = False
  6225. End Sub
  6226.  
  6227. '*************************
  6228. ' Feliz Navidad Cabrones
  6229. '*************************
  6230. ' Mode 11
  6231. ' 3rd Tomb Award
  6232. ' 2 multiball mode
  6233. ' 2 arrows lit red,
  6234. ' shoot a red one it becomes green,
  6235. ' shoot a green one it becomes red
  6236. ' make all arrows green
  6237. ' shoot the witch for a Super Jackpot (which can be multiplied by 3 according to the strength of the hit)
  6238. ' start over with more arrows
  6239.  
  6240. Sub StartFelizNavidadCabrones
  6241. DMD "", "", "feliznavidad", eNone, eNone, eBlink, 1500, True, "fanfare2"
  6242. If Mode(CurrentPlayer, 0) <> 0 then StopCurrentMode
  6243. StopBRUJALetter
  6244. Mode(CurrentPlayer, 0) = 11
  6245. 'start with 2 lights
  6246. SetLightColor light056, red, 2
  6247. SetLightColor light053, red, 2
  6248. AddMultiball 1
  6249. LightEffect 5
  6250. post001.IsDropped = 0:PlaySoundAt "fx_SolenoidOn", Trigger010
  6251. post002.IsDropped = 0
  6252. vpmtimer.addtimer 2500, "PlaySoundAt""fx_SolenoidOff"", Trigger010: post001.IsDropped = 1:post002.IsDropped = 1 '"
  6253. FNCStep = 0
  6254. EnableBallsaver 20
  6255. End Sub
  6256.  
  6257. Sub StopFNC
  6258. StopAddaBall
  6259. Mode(CurrentPlayer, 0) = 0
  6260. End Sub
  6261.  
  6262. Sub CheckFNC
  6263. Select Case FNCStep
  6264. Case 0 ' two arrow lits in Red and they both must be green to continue
  6265. If light056.State = 1 AND light053.State = 1 Then 'both lights are green so go to the next step
  6266. DMD " MADNESS JACKPOT", CL(1, "1.000.000"), "", eNone, eBlink, eNone, 1500, True, "vo_1million"
  6267. Addscore 1000000
  6268. FNCStep = 1
  6269. SetLightColor light056, red, 2
  6270. SetLightColor light053, red, 2
  6271. SetLightColor light055, red, 2
  6272. EnableBallsaver 15
  6273. End If
  6274. Case 1 '3 lights
  6275. If light056.State = 1 AND light053.State = 1 AND light055.State = 1 Then 'all 3 lights are green so go to the next step
  6276. DMD " MADNESS JACKPOT", CL(1, "2.000.000"), "", eNone, eBlink, eNone, 1500, True, "vo_2million"
  6277. Addscore 2000000
  6278. FNCStep = 2
  6279. SetLightColor light056, red, 2
  6280. SetLightColor light053, red, 2
  6281. SetLightColor light055, red, 2
  6282. SetLightColor light052, red, 2
  6283. EnableBallsaver 15
  6284. End If
  6285. Case 2 '4 lights
  6286. If light056.State = 1 AND light053.State = 1 AND light055.State = 1 AND light052.State = 1 Then 'all 4 lights are green so go to the next step
  6287. DMD " MADNESS JACKPOT", CL(1, "3.000.000"), "", eNone, eBlink, eNone, 1500, True, "vo_3million"
  6288. Addscore 3000000
  6289. FNCStep = 3
  6290. SetLightColor light056, red, 2
  6291. SetLightColor light053, red, 2
  6292. SetLightColor light055, red, 2
  6293. SetLightColor light052, red, 2
  6294. SetLightColor light054, red, 2
  6295. EnableBallsaver 15
  6296. bAddaBallActivated = True:Light046.State = 2
  6297. End If
  6298. Case 3 '5 lights
  6299. If light056.State = 1 AND light053.State = 1 AND light055.State = 1 AND light052.State = 1 AND light054.State = 1 Then 'all 5 lights are green so go to the next step
  6300. DMD " MADNESS JACKPOT", CL(1, "4.000.000"), "", eNone, eBlink, eNone, 1500, True, "vo_4million"
  6301. Addscore 4000000
  6302. FNCStep = 4
  6303. SetLightColor light056, red, 2
  6304. SetLightColor light053, red, 2
  6305. SetLightColor light055, red, 2
  6306. SetLightColor light052, red, 2
  6307. SetLightColor light054, red, 2
  6308. SetLightColor light049, red, 2
  6309. EnableBallsaver 20
  6310. End If
  6311. Case 4 '6 lights
  6312. If light056.State = 1 AND light053.State = 1 AND light055.State = 1 AND light052.State = 1 AND light054.State = 1 AND light049.State = 1 Then 'all 6 lights are green so go to the next step
  6313. DMD " MADNESS JACKPOT", CL(1, "5.000.000"), "", eNone, eBlink, eNone, 1500, True, "vo_5million"
  6314. Addscore 5000000
  6315. FNCStep = 5
  6316. SetLightColor light056, red, 2
  6317. SetLightColor light053, red, 2
  6318. SetLightColor light055, red, 2
  6319. SetLightColor light052, red, 2
  6320. SetLightColor light054, red, 2
  6321. SetLightColor light049, red, 2
  6322. SetLightColor light057, red, 2
  6323. EnableBallsaver 20
  6324. End If
  6325. Case 5 'all 7 lights
  6326. If light056.State = 1 AND light053.State = 1 AND light055.State = 1 AND light052.State = 1 AND light054.State = 1 AND light049.State = 1 AND light057.State = 1 Then 'all 7 lights are green
  6327. DMD " MADNESS JACKPOT", CL(1, "10.000.000"), "", eNone, eBlink, eNone, 1500, True, "fanfare3"
  6328. DMD "FELIZ NAVIDAD CABRON", CL(1, "COMPLETED"), "", eNone, eBlink, eNone, 1500, True, ""
  6329. Addscore 10000000
  6330. StopFNC
  6331. StartBRUJALetter
  6332. End If
  6333. End Select
  6334. End Sub
  6335.  
  6336. '*************************
  6337. ' La Danza del Fuego
  6338. '*************************
  6339. 'Mode 12 - Mega Wizard Mode
  6340. '10th Tomb Award
  6341. '6 ball multiball
  6342. 'All shots are lit for jackpot
  6343.  
  6344. Sub StartLaDanzaDelFuego
  6345. DMD "", "", "danza", eNone, eNone, eBlink, 1500, True, "fanfare1"
  6346. If Mode(CurrentPlayer, 0) <> 0 then StopCurrentMode
  6347. Mode(CurrentPlayer, 0) = 12
  6348. AddMultiball 6
  6349. LightEffect 5
  6350. post001.IsDropped = 0:PlaySoundAt "fx_SolenoidOn", Trigger010
  6351. post002.IsDropped = 0
  6352. vpmtimer.addtimer 12000, "PlaySoundAt""fx_SolenoidOff"", Trigger010: post001.IsDropped = 1:post002.IsDropped = 1 '"
  6353. EnableBallsaver 30
  6354. SetLightColor light056, red, 2
  6355. SetLightColor light053, red, 2
  6356. SetLightColor light055, red, 2
  6357. SetLightColor light052, red, 2
  6358. SetLightColor light054, red, 2
  6359. SetLightColor light049, red, 2
  6360. SetLightColor light057, red, 2
  6361. End Sub
  6362.  
  6363. Sub CheckLDDF 'turn on witch SJP
  6364. If light056.State = 0 AND light053.State = 0 AND light055.State = 0 AND light052.State = 0 AND light054.State = 0 AND light049.State = 0 AND light057.State = 0 Then 'all 7 lights are off
  6365. BrujaFlasher.Enabled = 1
  6366. bLDDFSJPEnabled = True
  6367. End If
  6368. End Sub
  6369.  
  6370. Sub RestartLDDF
  6371. EnableBallsaver 20
  6372. SetLightColor light056, red, 2
  6373. SetLightColor light053, red, 2
  6374. SetLightColor light055, red, 2
  6375. SetLightColor light052, red, 2
  6376. SetLightColor light054, red, 2
  6377. SetLightColor light049, red, 2
  6378. SetLightColor light057, red, 2
  6379. End Sub
Advertisement
Add Comment
Please, Sign In to add comment