Outhere

Manowar_Band

Feb 4th, 2021
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 145.28 KB | None | 0 0
  1. ' ****************************************************************
  2. ' VISUAL PINBALL X
  3. ' JPSalas Diablo Pinball Script
  4. ' Version 1.0.0
  5. ' ****************************************************************
  6.  
  7. 'DOF Config by Arngrim
  8. '101 Left Flipper
  9. '102 Right Flipper
  10. '103 Left Slingshot
  11. '104 Left Slingshot Shake
  12. '105 Right Slingshot
  13. '106 Right Slingshot Shake
  14. '107 Bumper Left
  15. '108 Bumper Center
  16. '109 Bumper Right
  17. '110 Ball Release
  18. '111 AutoPlunger
  19. '112 White Flash on Strobe Toy for autoplunger, Chestout kicker, extra ball, party award
  20. '113 Drain Light
  21. '114 Start Button Light, when credit is bigger than 0
  22. '115 Chestout kicker
  23. '116 ChestDoor Drop or Reset
  24. '117 Strobe 250ms
  25. '118 Drop targets left hit
  26. '119 Drop targets center hit
  27. '120 Drop targets right hit
  28. '121 Knocker for extra ball and award special
  29. '122 Triggertop1 Light
  30. '123 Triggertop2 Light
  31. '124 Triggertop3 Light
  32. '125 Strobe 500ms
  33. '126 Beacon when mutliball start
  34. '127 small shaker effect when magnets are ON
  35. '128 beacon effect when ball is on chest hole
  36. '129 Left Bumper Flash
  37. '130 Center Bumper Flash
  38. '131 Right Bumper Flash
  39. '132 Outlane Left Light
  40. '133 Inlanes Left Light
  41. '134 Inlane Riht Light
  42. '135 Outlane Right Light
  43. '136 Chest flasher 2000 ms
  44. '137 Chest flasher 1000 ms
  45. '138 Bumper Left Blink Flasher
  46. '139 Bumper Center Blink Flasher
  47. '140 Bumper Right Blink Flasher
  48. '141 RGB GI White
  49. '142 RGB GI Purple
  50. '143 RGB GI Darkblue
  51. '144 RGB GI Blue
  52. '145 RGB GI Green
  53. '146 RGB GI Darkgreen
  54. '147 RGB GI Yellow
  55. '148 RGB GI Amber
  56. '149 RGB GI Orange
  57. '150 RGB GI Red
  58. '151 Flasher Center Purple Blink
  59. '152 Flasher Left Purple Blink
  60. '153 Flasher Right Purple Blink
  61. '154 Rear Flashers Blink 1000ms
  62. '155 Rear Flashers Blink 500ms
  63.  
  64. Option Explicit
  65. Randomize
  66. ' COPY EVERYTHING BELOW TO THE TOP OF YOUR TABLE SCRIPT UNDER OPTION EXPLICIT Start Pup Pack
  67.  
  68. '****** PuP Variables ******
  69.  
  70. Dim usePUP: Dim cPuPPack: Dim PuPlayer: Dim PUPStatus: PUPStatus=false ' dont edit this line!!!
  71.  
  72. '*************************** PuP Settings for this table ********************************
  73.  
  74. usePUP = true ' enable Pinup Player functions for this table
  75. cPuPPack = "Manowar_Band" ' name of the PuP-Pack / PuPVideos folder for this table
  76.  
  77. '//////////////////// PINUP PLAYER: STARTUP & CONTROL SECTION //////////////////////////
  78.  
  79. ' This is used for the startup and control of Pinup Player
  80.  
  81. Sub PuPStart(cPuPPack)
  82. If PUPStatus=true then Exit Sub
  83. If usePUP=true then
  84. Set PuPlayer = CreateObject("PinUpPlayer.PinDisplay")
  85. If PuPlayer is Nothing Then
  86. usePUP=false
  87. PUPStatus=false
  88. Else
  89. PuPlayer.B2SInit "",cPuPPack 'start the Pup-Pack
  90. PUPStatus=true
  91. End If
  92. End If
  93. End Sub
  94.  
  95. Sub pupevent(EventNum)
  96. if (usePUP=false or PUPStatus=false) then Exit Sub
  97. PuPlayer.B2SData "E"&EventNum,1 'send event to Pup-Pack
  98. End Sub
  99.  
  100. ' ******* How to use PUPEvent to trigger / control a PuP-Pack *******
  101.  
  102. ' Usage: pupevent(EventNum)
  103.  
  104. ' EventNum = PuP Exxx trigger from the PuP-Pack
  105.  
  106. ' Example: pupevent 102
  107.  
  108. ' This will trigger E102 from the table's PuP-Pack
  109.  
  110. ' DO NOT use any Exxx triggers already used for DOF (if used) to avoid any possible confusion
  111.  
  112. '************ PuP-Pack Startup **************
  113.  
  114. PuPStart(cPuPPack) 'Check for PuP - If found, then start Pinup Player / PuP-Pack Finish Start Pup Pack
  115. Const BallSize = 50 ' 50 is the normal size
  116. Const cGameName = "Diablo"
  117.  
  118. ' Load the core.vbs for supporting Subs and functions
  119. LoadCoreFiles
  120.  
  121. Sub LoadCoreFiles
  122. On Error Resume Next
  123. ExecuteGlobal GetTextFile("core.vbs")
  124. If Err Then MsgBox "Can't open core.vbs"
  125. ExecuteGlobal GetTextFile("controller.vbs")
  126. If Err Then MsgBox "Can't open controller.vbs"
  127. On Error Goto 0
  128. End Sub
  129.  
  130. ' Define any Constants
  131. Const TableName = "Manowar_Band"
  132. Const myVersion = "1.0.0"
  133. Const MaxPlayers = 4 ' from 1 to 4
  134. Const BallSaverTime = 20 ' in seconds
  135. Const MaxMultiplier = 5 ' limit to 5x in this game
  136. Const BallsPerGame = 3 ' 3 or 5
  137. Const MaxMultiballs = 5 ' max number of balls during multiballs
  138.  
  139. ' Define Global Variables
  140. Dim PlayersPlayingGame
  141. Dim CurrentPlayer
  142. Dim Credits
  143. Dim BonusPoints(4)
  144. Dim BonusHeldPoints(4)
  145. Dim BonusMultiplier(4)
  146. Dim bBonusHeld
  147. Dim BallsRemaining(4)
  148. Dim ExtraBallsAwards(4)
  149. Dim Score(4)
  150. Dim HighScore(4)
  151. Dim HighScoreName(4)
  152. Dim Jackpot
  153. Dim SuperJackpot
  154. Dim Tilt
  155. Dim TiltSensitivity
  156. Dim Tilted
  157. Dim TotalGamesPlayed
  158. Dim mBalls2Eject
  159. Dim SkillshotValue(4)
  160. Dim bAutoPlunger
  161. Dim bInstantInfo
  162. Dim bAttractMode
  163. Dim ao,bsnr 'Stats B2S use it
  164. Dim ActiveDOFCol
  165.  
  166. ' Define Game Control Variables
  167. Dim LastSwitchHit
  168. Dim BallsOnPlayfield
  169. Dim BallsInLock
  170. Dim BallsInHole
  171.  
  172. ' Define Game Flags
  173. Dim bFreePlay
  174. Dim bGameInPlay
  175. Dim bOnTheFirstBall
  176. Dim bBallInPlungerLane
  177. Dim bBallSaverActive
  178. Dim bBallSaverReady
  179. Dim bMultiBallMode
  180. Dim bMusicOn
  181. Dim bSkillshotReady
  182. Dim bExtraBallWonThisBall
  183. Dim bJustStarted
  184.  
  185. ' core.vbs variables
  186. Dim plungerIM 'used mostly as an autofire plunger
  187. Dim LMagnet, RMagnet
  188.  
  189. ' *********************************************************************
  190. ' Visual Pinball Defined Script Events
  191. ' *********************************************************************
  192.  
  193. Sub Table1_Init()
  194. LoadEM
  195. Dim i
  196. Randomize
  197.  
  198. 'Impulse Plunger as autoplunger
  199. Const IMPowerSetting = 45 ' Plunger Power
  200. Const IMTime = 1.1 ' Time in seconds for Full Plunge
  201. Set plungerIM = New cvpmImpulseP
  202. With plungerIM
  203. .InitImpulseP swplunger, IMPowerSetting, IMTime
  204. .Random 1.5
  205. .InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_solenoid", DOFContactors)
  206. .CreateEvents "plungerIM"
  207. End With
  208.  
  209. Set LMagnet = New cvpmTurnTable
  210. With LMagnet
  211. .InitTurnTable Magnet1, 90
  212. .spinCW = False
  213. .SpinUp = 90
  214. .SpinDown = 90
  215. .MotorOn = False
  216. .CreateEvents "LMagnet"
  217. End With
  218.  
  219. Set RMagnet = New cvpmTurnTable
  220. With RMagnet
  221. .InitTurnTable Magnet2, 90
  222. .spinCW = True
  223. .SpinUp = 90
  224. .SpinDown = 90
  225. .MotorOn = False
  226. .CreateEvents "RMagnet"
  227. End With
  228.  
  229. ' Misc. VP table objects Initialisation, droptargets, animations...
  230. VPObjects_Init
  231.  
  232. ' load saved values, highscore, names, jackpot
  233. Loadhs
  234.  
  235. ' Initalise the DMD display
  236. DMD_Init
  237.  
  238. ' freeplay or coins
  239. bFreePlay = True 'we dont want coins
  240.  
  241. ' Init main variables and any other flags
  242. bAttractMode = False
  243. bOnTheFirstBall = False
  244. bBallInPlungerLane = False
  245. bBallSaverActive = False
  246. bBallSaverReady = False
  247. bMultiBallMode = False
  248. bGameInPlay = False
  249. bAutoPlunger = False
  250. bMusicOn = False
  251. BallsOnPlayfield = 0
  252. BallsInLock = 0
  253. BallsInHole = 0
  254. LastSwitchHit = ""
  255. Tilt = 0
  256. TiltSensitivity = 6
  257. Tilted = False
  258. bBonusHeld = False
  259. bJustStarted = True
  260. bInstantInfo = False
  261. ' set any lights for the attract mode
  262. GiOff
  263. StartAttractMode
  264.  
  265. ' Remove the cabinet rails if in FS mode
  266. If Table1.ShowDT = False then
  267. lrail.Visible = False
  268. rrail.Visible = False
  269. End If
  270. End Sub
  271.  
  272. '******
  273. ' Keys
  274. '******
  275.  
  276. Sub Table1_KeyDown(ByVal Keycode)
  277. If Keycode = AddCreditKey Then
  278. Credits = Credits + 1
  279. DOF 114, DOFOn
  280. If(Tilted = False) Then
  281. DMDFlush
  282. DMD "black.jpg", "", "CREDITS " &credits, 500
  283. PlaySound "fx_coin"
  284. If NOT bGameInPlay Then ShowTableInfo
  285. End If
  286. End If
  287.  
  288. If keycode = PlungerKey Then
  289. Plunger.Pullback
  290. End If
  291.  
  292. If hsbModeActive Then
  293. EnterHighScoreKey(keycode)
  294. Exit Sub
  295. End If
  296.  
  297. ' Table specific
  298.  
  299. ' Normal flipper action
  300.  
  301. If bGameInPlay AND NOT Tilted Then
  302.  
  303. If keycode = LeftTiltKey Then Nudge 90, 6:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt
  304. If keycode = RightTiltKey Then Nudge 270, 6:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt
  305. If keycode = CenterTiltKey Then Nudge 0, 7:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt
  306.  
  307. If keycode = LeftFlipperKey Then SolLFlipper 1:InstantInfoTimer.Enabled = True
  308. pupevent 701
  309. If keycode = RightFlipperKey Then SolRFlipper 1:InstantInfoTimer.Enabled = True
  310. pupevent 702
  311.  
  312. If keycode = StartGameKey Then
  313. If((PlayersPlayingGame <MaxPlayers) AND(bOnTheFirstBall = True) ) Then
  314.  
  315. If(bFreePlay = True) Then
  316. PlayersPlayingGame = PlayersPlayingGame + 1
  317. TotalGamesPlayed = TotalGamesPlayed + 1
  318. DMDFlush
  319. DMD "black.jpg", " ", PlayersPlayingGame & " WARRIORS", 500
  320. PlaySound "so_fanfare1"
  321. Else
  322. If(Credits> 0) then
  323. PlayersPlayingGame = PlayersPlayingGame + 1
  324. TotalGamesPlayed = TotalGamesPlayed + 1
  325. Credits = Credits - 1
  326. DMDFlush
  327. DMD "black.jpg", " ", PlayersPlayingGame & " WARRIORS", 500
  328. PlaySound "so_fanfare1"
  329. Else
  330. ' Not Enough Credits to start a game.
  331. DOF 114, DOFOff
  332. DMDFlush
  333. DMD "black.jpg", "CREDITS " &credits, "INSERT COIN", 500
  334. PlaySound "so_nocredits"
  335. End If
  336. End If
  337. End If
  338. End If
  339. Else ' If (GameInPlay)
  340.  
  341. If keycode = StartGameKey Then
  342. pupevent 716
  343. If(bFreePlay = True) Then
  344. If(BallsOnPlayfield = 0) Then
  345. ResetForNewGame()
  346. End If
  347. Else
  348. If(Credits> 0) Then
  349. pupevent 717
  350. If(BallsOnPlayfield = 0) Then
  351. Credits = Credits - 1
  352. ResetForNewGame()
  353. End If
  354. Else
  355. ' Not Enough Credits to start a game.
  356. DOF 114, DOFOff
  357. DMDFlush
  358. DMD "black.jpg", "CREDITS " &credits, "INSERT COIN", 500
  359. ShowTableInfo
  360. End If
  361. End If
  362. End If
  363. End If ' If (GameInPlay)
  364.  
  365. if keycode = "3" then StartNextMode
  366. if keycode = "4" then winmode mode(0)
  367.  
  368. End Sub
  369.  
  370. Sub Table1_KeyUp(ByVal keycode)
  371.  
  372. If keycode = PlungerKey Then
  373. Plunger.Fire
  374. End If
  375.  
  376. If hsbModeActive Then
  377. Exit Sub
  378. End If
  379.  
  380. ' Table specific
  381.  
  382. If bGameInPLay AND NOT Tilted Then
  383. If keycode = LeftFlipperKey Then
  384. pupevent 703
  385. SolLFlipper 0
  386. InstantInfoTimer.Enabled = False
  387. If bInstantInfo Then
  388. DMDScoreNow
  389. bInstantInfo = False
  390. End If
  391. End If
  392. If keycode = RightFlipperKey Then
  393. pupevent 704
  394. SolRFlipper 0
  395. InstantInfoTimer.Enabled = False
  396. If bInstantInfo Then
  397. DMDScoreNow
  398. bInstantInfo = False
  399. End If
  400. End If
  401. End If
  402. End Sub
  403.  
  404. Sub InstantInfoTimer_Timer
  405. InstantInfoTimer.Enabled = False
  406. bInstantInfo = True
  407. DMDFlush
  408. UltraDMDTimer.Enabled = 1
  409. End Sub
  410.  
  411. Sub InstantInfo
  412. Jackpot = 1000000 + Round(Score(CurrentPlayer) / 10, 0)
  413. DMD "black.jpg", "", "INSTANT INFO", 500
  414. DMD "black.jpg", "JACKPOT", Jackpot, 800
  415. DMD "black.jpg", "LEVEL", Level(CurrentPlayer), 800
  416. DMD "black.jpg", "BONUS MULT", BonusMultiplier(CurrentPlayer), 800
  417. DMD "black.jpg", "ORBIT BONUS", OrbitHits, 800
  418. DMD "black.jpg", "LANE BONUS", LaneBonus, 800
  419. DMD "black.jpg", "TARGET BONUS", TargetBonus, 800
  420. DMD "black.jpg", "RAMP BONUS", RampBonus, 800
  421. DMD "black.jpg", "MANOWAR BATTLES", Monsters(CurrentPlayer), 800
  422. End Sub
  423.  
  424. '*************
  425. ' Pause Table
  426. '*************
  427.  
  428. Sub table1_Paused
  429. End Sub
  430.  
  431. Sub table1_unPaused
  432. End Sub
  433.  
  434. Sub table1_Exit
  435. Savehs
  436. if B2SOn Then Controller.stop
  437. End Sub
  438.  
  439. '********************
  440. ' Flippers
  441. '********************
  442.  
  443. Sub SolLFlipper(Enabled)
  444. If Enabled Then
  445. PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, 1, -0.05, 0.15
  446. pupevent 705
  447. LeftFlipper.RotateToEnd
  448. If bSkillshotReady = False Then
  449. RotateLaneLightsLeft
  450. End If
  451. Else
  452. PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, -0.05, 0.15
  453. LeftFlipper.RotateToStart
  454. End If
  455. End Sub
  456.  
  457. Sub SolRFlipper(Enabled)
  458. If Enabled Then
  459. PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, 1, 0.05, 0.15
  460. pupevent 706
  461. RightFlipper.RotateToEnd
  462. If bSkillshotReady = False Then
  463. RotateLaneLightsRight
  464. End If
  465. Else
  466. PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, 0.05, 0.15
  467. RightFlipper.RotateToStart
  468. End If
  469. End Sub
  470.  
  471. ' flippers hit Sound
  472.  
  473. Sub LeftFlipper_Collide(parm)
  474. PlaySound "fx_rubber_flipper", 0, parm / 10, -0.05, 0.25
  475. End Sub
  476.  
  477. Sub RightFlipper_Collide(parm)
  478. PlaySound "fx_rubber_flipper", 0, parm / 10, 0.05, 0.25
  479. End Sub
  480.  
  481. Sub RotateLaneLightsLeft
  482. Dim TempState
  483. 'flipper lanes
  484. TempState = l15.State
  485. l15.State = l16.State
  486. l16.State = l17.State
  487. l17.State = l18.State
  488. l18.State = l19.State
  489. l19.State = TempState
  490. 'top lanes
  491. TempState = l20.State
  492. l20.State = l21.State
  493. l21.State = l22.State
  494. l22.State = TempState
  495. If Mode(0) <> 2 AND bBumperFrenzy = False Then UpdateBumperLights
  496. End Sub
  497.  
  498. Sub RotateLaneLightsRight
  499. Dim TempState
  500. 'flipperlanes
  501. TempState = l19.State
  502. l19.State = l18.State
  503. l18.State = l17.State
  504. l17.State = l16.State
  505. l16.State = l15.State
  506. l15.State = TempState
  507. 'top lanes
  508. TempState = l22.State
  509. l22.State = l21.State
  510. l21.State = l20.State
  511. l20.State = TempState
  512. If Mode(0) <> 2 AND bBumperFrenzy = False Then UpdateBumperLights
  513. End Sub
  514.  
  515. '*********
  516. ' TILT
  517. '*********
  518.  
  519. 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
  520.  
  521. Sub CheckTilt 'Called when table is nudged
  522. Tilt = Tilt + TiltSensitivity 'Add to tilt count
  523. TiltDecreaseTimer.Enabled = True
  524. If(Tilt> TiltSensitivity) AND(Tilt <15) Then 'show a warning
  525. DMDFlush
  526. DMD "black.jpg", " ", "CAREFUL!", 800
  527. End if
  528. If Tilt> 15 Then 'If more that 15 then TILT the table
  529. Tilted = True
  530. 'display Tilt
  531. DMDFlush
  532. DMD "black.jpg", " ", "TILT!", 99999
  533. DisableTable True
  534. TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
  535. End If
  536. End Sub
  537.  
  538. Sub TiltDecreaseTimer_Timer
  539. ' DecreaseTilt
  540. If Tilt> 0 Then
  541. Tilt = Tilt - 0.1
  542. Else
  543. TiltDecreaseTimer.Enabled = False
  544. End If
  545. End Sub
  546.  
  547. Sub DisableTable(Enabled)
  548. If Enabled Then
  549. 'turn off GI and turn off all the lights
  550. GiOff
  551. LightSeqTilt.Play SeqAllOff
  552. 'Disable slings, bumpers etc
  553. LeftFlipper.RotateToStart
  554. RightFlipper.RotateToStart
  555. 'Bumper1.Force = 0
  556.  
  557. LeftSlingshot.Disabled = 1
  558. RightSlingshot.Disabled = 1
  559. Else
  560. 'turn back on GI and the lights
  561. GiOn
  562. LightSeqTilt.StopPlay
  563. 'Bumper1.Force = 6
  564. LeftSlingshot.Disabled = 0
  565. RightSlingshot.Disabled = 0
  566. 'clean up the buffer display
  567. DMDFlush
  568. End If
  569. End Sub
  570.  
  571. Sub TiltRecoveryTimer_Timer()
  572. ' if all the balls have been drained then..
  573. If(BallsOnPlayfield = 0) Then
  574. ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
  575. EndOfBall()
  576. TiltRecoveryTimer.Enabled = False
  577. End If
  578. ' else retry (checks again in another second or so)
  579. End Sub
  580.  
  581. '********************
  582. ' Music as wav sounds
  583. '********************
  584.  
  585. Dim Song
  586. Song = ""
  587.  
  588. Sub PlaySong(name)
  589. If bMusicOn Then
  590. If Song <> name Then
  591. StopSound Song
  592. Song = name
  593. If Song = "mu_end" Then
  594. PlaySound Song, 0, 0.1 'this last number is the volume, from 0 to 1
  595. Else
  596. PlaySound Song, -1, 0.1 'this last number is the volume, from 0 to 1
  597. End If
  598. End If
  599. End If
  600. End Sub
  601.  
  602. '**********************
  603. ' GI effects
  604. ' independent routine
  605. ' it turns on the gi
  606. ' when there is a ball
  607. ' in play
  608. '**********************
  609.  
  610. Dim OldGiState
  611. OldGiState = -1 'start witht the Gi off
  612.  
  613. Sub ChangeGi(col) 'changes the gi color
  614. Dim i
  615. ActiveDOFCol = 140 + col
  616. DOF ActiveDOFCol, DOFOn
  617. debug.print ActiveDOFCol
  618. For i = 140 to 150
  619. If i <> ActiveDOFCol Then DOF i, DOFOff
  620. Next
  621. Dim bulb
  622. For each bulb in aGILights
  623. SetLightColor bulb, col, -1
  624. Next
  625. End Sub
  626.  
  627. Sub GIUpdateTimer_Timer
  628. Dim tmp, obj
  629. tmp = Getballs
  630. If UBound(tmp) <> OldGiState Then
  631. OldGiState = Ubound(tmp)
  632. If UBound(tmp) = 3 Then 'we have 4 captive balls on the table (-1 means no balls, 0 is the first ball, 1 is the second..)
  633. GiOff ' turn off the gi if no active balls on the table, we could also have used the variable ballsonplayfield.
  634. Else
  635. Gion
  636. End If
  637. End If
  638. End Sub
  639.  
  640. Sub GiOn
  641. DOF ActiveDOFCol, DOFOn
  642. Dim bulb
  643. For each bulb in aGiLights
  644. bulb.State = 1
  645. Next
  646.  
  647. StartFire
  648. End Sub
  649.  
  650. Sub GiOff
  651. DOF ActiveDOFCol, DOFOff
  652. Dim bulb
  653. For each bulb in aGiLights
  654. bulb.State = 0
  655. Next
  656.  
  657. StartFire
  658. End Sub
  659.  
  660. Dim Fire1Pos, Fire2Pos, Fire3Pos, Fire4Pos, Fire5Pos, Flames
  661. Flames = Array("fire01", "fire02", "fire03", "fire04", "fire05", "fire06", "fire07", "fire08", "fire09", _
  662. "fire10", "fire11", "fire12", "fire13", "fire14", "fire15", "fire16", "fire17", "fire18", "fire19", _
  663. "fire20", "fire21", "fire22", "fire23", "fire24", "fire25", "fire26", "fire27", "fire28", "fire29", "fire30")
  664.  
  665. Sub StartFire
  666. Fire1Pos = 0
  667. Fire2Pos = 6
  668. Fire3Pos = 12
  669. Fire4Pos = 18
  670. Fire5Pos = 24
  671. FireTimer.Enabled = 1
  672. End Sub
  673.  
  674. Sub FireTimer_Timer
  675. 'debug.print fire1pos
  676. Fire1.ImageA = Flames(Fire1Pos)
  677. Fire2.ImageA = Flames(Fire2Pos)
  678. Fire3.ImageA = Flames(Fire3Pos)
  679. Fire4.ImageA = Flames(Fire4Pos)
  680. Fire5.ImageA = Flames(Fire5Pos)
  681. Fire1Pos = (Fire1Pos + 1) MOD 30
  682. Fire2Pos = (Fire2Pos + 1) MOD 30
  683. Fire3Pos = (Fire3Pos + 1) MOD 30
  684. Fire4Pos = (Fire4Pos + 1) MOD 30
  685. Fire5Pos = (Fire5Pos + 1) MOD 30
  686. End Sub
  687.  
  688. ' GI & light sequence effects
  689.  
  690. Sub GiEffect(n)
  691. Dim ii
  692. Select Case n
  693. Case 0 'all off
  694. LightSeqGi.Play SeqAlloff
  695. Case 1 'all blink
  696. LightSeqGi.UpdateInterval = 10
  697. LightSeqGi.Play SeqBlinking, , 10, 10
  698. Case 2 'random
  699. LightSeqGi.UpdateInterval = 10
  700. LightSeqGi.Play SeqRandom, 50, , 1000
  701. Case 3 'upon
  702. LightSeqGi.UpdateInterval = 4
  703. LightSeqGi.Play SeqUpOn, 5, 1
  704. Case 4 ' left-right-left
  705. LightSeqGi.UpdateInterval = 5
  706. LightSeqGi.Play SeqLeftOn, 10, 1
  707. LightSeqGi.UpdateInterval = 5
  708. LightSeqGi.Play SeqRightOn, 10, 1
  709. End Select
  710. End Sub
  711.  
  712. Sub LightEffect(n)
  713. Select Case n
  714. Case 0 ' all off
  715. LightSeqInserts.Play SeqAlloff
  716. Case 1 'all blink
  717. LightSeqInserts.UpdateInterval = 10
  718. LightSeqInserts.Play SeqBlinking, , 10, 10
  719. Case 2 'random
  720. LightSeqInserts.UpdateInterval = 10
  721. LightSeqInserts.Play SeqRandom, 50, , 1000
  722. Case 3 'upon
  723. LightSeqInserts.UpdateInterval = 4
  724. LightSeqInserts.Play SeqUpOn, 10, 1
  725. Case 4 ' left-right-left
  726. LightSeqInserts.UpdateInterval = 5
  727. LightSeqInserts.Play SeqLeftOn, 10, 1
  728. LightSeqInserts.UpdateInterval = 5
  729. LightSeqInserts.Play SeqRightOn, 10, 1
  730. End Select
  731. End Sub
  732.  
  733. ' Flasher Effects using lights
  734.  
  735. Dim FEStep, FEffect
  736. FEStep = 0
  737. FEffect = 0
  738.  
  739. Sub FlashEffect(n)
  740. Dim ii
  741. Select case n
  742. Case 0 ' all off
  743. LightSeqFlasher.Play SeqAlloff
  744. Case 1 'all blink
  745. LightSeqFlasher.UpdateInterval = 10
  746. LightSeqFlasher.Play SeqBlinking, , 10, 10
  747. Case 2 'random
  748. LightSeqFlasher.UpdateInterval = 10
  749. LightSeqFlasher.Play SeqRandom, 50, , 1000
  750. Case 3 'upon
  751. LightSeqFlasher.UpdateInterval = 4
  752. LightSeqFlasher.Play SeqUpOn, 10, 1
  753. Case 4 ' left-right-left
  754. LightSeqFlasher.UpdateInterval = 5
  755. LightSeqFlasher.Play SeqLeftOn, 10, 1
  756. LightSeqFlasher.UpdateInterval = 5
  757. LightSeqFlasher.Play SeqRightOn, 10, 1
  758. End Select
  759. End Sub
  760.  
  761. ' *********************************************************************
  762. ' Supporting Ball & Sound Functions
  763. ' *********************************************************************
  764.  
  765. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  766. Vol = Csng(BallVel(ball) ^2 / 1500)
  767. End Function
  768.  
  769. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  770. Dim tmp
  771. tmp = ball.x * 2 / table1.width-1
  772. If tmp> 0 Then
  773. Pan = Csng(tmp ^10)
  774. Else
  775. Pan = Csng(-((- tmp) ^10) )
  776. End If
  777. End Function
  778.  
  779. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  780. Pitch = BallVel(ball) * 20
  781. End Function
  782.  
  783. Function BallVel(ball) 'Calculates the ball speed
  784. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  785. End Function
  786.  
  787. '*****************************************
  788. ' JP's VP10 Rolling Sounds
  789. '*****************************************
  790.  
  791. Const tnob = 20 ' total number of balls
  792. Const lob = 0 'number of locked balls
  793. ReDim rolling(tnob)
  794. InitRolling
  795.  
  796. Sub InitRolling
  797. Dim i
  798. For i = 0 to tnob
  799. rolling(i) = False
  800. Next
  801. End Sub
  802.  
  803. Sub RollingUpdate()
  804. Dim BOT, b, ballpitch
  805. BOT = GetBalls
  806.  
  807. ' stop the sound of deleted balls
  808. For b = UBound(BOT) + 1 to tnob
  809. rolling(b) = False
  810. StopSound("fx_ballrolling" & b)
  811. Next
  812.  
  813. ' exit the sub if no balls on the table
  814. If UBound(BOT) = -1 Then Exit Sub 'there no extra balls on this table
  815.  
  816. ' play the rolling sound for each ball
  817. For b = lob to UBound(BOT)
  818. If BallVel(BOT(b) )> 1 Then
  819. If BOT(b).z <30 Then
  820. ballpitch = Pitch(BOT(b) )
  821. Else
  822. ballpitch = Pitch(BOT(b) ) * 50
  823. End If
  824. rolling(b) = True
  825. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, ballpitch, 1, 0
  826. Else
  827. If rolling(b) = True Then
  828. StopSound("fx_ballrolling" & b)
  829. rolling(b) = False
  830. End If
  831. End If
  832. Next
  833. End Sub
  834.  
  835. '**********************
  836. ' Ball Collision Sound
  837. '**********************
  838.  
  839. Sub OnBallBallCollision(ball1, ball2, velocity)
  840. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  841. End Sub
  842.  
  843. '******************************
  844. ' Diverse Collection Hit Sounds
  845. '******************************
  846.  
  847. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  848. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber_band", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  849. Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  850. Sub aRubber_Pins_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  851. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  852. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  853. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  854.  
  855. ' Random quotes from the game
  856.  
  857. Sub PlayQuote_timer() 'one quote each 2 minutes
  858. Dim Quote
  859. Quote = "di_quote" & INT(RND * 56) + 1
  860. PlaySound Quote
  861. End Sub
  862.  
  863. ' Ramp Soundss
  864. Sub REnd1_Hit()
  865. StopSound "fx_metalrolling"
  866. PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall)
  867. End Sub
  868.  
  869. Sub REnd2_Hit()
  870. StopSound "fx_metalrolling"
  871. PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall)
  872. End Sub
  873.  
  874. ' *********************************************************************
  875. ' User Defined Script Events
  876. ' *********************************************************************
  877.  
  878. ' Initialise the Table for a new Game
  879. '
  880. Sub ResetForNewGame()
  881. Dim i
  882.  
  883. bGameInPLay = True
  884.  
  885. 'resets the score display, and turn off attrack mode
  886. StopAttractMode
  887. GiOn
  888.  
  889. TotalGamesPlayed = TotalGamesPlayed + 1
  890. CurrentPlayer = 1
  891. PlayersPlayingGame = 1
  892. bOnTheFirstBall = True
  893. For i = 1 To MaxPlayers
  894. Score(i) = 0
  895. BonusPoints(i) = 0
  896. BonusHeldPoints(i) = 0
  897. BonusMultiplier(i) = 1
  898. BallsRemaining(i) = BallsPerGame
  899. ExtraBallsAwards(i) = 0
  900. Next
  901.  
  902. ' initialise any other flags
  903. Tilt = 0
  904.  
  905. ' initialise Game variables
  906. Game_Init()
  907.  
  908. ' you may wish to start some music, play a sound, do whatever at this point
  909.  
  910. vpmtimer.addtimer 1500, "FirstBall '"
  911. End Sub
  912.  
  913. ' This is used to delay the start of a game to allow any attract sequence to
  914. ' complete. When it expires it creates a ball for the player to start playing with
  915.  
  916. Sub FirstBall
  917. ' reset the table for a new ball
  918. ResetForNewPlayerBall()
  919. ' create a new ball in the shooters lane
  920. CreateNewBall()
  921. End Sub
  922.  
  923. ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
  924. ' lost one or we have moved onto the next player (if multiple are playing))
  925.  
  926. Sub ResetForNewPlayerBall()
  927. ' make sure the correct display is upto date
  928. AddScore 0
  929.  
  930. ' set the current players bonus multiplier back down to 1X
  931. SetBonusMultiplier 1
  932.  
  933. ' reset any drop targets, lights, game Mode etc..
  934.  
  935. BonusPoints(CurrentPlayer) = 0
  936. bBonusHeld = False
  937. bExtraBallWonThisBall = False
  938. ResetNewBallLights()
  939. 'Reset any table specific
  940. ResetNewBallVariables
  941.  
  942. 'This is a new ball, so activate the ballsaver
  943. bBallSaverReady = True
  944.  
  945. 'and the skillshot
  946. bSkillShotReady = True
  947.  
  948. 'Change the music ?
  949. End Sub
  950.  
  951. ' Create a new ball on the Playfield
  952.  
  953. Sub CreateNewBall()
  954. ' create a ball in the plunger lane kicker.
  955. BallRelease.CreateSizedball BallSize / 2
  956.  
  957. ' There is a (or another) ball on the playfield
  958. BallsOnPlayfield = BallsOnPlayfield + 1
  959.  
  960. ' kick it out..
  961. PlaySound SoundFXDOF("fx_Ballrel", 110, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1
  962. BallRelease.Kick 90, 4
  963.  
  964. ' if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations)
  965. ' set the bAutoPlunger flag to kick the ball in play automatically
  966. If BallsOnPlayfield> 1 Then
  967. DOF 111, DOFPulse
  968. DOF 112, DOFPulse
  969. DOF 126, DOFPulse
  970. bMultiBallMode = True
  971. bAutoPlunger = True
  972. End If
  973. End Sub
  974.  
  975. ' Add extra balls to the table with autoplunger
  976. ' Use it as AddMultiball 4 to add 4 extra balls to the table
  977.  
  978. Sub AddMultiball(nballs)
  979. mBalls2Eject = mBalls2Eject + nballs
  980. CreateMultiballTimer.Enabled = True
  981. 'and eject the first ball
  982. CreateMultiballTimer_Timer
  983. End Sub
  984.  
  985. ' Eject the ball after the delay, AddMultiballDelay
  986. Sub CreateMultiballTimer_Timer()
  987. ' wait if there is a ball in the plunger lane
  988. If bBallInPlungerLane Then
  989. Exit Sub
  990. Else
  991. If BallsOnPlayfield <MaxMultiballs Then
  992. CreateNewBall()
  993. mBalls2Eject = mBalls2Eject -1
  994. If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
  995. CreateMultiballTimer.Enabled = False
  996. End If
  997. Else 'the max number of multiballs is reached, so stop the timer
  998. mBalls2Eject = 0
  999. CreateMultiballTimer.Enabled = False
  1000. End If
  1001. End If
  1002. End Sub
  1003.  
  1004. ' The Player has lost his ball (there are no more balls on the playfield).
  1005. ' Handle any bonus points awarded
  1006.  
  1007. Sub EndOfBall()
  1008. Dim AwardPoints, TotalBonus, ii
  1009. AwardPoints = 0
  1010. TotalBonus = 0
  1011. ' the first ball has been lost. From this point on no new players can join in
  1012. bOnTheFirstBall = False
  1013.  
  1014. ' only process any of this if the table is not tilted. (the tilt recovery
  1015. ' mechanism will handle any extra balls or end of game)
  1016.  
  1017. If NOT Tilted Then
  1018.  
  1019. 'Count the bonus. This table uses several bonus
  1020. 'Lane Bonus
  1021. AwardPoints = LaneBonus * 1000
  1022. TotalBonus = AwardPoints
  1023. DMD "bonus-background.wmv", "LANE BONUS", AwardPoints, 700
  1024. pupevent 750
  1025. vpmtimer.addtimer 1300, "PlaySound ""bonus"", 0, 1, 0, 0, 0, 0, 0 '"
  1026.  
  1027. 'Number of Target banks completed
  1028. AwardPoints = TargetBonus * 100000
  1029. TotalBonus = TotalBonus + AwardPoints
  1030. DMD "bonus-background.wmv", "TARGET BONUS", AwardPoints, 700
  1031. pupevent 751
  1032. vpmtimer.addtimer 2200, "PlaySound ""bonus"", 0, 1, 0, 0, 1000, 0, 0 '"
  1033.  
  1034. 'Number of Ramps completed
  1035. AwardPoints = RampBonus * 10000
  1036. TotalBonus = TotalBonus + AwardPoints
  1037. DMD "bonus-background.wmv", "RAMP BONUS", AwardPoints, 700
  1038. pupevent 752
  1039. vpmtimer.addtimer 2900, "PlaySound ""bonus"", 0, 1, 0, 0, 2000, 0, 0 '"
  1040.  
  1041. 'Number of Orbits registered
  1042. AwardPoints = OrbitHits * 32260
  1043. TotalBonus = TotalBonus + AwardPoints
  1044. DMD "bonus-background.wmv", "ORBIT BONUS", AwardPoints, 700
  1045. pupevent 753
  1046. vpmtimer.addtimer 3600, "PlaySound ""bonus"", 0, 1, 0, 0, 3000, 0, 0 '"
  1047.  
  1048. 'Number of monsters defeated
  1049. AwardPoints = Monsters(CurrentPlayer) * 25130
  1050. DMD "bonus-background.wmv", "MANOWAR BATTLES", monsters(CurrentPlayer), 700
  1051. pupevent 754
  1052. vpmtimer.addtimer 4400, "PlaySound ""bonus"", 0, 1, 0, 0, 4000, 0, 0 '"
  1053.  
  1054. 'Player Level
  1055. AwardPoints = Level(CurrentPlayer) * 50000
  1056. TotalBonus = TotalBonus + AwardPoints
  1057. DMD "bonus-background.wmv", "LEVEL BONUS", Level(CurrentPlayer), 700
  1058. pupevent 755
  1059. vpmtimer.addtimer 5000, "PlaySound ""bonus"", 0, 1, 0, 0, 5000, 0, 0 '"
  1060.  
  1061. ' calculate the totalbonus
  1062. TotalBonus = TotalBonus * BonusMultiplier(CurrentPlayer) + BonusHeldPoints(CurrentPlayer)
  1063.  
  1064. ' handle the bonus held
  1065. ' reset the bonus held value since it has been already added to the bonus
  1066. BonusHeldPoints(CurrentPlayer) = 0
  1067.  
  1068. ' the player has won the bonus held award so do something with it :)
  1069. If bBonusHeld Then
  1070. If Balls = BallsPerGame Then ' this is the last ball, so if bonus held has been awarded then double the bonus
  1071. TotalBonus = TotalBonus * 2
  1072. End If
  1073. Else ' this is not the last ball so save the bonus for the next ball
  1074. BonusHeldPoints(CurrentPlayer) = TotalBonus
  1075. End If
  1076. bBonusHeld = False
  1077.  
  1078. ' Add the bonus to the score
  1079. DMD "bonus-background.wmv", "TOTAL BONUS X " &BonusMultiplier(CurrentPlayer), TotalBonus, 2200
  1080. pupevent 756
  1081. 'vpmtimer.addtimer 6200', "PlaySound ""goblin"" '"
  1082. pupevent 772
  1083. AddScore TotalBonus
  1084.  
  1085. ' add a bit of a delay to allow for the bonus points to be shown & added up
  1086. vpmtimer.addtimer 8500, "EndOfBall2 '"
  1087. Else 'if tilted then only add a short delay
  1088. vpmtimer.addtimer 100, "EndOfBall2 '"
  1089. End If
  1090. End Sub
  1091.  
  1092. ' The Timer which delays the machine to allow any bonus points to be added up
  1093. ' has expired. Check to see if there are any extra balls for this player.
  1094. ' if not, then check to see if this was the last ball (of the currentplayer)
  1095. '
  1096. Sub EndOfBall2()
  1097. ' if were tilted, reset the internal tilted flag (this will also
  1098. ' set TiltWarnings back to zero) which is useful if we are changing player LOL
  1099. Tilted = False
  1100. Tilt = 0
  1101. DisableTable False 'enable again bumpers and slingshots
  1102.  
  1103. ' has the player won an extra-ball ? (might be multiple outstanding)
  1104. If(ExtraBallsAwards(CurrentPlayer) <> 0) Then
  1105. 'debug.print "Extra Ball"
  1106.  
  1107. ' yep got to give it to them
  1108. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) - 1
  1109.  
  1110. ' if no more EB's then turn off any shoot again light
  1111. If(ExtraBallsAwards(CurrentPlayer) = 0) Then
  1112. LightShootAgain.State = 0
  1113. End If
  1114.  
  1115. ' You may wish to do a bit of a song AND dance at this point
  1116. 'DMD "extra-ball.wmv", "", "", 5000
  1117. pupevent 710
  1118.  
  1119. ' In this table an extra ball will have the skillshot and ball saver, so we reset the playfield for the new ball
  1120. ResetForNewPlayerBall()
  1121.  
  1122. ' Create a new ball in the shooters lane
  1123. CreateNewBall()
  1124. Else ' no extra balls
  1125.  
  1126. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer) - 1
  1127.  
  1128. ' was that the last ball ?
  1129. If(BallsRemaining(CurrentPlayer) <= 0) Then
  1130. 'debug.print "No More Balls, High Score Entry"
  1131.  
  1132. ' Submit the currentplayers score to the High Score system
  1133. CheckHighScore()
  1134. ' you may wish to play some music at this point
  1135.  
  1136. Else
  1137.  
  1138. ' not the last ball (for that player)
  1139. ' if multiple players are playing then move onto the next one
  1140. EndOfBallComplete()
  1141. End If
  1142. End If
  1143. End Sub
  1144.  
  1145. ' This function is called when the end of bonus display
  1146. ' (or high score entry finished) AND it either end the game or
  1147. ' move onto the next player (or the next ball of the same player)
  1148. '
  1149. Sub EndOfBallComplete()
  1150. Dim NextPlayer
  1151.  
  1152. 'debug.print "EndOfBall - Complete"
  1153.  
  1154. ' are there multiple players playing this game ?
  1155. If(PlayersPlayingGame> 1) Then
  1156. ' then move to the next player
  1157. NextPlayer = CurrentPlayer + 1
  1158. ' are we going from the last player back to the first
  1159. ' (ie say from player 4 back to player 1)
  1160. If(NextPlayer> PlayersPlayingGame) Then
  1161. NextPlayer = 1
  1162. End If
  1163. Else
  1164. NextPlayer = CurrentPlayer
  1165. End If
  1166.  
  1167. 'debug.print "Next Player = " & NextPlayer
  1168.  
  1169. ' is it the end of the game ? (all balls been lost for all players)
  1170. If((BallsRemaining(CurrentPlayer) <= 0) AND(BallsRemaining(NextPlayer) <= 0) ) Then
  1171. ' you may wish to do some sort of Point Match free game award here
  1172. ' generally only done when not in free play mode
  1173.  
  1174. ' set the machine into game over mode
  1175. EndOfGame()
  1176.  
  1177. ' you may wish to put a Game Over message on the desktop/backglass
  1178.  
  1179. Else
  1180. ' set the next player
  1181. CurrentPlayer = NextPlayer
  1182.  
  1183. ' make sure the correct display is up to date
  1184. AddScore 0
  1185.  
  1186. ' reset the playfield for the new player (or new ball)
  1187. ResetForNewPlayerBall()
  1188.  
  1189. ' AND create a new ball
  1190. CreateNewBall()
  1191.  
  1192. ' play a sound if more than 1 player
  1193. If PlayersPlayingGame> 1 Then
  1194. PlaySound "vo_player" &CurrentPlayer
  1195. DMD "black.jpg", " ", "WARRIOR " &CurrentPlayer, 800
  1196. End If
  1197. End If
  1198. End Sub
  1199.  
  1200. ' This function is called at the End of the Game, it should reset all
  1201. ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
  1202.  
  1203. Sub EndOfGame()
  1204. 'debug.print "End Of Game"
  1205. bGameInPLay = False
  1206. ' just ended your game then play the end of game tune
  1207. If NOT bJustStarted Then
  1208. 'PlaySong "m_end"
  1209. End If
  1210.  
  1211. bJustStarted = False
  1212. ' ensure that the flippers are down
  1213. SolLFlipper 0
  1214. SolRFlipper 0
  1215.  
  1216. ' terminate all Mode - eject locked balls
  1217. ' most of the Mode/timers terminate at the end of the ball
  1218. 'PlayQuote.Enabled = 0
  1219. ' show game over on the DMD
  1220. DMD "game-over.wmv", "", "", 11000
  1221. pupevent 711
  1222.  
  1223. ' set any lights for the attract mode
  1224. GiOff
  1225. StartAttractMode
  1226. ' you may wish to light any Game Over Light you may have
  1227. End Sub
  1228.  
  1229. Function Balls
  1230. Dim tmp
  1231. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  1232. If tmp> BallsPerGame Then
  1233. Balls = BallsPerGame
  1234. Else
  1235. Balls = tmp
  1236. End If
  1237. End Function
  1238.  
  1239. ' *********************************************************************
  1240. ' Drain / Plunger Functions
  1241. ' *********************************************************************
  1242.  
  1243. ' lost a ball ;-( check to see how many balls are on the playfield.
  1244. ' if only one then decrement the remaining count AND test for End of game
  1245. ' if more than 1 ball (multi-ball) then kill of the ball but don't create
  1246. ' a new one
  1247. '
  1248. Sub Drain_Hit()
  1249. ' Destroy the ball
  1250. Drain.DestroyBall
  1251. ' Exit Sub ' only for debugging - this way you can add balls from the debug window
  1252.  
  1253. BallsOnPlayfield = BallsOnPlayfield - 1
  1254.  
  1255. ' pretend to knock the ball into the ball storage mech
  1256. PlaySound "fx_drain"
  1257. DOF 113, DOFPulse
  1258. 'if Tilted the end Ball Mode
  1259. If Tilted Then
  1260. StopEndOfBallMode
  1261. End If
  1262.  
  1263. ' if there is a game in progress AND it is not Tilted
  1264. If(bGameInPLay = True) AND(Tilted = False) Then
  1265.  
  1266. ' is the ball saver active,
  1267. If(bBallSaverActive = True) Then
  1268.  
  1269. ' yep, create a new ball in the shooters lane
  1270. ' we use the Addmultiball in case the multiballs are being ejected
  1271. AddMultiball 1
  1272. ' we kick the ball with the autoplunger
  1273. bAutoPlunger = True
  1274. ' you may wish to put something on a display or play a sound at this point
  1275. DMD "ball-save.wmv", "", "", 5000
  1276. pupevent 712
  1277. Else
  1278. ' cancel any multiball if on last ball (ie. lost all other balls)
  1279. If(BallsOnPlayfield = 1) Then
  1280. ' AND in a multi-ball??
  1281. If(bMultiBallMode = True) then
  1282. ' not in multiball mode any more
  1283. bMultiBallMode = False
  1284. ' you may wish to change any music over at this point and
  1285. ' turn off any multiball specific lights
  1286. ' ResetJackpotLights
  1287. l42.State = 0
  1288. l43.State = 0
  1289. l44.State = 0
  1290. l45.State = 0
  1291. l46.State = 0
  1292. PlaySong "mu_main"
  1293. End If
  1294. End If
  1295.  
  1296. ' was that the last ball on the playfield
  1297. If(BallsOnPlayfield = 0) Then
  1298. ' End Mode and timers
  1299. StopSound Song:Song = ""
  1300. ChangeGi white
  1301. ' Show the end of ball animation
  1302. ' and continue with the end of ball
  1303. DMDFlush
  1304. Select Case Mode(0)
  1305. Case 0, 1, 3, 5, 7
  1306. DMD "ball-lost-2.wmv", "", "", 5000
  1307. pupevent 713
  1308. vpmtimer.addtimer 4500, "EndOfBall '"
  1309. Case 2, 4, 6, 8, 10
  1310. DMD "ball-lost-1.wmv", "", "", 10000
  1311. pupevent 714
  1312. vpmtimer.addtimer 9500, "EndOfBall '"
  1313. End Select
  1314. StopEndOfBallMode
  1315. End If
  1316. End If
  1317. End If
  1318. End Sub
  1319.  
  1320. ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane
  1321. ' Check to see if a ball saver mechanism is needed and if so fire it up.
  1322.  
  1323. Sub swPlungerRest_Hit()
  1324. 'debug.print "ball in plunger lane"
  1325. ' some sound according to the ball position
  1326. PlaySound "fx_sensor", 0, 1, 0.15, 0.25
  1327. bBallInPlungerLane = True
  1328. ' turn on Launch light is there is one
  1329. 'LaunchLight.State = 2
  1330.  
  1331. 'be sure to update the Scoreboard after the animations, if any
  1332. UltraDMDScoreTimer.Enabled = 1
  1333.  
  1334. ' kick the ball in play if the bAutoPlunger flag is on
  1335. If bAutoPlunger Then
  1336. 'debug.print "autofire the ball"
  1337. PlungerIM.AutoFire
  1338. DOF 111, DOFPulse
  1339. DOF 112, DOFPulse
  1340. bAutoPlunger = False
  1341. End If
  1342. ' if there is a need for a ball saver, then start off a timer
  1343. ' only start if it is ready, and it is currently not running, else it will reset the time period
  1344. If(bBallSaverReady = True) AND(BallSaverTime <> 0) And(bBallSaverActive = False) Then
  1345. EnableBallSaver BallSaverTime
  1346. End If
  1347. 'Start the Selection of the skillshot if ready
  1348. If bSkillShotReady Then
  1349. swPlungerRest.TimerEnabled = 1 ' this is a new ball, so show the launch ball if inactive for 6 seconds
  1350. UpdateSkillshot()
  1351. End If
  1352. ' remember last trigger hit by the ball.
  1353. LastSwitchHit = "swPlungerRest"
  1354. End Sub
  1355.  
  1356. ' The ball is released from the plunger turn off some flags and check for skillshot
  1357.  
  1358. Sub swPlungerRest_UnHit()
  1359. bBallInPlungerLane = False
  1360. swPlungerRest.TimerEnabled = 0 'stop the launch ball timer if active
  1361. If bSkillShotReady Then
  1362. ResetSkillShotTimer.Enabled = 1
  1363. End If
  1364. If NOT bMultiballMode Then
  1365. PlaySong "mu_main"
  1366. End If
  1367. ' turn off LaunchLight
  1368. ' LaunchLight.State = 0
  1369. End Sub
  1370.  
  1371. ' swPlungerRest timer to show the "launch ball" if the player has not shot the ball during 6 seconds
  1372.  
  1373. Sub swPlungerRest_Timer
  1374. 'DMD "start.wmv", "", "", 17000
  1375. pupevent 715
  1376. swPlungerRest.TimerEnabled = 0
  1377. End Sub
  1378.  
  1379. Sub EnableBallSaver(seconds)
  1380. 'debug.print "Ballsaver started"
  1381. ' set our game flag
  1382. bBallSaverActive = True
  1383. bBallSaverReady = False
  1384. ' start the timer
  1385. BallSaverTimerExpired.Interval = 1000 * seconds
  1386. BallSaverTimerExpired.Enabled = True
  1387. BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
  1388. BallSaverSpeedUpTimer.Enabled = True
  1389. ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
  1390. LightShootAgain.BlinkInterval = 160
  1391. SetLightColor LightShootAgain, amber, 2
  1392. End Sub
  1393.  
  1394. ' The ball saver timer has expired. Turn it off AND reset the game flag
  1395. '
  1396. Sub BallSaverTimerExpired_Timer()
  1397. 'debug.print "Ballsaver ended"
  1398. BallSaverTimerExpired.Enabled = False
  1399. ' clear the flag
  1400. bBallSaverActive = False
  1401. ' if you have a ball saver light then turn it off at this point
  1402. LightShootAgain.State = 0
  1403. End Sub
  1404.  
  1405. Sub BallSaverSpeedUpTimer_Timer()
  1406. 'debug.print "Ballsaver Speed Up Light"
  1407. BallSaverSpeedUpTimer.Enabled = False
  1408. ' Speed up the blinking
  1409. LightShootAgain.BlinkInterval = 80
  1410. LightShootAgain.State = 2
  1411. End Sub
  1412.  
  1413. ' *********************************************************************
  1414. ' Supporting Score Functions
  1415. ' *********************************************************************
  1416.  
  1417. ' Add points to the score AND update the score board
  1418. ' In this table we use SecondRound variable to double the score points in the second round after killing Malthael
  1419. Sub AddScore(points)
  1420. If(Tilted = False) Then
  1421. ' add the points to the current players score variable
  1422. Score(CurrentPlayer) = Score(CurrentPlayer) + points * SecondRound
  1423. ' update the score displays
  1424. DMDScore
  1425. End if
  1426.  
  1427. ' you may wish to check to see if the player has gotten a replay
  1428. End Sub
  1429.  
  1430. ' Add bonus to the bonuspoints AND update the score board
  1431.  
  1432. Sub AddBonus(points) 'not used in this table, since there are many different bonus items.
  1433. If(Tilted = False) Then
  1434. ' add the bonus to the current players bonus variable
  1435. BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points
  1436. ' update the score displays
  1437. DMDScore
  1438. End if
  1439.  
  1440. ' you may wish to check to see if the player has gotten a replay
  1441. End Sub
  1442.  
  1443. ' Add some points to the current Jackpot.
  1444. '
  1445. Sub AddJackpot(points) 'not used in this table
  1446. ' Jackpots only generally increment in multiball mode AND not tilted
  1447. ' but this doesn't have to be the case
  1448. 'If(Tilted = False)Then
  1449.  
  1450. ' If(bMultiBallMode = True) Then
  1451. ' Jackpot = Jackpot + points
  1452. ' you may wish to limit the jackpot to a upper limit, ie..
  1453. ' If (Jackpot >= 6000) Then
  1454. ' Jackpot = 6000
  1455. ' End if
  1456. 'End if
  1457. 'End if
  1458. End Sub
  1459.  
  1460. Sub AddSuperJackpot(points)
  1461. If(Tilted = False) Then
  1462.  
  1463. ' If(bMultiBallMode = True) Then
  1464. ' SuperJackpot = SuperJackpot + points
  1465. ' you may wish to limit the jackpot to a upper limit, ie..
  1466. ' If (Jackpot >= 6000) Then
  1467. ' Jackpot = 6000
  1468. ' End if
  1469. 'End if
  1470. End if
  1471. End Sub
  1472.  
  1473. Sub AddBonusMultiplier(n)
  1474. Dim NewBonusLevel
  1475. ' if not at the maximum bonus level
  1476. if(BonusMultiplier(CurrentPlayer) + n <MaxMultiplier) then
  1477. ' then add and set the lights
  1478. NewBonusLevel = BonusMultiplier(CurrentPlayer) + n
  1479. SetBonusMultiplier(NewBonusLevel)
  1480. Else
  1481. l2.State = 2:l3.State = 2:l4.State = 2:l5.State = 2
  1482. AddScore 5000000
  1483. DMD "black.jpg", " ", "5.000.000", 1000
  1484. End if
  1485. End Sub
  1486.  
  1487. ' Set the Bonus Multiplier to the specified level AND set any lights accordingly
  1488. ' There is no bonus multiplier lights in this table
  1489.  
  1490. Sub SetBonusMultiplier(Level)
  1491. ' Set the multiplier to the specified level
  1492. BonusMultiplier(CurrentPlayer) = Level
  1493. ' Update the lights
  1494. Select Case Level
  1495. Case 1:l2.State = 0:l3.State = 0:l4.State = 0:l5.State = 0
  1496. Case 2:l2.State = 1:l3.State = 0:l4.State = 0:l5.State = 0
  1497. Case 3:l2.State = 0:l3.State = 1:l4.State = 0:l5.State = 0
  1498. Case 4:l2.State = 0:l3.State = 0:l4.State = 1:l5.State = 0
  1499. Case 5:l2.State = 0:l3.State = 0:l4.State = 0:l5.State = 1
  1500. End Select
  1501. End Sub
  1502.  
  1503. Sub AwardExtraBall()
  1504. If NOT bExtraBallWonThisBall Then
  1505. DMDBlink "black.jpg", " ", "EXTRA BALL WON", 100, 10
  1506. 'DMD "extra-ball.wmv", "", "", 5000
  1507. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  1508. DOF 121, DOFPulse
  1509. DOF 112, DOFPulse
  1510. bExtraBallWonThisBall = True
  1511. GiEffect 1
  1512. LightEffect 2
  1513. END If
  1514. End Sub
  1515.  
  1516. Sub AwardSpecial()
  1517. DMDBlink "black.jpg", " ", "EXTRA GAME WON", 100, 10
  1518. Credits = Credits + 1
  1519. DOF 114, DOFOn
  1520. DOF 121, DOFPulse
  1521. DOF 112, DOFPulse
  1522. GiEffect 1
  1523. LightEffect 1
  1524. End Sub
  1525.  
  1526. 'in this table the jackpot is always 1 million + 10% of your score
  1527.  
  1528. Sub AwardJackpot() 'award a normal jackpot, double or triple jackpot
  1529. Jackpot = 1000000 + Round(Score(CurrentPlayer) / 10, 0)
  1530. DMDBlink "black.jpg", "JACKPOT", Jackpot, 100, 10
  1531. PlaySound "criticalhit"
  1532. AddScore Jackpot
  1533. GiEffect 1
  1534. DOF 125, DOFPulse
  1535. LightEffect 2
  1536. FlashEffect 2
  1537. DOF 154, DOFPulse
  1538. End Sub
  1539.  
  1540. Sub AwardDoubleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
  1541. Jackpot = (1000000 + Round(Score(CurrentPlayer) / 10, 0) ) * 2
  1542. DMDBlink "black.jpg", "DOUBLE JACKPOT", Jackpot, 100, 10
  1543. PlaySound "criticalhit"
  1544. AddScore Jackpot
  1545. GiEffect 1
  1546. DOF 125, DOFPulse
  1547. LightEffect 2
  1548. FlashEffect 2
  1549. DOF 154, DOFPulse
  1550. End Sub
  1551.  
  1552. Sub AwardSuperJackpot() 'this is actually a tripple jackpot
  1553. SuperJackpot = (1000000 + Round(Score(CurrentPlayer) / 10, 0) ) * 3
  1554. DMDBlink "black.jpg", "SUPER JACKPOT", SuperJackpot, 100, 10
  1555. PlaySound "criticalhit"
  1556. AddScore SuperJackpot
  1557. GiEffect 1
  1558. DOF 125, DOFPulse
  1559. LightEffect 2
  1560. FlashEffect 2
  1561. DOF 154, DOFPulse
  1562. End Sub
  1563.  
  1564. Sub AwardSkillshot()
  1565. Dim i
  1566. ResetSkillShotTimer_Timer
  1567. 'show dmd animation
  1568. DMDFlush
  1569. Select case SkillShotValue(CurrentPlayer)
  1570. case 1000000
  1571. 'DMD "skillshot1.wmv", " ", " ", 5000
  1572. pupevent 760
  1573. AddScore SkillshotValue(CurrentPLayer)
  1574. case 2000000
  1575. 'DMD "skillshot2.wmv", " ", " ", 5000
  1576. AddScore SkillshotValue(CurrentPLayer)
  1577. pupevent 761
  1578. case 3000000
  1579. 'DMD "skillshot3.wmv", " ", " ", 5000
  1580. pupevent 762
  1581. AddScore SkillshotValue(CurrentPLayer)
  1582. case 4000000
  1583. 'DMD "skillshot4.wmv", " ", " ", 5000
  1584. pupevent 763
  1585. AddScore SkillshotValue(CurrentPLayer)
  1586. case 5000000
  1587. 'DMD "skillshot5.wmv", " ", " ", 5000
  1588. pupevent 764
  1589. AddScore SkillshotValue(CurrentPLayer)
  1590. case ELSE
  1591. 'DMD "skillshot.wmv", " ", " ", 5000
  1592. pupevent 765
  1593. AddScore SkillshotValue(CurrentPLayer)
  1594. End Select
  1595. ' increment the skillshot value with 1 million
  1596. SkillShotValue(CurrentPLayer) = SkillShotValue(CurrentPLayer) + 1000000
  1597. 'do some light show
  1598. GiEffect 1
  1599. DOF 117, DOFPulse
  1600. LightEffect 2
  1601. 'enable the start act/battle by opening the chest door
  1602. DropChestDoor
  1603. End Sub
  1604.  
  1605. Sub Congratulation()
  1606. Dim tmp
  1607. tmp = "vo_congrat" & INT(RND * 21 + 1)
  1608. PlaySound tmp
  1609. End Sub
  1610. '*****************************
  1611. ' Load / Save / Highscore
  1612. '*****************************
  1613.  
  1614. Sub Loadhs
  1615. Dim x
  1616. x = LoadValue(TableName, "HighScore1")
  1617. If(x <> "") Then HighScore(0) = CDbl(x) Else HighScore(0) = 100000 End If
  1618.  
  1619. x = LoadValue(TableName, "HighScore1Name")
  1620. If(x <> "") Then HighScoreName(0) = x Else HighScoreName(0) = "AAA" End If
  1621.  
  1622. x = LoadValue(TableName, "HighScore2")
  1623. If(x <> "") then HighScore(1) = CDbl(x) Else HighScore(1) = 100000 End If
  1624.  
  1625. x = LoadValue(TableName, "HighScore2Name")
  1626. If(x <> "") then HighScoreName(1) = x Else HighScoreName(1) = "BBB" End If
  1627.  
  1628. x = LoadValue(TableName, "HighScore3")
  1629. If(x <> "") then HighScore(2) = CDbl(x) Else HighScore(2) = 100000 End If
  1630.  
  1631. x = LoadValue(TableName, "HighScore3Name")
  1632. If(x <> "") then HighScoreName(2) = x Else HighScoreName(2) = "CCC" End If
  1633.  
  1634. x = LoadValue(TableName, "HighScore4")
  1635. If(x <> "") then HighScore(3) = CDbl(x) Else HighScore(3) = 100000 End If
  1636.  
  1637. x = LoadValue(TableName, "HighScore4Name")
  1638. If(x <> "") then HighScoreName(3) = x Else HighScoreName(3) = "DDD" End If
  1639.  
  1640. x = LoadValue(TableName, "Credits")
  1641. If(x <> "") then Credits = CInt(x):DOF 114, DOFOn:Else Credits = 0 End If
  1642.  
  1643. 'x = LoadValue(TableName, "Jackpot")
  1644. 'If(x <> "") then Jackpot = CDbl(x) Else Jackpot = 200000 End If
  1645. x = LoadValue(TableName, "TotalGamesPlayed")
  1646. If(x <> "") then TotalGamesPlayed = CInt(x) Else TotalGamesPlayed = 0 End If
  1647. End Sub
  1648.  
  1649. Sub Savehs
  1650. SaveValue TableName, "HighScore1", HighScore(0)
  1651. SaveValue TableName, "HighScore1Name", HighScoreName(0)
  1652. SaveValue TableName, "HighScore2", HighScore(1)
  1653. SaveValue TableName, "HighScore2Name", HighScoreName(1)
  1654. SaveValue TableName, "HighScore3", HighScore(2)
  1655. SaveValue TableName, "HighScore3Name", HighScoreName(2)
  1656. SaveValue TableName, "HighScore4", HighScore(3)
  1657. SaveValue TableName, "HighScore4Name", HighScoreName(3)
  1658. SaveValue TableName, "Credits", Credits
  1659. 'SaveValue TableName, "Jackpot", Jackpot
  1660. SaveValue cGameName, "TotalGamesPlayed", TotalGamesPlayed
  1661. End Sub
  1662.  
  1663. ' ***********************************************************
  1664. ' High Score Initals Entry Functions - based on Black's code
  1665. ' ***********************************************************
  1666.  
  1667. Dim hsbModeActive
  1668. Dim hsEnteredName
  1669. Dim hsEnteredDigits(3)
  1670. Dim hsCurrentDigit
  1671. Dim hsValidLetters
  1672. Dim hsCurrentLetter
  1673. Dim hsLetterFlash
  1674.  
  1675. Sub CheckHighscore()
  1676. Dim tmp
  1677. tmp = Score(1)
  1678.  
  1679. If Score(2)> tmp Then tmp = Score(2)
  1680. If Score(3)> tmp Then tmp = Score(3)
  1681. If Score(4)> tmp Then tmp = Score(4)
  1682.  
  1683. If tmp> HighScore(1) Then 'add 1 credit for beating the highscore
  1684. AwardSpecial
  1685. End If
  1686.  
  1687. If tmp> HighScore(3) Then
  1688. vpmtimer.addtimer 2000, "PlaySound ""vo_contratulationsgreatscore"" '"
  1689. HighScore(3) = tmp
  1690. 'enter player's name
  1691. HighScoreEntryInit()
  1692. Else
  1693. EndOfBallComplete()
  1694. End If
  1695. End Sub
  1696.  
  1697. Sub HighScoreEntryInit()
  1698. hsbModeActive = True
  1699. PlaySound "vo_enteryourinitials"
  1700. hsLetterFlash = 0
  1701.  
  1702. hsEnteredDigits(0) = "A"
  1703. hsEnteredDigits(1) = " "
  1704. hsEnteredDigits(2) = " "
  1705. hsCurrentDigit = 0
  1706.  
  1707. hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ<+-0123456789" ' < is used to delete the last letter
  1708. hsCurrentLetter = 1
  1709. DMDFlush
  1710. DMDId "hsc", "black.jpg", "WARRIOR NAME:", " ", 999999
  1711. HighScoreDisplayName()
  1712. End Sub
  1713.  
  1714. Sub EnterHighScoreKey(keycode)
  1715. If keycode = LeftFlipperKey Then
  1716. Playsound "fx_Previous"
  1717. hsCurrentLetter = hsCurrentLetter - 1
  1718. if(hsCurrentLetter = 0) then
  1719. hsCurrentLetter = len(hsValidLetters)
  1720. end if
  1721. HighScoreDisplayName()
  1722. End If
  1723.  
  1724. If keycode = RightFlipperKey Then
  1725. Playsound "fx_Next"
  1726. hsCurrentLetter = hsCurrentLetter + 1
  1727. if(hsCurrentLetter> len(hsValidLetters) ) then
  1728. hsCurrentLetter = 1
  1729. end if
  1730. HighScoreDisplayName()
  1731. End If
  1732.  
  1733. If keycode = StartGameKey OR keycode = PlungerKey Then
  1734. if(mid(hsValidLetters, hsCurrentLetter, 1) <> "<") then
  1735. playsound "fx_Enter"
  1736. hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
  1737. hsCurrentDigit = hsCurrentDigit + 1
  1738. if(hsCurrentDigit = 3) then
  1739. HighScoreCommitName()
  1740. else
  1741. HighScoreDisplayName()
  1742. end if
  1743. else
  1744. playsound "fx_Esc"
  1745. hsEnteredDigits(hsCurrentDigit) = " "
  1746. if(hsCurrentDigit> 0) then
  1747. hsCurrentDigit = hsCurrentDigit - 1
  1748. end if
  1749. HighScoreDisplayName()
  1750. end if
  1751. end if
  1752. End Sub
  1753.  
  1754. Sub HighScoreDisplayName()
  1755. Dim i, TempStr
  1756.  
  1757. TempStr = " >"
  1758. if(hsCurrentDigit> 0) then TempStr = TempStr & hsEnteredDigits(0)
  1759. if(hsCurrentDigit> 1) then TempStr = TempStr & hsEnteredDigits(1)
  1760. if(hsCurrentDigit> 2) then TempStr = TempStr & hsEnteredDigits(2)
  1761.  
  1762. if(hsCurrentDigit <> 3) then
  1763. if(hsLetterFlash <> 0) then
  1764. TempStr = TempStr & "_"
  1765. else
  1766. TempStr = TempStr & mid(hsValidLetters, hsCurrentLetter, 1)
  1767. end if
  1768. end if
  1769.  
  1770. if(hsCurrentDigit <1) then TempStr = TempStr & hsEnteredDigits(1)
  1771. if(hsCurrentDigit <2) then TempStr = TempStr & hsEnteredDigits(2)
  1772.  
  1773. TempStr = TempStr & "< "
  1774. DMDMod "hsc", "WARRIOR NAME:", Mid(TempStr, 2, 5), 999999
  1775. End Sub
  1776.  
  1777. Sub HighScoreCommitName()
  1778. hsbModeActive = False
  1779. 'PlaySong "m_end"
  1780. hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
  1781. if(hsEnteredName = " ") then
  1782. hsEnteredName = "YOU"
  1783. end if
  1784.  
  1785. HighScoreName(3) = hsEnteredName
  1786. SortHighscore
  1787. DMDFlush
  1788. EndOfBallComplete()
  1789. End Sub
  1790.  
  1791. Sub SortHighscore
  1792. Dim tmp, tmp2, i, j
  1793. For i = 0 to 3
  1794. For j = 0 to 2
  1795. If HighScore(j) <HighScore(j + 1) Then
  1796. tmp = HighScore(j + 1)
  1797. tmp2 = HighScoreName(j + 1)
  1798. HighScore(j + 1) = HighScore(j)
  1799. HighScoreName(j + 1) = HighScoreName(j)
  1800. HighScore(j) = tmp
  1801. HighScoreName(j) = tmp2
  1802. End If
  1803. Next
  1804. Next
  1805. End Sub
  1806.  
  1807. '****************************************
  1808. ' Real Time updatess using the GameTimer
  1809. '****************************************
  1810. 'used for all the real time updates
  1811.  
  1812. Sub GameTimer_Timer
  1813. RollingUpdate
  1814. ' add any other real time update subs, like gates or diverters
  1815. End Sub
  1816.  
  1817. '********************************************************************************************
  1818. ' Only for VPX 10.2 and higher.
  1819. ' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  1820. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  1821. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  1822. '********************************************************************************************
  1823.  
  1824. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first version
  1825.  
  1826. If TypeName(MyLight) = "Light" Then
  1827.  
  1828. If FinalState = 2 Then
  1829. FinalState = MyLight.State 'Keep the current light state
  1830. End If
  1831. MyLight.BlinkInterval = BlinkPeriod
  1832. MyLight.Duration 2, TotalPeriod, FinalState
  1833. ElseIf TypeName(MyLight) = "Flasher" Then
  1834.  
  1835. Dim steps
  1836.  
  1837. ' Store all blink information
  1838. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  1839. If FinalState = 2 Then 'Keep the current flasher state
  1840. FinalState = ABS(MyLight.Visible)
  1841. End If
  1842. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  1843.  
  1844. ' Start blink timer and create timer subroutine
  1845. MyLight.TimerInterval = BlinkPeriod
  1846. MyLight.TimerEnabled = 0
  1847. MyLight.TimerEnabled = 1
  1848. 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"
  1849. End If
  1850. End Sub
  1851.  
  1852. '******************************************
  1853. ' Change light color - simulate color leds
  1854. ' changes the light color and state
  1855. ' 10 colors: red, orange, amber, yellow...
  1856. '******************************************
  1857. ' in this table this colors are use to keep track of the progress during the acts and battles
  1858.  
  1859. 'colors
  1860. Dim red, orange, amber, yellow, darkgreen, green, blue, darkblue, purple, white
  1861.  
  1862. red = 10
  1863. orange = 9
  1864. amber = 8
  1865. yellow = 7
  1866. darkgreen = 6
  1867. green = 5
  1868. blue = 4
  1869. darkblue = 3
  1870. purple = 2
  1871. white = 1
  1872.  
  1873. Sub SetLightColor(n, col, stat)
  1874. Select Case col
  1875. Case 0
  1876. n.color = RGB(18, 0, 0)
  1877. n.colorfull = RGB(255, 0, 0)
  1878. Case red
  1879. n.color = RGB(18, 0, 0)
  1880. n.colorfull = RGB(255, 0, 0)
  1881. Case orange
  1882. n.color = RGB(18, 3, 0)
  1883. n.colorfull = RGB(255, 64, 0)
  1884. Case amber
  1885. n.color = RGB(193, 49, 0)
  1886. n.colorfull = RGB(255, 153, 0)
  1887. Case yellow
  1888. n.color = RGB(18, 18, 0)
  1889. n.colorfull = RGB(255, 255, 0)
  1890. Case darkgreen
  1891. n.color = RGB(0, 8, 0)
  1892. n.colorfull = RGB(0, 64, 0)
  1893. Case green
  1894. n.color = RGB(0, 18, 0)
  1895. n.colorfull = RGB(0, 255, 0)
  1896. Case blue
  1897. n.color = RGB(0, 18, 18)
  1898. n.colorfull = RGB(0, 255, 255)
  1899. Case darkblue
  1900. n.color = RGB(0, 8, 8)
  1901. n.colorfull = RGB(0, 64, 64)
  1902. Case purple
  1903. n.color = RGB(128, 0, 128)
  1904. n.colorfull = RGB(255, 0, 255)
  1905. Case white
  1906. n.color = RGB(255, 252, 224)
  1907. n.colorfull = RGB(193, 91, 0)
  1908. Case white
  1909. n.color = RGB(255, 252, 224)
  1910. n.colorfull = RGB(193, 91, 0)
  1911. End Select
  1912. If stat <> -1 Then
  1913. n.State = 0
  1914. n.State = stat
  1915. End If
  1916. End Sub
  1917.  
  1918. Sub ResetAllLightsColor ' Called at a new game
  1919. 'shoot again
  1920. SetLightColor LightShootAgain, amber, -1
  1921. ' bonus
  1922. SetLightColor l2, yellow, -1
  1923. SetLightColor l3, yellow, -1
  1924. SetLightColor l4, yellow, -1
  1925. SetLightColor l5, yellow, -1
  1926. ' Acts
  1927. SetLightColor l7, red, -1
  1928. SetLightColor l8, red, -1
  1929. SetLightColor l10, red, -1
  1930. SetLightColor l12, red, -1
  1931. SetLightColor l13, red, -1
  1932. ' Lords
  1933. SetLightColor l6, red, -1
  1934. SetLightColor l9, red, -1
  1935. SetLightColor l11, red, -1
  1936. SetLightColor l14, red, -1
  1937. SetLightColor l47, red, -1
  1938. ' flipper lanes
  1939. SetLightColor l15, orange, -1
  1940. SetLightColor l16, orange, -1
  1941. SetLightColor l17, orange, -1
  1942. SetLightColor l18, orange, -1
  1943. SetLightColor l19, orange, -1
  1944. ' bash
  1945. SetLightColor l28, blue, -1
  1946. SetLightColor l29, blue, -1
  1947. SetLightColor l30, blue, -1
  1948. SetLightColor l31, blue, -1
  1949. ' skill
  1950. SetLightColor l35, yellow, -1
  1951. SetLightColor l36, yellow, -1
  1952. SetLightColor l37, yellow, -1
  1953. SetLightColor l40, yellow, -1
  1954. SetLightColor l41, yellow, -1
  1955. ' life - extra ball
  1956. SetLightColor l23, purple, -1
  1957. SetLightColor l24, purple, -1
  1958. SetLightColor l25, purple, -1
  1959. SetLightColor l26, purple, -1
  1960. SetLightColor l27, purple, -1
  1961. ' attack arrows
  1962. SetLightColor l32, green, -1
  1963. SetLightColor l33, green, -1
  1964. SetLightColor l34, green, -1
  1965. SetLightColor l38, green, -1
  1966. SetLightColor l39, green, -1
  1967. ' critical - jackpot
  1968. SetLightColor l42, red, -1
  1969. SetLightColor l43, red, -1
  1970. SetLightColor l44, green, -1
  1971. SetLightColor l45, red, -1
  1972. SetLightColor l46, red, -1
  1973. ' level
  1974. SetLightColor l20, orange, -1
  1975. SetLightColor l21, orange, -1
  1976. SetLightColor l22, orange, -1
  1977. End Sub
  1978.  
  1979. Sub UpdateBonusColors
  1980. End Sub
  1981.  
  1982. '*************************
  1983. ' Rainbow Changing Lights
  1984. '*************************
  1985.  
  1986. Dim RGBStep, RGBFactor, rRed, rGreen, rBlue, RainbowLights
  1987.  
  1988. Sub StartRainbow(n)
  1989. set RainbowLights = n
  1990. RGBStep = 0
  1991. RGBFactor = 5
  1992. rRed = 255
  1993. rGreen = 0
  1994. rBlue = 0
  1995. RainbowTimer.Enabled = 1
  1996. End Sub
  1997.  
  1998. Sub StopRainbow()
  1999. Dim obj
  2000. RainbowTimer.Enabled = 0
  2001. RainbowTimer.Enabled = 0
  2002. End Sub
  2003.  
  2004. Sub RainbowTimer_Timer 'rainbow led light color changing
  2005. Dim obj
  2006. Select Case RGBStep
  2007. Case 0 'Green
  2008. rGreen = rGreen + RGBFactor
  2009. If rGreen> 255 then
  2010. rGreen = 255
  2011. RGBStep = 1
  2012. End If
  2013. Case 1 'Red
  2014. rRed = rRed - RGBFactor
  2015. If rRed <0 then
  2016. rRed = 0
  2017. RGBStep = 2
  2018. End If
  2019. Case 2 'Blue
  2020. rBlue = rBlue + RGBFactor
  2021. If rBlue> 255 then
  2022. rBlue = 255
  2023. RGBStep = 3
  2024. End If
  2025. Case 3 'Green
  2026. rGreen = rGreen - RGBFactor
  2027. If rGreen <0 then
  2028. rGreen = 0
  2029. RGBStep = 4
  2030. End If
  2031. Case 4 'Red
  2032. rRed = rRed + RGBFactor
  2033. If rRed> 255 then
  2034. rRed = 255
  2035. RGBStep = 5
  2036. End If
  2037. Case 5 'Blue
  2038. rBlue = rBlue - RGBFactor
  2039. If rBlue <0 then
  2040. rBlue = 0
  2041. RGBStep = 0
  2042. End If
  2043. End Select
  2044. For each obj in RainbowLights
  2045. obj.color = RGB(rRed \ 10, rGreen \ 10, rBlue \ 10)
  2046. obj.colorfull = RGB(rRed, rGreen, rBlue)
  2047. Next
  2048. End Sub
  2049.  
  2050. '***********************************************************************************
  2051. ' JPS DMD - very simple DMD routines using UltraDMD
  2052. '***********************************************************************************
  2053.  
  2054. Dim UltraDMD
  2055.  
  2056. ' DMD using UltraDMD calls
  2057.  
  2058. Sub DMD(background, toptext, bottomtext, duration)
  2059. UltraDMD.DisplayScene00 background, toptext, 15, bottomtext, 15, 14, duration, 14
  2060. UltraDMDScoreTimer.Enabled = 1 'to show the score after the animation/message
  2061. End Sub
  2062.  
  2063. Sub DMDBlink(background, toptext, bottomtext, duration, nblinks) 'blinks the lower text nblinks times
  2064. Dim i
  2065. For i = 1 to nblinks
  2066. UltraDMD.DisplayScene00 background, toptext, 15, bottomtext, 15, 14, duration, 14
  2067. Next
  2068.  
  2069. UltraDMDScoreTimer.Enabled = 1 'to show the score after the animation/message
  2070. End Sub
  2071.  
  2072. Sub DMDScore
  2073. If NOT UltraDMD.IsRendering Then
  2074. UltraDMD.SetScoreboardBackgroundImage "scoreboard-background.jpg", 15, 7
  2075. Select case Mode(0)
  2076. Case 0, 11 'no mode is active, then show the 4 players, current player, Level and ball number
  2077. UltraDMD.SetScoreboardBackgroundImage "scoreboard-background.jpg", 15, 7
  2078. UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "Warrior " & CurrentPlayer & " Level " & Level(CurrentPlayer), "Ball " & Balls
  2079. Case 1, 3, 5, 7, 9 'during acts, show the 4 players, player number, Level and number of Monsters hit and the total number of Monsters
  2080. UltraDMD.SetScoreboardBackgroundImage "scoreboard-background.jpg", 15, 7
  2081. UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "Warrior " & CurrentPlayer & " Level " & Level(CurrentPlayer), "Act " & MonsterHits & "/" & MonsterTotal
  2082. Case 2 'during monster battles show the monsters life and the score
  2083. UltraDMD.SetScoreboardBackgroundImage Butcher(ColorCode), 15, 7
  2084. UltraDMD.DisplayScoreboard 2, 1, Score(CurrentPlayer), LordStrength, 0, 0, "", ""
  2085. Case 4 'during monster battles show the monsters life and the score
  2086. UltraDMD.SetScoreboardBackgroundImage Belial(ColorCode), 15, 7
  2087. UltraDMD.DisplayScoreboard 2, 1, Score(CurrentPlayer), LordStrength, 0, 0, "", ""
  2088. Case 6 'during monster battles show the monsters life and the score
  2089. UltraDMD.SetScoreboardBackgroundImage Azmodan(ColorCode), 15, 7
  2090. UltraDMD.DisplayScoreboard 2, 1, Score(CurrentPlayer), LordStrength, 0, 0, "", ""
  2091. Case 8 'during monster battles show the monsters life and the score
  2092. UltraDMD.SetScoreboardBackgroundImage Diablo(ColorCode), 15, 7
  2093. UltraDMD.DisplayScoreboard 2, 1, Score(CurrentPlayer), LordStrength, 0, 0, "", ""
  2094. Case 10 'during monster battles show the monsters life and the score
  2095. UltraDMD.SetScoreboardBackgroundImage Malthael(ColorCode), 15, 7
  2096. UltraDMD.DisplayScoreboard 2, 1, Score(CurrentPlayer), LordStrength, 0, 0, "", ""
  2097. End Select
  2098. Else
  2099. UltraDMDScoreTimer.Enabled = 1
  2100. End If
  2101. End Sub
  2102.  
  2103. Sub DMDScoreNow
  2104. DMDFlush
  2105. DMDScore
  2106. End Sub
  2107.  
  2108. Sub DMDFLush
  2109. UltraDMDTimer.Enabled = 0
  2110. UltraDMDScoreTimer.Enabled = 0
  2111. UltraDMD.CancelRendering
  2112. UltraDMD.Clear
  2113. End Sub
  2114.  
  2115. Sub DMDScrollCredits(background, text, duration)
  2116. UltraDMD.ScrollingCredits background, text, 15, 14, duration, 14
  2117. End Sub
  2118.  
  2119. Sub DMDId(id, background, toptext, bottomtext, duration)
  2120. UltraDMD.DisplayScene00ExwithID id, False, background, toptext, 15, 0, bottomtext, 15, 0, 14, duration, 14
  2121. End Sub
  2122.  
  2123. Sub DMDMod(id, toptext, bottomtext, duration)
  2124. UltraDMD.ModifyScene00Ex id, toptext, bottomtext, duration
  2125. End Sub
  2126.  
  2127. Sub UltraDMDTimer_Timer() 'used for repeating the attrack mode and the instant info.
  2128. If bInstantInfo Then
  2129. InstantInfo
  2130. ElseIf bAttractMode Then
  2131. ShowTableInfo
  2132. End If
  2133. End Sub
  2134.  
  2135. Sub UltraDMDScoreTimer_Timer()
  2136. If NOT UltraDMD.IsRendering Then
  2137. DMDScoreNow
  2138. End If
  2139. End Sub
  2140.  
  2141. Dim Butcher, Belial, Azmodan, Diablo, Malthael
  2142. Butcher = Array("butch-0.jpg", "butch-10.jpg", "butch-20.jpg", "butch-30.jpg", "butch-40.jpg", "butch-50.jpg", "butch-60.jpg", "butch-70.jpg", "butch-80.jpg", "butch-90.jpg", "butch-100.jpg")
  2143. Belial = Array("bel-0.jpg", "bel-10.jpg", "bel-20.jpg", "bel-30.jpg", "bel-40.jpg", "bel-50.jpg", "bel-60.jpg", "bel-70.jpg", "bel-80.jpg", "bel-90.jpg", "bel-100.jpg")
  2144. Azmodan = Array("az-0.jpg", "az-10.jpg", "az-20.jpg", "az-30.jpg", "az-40.jpg", "az-50.jpg", "az-60.jpg", "az-70.jpg", "az-80.jpg", "az-90.jpg", "az-100.jpg")
  2145. Diablo = Array("dia-0.jpg", "dia-10.jpg", "dia-20.jpg", "dia-30.jpg", "dia-40.jpg", "dia-50.jpg", "dia-60.jpg", "dia-70.jpg", "dia-80.jpg", "dia-90.jpg", "dia-100.jpg")
  2146. Malthael = Array("mal-0.jpg", "mal-10.jpg", "mal-20.jpg", "mal-30.jpg", "mal-40.jpg", "mal-50.jpg", "mal-60.jpg", "mal-70.jpg", "mal-80.jpg", "mal-90.jpg", "mal-100.jpg")
  2147.  
  2148. Sub DMD_Init
  2149. Set UltraDMD = CreateObject("UltraDMD.DMDObject")
  2150. If UltraDMD is Nothing Then
  2151. MsgBox "No UltraDMD found. This table will NOT run without it."
  2152. Exit Sub
  2153. End If
  2154.  
  2155. UltraDMD.Init
  2156. If Not UltraDMD.GetMajorVersion = 1 Then
  2157. MsgBox "Incompatible Version of UltraDMD found."
  2158. Exit Sub
  2159. End If
  2160.  
  2161. If UltraDMD.GetMinorVersion <1 Then
  2162. MsgBox "Incompatible Version of UltraDMD found. Please update to version 1.1 or newer."
  2163. Exit Sub
  2164. End If
  2165.  
  2166. Dim fso:Set fso = CreateObject("Scripting.FileSystemObject")
  2167. Dim curDir:curDir = fso.GetAbsolutePathName(".")
  2168.  
  2169. Dim DirName
  2170. DirName = curDir& "\" &TableName& ".UltraDMD"
  2171.  
  2172. If Not fso.FolderExists(DirName) Then _
  2173. Msgbox "UltraDMD userfiles directory '" & DirName & "' does not exist." & CHR(13) & "No graphic images will be displayed on the DMD"
  2174. UltraDMD.SetProjectFolder DirName
  2175.  
  2176. ' wait for the animation to end
  2177. While UltraDMD.IsRendering = True
  2178. WEnd
  2179.  
  2180. ' Show ROM version number
  2181. DMD "black.jpg", "MANOWAR", "ROM VERS " &myVersion, 1000
  2182. End Sub
  2183.  
  2184. ' ********************************
  2185. ' Table info & Attract Mode
  2186. ' ********************************
  2187.  
  2188. Sub ShowTableInfo
  2189. Dim i
  2190. 'info goes in a loop only stopped by the credits and the startkey
  2191. If Score(1) Then
  2192. DMD "black.jpg", "WARRIOR 1", Score(1), 3000
  2193. End If
  2194. If Score(2) Then
  2195. DMD "black.jpg", "WARRIOR 2", Score(2), 3000
  2196. End If
  2197. If Score(3) Then
  2198. DMD "black.jpg", "WARRIOR 3", Score(3), 3000
  2199. End If
  2200. If Score(4) Then
  2201. DMD "black.jpg", "WARRIOR 4", Score(4), 3000
  2202. End If
  2203.  
  2204. 'coins or freeplay
  2205. If bFreePlay Then
  2206. DMD "black.jpg", " ", "FREE PLAY", 2000
  2207. DMD "intro-freeplay.wmv", "", "", 63000
  2208. Else
  2209. If Credits> 0 Then
  2210. DMD "black.jpg", "CREDITS " &credits, "PRESS START", 2000
  2211. Else
  2212. DMD "black.jpg", "CREDITS " &credits, "INSERT COIN", 2000
  2213. End If
  2214. DMD "intro-coins.wmv", "", "", 65000
  2215. End If
  2216.  
  2217. DMD "black.jpg", "HIGHSCORES", "1> " & HighScoreName(0) & " " & FormatNumber(HighScore(0), 0, , , -1), 3000
  2218. DMD "black.jpg", "HIGHSCORES", "2> " & HighScoreName(1) & " " & FormatNumber(HighScore(1), 0, , , -1), 3000
  2219. DMD "black.jpg", "HIGHSCORES", "3> " & HighScoreName(2) & " " & FormatNumber(HighScore(2), 0, , , -1), 3000
  2220. DMD "black.jpg", "HIGHSCORES", "4> " & HighScoreName(3) & " " & FormatNumber(HighScore(3), 0, , , -1), 3000
  2221. End Sub
  2222.  
  2223. Sub StartAttractMode()
  2224. bAttractMode = True
  2225. UltraDMDTimer.Enabled = 1
  2226. StartLightSeq
  2227. ShowTableInfo
  2228. StartRainbow aLights
  2229. pupevent 770
  2230. End Sub
  2231.  
  2232. Sub StopAttractMode()
  2233. bAttractMode = False
  2234. DMDScoreNow
  2235. LightSeqAttract.StopPlay
  2236. LightSeqFlasher.StopPlay
  2237. StopRainbow
  2238. ResetAllLightsColor
  2239. pupevent 771
  2240. 'StopSong
  2241. End Sub
  2242.  
  2243. Sub StartLightSeq()
  2244. 'lights sequences
  2245. LightSeqFlasher.UpdateInterval = 150
  2246. LightSeqFlasher.Play SeqRandom, 10, , 50000
  2247. LightSeqAttract.UpdateInterval = 25
  2248. LightSeqAttract.Play SeqBlinking, , 5, 150
  2249. LightSeqAttract.Play SeqRandom, 40, , 4000
  2250. LightSeqAttract.Play SeqAllOff
  2251. LightSeqAttract.UpdateInterval = 8
  2252. LightSeqAttract.Play SeqUpOn, 50, 1
  2253. LightSeqAttract.UpdateInterval = 8
  2254. LightSeqAttract.Play SeqDownOn, 25, 1
  2255. LightSeqAttract.UpdateInterval = 8
  2256. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2257. LightSeqAttract.UpdateInterval = 8
  2258. LightSeqAttract.Play SeqUpOn, 25, 1
  2259. LightSeqAttract.UpdateInterval = 8
  2260. LightSeqAttract.Play SeqDownOn, 25, 1
  2261. LightSeqAttract.UpdateInterval = 8
  2262. LightSeqAttract.Play SeqUpOn, 25, 1
  2263. LightSeqAttract.UpdateInterval = 8
  2264. LightSeqAttract.Play SeqDownOn, 25, 1
  2265. LightSeqAttract.UpdateInterval = 10
  2266. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2267. LightSeqAttract.UpdateInterval = 5
  2268. LightSeqAttract.Play SeqRightOn, 50, 1
  2269. LightSeqAttract.UpdateInterval = 5
  2270. LightSeqAttract.Play SeqLeftOn, 50, 1
  2271. LightSeqAttract.UpdateInterval = 8
  2272. LightSeqAttract.Play SeqRightOn, 50, 1
  2273. LightSeqAttract.UpdateInterval = 8
  2274. LightSeqAttract.Play SeqLeftOn, 50, 1
  2275. LightSeqAttract.UpdateInterval = 8
  2276. LightSeqAttract.Play SeqRightOn, 40, 1
  2277. LightSeqAttract.UpdateInterval = 8
  2278. LightSeqAttract.Play SeqLeftOn, 40, 1
  2279. LightSeqAttract.UpdateInterval = 10
  2280. LightSeqAttract.Play SeqRightOn, 30, 1
  2281. LightSeqAttract.UpdateInterval = 10
  2282. LightSeqAttract.Play SeqLeftOn, 30, 1
  2283. LightSeqAttract.UpdateInterval = 8
  2284. LightSeqAttract.Play SeqRightOn, 25, 1
  2285. LightSeqAttract.UpdateInterval = 8
  2286. LightSeqAttract.Play SeqLeftOn, 25, 1
  2287. LightSeqAttract.UpdateInterval = 8
  2288. LightSeqAttract.Play SeqRightOn, 15, 1
  2289. LightSeqAttract.UpdateInterval = 8
  2290. LightSeqAttract.Play SeqLeftOn, 15, 1
  2291. LightSeqAttract.UpdateInterval = 10
  2292. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2293. LightSeqAttract.UpdateInterval = 8
  2294. LightSeqAttract.Play SeqLeftOn, 25, 1
  2295. LightSeqAttract.UpdateInterval = 8
  2296. LightSeqAttract.Play SeqRightOn, 25, 1
  2297. LightSeqAttract.UpdateInterval = 8
  2298. LightSeqAttract.Play SeqLeftOn, 25, 1
  2299. LightSeqAttract.UpdateInterval = 8
  2300. LightSeqAttract.Play SeqUpOn, 25, 1
  2301. LightSeqAttract.UpdateInterval = 8
  2302. LightSeqAttract.Play SeqDownOn, 25, 1
  2303. LightSeqAttract.UpdateInterval = 8
  2304. LightSeqAttract.Play SeqUpOn, 25, 1
  2305. LightSeqAttract.UpdateInterval = 8
  2306. LightSeqAttract.Play SeqDownOn, 25, 1
  2307. LightSeqAttract.UpdateInterval = 5
  2308. LightSeqAttract.Play SeqStripe1VertOn, 50, 2
  2309. LightSeqAttract.UpdateInterval = 8
  2310. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2311. LightSeqAttract.UpdateInterval = 8
  2312. LightSeqAttract.Play SeqStripe1VertOn, 50, 3
  2313. LightSeqAttract.UpdateInterval = 8
  2314. LightSeqAttract.Play SeqLeftOn, 25, 1
  2315. LightSeqAttract.UpdateInterval = 8
  2316. LightSeqAttract.Play SeqRightOn, 25, 1
  2317. LightSeqAttract.UpdateInterval = 8
  2318. LightSeqAttract.Play SeqLeftOn, 25, 1
  2319. LightSeqAttract.UpdateInterval = 8
  2320. LightSeqAttract.Play SeqUpOn, 25, 1
  2321. LightSeqAttract.UpdateInterval = 8
  2322. LightSeqAttract.Play SeqDownOn, 25, 1
  2323. LightSeqAttract.UpdateInterval = 8
  2324. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2325. LightSeqAttract.UpdateInterval = 8
  2326. LightSeqAttract.Play SeqStripe2VertOn, 50, 3
  2327. LightSeqAttract.UpdateInterval = 8
  2328. LightSeqAttract.Play SeqLeftOn, 25, 1
  2329. LightSeqAttract.UpdateInterval = 8
  2330. LightSeqAttract.Play SeqRightOn, 25, 1
  2331. LightSeqAttract.UpdateInterval = 8
  2332. LightSeqAttract.Play SeqLeftOn, 25, 1
  2333. LightSeqAttract.UpdateInterval = 8
  2334. LightSeqAttract.Play SeqUpOn, 25, 1
  2335. LightSeqAttract.UpdateInterval = 8
  2336. LightSeqAttract.Play SeqDownOn, 25, 1
  2337. LightSeqAttract.UpdateInterval = 8
  2338. LightSeqAttract.Play SeqUpOn, 25, 1
  2339. LightSeqAttract.UpdateInterval = 8
  2340. LightSeqAttract.Play SeqDownOn, 25, 1
  2341. LightSeqAttract.UpdateInterval = 8
  2342. LightSeqAttract.Play SeqStripe1VertOn, 25, 3
  2343. LightSeqAttract.UpdateInterval = 8
  2344. LightSeqAttract.Play SeqStripe2VertOn, 25, 3
  2345. LightSeqAttract.UpdateInterval = 8
  2346. LightSeqAttract.Play SeqUpOn, 15, 1
  2347. LightSeqAttract.UpdateInterval = 8
  2348. LightSeqAttract.Play SeqDownOn, 15, 1
  2349. LightSeqAttract.UpdateInterval = 8
  2350. LightSeqAttract.Play SeqUpOn, 15, 1
  2351. LightSeqAttract.UpdateInterval = 8
  2352. LightSeqAttract.Play SeqDownOn, 15, 1
  2353. LightSeqAttract.UpdateInterval = 8
  2354. LightSeqAttract.Play SeqUpOn, 15, 1
  2355. LightSeqAttract.UpdateInterval = 8
  2356. LightSeqAttract.Play SeqDownOn, 15, 1
  2357. LightSeqAttract.UpdateInterval = 8
  2358. LightSeqAttract.Play SeqRightOn, 15, 1
  2359. LightSeqAttract.UpdateInterval = 8
  2360. LightSeqAttract.Play SeqLeftOn, 15, 1
  2361. LightSeqAttract.UpdateInterval = 8
  2362. LightSeqAttract.Play SeqRightOn, 15, 1
  2363. LightSeqAttract.UpdateInterval = 8
  2364. LightSeqAttract.Play SeqLeftOn, 15, 1
  2365. End Sub
  2366.  
  2367. Sub LightSeqAttract_PlayDone()
  2368. StartLightSeq()
  2369. End Sub
  2370.  
  2371. Sub LightSeqTilt_PlayDone()
  2372. LightSeqTilt.Play SeqAllOff
  2373. End Sub
  2374.  
  2375. Sub LightSeqSkillshot_PlayDone()
  2376. LightSeqSkillshot.Play SeqAllOff
  2377. End Sub
  2378.  
  2379. '***********************************************************************
  2380. ' *********************************************************************
  2381. ' Table Specific Script Starts Here
  2382. ' *********************************************************************
  2383. '***********************************************************************
  2384.  
  2385. ' droptargets, animations, etc
  2386. Sub VPObjects_Init
  2387.  
  2388. End Sub
  2389.  
  2390. ' tables variables and Mode init
  2391. Dim Level(4)
  2392. Dim demons(4)
  2393. Dim monsters(4)
  2394. Dim LaneBonus
  2395. Dim TargetBonus
  2396. Dim RampBonus
  2397. Dim OrbitHits
  2398. Dim MonsterHits
  2399. Dim MonsterTotal
  2400. Dim bActReady
  2401. Dim LordStrength
  2402. Dim LordLifeStep
  2403. Dim LordLifeInterval
  2404. Dim bBumperFrenzy
  2405. Dim BumperValue(4)
  2406. Dim SecondRound
  2407. Dim bJackpot
  2408. Dim ComboValue
  2409.  
  2410. Sub Game_Init() 'called at the start of a new game
  2411. Dim i
  2412. bExtraBallWonThisBall = False
  2413. TurnOffPlayfieldLights()
  2414. 'Play some Music
  2415. PlaySong "mu_main"
  2416. 'Init Variables
  2417. For i = 0 to 4
  2418. Level(i) = 0
  2419. demons(i) = 0
  2420. monsters(i) = 0
  2421. SkillshotValue(i) = 1000000 ' increases by 1000000 each time it is collected
  2422. Next
  2423.  
  2424. LaneBonus = 0 'it gets deleted when a new ball is launched
  2425. TargetBonus = 0
  2426. RampBonus = 0
  2427. OrbitHits = 0
  2428. MonsterHits = 0
  2429. MonsterTotal = 15
  2430. bActReady = False
  2431. LordStrength = 100
  2432. LordLifeStep = 1
  2433. LordLifeInterval = 10000
  2434. BumperValue(1) = 150
  2435. BumperValue(2) = 150
  2436. BumperValue(3) = 150
  2437. BumperValue(4) = 150
  2438. bBumperFrenzy = False
  2439. SecondRound = 1
  2440. bJackpot = False
  2441. ComboValue = 0
  2442. 'Init Delays/Timers
  2443. 'PlayQuote.Enabled = 1
  2444. 'MainMode Init()
  2445. For i = 0 to 10
  2446. Mode(i) = 0
  2447. Next
  2448. 'Init lights
  2449. End Sub
  2450.  
  2451. Sub StopEndOfBallMode() 'this sub is called after the last ball is drained
  2452. ResetSkillShotTimer_Timer
  2453. If Mode(0) Then StopMode Mode(0) 'a mode is active so stop it
  2454. Gate1.Open = False 'close the top gates
  2455. Gate2.Open = False
  2456. StopBumperFrenzy
  2457. ResetChestDoor
  2458. MalthaelAttackTimer.Enabled = 0
  2459. StopJackpots
  2460. End Sub
  2461.  
  2462. Sub ResetNewBallVariables() 'reset variables for a new ball or player
  2463. LaneBonus = 0
  2464. TargetBonus = 0
  2465. RampBonus = 0
  2466. OrbitHits = 0
  2467. MalthaelAttackTimer.Enabled = 1
  2468. End Sub
  2469.  
  2470. Sub ResetNewBallLights() 'turn on or off the needed lights before a new ball is released
  2471. 'top Level lights
  2472. l20.State = 0
  2473. l21.State = 0
  2474. l22.State = 0
  2475. SetLightColor bumperLight1, white, 0
  2476. SetLightColor bumperLight1a, white, 0
  2477. SetLightColor bumperLight2, white, 0
  2478. SetLightColor bumperLight2a, white, 0
  2479. SetLightColor bumperLight3, white, 0
  2480. SetLightColor bumperLight3a, white, 0
  2481. End Sub
  2482.  
  2483. Sub TurnOffPlayfieldLights()
  2484. Dim a
  2485. For each a in aLights
  2486. a.State = 0
  2487. Next
  2488. End Sub
  2489.  
  2490. Sub UpdateSkillShot() 'Updates the skillshot light
  2491. LightSeqSkillshot.Play SeqAllOff
  2492. l21.State = 2
  2493. 'DMDFlush
  2494. End Sub
  2495.  
  2496. Sub SkillshotOff_Hit 'trigger to stop the skillshot due to a weak plunger shot
  2497. If bSkillShotReady Then
  2498. ResetSkillShotTimer_Timer
  2499. End If
  2500. End Sub
  2501.  
  2502. Sub ResetSkillShotTimer_Timer 'timer to reset the skillshot lights & variables
  2503. ResetSkillShotTimer.Enabled = 0
  2504. bSkillShotReady = False
  2505. LightSeqSkillshot.StopPlay
  2506. If l21.State = 2 Then l21.State = 0
  2507. SetLightColor l34, blue, 2 'enable the start act/battle at the chest after the skillshot
  2508. bActReady = True
  2509. 'DMDScoreNow
  2510. End Sub
  2511.  
  2512. '**********
  2513. ' Jackpots
  2514. '**********
  2515. ' One of the red arrows blinks, hit it for a Jackpot
  2516.  
  2517. Sub StartJackpots
  2518. JackpotTimerExpired.Enabled = 1
  2519. ' always start the jackpot with the left ramp & right ramp
  2520. SetLightColor l43, red, 2
  2521. SetLightColor l45, red, 2
  2522. bJackpot = true
  2523. End Sub
  2524.  
  2525. Sub StopJackpots
  2526. JackpotTimerExpired.Enabled = 0
  2527. l42.State = 0
  2528. l43.State = 0
  2529. l45.State = 0
  2530. l46.State = 0
  2531. bJackpot = False
  2532. End Sub
  2533.  
  2534. Sub JackpotTimerExpired_Timer
  2535. StopJackpots
  2536. End Sub
  2537.  
  2538. ' *********************************************************************
  2539. ' Table Object Hit Events
  2540. '
  2541. ' Any target hit Sub will follow this:
  2542. ' - play a sound
  2543. ' - do some physical movement
  2544. ' - add a score, bonus
  2545. ' - check some variables/Mode this trigger is a member of
  2546. ' - set the "LastSwitchHit" variable in case it is needed later
  2547. ' *********************************************************************
  2548.  
  2549. ' Slingshots has been hit
  2550.  
  2551. Dim LStep, RStep
  2552.  
  2553. Sub LeftSlingShot_Slingshot
  2554. If Tilted Then Exit Sub
  2555. PlaySound SoundFXDOF("fx_slingshot", 103, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
  2556. DOF 104, DOFPulse
  2557. LeftSling4.Visible = 1
  2558. Lemk.RotX = 26
  2559. LStep = 0
  2560. DragonLS.RotZ = -15
  2561. LeftSlingShot.TimerEnabled = True
  2562. ' add some points
  2563. AddScore 110
  2564. ' add some effect to the table?
  2565. 'FlashForMs l20, 1000, 50, 0:FlashForMs l20f, 1000, 50, 0
  2566. 'FlashForMs l21, 1000, 50, 0:FlashForMs l21f, 1000, 50, 0
  2567. ' remember last trigger hit by the ball
  2568. LastSwitchHit = "LeftSlingShot"
  2569. End Sub
  2570.  
  2571. Sub LeftSlingShot_Timer
  2572. Select Case LStep
  2573. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14:dragonLS.RotZ = -10
  2574. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2:dragonLS.RotZ = -5
  2575. Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -10:dragonLS.RotZ = 0:LeftSlingShot.TimerEnabled = 0
  2576. End Select
  2577.  
  2578. LStep = LStep + 1
  2579. End Sub
  2580.  
  2581. Sub RightSlingShot_Slingshot
  2582. If Tilted Then Exit Sub
  2583. PlaySound SoundFXDOF("fx_slingshot", 105, DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
  2584. DOF 106, DOFPulse
  2585. RightSling4.Visible = 1
  2586. Remk.RotX = 26
  2587. RStep = 0
  2588. DragonRS.RotZ = -15
  2589. RightSlingShot.TimerEnabled = True
  2590. ' add some points
  2591. AddScore 110
  2592. ' add some effect to the table?
  2593. 'FlashForMs l22, 1000, 50, 0:FlashForMs l22f, 1000, 50, 0
  2594. 'FlashForMs l23, 1000, 50, 0:FlashForMs l23f, 1000, 50, 0
  2595. ' remember last trigger hit by the ball
  2596. LastSwitchHit = "RightSlingShot"
  2597. End Sub
  2598.  
  2599. Sub RightSlingShot_Timer
  2600. Select Case RStep
  2601. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14:dragonRS.RotZ = -10
  2602. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2:dragonRS.RotZ = -5
  2603. Case 3:RightSLing2.Visible = 0:Remk.RotX = -10:dragonRS.RotZ = 0:RightSlingShot.TimerEnabled = 0
  2604. End Select
  2605.  
  2606. RStep = RStep + 1
  2607. End Sub
  2608.  
  2609. '*********
  2610. ' Bumpers
  2611. '*********
  2612.  
  2613. Sub Bumper1_Hit
  2614. If NOT Tilted Then
  2615. PlaySound SoundFXDOF("fx_Bumper",107,DOFPulse,DOFContactors)
  2616. DOF 129, DOFPulse
  2617. PlaySound "di_sword1"
  2618. ' add some points
  2619. If bBumperFrenzy Then
  2620. AddScore BumperValue(CurrentPLayer) * 50
  2621. Else
  2622. AddScore BumperValue(CurrentPLayer) + 1000 * BumperLight1.State ' during the Butcher's fight they will score double (the lights are blinking, so the light.State has a value of 2)
  2623. End If
  2624. ' remember last trigger hit by the ball
  2625. LastSwitchHit = "Bumper1"
  2626. If Mode(0) = 2 Then
  2627. LordStrength = LordStrength - 1 - Level(CurrentPLayer)
  2628. FlashEffect 2
  2629. DOF 154, DOFPulse
  2630. CheckLordStrength
  2631. ' Restart the Lords life restore timer
  2632. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  2633. RestartLordLifeTimer
  2634. End If
  2635. End If
  2636. End Sub
  2637.  
  2638. Sub Bumper2_Hit
  2639. If NOT Tilted Then
  2640. PlaySound SoundFXDOF("fx_Bumper",108,DOFPulse,DOFContactors)
  2641. DOF 130, DOFPulse
  2642. PlaySound "di_sword2"
  2643. ' add some points
  2644. If bBumperFrenzy Then
  2645. AddScore BumperValue(CurrentPLayer) * 50
  2646. Else
  2647. AddScore BumperValue(CurrentPLayer) + 1000 * BumperLight1.State ' during the Butcher's fight they will score double (the lights are blinking, so the light.State has a value of 2)
  2648. End If
  2649. ' remember last trigger hit by the ball
  2650. LastSwitchHit = "Bumper2"
  2651. If Mode(0) = 2 Then
  2652. LordStrength = LordStrength - 1 - Level(CurrentPLayer)
  2653. FlashEffect 2
  2654. DOF 154, DOFPulse
  2655. CheckLordStrength
  2656. ' Restart the Lords life restore timer
  2657. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  2658. RestartLordLifeTimer
  2659. End If
  2660. End If
  2661. End Sub
  2662.  
  2663. Sub Bumper3_Hit
  2664. If NOT Tilted Then
  2665. PlaySound SoundFXDOF("fx_Bumper",109,DOFPulse,DOFContactors)
  2666. DOF 131, DOFPulse
  2667. PlaySound "di_sword3"
  2668. ' add some points
  2669. If bBumperFrenzy Then
  2670. AddScore BumperValue(CurrentPLayer) * 50
  2671. Else
  2672. AddScore BumperValue(CurrentPLayer) + 1000 * BumperLight1.State ' during the Butcher's fight they will score double (the lights are blinking, so the light.State has a value of 2)
  2673. End If
  2674. ' remember last trigger hit by the ball
  2675. LastSwitchHit = "Bumper3"
  2676. If Mode(0) = 2 Then
  2677. LordStrength = LordStrength - 1 - Level(CurrentPLayer)
  2678. FlashEffect 2
  2679. DOF 154, DOFPulse
  2680. CheckLordStrength
  2681. ' Restart the Lords life restore timer
  2682. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  2683. RestartLordLifeTimer
  2684. End If
  2685. End If
  2686. End Sub
  2687.  
  2688. Sub Bumper4_Hit
  2689. If NOT Tilted Then
  2690. PlaySound "fx_Bumper"
  2691. PlaySound "di_sword3"
  2692. ' add some points
  2693. If bBumperFrenzy Then
  2694. AddScore BumperValue(CurrentPLayer) * 50
  2695. Else
  2696. AddScore BumperValue(CurrentPLayer) + 1000 * BumperLight1.State ' during the Butcher's fight they will score double (the lights are blinking, so the light.State has a value of 2)
  2697. End If
  2698. ' remember last trigger hit by the ball
  2699. LastSwitchHit = "Bumper4"
  2700. If Mode(0) = 2 Then
  2701. LordStrength = LordStrength - 1 - Level(CurrentPLayer)
  2702. FlashEffect 2
  2703. DOF 154, DOFPulse
  2704. CheckLordStrength
  2705. ' Restart the Lords life restore timer
  2706. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  2707. RestartLordLifeTimer
  2708. End If
  2709. End If
  2710. End Sub
  2711.  
  2712. Sub UpdateBumperLights
  2713. SetLightColor bumperLight1, white, 0
  2714. SetLightColor bumperLight1a, white, 0
  2715. SetLightColor bumperLight2, white, 0
  2716. SetLightColor bumperLight2a, white, 0
  2717. SetLightColor bumperLight3, white, 0
  2718. SetLightColor bumperLight3a, white, 0
  2719. bumperLight1.State = l20.State
  2720. bumperLight2.State = l21.State
  2721. bumperLight3.State = l22.State
  2722. bumperLight1a.State = l20.State
  2723. bumperLight2a.State = l21.State
  2724. bumperLight3a.State = l22.State
  2725. End Sub
  2726.  
  2727. Sub StartBumperFrenzy
  2728. bBumperFrenzy = True
  2729. BumperFrenzyTimer.Enabled = 1
  2730. ' turn on the bumper lights
  2731. SetLightColor bumperLight1, white, 2
  2732. SetLightColor bumperLight1a, white, 2
  2733. SetLightColor bumperLight2, white, 2
  2734. SetLightColor bumperLight2a, white, 2
  2735. SetLightColor bumperLight3, white, 2
  2736. SetLightColor bumperLight3a, white, 2
  2737. ' Start the rainbow lights on the bumpers
  2738. StartRainbow aBumperLights
  2739. End Sub
  2740.  
  2741. Sub StopBumperFrenzy
  2742. Dim ii
  2743. bBumperFrenzy = False
  2744. ' turn off the timer
  2745. BumperFrenzyTimer.Enabled = 0
  2746. ' restore the bumper lights
  2747. StopRainbow
  2748. For each ii in aBumperLights
  2749. SetLightColor ii, White, 0
  2750. Next
  2751.  
  2752. UpdateBumperLights
  2753. End Sub
  2754.  
  2755. Sub BumperFrenzyTimer_Timer ' the timer is up, so stop the mode
  2756. StopBumperFrenzy
  2757. End Sub
  2758.  
  2759. '***********
  2760. ' Level Lanes
  2761. '***********
  2762.  
  2763. Sub triggertop1_Hit
  2764. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2765. DOF 122, DOFPulse
  2766. If Tilted Then Exit Sub
  2767. LaneBonus = LaneBonus + 1
  2768. If bskillshotReady Then ResetSkillShotTimer_Timer
  2769. l20.State = 1
  2770. If(Mode(0) <> 2) AND(bBumperFrenzy = False) Then UpdateBumperLights
  2771. AddScore 2870
  2772. ' Do some sound or light effect: turn on bumper 1 lights
  2773. If Mode(0) <> 2 Then 'during the Butcher's fight the bumpers are blinking
  2774. FlashForms BumperLight1, 1000, 40, 1:FlashForms BumperLight1a, 1000, 40, 1
  2775. DOF 138, DOFPulse
  2776. End If
  2777. LastSwitchHit = "triggertop1"
  2778. ' do some check
  2779. CheckLevelLanes
  2780. End Sub
  2781.  
  2782. Sub triggertop2_Hit 'this is the skillshot lane
  2783. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2784. DOF 123, DOFPulse
  2785. If Tilted Then Exit Sub
  2786. LaneBonus = LaneBonus + 1
  2787. If bskillshotReady Then
  2788. AwardSkillShot
  2789. End If
  2790. l21.State = 1
  2791. If(Mode(0) <> 2) AND(bBumperFrenzy = False) Then UpdateBumperLights
  2792. AddScore 2870 'normal score
  2793. ' Do some sound or light effect: turn on bumper 2 lights
  2794. If Mode(0) <> 2 Then 'during the Butcher's fight the bumpers are blinking
  2795. FlashForms BumperLight2, 1000, 40, 1:FlashForms BumperLight2a, 1000, 40, 1
  2796. DOF 139, DOFPulse
  2797. End If
  2798. LastSwitchHit = "triggertop2"
  2799. ' do some check
  2800. CheckLevelLanes
  2801. End Sub
  2802.  
  2803. Sub triggertop3_Hit
  2804. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2805. DOF 124, DOFPulse
  2806. If Tilted Then Exit Sub
  2807. LaneBonus = LaneBonus + 1
  2808. If bskillshotReady Then ResetSkillShotTimer_Timer
  2809. l22.State = 1
  2810. If(Mode(0) <> 2) AND(bBumperFrenzy = False) Then UpdateBumperLights
  2811. AddScore 2870
  2812. ' Do some sound or light effect: turn on bumper 3 lights
  2813. If Mode(0) <> 2 Then 'during the Butcher's fight the bumpers are blinking
  2814. FlashForms BumperLight3, 1000, 40, 1:FlashForms BumperLight3a, 1000, 40, 1
  2815. DOF 140, DOFPulse
  2816. End If
  2817. LastSwitchHit = "triggertop3"
  2818. ' do some check
  2819. CheckLevelLanes
  2820. End Sub
  2821.  
  2822. Sub CheckLevelLanes() 'use the lane lights
  2823. If l20.State + l21.State + l22.State = 3 Then
  2824. ' turn off only the Level lights, not the bumpers
  2825. l20.State = 0
  2826. l21.State = 0
  2827. l22.State = 0
  2828. 'up one level to the current player
  2829. Level(CurrentPlayer) = Level(CurrentPlayer) + 1
  2830. 'Increase bonus multiplier
  2831. AddBonusMultiplier 1
  2832. 'flash and Light effect
  2833. LightEffect 3
  2834. FlashEffect 3
  2835. 'DMD
  2836. 'DMD "levelup.wmv", "", "", 3000
  2837. pupevent 757
  2838. ' open the gates and enable the orbit shots
  2839. Gate1.Open = true:Gate2.Open = True
  2840. OrbitCloseTimer.Enabled = 1
  2841. End If
  2842. End Sub
  2843.  
  2844. Sub OrbitCloseTimer_Timer
  2845. Gate1.Open = False:Gate2.Open = False
  2846. OrbitCloseTimer.Enabled = 0
  2847. End Sub
  2848.  
  2849. '**********************
  2850. ' Flipper Lanes: QUEST
  2851. '**********************
  2852.  
  2853. Sub sw1_Hit
  2854. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2855. DOF 132, DOFPulse
  2856. If Tilted Then Exit Sub
  2857. LaneBonus = LaneBonus + 1
  2858. l15.State = 1
  2859. AddScore 50050
  2860. ' Do some sound or light effect
  2861. ' do some check
  2862. CheckQUESTLanes
  2863. End Sub
  2864.  
  2865. Sub sw2_Hit
  2866. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2867. DOF 133, DOFPulse
  2868. If Tilted Then Exit Sub
  2869. LaneBonus = LaneBonus + 1
  2870. l16.State = 1
  2871. AddScore 10010
  2872. ' Do some sound or light effect
  2873. ' do some check
  2874. CheckQUESTLanes
  2875. End Sub
  2876.  
  2877. Sub sw3_Hit
  2878. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2879. DOF 133, DOFPulse
  2880. If Tilted Then Exit Sub
  2881. LaneBonus = LaneBonus + 1
  2882. l17.State = 1
  2883. AddScore 10010
  2884. ' Do some sound or light effect
  2885. ' do some check
  2886. CheckQUESTLanes
  2887. End Sub
  2888.  
  2889. Sub sw4_Hit
  2890. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2891. DOF 134, DOFPulse
  2892. If Tilted Then Exit Sub
  2893. LaneBonus = LaneBonus + 1
  2894. l18.State = 1
  2895. AddScore 10010
  2896. ' Do some sound or light effect
  2897. ' do some check
  2898. CheckQUESTLanes
  2899. End Sub
  2900.  
  2901. Sub sw5_Hit
  2902. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  2903. DOF 135, DOFPulse
  2904. If Tilted Then Exit Sub
  2905. LaneBonus = LaneBonus + 1
  2906. l19.State = 1
  2907. AddScore 50050
  2908. ' Do some sound or light effect
  2909. ' do some check
  2910. CheckQUESTLanes
  2911. End Sub
  2912.  
  2913. Sub CheckQUESTLanes() 'use the lane lights
  2914. If l15.State + l16.State + l17.State + l18.State + l19.State = 5 Then
  2915. 'DMD "quest-lights.wmv", "", "", 4000
  2916. pupevent 758
  2917. 'Increase bonus multiplier
  2918. AddBonusMultiplier 1
  2919. 'flash and Light effect
  2920. l15.State = 0
  2921. l16.State = 0
  2922. l17.State = 0
  2923. l18.State = 0
  2924. l19.State = 0
  2925. LightEffect 1
  2926. GIEffect 1
  2927. DOF 117, DOFPulse
  2928. FlashEffect 1
  2929. DOF 155, DOFPulse
  2930. DropChestDoor 'open the door to the chest
  2931. AddMultiball 1 'add a multiball
  2932. End If
  2933. End Sub
  2934.  
  2935. '*****************
  2936. ' BASH Targets
  2937. '*****************
  2938.  
  2939. Sub dt1_Hit
  2940. PlaySound SoundFXDOF("fx_target",118,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  2941. PlaySound "bash"
  2942. If Tilted Then Exit Sub
  2943. Select Case Mode(0)
  2944. Case 4 ' Belial
  2945. If l28.State = 1 Then 'the light is lit so hit Belial
  2946. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  2947. GiEffect 2
  2948. DOF 117, DOFPulse
  2949. CheckLordStrength
  2950. ' Restart the Lords life restore timer
  2951. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  2952. RestartLordLifeTimer
  2953. Else ' the light is off so give back life to Belial
  2954. LordStrength = LordStrength + 5
  2955. If LordStrength> 100 Then
  2956. LordStrength = 100
  2957. End If
  2958. End If
  2959. Case Else
  2960. l28.State = 1
  2961. ' do some check
  2962. CheckBASHTargets
  2963. End Select
  2964. AddScore 25010
  2965. ' Do some sound or light effect
  2966. LightEffect 1
  2967. LastSwitchHit = "dt1"
  2968. End Sub
  2969.  
  2970. Sub dt2_Hit
  2971. PlaySound SoundFXDOF("fx_target",118,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  2972. PlaySound "bash"
  2973. If Tilted Then Exit Sub
  2974. Select Case Mode(0)
  2975. Case 4 ' Belial
  2976. If l29.State = 1 Then 'the light is lit so hit Belial
  2977. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  2978. GiEffect 2
  2979. DOF 117, DOFPulse
  2980. CheckLordStrength
  2981. ' Restart the Lords life restore timer
  2982. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  2983. RestartLordLifeTimer
  2984. Else ' the light is off so give back life to Belial
  2985. LordStrength = LordStrength + 5
  2986. If LordStrength> 100 Then
  2987. LordStrength = 100
  2988. End If
  2989. End If
  2990. Case Else
  2991. l29.State = 1
  2992. ' do some check
  2993. CheckBASHTargets
  2994. End Select
  2995. AddScore 25010
  2996. ' Do some sound or light effect
  2997. LightEffect 1
  2998. LastSwitchHit = "dt2"
  2999. End Sub
  3000.  
  3001. Sub dt3_Hit
  3002. PlaySound SoundFXDOF("fx_target",118,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  3003. PlaySound "bash"
  3004. If Tilted Then Exit Sub
  3005. Select Case Mode(0)
  3006. Case 4 ' Belial
  3007. If l30.State = 1 Then 'the light is lit so hit Belial
  3008. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3009. GiEffect 2
  3010. DOF 117, DOFPulse
  3011. CheckLordStrength
  3012. Else ' the light is off so give back life to Belial
  3013. LordStrength = LordStrength + 5
  3014. If LordStrength> 100 Then
  3015. LordStrength = 100
  3016. End If
  3017. End If
  3018. Case Else
  3019. l30.State = 1
  3020. ' do some check
  3021. CheckBASHTargets
  3022. End Select
  3023. AddScore 25010
  3024. ' Do some sound or light effect
  3025. LightEffect 1
  3026. LastSwitchHit = "dt3"
  3027. End Sub
  3028.  
  3029. Sub dt4_Hit
  3030. PlaySound SoundFXDOF("fx_target",118,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  3031. PlaySound "bash"
  3032. If Tilted Then Exit Sub
  3033. Select Case Mode(0)
  3034. Case 4 ' Belial
  3035. If l31.State = 1 Then 'the light is lit so hit Belial
  3036. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3037. GiEffect 2
  3038. DOF 117, DOFPulse
  3039. CheckLordStrength
  3040. ' Restart the Lords life restore timer
  3041. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3042. RestartLordLifeTimer
  3043. Else ' the light is off so give back life to Belial
  3044. LordStrength = LordStrength + 5
  3045. If LordStrength> 100 Then
  3046. LordStrength = 100
  3047. End If
  3048. End If
  3049. Case Else
  3050. l31.State = 1
  3051. ' do some check
  3052. CheckBASHTargets
  3053. End Select
  3054. AddScore 25010
  3055. ' Do some sound or light effect
  3056. LightEffect 1
  3057. LastSwitchHit = "dt4"
  3058. End Sub
  3059.  
  3060. Sub CheckBASHTargets
  3061. If l28.State + l29.State + l30.State + l31.State = 4 Then
  3062. FlashEffect 2
  3063. DOF 154, DOFPulse
  3064. ' increment the target bonus
  3065. TargetBonus = TargetBonus + 1
  3066. If TargetBonus = 3 Then 'lit extra ball at the chest
  3067. l25.State = 2
  3068. DMDBlink "black.jpg", " ", "EXTRA BALL IS LIT", 50, 20
  3069. End If
  3070. Select Case Mode(0)
  3071. Case 1, 3, 5, 7, 9
  3072. DMD "bash-lights.wmv", "", "", 4000
  3073. MonsterHits = MonsterHits + 5 + Level(CurrentPlayer)
  3074. CheckActMonsters
  3075. MonsterHitTimer_Timer
  3076. ResetBashLights
  3077. Case 2, 4, 6, 8, 10
  3078. LordStrength = LordStrength -15 + Level(CurrentPlayer)
  3079. CheckLordStrength
  3080. ResetBashLights
  3081. End Select
  3082. End If
  3083. End Sub
  3084.  
  3085. Sub ResetBashLights
  3086. l28.State = 0
  3087. l29.State = 0
  3088. l30.State = 0
  3089. l31.State = 0
  3090. End Sub
  3091.  
  3092. '*****************
  3093. ' SKILL Targets
  3094. '*****************
  3095.  
  3096. Sub dt5_Hit
  3097. PlaySound SoundFXDOF("fx_target",119,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  3098. PlaySound "chains"
  3099. If Tilted Then Exit Sub
  3100. Select Case Mode(0)
  3101. Case 4 ' Belial
  3102. If l35.State = 1 Then 'the light is lit so hit Belial
  3103. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3104. GiEffect 2
  3105. DOF 117, DOFPulse
  3106. CheckLordStrength
  3107. ' Restart the Lords life restore timer
  3108. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3109. RestartLordLifeTimer
  3110. Else ' the light is off so give back life to Belial
  3111. LordStrength = LordStrength + 5
  3112. If LordStrength> 100 Then
  3113. LordStrength = 100
  3114. End If
  3115. End If
  3116. Case Else
  3117. l35.State = 1
  3118. ' do some check
  3119. CheckSKILLTargets
  3120. End Select
  3121. AddScore 25010
  3122. ' Do some sound or light effect
  3123. LightEffect 1
  3124. LastSwitchHit = "dt5"
  3125. End Sub
  3126.  
  3127. Sub dt6_Hit
  3128. PlaySound SoundFXDOF("fx_target",119,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  3129. PlaySound "chains"
  3130. If Tilted Then Exit Sub
  3131. Select Case Mode(0)
  3132. Case 4 ' Belial
  3133. If l36.State = 1 Then 'the light is lit so hit Belial
  3134. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3135. GiEffect 2
  3136. DOF 117, DOFPulse
  3137. CheckLordStrength
  3138. ' Restart the Lords life restore timer
  3139. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3140. RestartLordLifeTimer
  3141. Else ' the light is off so give back life to Belial
  3142. LordStrength = LordStrength + 5
  3143. If LordStrength> 100 Then
  3144. LordStrength = 100
  3145. End If
  3146. End If
  3147. Case Else
  3148. l36.State = 1
  3149. ' do some check
  3150. CheckSKILLTargets
  3151. End Select
  3152. AddScore 25010
  3153. ' Do some sound or light effect
  3154. LightEffect 1
  3155. LastSwitchHit = "dt6"
  3156. End Sub
  3157.  
  3158. Sub dt7_Hit
  3159. PlaySound SoundFXDOF("fx_target",119,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  3160. PlaySound "chains"
  3161. If Tilted Then Exit Sub
  3162. Select Case Mode(0)
  3163. Case 4 ' Belial
  3164. If l37.State = 1 Then 'the light is lit so hit Belial
  3165. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3166. GiEffect 2
  3167. DOF 117, DOFPulse
  3168. CheckLordStrength
  3169. ' Restart the Lords life restore timer
  3170. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3171. RestartLordLifeTimer
  3172. Else ' the light is off so give back life to Belial
  3173. LordStrength = LordStrength + 5
  3174. If LordStrength> 100 Then
  3175. LordStrength = 100
  3176. End If
  3177. End If
  3178. Case Else
  3179. l37.State = 1
  3180. ' do some check
  3181. CheckSKILLTargets
  3182. End Select
  3183. AddScore 25010
  3184. ' Do some sound or light effect
  3185. LightEffect 1
  3186. LastSwitchHit = "dt7"
  3187. End Sub
  3188.  
  3189. Sub dt8_Hit
  3190. PlaySound SoundFXDOF("fx_target",120,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  3191. PlaySound "chains"
  3192. If Tilted Then Exit Sub
  3193. Select Case Mode(0)
  3194. Case 4 ' Belial
  3195. If l40.State = 1 Then 'the light is lit so hit Belial
  3196. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3197. GiEffect 2
  3198. DOF 117, DOFPulse
  3199. CheckLordStrength
  3200. ' Restart the Lords life restore timer
  3201. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3202. RestartLordLifeTimer
  3203. Else ' the light is off so give back some life to Belial
  3204. LordStrength = LordStrength + 5
  3205. If LordStrength> 100 Then
  3206. LordStrength = 100
  3207. End If
  3208. End If
  3209. Case Else
  3210. l40.State = 1
  3211. ' do some check
  3212. CheckSKILLTargets
  3213. End Select
  3214. AddScore 25010
  3215. ' Do some sound or light effect
  3216. LightEffect 1
  3217. LastSwitchHit = "dt8"
  3218. End Sub
  3219.  
  3220. Sub dt9_Hit
  3221. PlaySound SoundFXDOF("fx_target",120,DOFPulse,DOFTargets), 0, 1, pan(ActiveBall)
  3222. PlaySound "chains"
  3223. If Tilted Then Exit Sub
  3224. Select Case Mode(0)
  3225. Case 4 ' Belial
  3226. If l41.State = 1 Then 'the light is lit so hit Belial
  3227. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3228. GiEffect 2
  3229. DOF 117, DOFPulse
  3230. CheckLordStrength
  3231. ' Restart the Lords life restore timer
  3232. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3233. RestartLordLifeTimer
  3234. Else ' the light is off so give back life to Belial
  3235. LordStrength = LordStrength + 5
  3236. If LordStrength> 100 Then
  3237. LordStrength = 100
  3238. End If
  3239. End If
  3240. Case Else
  3241. l41.State = 1
  3242. ' do some check
  3243. CheckSKILLTargets
  3244. End Select
  3245. AddScore 25010
  3246. ' Do some sound or light effect
  3247. LightEffect 1
  3248. LastSwitchHit = "dt9"
  3249. End Sub
  3250.  
  3251. Sub CheckSKILLTargets
  3252. If l35.State + l36.State + l37.State + l40.State + l41.State = 5 Then
  3253. FlashEffect 2
  3254. DOF 154, DOFPulse
  3255. ' increment the target bonus
  3256. TargetBonus = TargetBonus + 1
  3257. If TargetBonus = 3 Then 'lit extra ball at the chest
  3258. l25.State = 2
  3259. DMDBlink "black.jpg", " ", "EXTRA BALL IS LIT", 50, 20
  3260. End If
  3261. Select Case Mode(0)
  3262. Case 1, 3, 5, 7, 9
  3263. 'DMD "skill-lights.wmv", "", "", 3000
  3264. pupevent 759
  3265. MonsterHits = MonsterHits + 7 + Level(CurrentPlayer)
  3266. CheckActMonsters
  3267. MonsterHitTimer_Timer
  3268. ResetSkillLights
  3269. Case 2, 4, 6, 8, 10
  3270. LordStrength = LordStrength -20 + Level(CurrentPlayer)
  3271. CheckLordStrength
  3272. ResetSkillLights
  3273. End Select
  3274. End If
  3275. End Sub
  3276.  
  3277. Sub ResetSkillLights
  3278. l35.State = 0
  3279. l36.State = 0
  3280. l37.State = 0
  3281. l40.State = 0
  3282. l41.State = 0
  3283. End Sub
  3284.  
  3285. '*******************
  3286. ' Resplendent Chest
  3287. '*******************
  3288.  
  3289. Sub ChestDoor_Hit
  3290. PlaySound SoundFXDOF("fx_droptarget",116,DOFPulse,DOFContactors), 0, 1, pan(ActiveBall)
  3291. 'PlaySound "centershot"
  3292. pupevent 773
  3293. If Tilted Then Exit Sub
  3294. DropChestDoor
  3295. End Sub
  3296.  
  3297. Sub DropChestDoor
  3298. ChestDoor.IsDropped = 1
  3299. DOF 116, DOFPulse
  3300. 'Play a sound, do some light/flash effect
  3301. GiEffect 1
  3302. DOF 117, DOFPulse
  3303. End Sub
  3304.  
  3305. Sub ResetChestDoor
  3306. ChestDoor.IsDropped = 0
  3307. DOF 116, DOFPulse
  3308. PlaySound "fx_resetdrop"
  3309. End Sub
  3310.  
  3311. Sub ChestHole_Hit
  3312. DOF 128, DOFOn
  3313. PlaySound "fx_kicker_enter", 0, 1, 0.1
  3314. ResetChestDoor
  3315. If NOT Tilted Then
  3316. FlashForMs f16, 2000, 50, 0
  3317. DOF 136, DOFPulse
  3318. If Mode(0) = 0 Then 'we could check here too for the variable bActReady
  3319. StartNextMode
  3320. vpmtimer.addtimer 6000, "ChestExit '"
  3321. Else
  3322. If Mode(0) = 11 Then 'the end
  3323. WinMalthael2
  3324. vpmtimer.addtimer 80000, "ChestExit '"
  3325. Else
  3326. GiveRandomAward
  3327. vpmtimer.addtimer 4400, "ChestExit '"
  3328. End If
  3329. End If
  3330. If l25.State = 2 Then 'give the extra ball
  3331. l25.State = 0
  3332. AwardExtraBall
  3333. End If
  3334. If bJackpot AND l44.State = 2 Then 'give the SuperJackpot & enable the next jackpot
  3335. l44.State = 0
  3336. SetLightColor l43, red, 2
  3337. SetLightColor l45, red, 2
  3338. AwardSuperJackpot
  3339. End If
  3340. Else 'if tilted then just exit the ball
  3341. vpmtimer.addtimer 100, "ChestExit '"
  3342. End If
  3343. End Sub
  3344.  
  3345. Sub ChestExit()
  3346. DOF 128, DOFOff
  3347. If B2SOn Then Controller.B2SSetData bsnr,1:Controller.B2SSetData 20,0:Controller.B2SSetData 80,1
  3348. FlashForMs f16, 1000, 50, 0
  3349. DOF 137, DOFPulse
  3350. ChestHole.DestroyBall
  3351. ChestOut.CreateBall
  3352. PlaySound SoundFXDOF("fx_popper",115,DOFPulse,DOFContactors)
  3353. DOF 112, DOFPulse
  3354. ChestOut.kick 65, 30, 1.56
  3355. End Sub
  3356.  
  3357. Sub GiveRandomAward() 'from the Chest and the Orbits
  3358. Dim tmp, tmp2
  3359. PlaySound "gold"
  3360. ' show some random values on the dmd
  3361. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3362. DMD "black.jpg", " ", "EXTRA BALL IS LIT", 20
  3363. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3364. DMD "black.jpg", " ", "BONUS MULTIPLIER", 20
  3365. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3366. DMD "black.jpg", " ", "LEVEL UP", 20
  3367. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3368. DMD "black.jpg", " ", "BUMPER VALUE", 20
  3369. DMD "black.jpg", " ", "LEVEL UP", 20
  3370. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3371. DMD "black.jpg", " ", "EXTRA BALL IS LIT", 20
  3372. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3373. DMD "black.jpg", " ", "BONUS MULTIPLIER", 20
  3374. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3375. DMD "black.jpg", " ", "LEVEL UP", 20
  3376. DMD "black.jpg", " ", "EXTRA POINTS", 20
  3377. DMD "black.jpg", " ", "BUMPER VALUE", 20
  3378. DMD "black.jpg", " ", "LEVEL UP", 20
  3379. DMD "black.jpg", " ", " ", 200
  3380.  
  3381. tmp = INT(RND(1) * 80)
  3382. Select Case tmp
  3383. Case 1 'Light Extra Ball
  3384. l23.State = 2:DMDBlink "black.jpg", " ", "EXTRA BALL IS LIT", 50, 20
  3385. Case 2 'Light Extra Ball
  3386. l24.State = 2:DMDBlink "black.jpg", " ", "EXTRA BALL IS LIT", 50, 20
  3387. Case 3 'Light Extra Ball
  3388. l25.State = 2:DMDBlink "black.jpg", " ", "EXTRA BALL IS LIT", 50, 20
  3389. Case 4 'Light Extra Ball
  3390. l26.State = 2:DMDBlink "black.jpg", " ", "EXTRA BALL IS LIT", 50, 20
  3391. Case 5 'Light Extra Ball
  3392. l27.State = 2:DMDBlink "black.jpg", " ", "EXTRA BALL IS LIT", 50, 20
  3393. Case 6, 41, 42 'Start Bumper frenzy, where each bumper hit will award 50x the bumper value. The bumpers will lit blue during this mode.
  3394. DMDBlink "black.jpg", " ", "BUMPER FRENZY", 50, 20
  3395. StartBumperFrenzy
  3396. Case 7, 8 '2,000,000 points
  3397. DMDBlink "black.jpg", "BIG POINTS", "2000000", 50, 20
  3398. AddScore 2000000
  3399. Case 9, 10, 11, 12 'Hold Bonus
  3400. DMDBlink "black.jpg", "BONUS HELD", "ACTIVATED", 50, 20
  3401. bBonusHeld = True
  3402. Case 13, 14, 15 '1,000,000 points
  3403. DMDBlink "black.jpg", "BIG POINTS", "1000000", 50, 20
  3404. AddScore 2000000
  3405. Case 16, 17, 18 'Increase Bonus Multiplier
  3406. DMDBlink "black.jpg", "INCREASED", "BONUS MULTIPLIER", 50, 20
  3407. AddBonusMultiplier 1
  3408. Case 19, 20, 21 'Level up 1
  3409. DMDBlink "black.jpg", " ", "1 LEVEL UP", 50, 20
  3410. Level(CurrentPlayer) = Level(CurrentPlayer) + 1
  3411. Case 22, 23 'Level up 2
  3412. DMDBlink "black.jpg", " ", "2 LEVELS UP", 50, 20
  3413. Level(CurrentPlayer) = Level(CurrentPlayer) + 2
  3414. Case 24, 25, 26, 27, 28 '500,000 points
  3415. DMDBlink "black.jpg", "BIG POINTS", "500000", 50, 20
  3416. AddScore 500000
  3417. Case 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 'Increase Bumper value
  3418. BumperValue(CurrentPlayer) = BumperValue(CurrentPlayer) + 300
  3419. DMDBlink "black.jpg", "BUMPER VALUE", BumperValue(CurrentPlayer), 50, 20
  3420. Case 39, 40, 43, 44 'extra multiball
  3421. DMDBlink "black.jpg", "EXTRA", "MULTIBALL", 50, 20
  3422. AddMultiball 1
  3423. Case 45, 46, 47, 48 ' Ball Save
  3424. EnableBallSaver 20
  3425. DMDBlink "black.jpg", "BALL SAVE", "ACTIVATED", 50, 20
  3426. Case 50 'Level up 3
  3427. DMDBlink "black.jpg", " ", "3 LEVELS UP", 50, 20
  3428. Level(CurrentPlayer) = Level(CurrentPlayer) + 3
  3429. Case ELSE 'Add a Random score from 100.000 to 300,000 points
  3430. tmp2 = INT((RND) * 3) * 100000 + 100000
  3431. DMDBlink "black.jpg", "EXTRA POINTS", tmp2, 50, 20
  3432. AddScore tmp2
  3433. End Select
  3434. End Sub
  3435.  
  3436. '*****************
  3437. ' The Orbit
  3438. '*****************
  3439.  
  3440. Sub OrbitTrigger1_Hit
  3441. If Tilted Then Exit Sub
  3442. If LastSwitchHit = "OrbitTrigger2" Then 'this is a completed orbit
  3443. OrbitHits = OrbitHits + 1
  3444. GiveRandomAward
  3445. Else
  3446. If l32.State = 2 Then
  3447. Select Case Mode(0)
  3448. Case 1, 3, 5, 7, 9
  3449. GiEffect 2
  3450. DOF 125, DOFPulse
  3451. 'DMD "leftloop.wmv", "", "", 2000
  3452. pupevent 716
  3453. Monsters(CurrentPlayer) = Monsters(CurrentPlayer) + 1 'bonus
  3454. MonsterHits = MonsterHits + 1 + Level(CurrentPlayer)
  3455. CheckActMonsters
  3456. MonsterHitTimer_Timer
  3457. UpdateModeLights
  3458. Case 4, 6, 10
  3459. FlashEffect 2
  3460. DOF 154, DOFPulse
  3461. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3462. CheckLordStrength
  3463. ' Restart the Lords life restore timerted)
  3464. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3465. RestartLordLifeTimer
  3466. Case 8 'diablo
  3467. l32.State = 0:l39.State = 2
  3468. FlashEffect 2
  3469. DOF 154, DOFPulse
  3470. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3471. CheckLordStrength
  3472. ' Restart the Lords life restore timerted)
  3473. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3474. RestartLordLifeTimer
  3475. End Select
  3476. End If
  3477. If bJackpot AND l42.State = 2 Then 'give the Jackpot & enable the next one
  3478. l42.State = 0
  3479. SetLightColor l46, red, 2
  3480. AwardJackpot
  3481. End If
  3482. If l23.State = 2 Then 'give the extra ball
  3483. l23.State = 0
  3484. AwardExtraBall
  3485. End If
  3486. End If
  3487. LastSwitchHit = "OrbitTrigger1"
  3488. End Sub
  3489.  
  3490. Sub OrbitTrigger2_Hit
  3491. If Tilted Then Exit Sub
  3492. If LastSwitchHit = "OrbitTrigger1" Then 'this is a completed orbit
  3493. OrbitHits = OrbitHits + 1
  3494. GiveRandomAward
  3495. Else
  3496. If l39.State = 2 Then
  3497. Select Case Mode(0)
  3498. Case 1, 3, 5, 7, 9
  3499. GiEffect 2
  3500. DOF 125, DOFPulse
  3501. 'DMD "rightloop.wmv", "", "", 2000
  3502. pupevent 717
  3503. Monsters(CurrentPlayer) = Monsters(CurrentPlayer) + 1 'bonus
  3504. MonsterHits = MonsterHits + 1 + Level(CurrentPlayer)
  3505. CheckActMonsters
  3506. MonsterHitTimer_Timer
  3507. UpdateModeLights
  3508. Case 4, 6, 10
  3509. FlashEffect 2
  3510. DOF 154, DOFPulse
  3511. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3512. CheckLordStrength
  3513. ' Restart the Lords life restore timerted)
  3514. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3515. RestartLordLifeTimer
  3516. Case 8 'diablo
  3517. l32.State = 2:l39.State = 0
  3518. FlashEffect 2
  3519. DOF 154, DOFPulse
  3520. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3521. CheckLordStrength
  3522. ' Restart the Lords life restore timerted)
  3523. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3524. RestartLordLifeTimer
  3525. End Select
  3526. End If
  3527. If bJackpot AND l46.State = 2 Then 'give the Jackpot & enable the next one
  3528. l46.State = 0
  3529. SetLightColor l44, red, 2
  3530. AwardJackpot
  3531. End If
  3532. If l27.State = 2 Then 'give the extra ball
  3533. l27.State = 0
  3534. AwardExtraBall
  3535. End If
  3536. End If
  3537. LastSwitchHit = "OrbitTrigger2"
  3538. End Sub
  3539.  
  3540. '****************
  3541. ' Ramps
  3542. '****************
  3543.  
  3544. Sub LeftRampDone_Hit
  3545. PlaySound "fx_metalrolling", 0, 1, pan(ActiveBall)
  3546. If Tilted Then Exit Sub
  3547. 'increase the ramp bonus
  3548. RampBonus = RampBonus + 1
  3549. If l33.State = 2 Then
  3550. Select Case Mode(0)
  3551. Case 1, 3, 5, 7, 9
  3552. GiEffect 2
  3553. DOF 125, DOFPulse
  3554. 'DMD "leftramp.wmv", "", "", 2000
  3555. pupevent 718
  3556. Monsters(CurrentPlayer) = Monsters(CurrentPlayer) + 1 'bonus
  3557. MonsterHits = MonsterHits + 1 + Level(CurrentPlayer)
  3558. CheckActMonsters
  3559. MonsterHitTimer_Timer
  3560. UpdateModeLights
  3561. Case 4, 6, 8, 10
  3562. FlashEffect 2
  3563. DOF 154, DOFPulse
  3564. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3565. CheckLordStrength
  3566. ' Restart the Lords life restore timerted)
  3567. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3568. RestartLordLifeTimer
  3569. End Select
  3570. End If
  3571. If LastSwitchHit = "RightRampDone" Then 'give combo
  3572. DOF 117, DOFPulse
  3573. ComboValue = 100000 + Round(Score(CurrentPlayer) / 10, 0)
  3574. DMDBlink "black.jpg", "COMBO", ComboValue, 100, 10
  3575. AddScore ComboValue
  3576. End If
  3577. If bJackpot AND l43.State = 2 Then 'give the Jackpot
  3578. AwardJackpot
  3579. l43.State = 0
  3580. l45.State = 0
  3581. SetLightColor l42, red, 2
  3582. End If
  3583. If l24.State = 2 Then 'give the extra ball
  3584. l24.State = 0
  3585. AwardExtraBall
  3586. End If
  3587. LastSwitchHit = "LeftRampDone"
  3588. End Sub
  3589.  
  3590. Sub RightRampDone_Hit
  3591. PlaySound "fx_metalrolling", 0, 1, pan(ActiveBall)
  3592. If Tilted Then Exit Sub
  3593. 'increase the ramp bonus
  3594. RampBonus = RampBonus + 1
  3595. If l38.State = 2 Then
  3596. Select Case Mode(0)
  3597. Case 1, 3, 5, 7, 9
  3598. GiEffect 2
  3599. DOF 125, DOFPulse
  3600. 'DMD "rightramp.wmv", "", "", 2000
  3601. pupevent 719
  3602. Monsters(CurrentPlayer) = Monsters(CurrentPlayer) + 1 'bonus
  3603. MonsterHits = MonsterHits + 1 + Level(CurrentPlayer)
  3604. CheckActMonsters
  3605. MonsterHitTimer_Timer
  3606. UpdateModeLights
  3607. Case 4, 6, 8, 10
  3608. FlashEffect 2
  3609. DOF 154, DOFPulse
  3610. LordStrength = LordStrength -10 - Level(CurrentPLayer)
  3611. CheckLordStrength
  3612. ' Restart the Lords life restore timerted)
  3613. LordLifeTimer.Interval = LordLifeInterval + Level(CurrentPlayer) * 200
  3614. RestartLordLifeTimer
  3615. End Select
  3616. End If
  3617. If LastSwitchHit = "LeftRampDone" Then 'give combo
  3618. DOF 117, DOFPulse
  3619. ComboValue = 100000 + Round(Score(CurrentPlayer) / 10, 0)
  3620. DMDBlink "black.jpg", "COMBO", ComboValue, 100, 10
  3621. AddScore ComboValue
  3622. End If
  3623. If bJackpot AND l45.State = 2 Then 'give the Jackpot
  3624. AwardJackpot
  3625. l43.State = 0
  3626. l45.State = 0
  3627. SetLightColor l42, red, 2
  3628. End If
  3629. If l26.State = 2 Then 'give the extra ball
  3630. l26.State = 0
  3631. AwardExtraBall
  3632. End If
  3633. LastSwitchHit = "RightRampDone"
  3634. End Sub
  3635.  
  3636. '************************
  3637. ' Mode: Acts & Battles
  3638. '************************
  3639.  
  3640. ' Mode are played one after each other
  3641. ' This is a cooperative table where each player will continue right after where the last player finished
  3642. ' If you loose the ball you'll need to restart the mode :)
  3643. '
  3644.  
  3645. Dim Mode(10) 'this is for easier programming
  3646.  
  3647. ' Mode(0) will have the current mode number
  3648. ' when a mode is not active Mode(n) = 0
  3649. ' when a mode is active Mode(n) = 2
  3650. ' when a mode is completed Mode(n) = 1
  3651. ' this is to be consistent with the light states
  3652.  
  3653. ' Only one mode can be active at a time.
  3654.  
  3655. ' Mode(1): Act 1
  3656. ' Mode(2): end of Act 1: Battle the Butcher
  3657. ' Mode(3): Act 2
  3658. ' Mode(4): end of Act 2: Battle Belial
  3659. ' Mode(5): Act 3
  3660. ' Mode(6): end of Act 3: Battle Azmodan
  3661. ' Mode(7): Act 4
  3662. ' Mode(8): end of Act 4: Battle Diablo
  3663. ' Mode(9): Act 5
  3664. ' Mode(10): end of Act 5: Battle Malthael
  3665.  
  3666. Sub StartNextMode
  3667. ' stop the start act lights & variables
  3668. l34.State = 0
  3669. l44.State = 0
  3670. bActReady = False
  3671.  
  3672. If Mode(1) = 0 Then
  3673. StartMode 1
  3674. ElseIf Mode(2) = 0 Then
  3675. StartMode 2
  3676. ElseIf Mode(3) = 0 Then
  3677. StartMode 3
  3678. ElseIf Mode(4) = 0 Then
  3679. StartMode 4
  3680. ElseIf Mode(5) = 0 Then
  3681. StartMode 5
  3682. ElseIf Mode(6) = 0 Then
  3683. StartMode 6
  3684. ElseIf Mode(7) = 0 Then
  3685. StartMode 7
  3686. ElseIf Mode(8) = 0 Then
  3687. StartMode 8
  3688. ElseIf Mode(9) = 0 Then
  3689. StartMode 9
  3690. ElseIf Mode(10) = 0 Then
  3691. StartMode 10
  3692. End If
  3693. End Sub
  3694.  
  3695. Sub StartMode(n)
  3696. l34.State = 0
  3697. DMDFlush
  3698. Select Case n
  3699. Case 1:StartAct1
  3700. Case 2:StartButcher
  3701. Case 3:StartAct2
  3702. Case 4:StartBelial
  3703. Case 5:StartAct3
  3704. Case 6:StartAzmodan
  3705. Case 7:StartAct4
  3706. Case 8:StartDiablo
  3707. Case 9:StartAct5
  3708. Case 10:StartMalthael
  3709. End Select
  3710. If B2sOn Then
  3711. Controller.B2SSetData 80,0:Controller.B2SSetData 20,1
  3712. for ao=1 to 11:Controller.B2SSetData ao,0:next
  3713. bsnr = n
  3714. End If
  3715. End Sub
  3716.  
  3717. Sub StopMode(n) 'called at the end of a ball
  3718. l34.State = 2
  3719. Select Case n
  3720. Case 1:StopAct1
  3721. Case 2:StopButcher
  3722. Case 3:StopAct2
  3723. Case 4:StopBelial
  3724. Case 5:StopAct3
  3725. Case 6:StopAzmodan
  3726. Case 7:StopAct4
  3727. Case 8:StopDiablo
  3728. Case 9:StopAct5
  3729. Case 10:StopMalthael
  3730. End Select
  3731. If B2sOn Then
  3732. Controller.B2SSetData bsnr,0
  3733. End If
  3734. End Sub
  3735.  
  3736. Sub WinMode(n) 'called after completing a mode
  3737. DMDFlush
  3738. Select Case n
  3739. Case 1:WinAct1
  3740. Case 2:WinButcher
  3741. Case 3:WinAct2
  3742. Case 4:WinBelial
  3743. Case 5:WinAct3
  3744. Case 6:WinAzmodan
  3745. Case 7:WinAct4
  3746. Case 8:WinDiablo
  3747. Case 9:WinAct5
  3748. Case 10:WinMalthael
  3749. End Select
  3750. End Sub
  3751.  
  3752. Sub UpdateModeLights()
  3753. 'update the lights according to the mode state
  3754. l7.State = Mode(1)
  3755. l6.State = Mode(2)
  3756. l8.State = Mode(3)
  3757. l9.State = Mode(4)
  3758. l10.State = Mode(5)
  3759. l11.State = Mode(6)
  3760. l12.State = Mode(7)
  3761. l14.State = Mode(8)
  3762. l13.State = Mode(9)
  3763. l47.State = Mode(10)
  3764. 'change the color of the active mode depending of how far the act or battle is finished
  3765. Select Case Mode(0)
  3766. Case 1:SetLightColor l7, ColorCode, 2
  3767. Case 2:SetLightColor l6, ColorCode, 2
  3768. Case 3:SetLightColor l8, ColorCode, 2
  3769. Case 4:SetLightColor l9, ColorCode, 2
  3770. Case 5:SetLightColor l10, ColorCode, 2
  3771. Case 6:SetLightColor l11, ColorCode, 2
  3772. Case 7:SetLightColor l12, ColorCode, 2
  3773. Case 8:SetLightColor l14, ColorCode, 2
  3774. Case 9:SetLightColor l13, ColorCode, 2
  3775. Case 10:SetLightColor l47, ColorCode, 2
  3776. End Select
  3777. End Sub
  3778.  
  3779. Function ColorCode ' gives the percent completed, this will be a number from 0 to 10
  3780. Select Case Mode(0)
  3781. Case 1, 3, 5, 7, 9
  3782. ColorCode = INT((MonsterHits / MonsterTotal) * 10)
  3783. Case 2, 4, 6, 8, 10
  3784. ColorCode = LordStrength \ 10
  3785. End Select
  3786. If ColorCode < 0 Then ColorCode = 0
  3787. If ColorCode > 10 Then ColorCode = 10
  3788. End Function
  3789.  
  3790. '********************
  3791. ' Monsters Hit Timer
  3792. '********************
  3793.  
  3794. Dim mStep:mStep = False
  3795.  
  3796. Sub MonsterHitTimer_Timer() ' will change the lights differently in each act
  3797. Dim tmp
  3798. Select Case Mode(0)
  3799. Case 1 ' all 4 lights are turned on
  3800. SetLightColor l32, White, 2
  3801. SetLightColor l33, White, 2
  3802. SetLightColor l38, White, 2
  3803. SetLightColor l39, White, 2
  3804. Case 3 ' 3 lights are turned on
  3805. tmp = INT(RND * 4)
  3806. SetLightColor l32, White, 2
  3807. SetLightColor l33, White, 2
  3808. SetLightColor l38, White, 2
  3809. SetLightColor l39, White, 2
  3810. Select Case tmp
  3811. Case 0:l32.State = 0
  3812. Case 1:l33.State = 0
  3813. Case 2:l38.State = 0
  3814. Case 3:l39.State = 0
  3815. End Select
  3816. Case 5 ' 2 lights, alternate between orbits and ramps
  3817. mStep = NOT mStep
  3818. If mStep Then
  3819. SetLightColor l32, White, 2
  3820. SetLightColor l33, White, 0
  3821. SetLightColor l38, White, 0
  3822. SetLightColor l39, White, 2
  3823. Else
  3824. SetLightColor l32, White, 0
  3825. SetLightColor l33, White, 2
  3826. SetLightColor l38, White, 2
  3827. SetLightColor l39, White, 0
  3828. End If
  3829. Case 7 ' left or right lights
  3830. mStep = NOT mStep
  3831. If mStep Then
  3832. SetLightColor l32, White, 2
  3833. SetLightColor l33, White, 2
  3834. SetLightColor l38, White, 0
  3835. SetLightColor l39, White, 0
  3836. Else
  3837. SetLightColor l32, White, 0
  3838. SetLightColor l33, White, 0
  3839. SetLightColor l38, White, 2
  3840. SetLightColor l39, White, 2
  3841. End If
  3842. Case 9 ' 1 random light at a time
  3843. tmp = INT(RND * 4)
  3844. l32.State = 0
  3845. l33.State = 0
  3846. l38.State = 0
  3847. l39.State = 0
  3848. Select Case tmp
  3849. Case 0:SetLightColor l32, White, 2
  3850. Case 1:SetLightColor l33, White, 2
  3851. Case 2:SetLightColor l38, White, 2
  3852. Case 3:SetLightColor l39, White, 2
  3853. End Select
  3854. End Select
  3855. End Sub
  3856.  
  3857. Sub StartMonsterTimer
  3858. MonsterHitTimer_Timer 'start one of the lights
  3859. MonsterHitTimer.Enabled = 1
  3860. End Sub
  3861.  
  3862. Sub StopMonsterTimer
  3863. MonsterHitTimer.Enabled = 0
  3864. l32.State = 0
  3865. l33.State = 0
  3866. l38.State = 0
  3867. l39.State = 0
  3868. End Sub
  3869.  
  3870. Sub CheckActMonsters
  3871. If MonsterHits >= MonsterTotal Then
  3872. WinMode Mode(0)
  3873. End If
  3874. UpdateModeLights()
  3875. End Sub
  3876.  
  3877. Sub CheckLordStrength
  3878. If LordStrength <= 0 Then
  3879. WinMode Mode(0)
  3880. End If
  3881. UpdateModeLights()
  3882. DMDScore
  3883. End Sub
  3884.  
  3885. Sub RestartLordLifeTimer()
  3886. LordLifeTimer.Enabled = 0
  3887. LordLifeTimer.Enabled = 1
  3888. End Sub
  3889.  
  3890. Sub LordLifeTimer_Timer ' increases the Lords strength if not hit
  3891. LordLifeTimer.Interval = LordLifeInterval
  3892. If LordStrength <100 then
  3893. LordStrength = LordStrength + LordLifeStep
  3894. UpdateModeLights()
  3895. DMDScore
  3896. End If
  3897. End Sub
  3898.  
  3899. '****************
  3900. ' Mode 1: Act 1
  3901. '****************
  3902. ' All the acts use these 2 variables:
  3903. ' MonsterHits, this the numbers of monsters to kill to end the Act and start the battle against the Lord
  3904. ' MonsterTotal, the total number of monsters of the act, or the total life of the Lord during battles
  3905.  
  3906. Sub StartAct1
  3907. 'play a sound - video -dmd
  3908. StopSound Song:Song = ""
  3909. DMD "act1.wmv", " ", " ", 6500
  3910. pupevent 720
  3911. ' start music after the intro
  3912. 'vpmtimer.AddTimer 6000, "PlaySong ""mu_act"" '" try stop music
  3913. 'setup variables
  3914. MonsterTotal = 10 + INT(RND * 5) ' from 10 to 15 monsters
  3915. MonsterHits = 0
  3916. Mode(0) = 1 ' this is the active mode
  3917. Mode(1) = 2 ' this means it is started, and the corresponding light will be turned on and start blinking
  3918. 'update lights
  3919. UpdateModeLights()
  3920. ChangeGi white
  3921. ' Start a timer to light a random arrow light and to change it from time to time
  3922. StartMonsterTimer
  3923. End Sub
  3924.  
  3925. Sub StopAct1
  3926. StopMonsterTimer
  3927. Mode(0) = 0
  3928. Mode(1) = 0
  3929. UpdateModeLights()
  3930. ChangeGi white
  3931. End Sub
  3932.  
  3933. Sub WinAct1
  3934. StopMonsterTimer
  3935. 'play a sound - video -dmd
  3936. StopSound Song:Song = ""
  3937. 'DMD "act-complete.wmv", "", "", 12000
  3938. pupevent 721
  3939. FlashEffect 2
  3940. DOF 154, DOFPulse
  3941. 'setup variables
  3942. Mode(0) = 0
  3943. Mode(1) = 1
  3944. 'update lights
  3945. UpdateModeLights()
  3946. ChangeGi white
  3947. SetLightColor l7, purple, 1
  3948. ' lit the boss light
  3949. SetLightColor l44, green, 2
  3950. vpmtimer.AddTimer 12000, "PlaySong ""mu_main"" '"
  3951. End Sub
  3952.  
  3953. '*********************
  3954. ' Mode 2: The Butcher
  3955. '*********************
  3956. ' The fights with the Lords use just one variable LordStrength
  3957.  
  3958. Sub StartButcher
  3959. StopSound Song:Song = ""
  3960. 'DMD "butcher-start.wmv", "", "", 12000
  3961. pupevent 722
  3962. ' start music after the intro
  3963. 'vpmtimer.AddTimer 12000, "PlaySong ""mu_lordfight"" '"
  3964. 'vpmtimer.AddTimer 8000, "PlaySound ""battle"" '"
  3965. LordStrength = 100
  3966. Mode(0) = 2
  3967. Mode(2) = 2
  3968. 'update lights
  3969. UpdateModeLights()
  3970. ChangeGi red
  3971. ' you need to hit the bumpers to defeat the Butcher so turn them red and blinking
  3972. SetLightColor bumperLight1, red, 2
  3973. SetLightColor bumperLight1a, red, 2
  3974. SetLightColor bumperLight2, red, 2
  3975. SetLightColor bumperLight2a, red, 2
  3976. SetLightColor bumperLight3, red, 2
  3977. SetLightColor bumperLight3a, red, 2
  3978. ' add 1 multiball after the video is finished
  3979. vpmtimer.addtimer 12000, "AddMultiBall 1 '"
  3980. ' Start the life restore timer
  3981. LordLifeStep = 1
  3982. LordLifeInterval = 3000
  3983. LordLifeTimer.Interval = LordLifeInterval
  3984. RestartLordLifeTimer
  3985. StartJackpots
  3986. End Sub
  3987.  
  3988. Sub StopButcher
  3989. Mode(0) = 0
  3990. Mode(2) = 0
  3991. 'update lights
  3992. SetLightColor bumperLight1, white, 0
  3993. SetLightColor bumperLight1a, white, 0
  3994. SetLightColor bumperLight2, white, 0
  3995. SetLightColor bumperLight2a, white, 0
  3996. SetLightColor bumperLight3, white, 0
  3997. SetLightColor bumperLight3a, white, 0
  3998. UpdateModeLights()
  3999. SetLightColor l6, white, 0
  4000. ChangeGi white
  4001. End Sub
  4002.  
  4003. Sub WinButcher
  4004. 'play a sound - video -dmd
  4005. StopSound Song:Song = ""
  4006. 'DMD "butcher-defeated.wmv", "", "", 14000
  4007. pupevent 723
  4008. FlashEffect 2
  4009. DOF 154, DOFPulse
  4010. LightEffect 2
  4011. GiEffect 2
  4012. DOF 125, DOFPulse
  4013. 'setup variables
  4014. Mode(0) = 0
  4015. Mode(2) = 1
  4016. 'update lights
  4017. SetLightColor bumperLight1, white, 0
  4018. SetLightColor bumperLight1a, white, 0
  4019. SetLightColor bumperLight2, white, 0
  4020. SetLightColor bumperLight2a, white, 0
  4021. SetLightColor bumperLight3, white, 0
  4022. SetLightColor bumperLight3a, white, 0
  4023. UpdateModeLights()
  4024. SetLightColor l6, purple, 1
  4025. ' lit the start act light to show the player that he can start the next mode
  4026. SetLightColor l34, blue, 2
  4027. ChangeGi white
  4028. 'vpmtimer.AddTimer 14000, "PlaySong ""mu_main"" '"
  4029. End Sub
  4030.  
  4031. '****************
  4032. ' Mode 3: Act 2
  4033. '****************
  4034. ' All the acts use these 2 variables:
  4035. ' MonsterHits, this the numbers of monsters to kill to end the Act and start the battle against the Lord
  4036. ' MonsterTotal, the total number of monsters of the act, or the total life of the Lord during battles
  4037.  
  4038. Sub StartAct2
  4039. 'play a sound - video -dmd
  4040. StopSound Song:Song = ""
  4041. DMD "act2.wmv", " ", " ", 6500
  4042. pupevent 724
  4043. ' start music after the intro
  4044. 'vpmtimer.AddTimer 6000, "PlaySong ""mu_act2"" '"
  4045. 'setup variables
  4046. MonsterTotal = 15 + INT(RND * 5) ' from 15 to 20 monsters
  4047. MonsterHits = 0
  4048. Mode(0) = 3 ' this is the active mode
  4049. Mode(3) = 2 ' this means it is started, and the corresponding light will be turned on and start blinking
  4050. 'update lights
  4051. UpdateModeLights()
  4052. ChangeGi white
  4053. ' Start a timer to light a random arrow light and to change it from time to time
  4054. StartMonsterTimer
  4055. End Sub
  4056.  
  4057. Sub StopAct2
  4058. StopMonsterTimer
  4059. Mode(0) = 0
  4060. Mode(3) = 0
  4061. UpdateModeLights()
  4062. ChangeGi white
  4063. End Sub
  4064.  
  4065. Sub WinAct2
  4066. StopMonsterTimer
  4067. 'play a sound - video -dmd
  4068. StopSound Song:Song = ""
  4069. 'DMD "act-complete.wmv", "", "", 12000
  4070. pupevent 725
  4071. FlashEffect 2
  4072. DOF 154, DOFPulse
  4073. 'setup variables
  4074. Mode(0) = 0
  4075. Mode(3) = 1
  4076. 'update lights
  4077. UpdateModeLights()
  4078. ChangeGi white
  4079. SetLightColor l8, purple, 1
  4080. ' lit the boss light
  4081. SetLightColor l44, green, 2
  4082. 'vpmtimer.AddTimer 12000, "PlaySong ""mu_main"" '"
  4083. End Sub
  4084.  
  4085. '**********************
  4086. ' Mode 4: Battle Belial
  4087. '**********************
  4088. ' Belial hides behind the targets.
  4089. ' Hit the lit targets to kill him
  4090. ' Do not hit the the off targets, they will increase the life of Belial
  4091. Dim TargetsPos
  4092.  
  4093. Sub StartBelial
  4094. StopSound Song:Song = ""
  4095. 'DMD "belial-start.wmv", "", "", 12000
  4096. pupevent 726
  4097. ' start music after the intro
  4098. 'vpmtimer.AddTimer 12000, "PlaySong ""mu_lordfight"" '"
  4099. 'vpmtimer.AddTimer 8000, "PlaySound ""battle"" '"
  4100. LordStrength = 100
  4101. Mode(0) = 4
  4102. Mode(4) = 2
  4103. 'update lights
  4104. UpdateModeLights()
  4105. ChangeGi yellow
  4106. ' you need to hit the lit targets to defeat Belial so turn start
  4107. TargetsPos = 0
  4108. BelialTargets.Enabled = 1
  4109. ' add 2 multiball after the video is finished
  4110. vpmtimer.addtimer 12000, "AddMultiBall 2 '"
  4111. ' Start the life restore timer
  4112. LordLifeStep = 2
  4113. LordLifeInterval = 2500
  4114. LordLifeTimer.Interval = LordLifeInterval
  4115. RestartLordLifeTimer
  4116. StartJackpots
  4117. End Sub
  4118.  
  4119. Sub StopBelial
  4120. Mode(0) = 0
  4121. Mode(4) = 0
  4122. BelialTargets.Enabled = 0
  4123. UpdateModeLights()
  4124. l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4125. ChangeGi white
  4126. End Sub
  4127.  
  4128. Sub WinBelial
  4129. 'play a sound - video -dmd
  4130. StopSound Song:Song = ""
  4131. 'DMD "belial-defeated.wmv", "", "", 14000
  4132. pupevent 727
  4133. FlashEffect 2
  4134. DOF 154, DOFPulse
  4135. LightEffect 2
  4136. GiEffect 2
  4137. DOF 125, DOFPulse
  4138. 'setup variables
  4139. Mode(0) = 0
  4140. Mode(4) = 1
  4141. 'update lights
  4142. BelialTargets.Enabled = 0
  4143. UpdateModeLights()
  4144. l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4145. ChangeGi white
  4146. SetLightColor l9, purple, 1
  4147. ' lit the start act light to show the player that he can start the next mode
  4148. SetLightColor l34, blue, 2
  4149. 'vpmtimer.AddTimer 14000, "PlaySong ""mu_main"" '"
  4150. End Sub
  4151.  
  4152. Sub BelialTargets_Timer()
  4153. Select Case TargetsPos
  4154. Case 0:l28.State = 1:l29.State = 1:l30.State = 1:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4155. Case 1:l28.State = 0:l29.State = 1:l30.State = 1:l31.State = 1:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4156. Case 2:l28.State = 0:l29.State = 0:l30.State = 1:l31.State = 1:l35.State = 1:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4157. Case 3:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 1:l35.State = 1:l36.State = 1:l37.State = 0:l40.State = 0:l41.State = 0
  4158. Case 4:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 1:l36.State = 1:l37.State = 1:l40.State = 0:l41.State = 0
  4159. Case 5:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 1:l37.State = 1:l40.State = 1:l41.State = 0
  4160. Case 6:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 1:l40.State = 1:l41.State = 1
  4161. Case 7:l28.State = 1:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 1:l41.State = 1
  4162. Case 8:l28.State = 1:l29.State = 1:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 1
  4163. Case 9:l28.State = 1:l29.State = 1:l30.State = 1:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4164. Case 10:l28.State = 0:l29.State = 1:l30.State = 1:l31.State = 1:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4165. Case 11:l28.State = 0:l29.State = 0:l30.State = 1:l31.State = 1:l35.State = 1:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 0
  4166. Case 12:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 1:l35.State = 1:l36.State = 1:l37.State = 0:l40.State = 0:l41.State = 0
  4167. Case 13:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 1:l36.State = 1:l37.State = 1:l40.State = 0:l41.State = 0 ' the 3 lights "SKI" stay lit for a few seconds
  4168. Case 25:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 1:l37.State = 1:l40.State = 1:l41.State = 0
  4169. Case 26:l28.State = 0:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 1:l40.State = 1:l41.State = 1
  4170. Case 27:l28.State = 1:l29.State = 0:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 1:l41.State = 1
  4171. Case 28:l28.State = 1:l29.State = 1:l30.State = 0:l31.State = 0:l35.State = 0:l36.State = 0:l37.State = 0:l40.State = 0:l41.State = 1:TargetsPos = -1
  4172. End Select
  4173.  
  4174. TargetsPos = TargetsPos + 1
  4175. End Sub
  4176.  
  4177. '****************
  4178. ' Mode 5: Act 3
  4179. '****************
  4180. ' All the acts use these 2 variables:
  4181. ' MonsterHits, this the numbers of monsters to kill to end the Act and start the battle against the Lord
  4182. ' MonsterTotal, the total number of monsters of the act, or the total life of the Lord during battles
  4183.  
  4184. Sub StartAct3
  4185. 'play a sound - video -dmd
  4186. StopSound Song:Song = ""
  4187. DMD "act3.wmv", " ", " ", 6500
  4188. pupevent 728
  4189. ' start music after the intro
  4190. 'vpmtimer.AddTimer 6000, "PlaySong ""mu_act"" '"
  4191. 'setup variables
  4192. MonsterTotal = 20 + INT(RND * 5) ' from 20 to 25 monsters
  4193. MonsterHits = 0
  4194. Mode(0) = 5 ' this is the active mode
  4195. Mode(5) = 2 ' this means it is started, and the corresponding light will be turned on and start blinking
  4196. 'update lights
  4197. UpdateModeLights()
  4198. ChangeGi white
  4199. ' Start a timer to light a random arrow(s) light and to change it from time to time
  4200. StartMonsterTimer
  4201. End Sub
  4202.  
  4203. Sub StopAct3
  4204. StopMonsterTimer
  4205. Mode(0) = 0
  4206. Mode(5) = 0
  4207. UpdateModeLights()
  4208. ChangeGi white
  4209. End Sub
  4210.  
  4211. Sub WinAct3
  4212. StopMonsterTimer
  4213. 'play a sound - video -dmd
  4214. StopSound Song:Song = ""
  4215. 'DMD "act-complete.wmv", "", "", 12000
  4216. pupevent 729
  4217. FlashEffect 2
  4218. DOF 154, DOFPulse
  4219. 'setup variables
  4220. Mode(0) = 0
  4221. Mode(5) = 1
  4222. 'update lights
  4223. UpdateModeLights()
  4224. ChangeGi white
  4225. SetLightColor l10, purple, 1
  4226. ' lit the boss light
  4227. SetLightColor l44, green, 2
  4228. 'vpmtimer.AddTimer 12000, "PlaySong ""mu_main"" '"
  4229. End Sub
  4230.  
  4231. '************************
  4232. ' Mode 6: Battle Azmodan
  4233. '************************
  4234. ' The fights with the Lords use just one variable LordStrength
  4235. ' you need to hit at least 10 times the orbits left or right
  4236.  
  4237. Sub StartAzmodan
  4238. StopSound Song:Song = ""
  4239. 'DMD "azmodan-start.wmv", "", "", 20000
  4240. pupevent 730
  4241. ' start music after the intro
  4242. 'vpmtimer.AddTimer 20000, "PlaySong ""mu_lordfight"" '"
  4243. 'vpmtimer.AddTimer 8000, "PlaySound ""battle"" '"
  4244. LordStrength = 100
  4245. Mode(0) = 6
  4246. Mode(6) = 2
  4247. 'update lights
  4248. UpdateModeLights()
  4249. ChangeGi green
  4250. ' turn on the arrow lights
  4251. SetLightColor l32, white, 2
  4252. SetLightColor l39, white, 2
  4253. ' add 3 multiball after the video is finished
  4254. vpmtimer.addtimer 20000, "AddMultiBall 3 '"
  4255. ' Start the life restore timer
  4256. LordLifeStep = 2
  4257. LordLifeInterval = 2000
  4258. LordLifeTimer.Interval = LordLifeInterval
  4259. RestartLordLifeTimer
  4260. StartJackpots
  4261. End Sub
  4262.  
  4263. Sub StopAzmodan
  4264. Mode(0) = 0
  4265. Mode(6) = 0
  4266. UpdateModeLights()
  4267. l32.state = 0
  4268. l39.State = 0
  4269. ChangeGi white
  4270. End Sub
  4271.  
  4272. Sub WinAzmodan
  4273. 'play a sound - video -dmd
  4274. StopSound Song:Song = ""
  4275. 'DMD "azmodan-defeated.wmv", "", "", 14000
  4276. pupevent 731
  4277. FlashEffect 2
  4278. DOF 154, DOFPulse
  4279. LightEffect 2
  4280. GiEffect 2
  4281. DOF 125, DOFPulse
  4282. 'setup variables
  4283. Mode(0) = 0
  4284. Mode(6) = 1
  4285. 'update lights
  4286. UpdateModeLights()
  4287. l32.state = 0
  4288. l39.State = 0
  4289. ChangeGi white
  4290. SetLightColor l11, purple, 1
  4291. ' lit the start act light to show the player that he can start the next mode
  4292. SetLightColor l34, blue, 2
  4293. 'vpmtimer.AddTimer 14000, "PlaySong ""mu_main"" '"
  4294. End Sub
  4295.  
  4296. '****************
  4297. ' Mode 7: Act 4
  4298. '****************
  4299. ' All the acts use these 2 variables:
  4300. ' MonsterHits, this the numbers of monsters to kill to end the Act and start the battle against the Lord
  4301. ' MonsterTotal, the total number of monsters of the act, or the total life of the Lord during battles
  4302.  
  4303. Sub StartAct4
  4304. 'play a sound - video -dmd
  4305. StopSound Song:Song = ""
  4306. DMD "act4.wmv", " ", " ", 6500
  4307. pupevent 732
  4308. ' start music after the intro
  4309. 'vpmtimer.AddTimer 6000, "PlaySong ""mu_act2"" '"
  4310. 'setup variables
  4311. MonsterTotal = 25 + INT(RND * 5) ' from 25 to 30 monsters
  4312. MonsterHits = 0
  4313. Mode(0) = 7 ' this is the active mode
  4314. Mode(7) = 2 ' this means it is started, and the corresponding light will be turned on and start blinking
  4315. 'update lights
  4316. UpdateModeLights()
  4317. ChangeGi white
  4318. ' Start a timer to light a random arrow light and to change it from time to time
  4319. StartMonsterTimer
  4320. End Sub
  4321.  
  4322. Sub StopAct4
  4323. StopMonsterTimer
  4324. Mode(0) = 0
  4325. Mode(7) = 0
  4326. UpdateModeLights()
  4327. End Sub
  4328.  
  4329. Sub WinAct4
  4330. StopMonsterTimer
  4331. 'play a sound - video -dmd
  4332. StopSound Song:Song = ""
  4333. 'DMD "act-complete.wmv", "", "", 12000
  4334. pupevent 733
  4335. FlashEffect 2
  4336. DOF 154, DOFPulse
  4337. 'setup variables
  4338. Mode(0) = 0
  4339. Mode(7) = 1
  4340. 'update lights
  4341. UpdateModeLights()
  4342. SetLightColor l12, purple, 1
  4343. ' lit the boss light
  4344. SetLightColor l44, green, 2
  4345. 'vpmtimer.AddTimer 12000, "PlaySong ""mu_main"" '"
  4346. End Sub
  4347.  
  4348. '************************
  4349. ' Mode 8: Battle Diablo
  4350. '************************
  4351. ' The fights with the Lords use just one variable LordStrength
  4352.  
  4353. Sub StartDiablo
  4354. StopSound Song:Song = ""
  4355. 'DMD "diablo-start.wmv", "", "", 19000
  4356. pupevent 734
  4357. ' start music after the intro
  4358. 'vpmtimer.AddTimer 19000, "PlaySong ""mu_lordfight"" '"
  4359. 'vpmtimer.AddTimer 8000, "PlaySound ""battle"" '"
  4360. LordStrength = 100
  4361. Mode(0) = 8
  4362. Mode(8) = 2
  4363. 'update lights
  4364. UpdateModeLights()
  4365. ChangeGi blue
  4366. ' you need to hit the top lanes and ramps, only one light will be active
  4367. SetLightColor l32, white, 2
  4368. ' Start the life restore timer
  4369. LordLifeStep = 3
  4370. LordLifeInterval = 1500
  4371. LordLifeTimer.Interval = LordLifeInterval
  4372. RestartLordLifeTimer
  4373. ' add 4 multiball after the video is finished
  4374. vpmtimer.addtimer 20000, "AddMultiBall 4 '"
  4375. StartJackpots
  4376. End Sub
  4377.  
  4378. Sub StopDiablo
  4379. Mode(0) = 0
  4380. Mode(8) = 0
  4381. UpdateModeLights()
  4382. l32.State = 0
  4383. l39.State = 0
  4384. ChangeGi white
  4385. End Sub
  4386.  
  4387. Sub WinDiablo
  4388. 'play a sound - video -dmd
  4389. StopSound Song:Song = ""
  4390. 'DMD "diablo-defeated.wmv", "", "", 14000
  4391. pupevent 735
  4392. FlashEffect 2
  4393. DOF 154, DOFPulse
  4394. LightEffect 2
  4395. GiEffect 2
  4396. DOF 125, DOFPulse
  4397. 'setup variables
  4398. Mode(0) = 0
  4399. Mode(8) = 1
  4400. 'update lights
  4401. UpdateModeLights()
  4402. l32.State = 0
  4403. l39.State = 0
  4404. ChangeGi white
  4405. SetLightColor l14, purple, 1
  4406. ' lit the start act light to show the player that he can start the next mode
  4407. SetLightColor l34, blue, 2
  4408. 'vpmtimer.AddTimer 14000, "PlaySong ""mu_main"" '"
  4409. End Sub
  4410.  
  4411. '****************
  4412. ' Mode 9: Act 5
  4413. '****************
  4414. ' All the acts use these 2 variables:
  4415. ' MonsterHits, this the numbers of monsters to kill to end the Act and start the battle against the Lord
  4416. ' MonsterTotal, the total number of monsters of the act, or the total life of the Lord during battles
  4417.  
  4418. Sub StartAct5
  4419. 'play a sound - video -dmd
  4420. StopSound Song:Song = ""
  4421. DMD "act5.wmv", " ", " ", 6500
  4422. pupevent 736
  4423. ' start music after the intro
  4424. 'vpmtimer.AddTimer 6000, "PlaySong ""mu_act"" '"
  4425. 'setup variables
  4426. MonsterTotal = 30 + INT(RND * 5) ' from 10 to 15 monsters
  4427. MonsterHits = 0
  4428. Mode(0) = 9 ' this is the active mode
  4429. Mode(9) = 2 ' this means it is started, and the corresponding light will be turned on and start blinking
  4430. 'update lights
  4431. UpdateModeLights()
  4432. ChangeGi white
  4433. ' Start a timer to light a random arrow light and to change it from time to time
  4434. StartMonsterTimer
  4435. End Sub
  4436.  
  4437. Sub StopAct5
  4438. StopMonsterTimer
  4439. Mode(0) = 0
  4440. Mode(9) = 0
  4441. UpdateModeLights()
  4442. End Sub
  4443.  
  4444. Sub WinAct5
  4445. StopMonsterTimer
  4446. 'play a sound - video -dmd
  4447. StopSound Song:Song = ""
  4448. 'DMD "act-complete.wmv", "", "", 12000
  4449. pupevent 737
  4450. FlashEffect 2
  4451. DOF 154, DOFPulse
  4452. ' Score an extra 5 million points
  4453. DMDBlink "black.jpg", "EXTRA SCORE", "5.000.000", 100, 10
  4454. Addscore 5000000
  4455. 'setup variables
  4456. Mode(0) = 0
  4457. Mode(9) = 1
  4458. 'update lights
  4459. UpdateModeLights()
  4460. SetLightColor l13, purple, 1
  4461. ' lit the boss light
  4462. SetLightColor l44, green, 2
  4463. 'vpmtimer.AddTimer 12000, "PlaySong ""mu_main"" '"
  4464. End Sub
  4465.  
  4466. '************************
  4467. ' Mode 10: Battle Malthael
  4468. '************************
  4469. ' The fights with the Lords use just one variable LordStrength
  4470.  
  4471. Sub StartMalthael
  4472. StopSound Song:Song = ""
  4473. 'DMD "malthael-start.wmv", "", "", 18000
  4474. pupevent 738
  4475. ' start music after the intro
  4476. 'vpmtimer.AddTimer 18000, "PlaySong ""mu_lordfight"" '"
  4477. 'vpmtimer.AddTimer 8000, "PlaySound ""battle"" '"
  4478. LordStrength = 100
  4479. Mode(0) = 10
  4480. Mode(10) = 2
  4481. 'update lights
  4482. UpdateModeLights()
  4483. ChangeGi purple
  4484. ' you need to hit the ramps
  4485. SetLightColor l33, white, 2
  4486. SetLightColor l38, white, 2
  4487. ' add 4 multiball after the video is finished
  4488. vpmtimer.addtimer 18000, "AddMultiBall 4 '"
  4489. ' Start the life restore timer
  4490. LordLifeStep = 4
  4491. LordLifeInterval = 1000
  4492. LordLifeTimer.Interval = LordLifeInterval
  4493. RestartLordLifeTimer
  4494. StartJackpots
  4495. End Sub
  4496.  
  4497. Sub StopMalthael
  4498. Mode(0) = 0
  4499. Mode(10) = 0
  4500. UpdateModeLights()
  4501. l33.State = 0
  4502. l38.State = 0
  4503. ChangeGi white
  4504. End Sub
  4505.  
  4506. Sub WinMalthael
  4507. 'setup variables
  4508. Mode(0) = 11 'the end
  4509. Mode(10) = 1
  4510. 'update lights
  4511. l33.State = 0
  4512. l38.State = 0
  4513. UpdateModeLights()
  4514. ChangeGi white
  4515. SetLightColor l47, purple, 1
  4516. DMD "black.jpg", "FIGHT FOR", "THE VIKINGS SHIP", 5000
  4517. MalthaelAttackTimer.Enabled = 0
  4518. ChestDoor.IsDropped = 1
  4519. DOF 116, DOFPulse
  4520. ' lit the 3 chest lights
  4521. SetLightColor l44, purple, 2
  4522. SetLightColor l34, purple, 2
  4523. SetLightColor l25, purple, 2
  4524. FlashEffect 2
  4525. DOF 154, DOFPulse
  4526. End Sub
  4527.  
  4528. Sub WinMalthael2
  4529. Dim i
  4530. 'play a sound - video -dmd
  4531. StopSound Song:Song = ""
  4532. 'DMD "malthael-defeated.wmv", "", "", 80000
  4533. pupevent 739
  4534. 'light show
  4535. LightSeqFlasher.UpdateInterval = 150
  4536. LightSeqFlasher.Play SeqRandom, 20, , 80000
  4537. LightSeqInserts.UpdateInterval = 150
  4538. LightSeqInserts.Play SeqRandom, 50, , 80000
  4539. ' Score an extra 5 million points
  4540. DMDBlink "black.jpg", "EXTRA SCORE", "5.000.000", 100, 10
  4541. Addscore 5000000
  4542. 'reset all lights and modes
  4543. For i = 0 to 10
  4544. Mode(i) = 0
  4545. Next
  4546.  
  4547. SecondRound = 2 'used to multiply by 2 all the scores in the scond round
  4548. UpdateModeLights()
  4549. l25.State = 0
  4550. l34.State = 0
  4551. l44.State = 0
  4552. ' lit the start act light to show the player that he can start the next mode
  4553. SetLightColor l34, blue, 2
  4554. 'vpmtimer.AddTimer 80000, "PlaySong ""mu_main"" '"
  4555. End Sub
  4556.  
  4557. ' this is the Malthael attack timer, starts at 2 attacks per minute and increases the frecuency on each act or battle
  4558. ' In the last battle he will attack each 10 seconds. Each attack is 5 seconds long.
  4559.  
  4560. Sub MalthaelAttackTimer_Timer
  4561. Dim tmp
  4562. tmp = Mode(0)
  4563. MalthaelAttackTimer.Interval = 30000 - tmp * 2000
  4564. ' play a sound
  4565. PlaySound "di_thunder"
  4566. ' flash the flashers
  4567. FlashForMs f2, 5000, 50, 0
  4568. DOF 151, DOFPulse
  4569. FlashForMs f14, 5000, 50, 0
  4570. DOF 152, DOFPulse
  4571. FlashForMs f15, 5000, 50, 0
  4572. DOF 153, DOFPulse
  4573. ' enable the magnets for a few seconds
  4574. EnableMagnets
  4575. vpmtimer.AddTimer 5000, "DisableMagnets '"
  4576. End Sub
  4577.  
  4578. Sub DisableMagnets
  4579. 'debug.print "magnets off"
  4580. DOF 127, DOFOff
  4581. LMagnet.MotorOn = False
  4582. RMagnet.MotorOn = False
  4583. End Sub
  4584.  
  4585. Sub EnableMagnets
  4586. DOF 127, DOFOn
  4587. LMagnet.MotorOn = True
  4588. RMagnet.MotorOn = True
  4589. End Sub
Advertisement
Add Comment
Please, Sign In to add comment