Arngrim

TNA

Nov 2nd, 2019
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 183.39 KB | None | 0 0
  1. '
  2. ' ****************************************************************
  3. ' VISUAL PINBALL X
  4. ' ****************************************************************
  5.  
  6. Option Explicit
  7. Randomize
  8.  
  9. Const bFreePlay = True 'True = FreePlay. False = Coins
  10. Const BallsPerGame = 3
  11. Const ReactorDifficulty = 2 'Default: 2 (1-Easy, 2-Med, 3-Hard)
  12. Const ReactorLevelMax = 9 'Default: 9 (1-9 Reactors)
  13. Const SongVolume = 0.5
  14.  
  15. Const BallSaverTime = 12 'Default: 12 seconds
  16. Const DropTargetResetTime = 5 'Default: 5 seconds during Multiball Jackpot
  17. Const ReactorPercentLossTime= 3 'Default: After Reactor 3, Reactor Percent drops back down by 1 every 3 seconds
  18. Const ExtraBallAward1 = 3 'Default: Extra Ball at Reactor 3 Critical stage
  19. Const ExtraBallAward2 = 6 'Default: Extra Ball at Reactor 6 Critical stage
  20. Const KeepLaneSaves = 1 'Default: 1 (Yes. 0=No)
  21. Const AutoPlungeDelay = 1.0 'Default: 1.0 seconds
  22.  
  23.  
  24. Const Testmode = 0 'Testing only
  25. Const debugGeneral = 0 'For debug only
  26. Const debugReactor = 0 'For debug only
  27. Const debugMultiball = 0 'For debug only
  28. Const debugGrid = 0 'For debug only
  29. Const debugDestroyRAD = 0 'For debug only
  30. Const debugMysteryAward = 0 'For debug only
  31. Const debugHighScore = 0 'For debug only
  32.  
  33. On Error Resume Next
  34. ExecuteGlobal GetTextFile("controller.vbs")
  35. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  36. On Error Goto 0
  37.  
  38. Dim UltraDMD
  39.  
  40. Const uwhite = 145
  41. Const ublue = 146
  42. Const ured = 147
  43.  
  44. Dim UndercabColor : UndercabColor = ublue
  45.  
  46. 'Sub LoadUltraDMD
  47. ' Set UltraDMD = CreateObject("UltraDMD.DMDObject")
  48. ' UltraDMD.Init
  49. ' uDMDScoreTimer.Enabled = 1
  50. 'End Sub
  51.  
  52. Sub uDMDScoreTimer_Timer
  53. UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "Ball " & Balls, "Credits " & Credits
  54. End Sub
  55.  
  56. Const cGameName = "tna"
  57. Const BallSize = 50 ' 50 is the normal size
  58.  
  59. ' Load the core.vbs for supporting Subs and functions
  60. LoadCoreVBS
  61.  
  62. Sub LoadCoreVBS
  63. On Error Resume Next
  64. ExecuteGlobal GetTextFile("core.vbs")
  65. If Err Then MsgBox "Can't open core.vbs"
  66. On Error Goto 0
  67. End Sub
  68.  
  69. Sub startB2S(aB2S)
  70. If B2SOn Then
  71. Controller.B2SSetData 1, 0
  72. Controller.B2SSetData 2, 0
  73. Controller.B2SSetData 3, 0
  74. Controller.B2SSetData 4, 0
  75. Controller.B2SSetData 5, 0
  76. Controller.B2SSetData 6, 0
  77. Controller.B2SSetData 7, 0
  78. Controller.B2SSetData 8, 0
  79. Controller.B2SSetData aB2S, 1
  80. End If
  81. End Sub
  82.  
  83. ' Define any Constants
  84. Const TableName = "TNA"
  85. Const myVersion = "1.0.0"
  86. Const MaxPlayers = 4
  87. Const MaxMultiplier = 4 'limit to 4x in this game
  88. Const MaxMultiballs = 4 ' max number of balls during multiballs
  89.  
  90. ' Define Global Variables
  91. Dim PlayersPlayingGame
  92. Dim CurrentPlayer
  93. Dim Credits
  94. Dim BonusPoints(4)
  95. Dim BonusHeldPoints(4)
  96. Dim BonusMultiplier(4)
  97. Dim bBonusHeld
  98. Dim BallsRemaining(4)
  99. Dim ExtraBallsAwards(4)
  100. Dim Score(4)
  101. Dim HighScore(4)
  102. Dim HighScoreName(4)
  103. Dim Tilt
  104. Dim TiltSensitivity
  105. Dim Tilted
  106. Dim TotalGamesPlayed
  107. Dim mBalls2Eject
  108. Dim SkillshotValue
  109. Dim HandsFreeSkillshotInsert
  110. Dim bAutoPlunger
  111. Dim bInstantInfo
  112. Const Quotemode = 0
  113.  
  114. ' Define Game Control Variables
  115. Dim LastSwitchHit
  116. Dim BallsOnPlayfield
  117. Dim BallsInLock
  118. Dim BallsInHole
  119.  
  120. ' Define Game Flags
  121. Dim bGameInPlay
  122. Dim bOnTheFirstBall
  123. Dim bBallInPlungerLane
  124. Dim bBallSaverActive
  125. Dim bBallSaverReady
  126. Dim bMultiBallMode
  127. Dim bMusicOn
  128.  
  129. 'Skillshot
  130. Dim SkillshotReady '0 = Off, 1 = Start, 2 = Plunged
  131. Dim bSkillshotSelect 'used to select the skillshot you want
  132.  
  133. Dim bExtraBallWonThisBall
  134. Dim bJustStarted
  135.  
  136. Dim plungerIM 'used mostly as an autofire plunger
  137. 'Dim ttable, cbleft, cbright
  138.  
  139. ' *********************************************************************
  140. ' Visual Pinball Defined Script Events
  141. ' *********************************************************************
  142.  
  143. Sub Table1_Init()
  144. LoadEM
  145. Dim i
  146. Randomize
  147.  
  148. 'Impulse Plunger as autoplunger
  149. Const IMPowerSetting = 40 ' Plunger Power
  150. Const IMTime = 1.1 ' Time in seconds for Full Plunge
  151. Set plungerIM = New cvpmImpulseP
  152. With plungerIM
  153. .InitImpulseP swplunger, IMPowerSetting, IMTime
  154. .Random 1.5
  155. .InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_solenoid", DOFContactors)
  156. .CreateEvents "plungerIM"
  157. End With
  158.  
  159.  
  160. 'load saved values, highscore, names, jackpot
  161. Loadhs
  162.  
  163. 'Init main variables
  164.  
  165. ' initalise the DMD display
  166. DMD_Init
  167.  
  168.  
  169. if bFreePlay = True Then
  170. DOF 140, DOFOn
  171. end if
  172.  
  173. ' initialse any other flags
  174. bOnTheFirstBall = False
  175. bBallInPlungerLane = False
  176. bBallSaverActive = False
  177. bBallSaverReady = False
  178. bMultiBallMode = False
  179. bGameInPlay = False
  180. bAutoPlunger = False
  181. bMusicOn = True
  182. SetBallsOnPlayfield 0
  183. BallsInLock = 0
  184. BallsInHole = 0
  185. LastSwitchHit = ""
  186. Tilt = 0
  187. TiltSensitivity = 6
  188. Tilted = False
  189. bBonusHeld = False
  190. bJustStarted = True
  191. bInstantInfo = False
  192.  
  193. 'EndOfGame()
  194. StartRainbow "all"
  195. PlaySong "bgout_tna10.mp3", 2
  196. ShowTableInfo
  197. LightSeqAttract.Play SeqRandom, 40, 1000, 0
  198.  
  199. ' Misc. VP table objects Initialisation, droptargets, animations...
  200. VPObjects_Init
  201.  
  202. ' Remove the cabinet rails if in FS mode
  203. If Table1.ShowDT = False then
  204. lrail.Visible = False
  205. rrail.Visible = False
  206. ' start the UltraDMD
  207. 'LoadUltraDMD
  208. End If
  209. End Sub
  210.  
  211. Dim ComboLoopFlag
  212. Sub SetLastSwitchHit (value)
  213. Dim comboscore
  214. 'check for combo first
  215. If (StrComp(value, "swRLoop") = 0) Then
  216. If ComboLoopFlag > 0 Then 'check if value is right loop switch
  217.  
  218. comboscore = 5000 * (2 ^ ComboLoopFlag)
  219. If comboscore > 160000 then comboscore = 160000
  220.  
  221. AddScore (comboscore)
  222. 'MSGBOX "COMBO " & ComboLoopFlag & "!"
  223. DMD "", eNone, Centerline(1, ("COMBO")), eNone, "", eNone, CenterLine(3, FormatScore(comboscore)), eBlinkFast, 800, True, "tna_combo"
  224. end if
  225.  
  226. elseif (StrComp(value, "swLLoop") = 0) AND (StrComp(LastSwitchHit, "swRLoop") = 0) then 'Loop detected
  227. ComboLoopFlag = ComboLoopFlag + 1
  228. else
  229. ComboLoopFlag = 0
  230. End If
  231.  
  232. LastSwitchHit = value
  233.  
  234. End Sub
  235.  
  236. '******
  237. ' Section; Keys
  238. '******
  239. Dim kickertest
  240. kickertest = 8
  241. Sub Table1_KeyDown(ByVal Keycode)
  242. If Keycode = AddCreditKey Then
  243. Credits = Credits + 1
  244. DOF 140, DOFOn
  245. If(Tilted = False)Then
  246. DMDFlush
  247. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CREDITS: " & Credits), eNone, 500, True, "fx_coin"
  248. If NOT bGameInPlay Then ShowTableInfo
  249. End If
  250. End If
  251.  
  252. If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
  253. If keycode = PlungerKey Then
  254. Plunger.Pullback
  255. PlaySound "fx_plungerpull"
  256. End If
  257. End If
  258. ' ************ DEBUG KEYS Sect *******
  259. ' ************ DEBUG KEYS Sect *******
  260. If Keycode = 3 Then
  261. BlockerWalls
  262. End If
  263. If TestMode = 1 Then
  264. If keycode = 17 Then 'W key
  265. ByPassGrid
  266. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR READY: GridTargets set"
  267. End If
  268. If keycode = 18 Then 'E key
  269. CheckReactorStart
  270. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR STARTED: CheckReactorStart"
  271. End If
  272. If keycode = 19 Then 'R key
  273. SetReactorPercent 100
  274. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR CRITICAL: SetReactorPercent 100"
  275. End If
  276. If keycode = 20 Then 'T key
  277. DecreaseReactorDestroyCount lD3, lBumperFlash
  278. DecreaseReactorDestroyCount lD3, lBumperFlash
  279. DecreaseReactorDestroyCount lRad1, fRad1
  280. DecreaseReactorDestroyCount lRad2, fRad2
  281. DecreaseReactorDestroyCount lRad3, fRad3
  282. DecreaseReactorDestroyCount lD1, fD1
  283. DecreaseReactorDestroyCount lD2, fD2
  284. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR DESTROYED: DecreaseReactorDestroyCount"
  285. End If
  286. If keycode = 21 Then kickerdebug.enabled = true 'Y key
  287. If keycode = 22 Then kickerdebug.enabled = true 'U key
  288. If keycode = 23 Then kickerdebug.enabled = true 'I key
  289. If keycode = 25 Then kickerdebug.enabled = true 'P key
  290. If keycode = 30 Then 'A key
  291. RotateLaneLightsRight
  292. Sw1_hit
  293. End If
  294. If keycode = 31 Then 'S key
  295. TargetRAD3_Hit
  296. TargetRAD2_Hit
  297. TargetRAD1_Hit
  298. End If
  299.  
  300. If keycode = 33 Then 'F key
  301. AddBonusMultiplier 1
  302. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:AddBonusMultiplier 1"
  303. End If
  304.  
  305. If keycode = 34 Then 'G key
  306. AwardSave 1
  307. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:AwardSave 1"
  308. End If
  309. If keycode = 35 Then 'H key
  310. TestHitTarget
  311. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:TestHitTarget"
  312. End If
  313. End If
  314. ' ************ DEBUG KEYS Sect *******
  315. ' ************ DEBUG KEYS Sect *******
  316.  
  317. If hsbModeActive Then
  318. EnterHighScoreKey(keycode)
  319. Exit Sub
  320. End If
  321.  
  322. ' Table specific
  323.  
  324. ' Normal flipper action
  325.  
  326. If bGameInPlay AND NOT Tilted Then
  327.  
  328. If keycode = LeftTiltKey Then Nudge 90, 6:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt
  329. If keycode = RightTiltKey Then Nudge 270, 6:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt
  330. If keycode = CenterTiltKey Then Nudge 0, 7:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt
  331.  
  332. If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
  333. If keycode = LeftFlipperKey Then SolLFlipper 1:InstantInfoTimer.Enabled = False
  334. If keycode = RightFlipperKey Then SolRFlipper 1:InstantInfoTimer.Enabled = False
  335.  
  336. If keycode = StartGameKey Then
  337. If((PlayersPlayingGame < MaxPlayers)AND(bOnTheFirstBall = True))Then
  338.  
  339. If(bFreePlay = True)Then
  340. PlayersPlayingGame = PlayersPlayingGame + 1
  341. TotalGamesPlayed = TotalGamesPlayed + 1
  342. PlaySound "gb_fanfare1"
  343. DMD "", eNone, "_", eNone, CenterLine(2, PlayersPlayingGame & " PLAYERS"), eBlink, "", eNone, 500, True, ""
  344. Else
  345. If(Credits > 0)then
  346. PlayersPlayingGame = PlayersPlayingGame + 1
  347. TotalGamesPlayed = TotalGamesPlayed + 1
  348. Credits = Credits - 1
  349. PlaySound "gb_fanfare1"
  350. DMD "", eNone, "_", eNone, CenterLine(2, PlayersPlayingGame & " PLAYERS"), eBlink, "", eNone, 500, True, ""
  351. Else
  352. ' Not Enough Credits to start a game.
  353. DOF 140, DOFOff
  354. DMDFlush
  355. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eNone, "", eNone, 500, True, ""
  356. End If
  357. End If
  358. End If
  359. End If
  360. End If
  361. Else ' If (GameInPlay)
  362.  
  363. If keycode = StartGameKey Then
  364. If(bFreePlay = True)Then
  365. If(BallsOnPlayfield = 0)Then
  366. ResetForNewGame()
  367. End If
  368. Else
  369. If(Credits > 0)Then
  370. If(BallsOnPlayfield = 0)Then
  371. Credits = Credits - 1
  372. ResetForNewGame()
  373. End If
  374. Else
  375. ' Not Enough Credits to start a game.
  376. DOF 140, DOFOff
  377. DMDFlush
  378. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eBlink, "", eNone, 500, True, ""
  379. PlaySound "gb_electricity1", 0, 1, -0.05, 0.05
  380. ShowTableInfo
  381. End If
  382. End If
  383. End If
  384. End If ' If (GameInPlay)
  385. End Sub
  386.  
  387. Sub Table1_KeyUp(ByVal keycode)
  388.  
  389. If keycode = PlungerKey Then
  390. Plunger.Fire
  391. PlaySound "fx_plunger"
  392. End If
  393.  
  394. 'Testkeys
  395. If keycode = 21 Then 'Y key
  396. kickerdebug.enabled = false
  397. If kickertest = -18 then
  398. kickertest = 19
  399. Else
  400. kickertest = -18
  401. End If
  402. kickerdebug.kick kickertest, 40
  403. End If
  404. If keycode = 22 Then 'U key
  405. kickerdebug.enabled = false
  406. kickertest = -8
  407. kickerdebug.kick kickertest, 40
  408. End If
  409. If keycode = 23 Then 'I key
  410. kickerdebug.enabled = false
  411. If kickertest = -2 then
  412. kickertest = 0
  413. ElseIf kickertest = 0 then
  414. kickertest = 4
  415. Else
  416. kickertest = -2
  417. End If
  418. kickerdebug.kick kickertest, 40
  419. End If
  420. If keycode = 25 Then 'P key
  421. kickerdebug.enabled = false
  422. kickertest = 8
  423. kickerdebug.kick kickertest, 40
  424. End If
  425.  
  426. If hsbModeActive Then
  427. Exit Sub
  428. End If
  429.  
  430. ' Table specific
  431.  
  432. If bGameInPLay AND NOT Tilted Then
  433. If keycode = LeftFlipperKey Then
  434. SolLFlipper 0
  435. InstantInfoTimer.Enabled = False
  436. If bInstantInfo Then
  437. bInstantInfo = False
  438. DMDScoreNow
  439. End If
  440. End If
  441. If keycode = RightFlipperKey Then
  442. SolRFlipper 0
  443. InstantInfoTimer.Enabled = False
  444. If bInstantInfo Then
  445. bInstantInfo = False
  446. DMDScoreNow
  447. End If
  448. End If
  449. End If
  450. End Sub
  451.  
  452. Sub InstantInfoTimer_Timer
  453. InstantInfoTimer.Enabled = False
  454. bInstantInfo = True
  455. Jackpot = 1000000 + Round(Score(CurrentPlayer) / 10, 0)
  456. DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "JACKPOT"), eScrollLeft, CenterLine(3, FormatScore(Jackpot)), eScrollLeft, 800, False, ""
  457. DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "SUPERJACKPOT"), eScrollLeft, CenterLine(3, FormatScore(SuperJackpot)), eScrollLeft, 800, False, ""
  458. ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "PKE LEVEL"), eScrollLeft, CenterLine(3, FormatScore(1)), eScrollLeft, 800, False, ""
  459. ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "PKE MULTIPLIER"), eScrollLeft, CenterLine(3, 1), eScrollLeft, 800, False, ""
  460. ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "GHOSTS CAUGHT"), eScrollLeft, CenterLine(3, Ghosts(CurrentPlayer) + GhostsHundreds(CurrentPlayer) * 100), eScrollLeft, 800, False, ""
  461. DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "BONUS MULTIPLIER"), eScrollLeft, CenterLine(3, BonusMultiplier(CurrentPlayer)), eScrollLeft, 800, False, ""
  462. ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "FIRESTATION HIT"), eScrollLeft, CenterLine(3, FormatScore(SpinnerValue * SpinnerLevel)), eScrollLeft, 800, False, ""
  463. End Sub
  464.  
  465. Sub EndFlipperStatus
  466. If bInstantInfo Then
  467. bInstantInfo = False
  468. DMDScoreNow
  469. End If
  470. End Sub
  471.  
  472. '*************
  473. ' Section; Pause Table
  474. '*************
  475.  
  476. Sub table1_Paused
  477. End Sub
  478.  
  479. Sub table1_unPaused
  480. End Sub
  481.  
  482. Sub table1_Exit
  483. Savehs
  484. End Sub
  485.  
  486. '********************
  487. ' Section; Flippers
  488. '********************
  489.  
  490. Sub SolLFlipper(Enabled)
  491. If Enabled Then
  492. PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, 1, -0.05, 0.15
  493. LeftFlipper.RotateToEnd
  494. LeftFlipper2.RotateToEnd
  495. RotateLaneLightsLeft
  496. Else
  497. PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, -0.05, 0.15
  498. LeftFlipper.RotateToStart
  499. LeftFlipper2.RotateToStart
  500. End If
  501. End Sub
  502.  
  503. Sub SolLFlipper2(Enabled)
  504. If Enabled Then
  505. LeftFlipper.RotateToEnd
  506. Else
  507. LeftFlipper.RotateToStart
  508. End If
  509. End Sub
  510.  
  511. Sub SolRFlipper(Enabled)
  512. If Enabled Then
  513. PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, 1, 0.05, 0.15
  514. RightFlipper.RotateToEnd
  515. RotateLaneLightsRight
  516. Else
  517. PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, 0.05, 0.15
  518. RightFlipper.RotateToStart
  519. End If
  520. End Sub
  521.  
  522. ' flippers hit Sound
  523.  
  524. Sub LeftFlipper_Collide(parm)
  525. PlaySound "flip_hit_1", 0, parm / 10, -0.05, 0.25
  526. End Sub
  527.  
  528. Sub RightFlipper_Collide(parm)
  529. PlaySound "flip_hit_1", 0, parm / 10, 0.05, 0.25
  530. End Sub
  531.  
  532. Sub LeftFlipper2_Collide(parm)
  533. PlaySound "flip_hit_1", 0, parm / 10, -0.05, 0.25
  534. End Sub
  535.  
  536. Sub RightFlipper2_Collide(parm)
  537. PlaySound "flip_hit_1", 0, parm / 10, 0.05, 0.25
  538. End Sub
  539.  
  540.  
  541. '*****************************
  542. ' Section; CORE Targets - Bonus Multiplier
  543. '*****************************
  544. Sub ResetCORE()
  545. L1.State = 0
  546. L2.State = 0
  547. L3.State = 0
  548. L4.State = 0
  549. End Sub
  550.  
  551. Sub CheckCORE
  552. If (L1.State = 1 and L2.State = 1 and L3.State = 1 and L4.State = 1) Then
  553. ResetCORE
  554.  
  555. ' 'to do lightseq
  556. ' FlashForMs l1, 2000, 100, 0
  557. ' FlashForMs l2, 2000, 100, 0
  558. ' FlashForMs l3, 2000, 100, 0
  559. ' FlashForMs l4, 2000, 100, 0
  560. '
  561. AddBonusMultiplier 1
  562. End If
  563. End Sub
  564.  
  565. Sub RotateLaneLightsLeft()
  566. Dim tmp
  567. tmp = l1.State
  568. l1.state = l2.State
  569. l2.State = l3.State
  570. l3.State = l4.State
  571. l4.State = tmp
  572.  
  573. tmp = la1.State
  574. la1.state = la2.State
  575. la2.State = la3.State
  576. la3.State = la4.State
  577. la4.State = tmp
  578.  
  579. If bSkillshotSelect Then
  580. SelectSkillshot(1)
  581. End If
  582. End Sub
  583.  
  584. Sub RotateLaneLightsRight()
  585. Dim tmp
  586. tmp = la4.State
  587. la4.state = la3.State
  588. la3.State = la2.State
  589. la2.State = la1.State
  590. la1.State = tmp
  591.  
  592. tmp = l4.State
  593. l4.state = l3.State
  594. l3.State = l2.State
  595. l2.State = l1.State
  596. l1.State = tmp
  597.  
  598. If bSkillshotSelect Then
  599. SelectSkillshot(2)
  600. End If
  601. End Sub
  602.  
  603. '*********
  604. ' Section; TILT
  605. '*********
  606.  
  607. 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
  608.  
  609. Sub CheckTilt 'Called when table is nudged
  610. Tilt = Tilt + TiltSensitivity 'Add to tilt count
  611. TiltDecreaseTimer.Enabled = True
  612. If(Tilt > TiltSensitivity)AND(Tilt < 15)Then 'show a warning
  613. DMD "", eNone, "_", eNone, CenterLine(2, "CAREFUL!"), eBlinkFast, "", eNone, 500, True, ""
  614. End if
  615. If Tilt > 15 Then 'If more that 15 then TILT the table
  616. Tilted = True
  617. 'display Tilt
  618. DMDFlush
  619. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "TILT!"), eBlinkFast, 200, False, ""
  620. DisableTable True
  621. TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
  622. End If
  623. End Sub
  624.  
  625. Sub TiltDecreaseTimer_Timer
  626. ' DecreaseTilt
  627. If Tilt > 0 Then
  628. Tilt = Tilt - 0.1
  629. Else
  630. TiltDecreaseTimer.Enabled = False
  631. End If
  632. End Sub
  633.  
  634. Sub DisableTable(Enabled)
  635. If Enabled Then
  636. 'turn off GI and turn off all the lights
  637. GiOff
  638. 'LightSeqTilt.Play SeqAllOff
  639. 'Disable slings, bumpers etc
  640. LeftFlipper.RotateToStart
  641. RightFlipper.RotateToStart
  642.  
  643. LeftSlingshot.Disabled = 1
  644. RightSlingshot.Disabled = 1
  645. Else
  646. 'turn back on GI and the lights
  647. 'GiOn
  648. ' 'LightSeqTilt.StopPlay
  649. LeftSlingshot.Disabled = 0
  650. RightSlingshot.Disabled = 0
  651. 'clean up the buffer display
  652. DMDFlush
  653. End If
  654. End Sub
  655.  
  656. Sub TiltRecoveryTimer_Timer()
  657. ' if all the balls have been drained then..
  658. If(BallsOnPlayfield = 0)Then
  659. ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
  660. EndOfBall()
  661. TiltRecoveryTimer.Enabled = False
  662. End If
  663. ' else retry (checks again in another second or so)
  664. End Sub
  665.  
  666. '********************
  667. ' Section; Music
  668. '********************
  669.  
  670. Dim Song
  671. Song = ""
  672. Dim m_main
  673.  
  674. Sub StartBackgroundMusic
  675. Dim tmp
  676.  
  677. tmp = ((ReactorLevel(CurrentPlayer) + RandomSongStart) Mod 8) + 2
  678. If debugGeneral Then debug.print "StartBackgroundMusic, ReactorState(CurrentPlayer)=" & ReactorState(CurrentPlayer)
  679. If ReactorState(CurrentPlayer) <> 3 Then 'Critical
  680. If ReactorLevel(CurrentPlayer) = 1 Then
  681. m_main = "bgout_TNA" & ReactorLevel(CurrentPlayer) & ".mp3"
  682. Else
  683. m_main = "bgout_TNA" & tmp & ".mp3"
  684. End If
  685. PlaySong m_main, 2
  686. End If
  687. End Sub
  688.  
  689. Sub StopBackgroundMusic
  690. If debugGeneral Then debug.print "StopBackgroundMusic"
  691. EndMusic
  692. Song = ""
  693. End Sub
  694.  
  695. Sub StartReactorCriticalMusic
  696. If debugGeneral Then debug.print "StartReactorCriticalMusic"
  697. EndMusic
  698. playsound "tna_reactorcritical", -1
  699. End Sub
  700.  
  701. Sub PlaySong(name, ttype)
  702. If debugGeneral Then debug.print "PlaySong " & "name"
  703. If bMusicOn Then
  704. If Song <> name Then
  705. StopSound Song
  706. EndMusic
  707. Song = name
  708. If ttype = 1 Then
  709. If Song = "m_end" Then
  710. PlaySound Song, 0, 0.1 'this last number is the volume, from 0 to 1
  711. Else
  712. PlaySound Song, -1, 1 'this last number is the volume, from 0 to 1
  713. End If
  714. Else
  715. PlayMusic Song, SongVolume
  716. End If
  717. End If
  718. End If
  719. End Sub
  720.  
  721. '**********************
  722. ' Section; GI effects
  723. ' independent routine
  724. ' it turns on the gi
  725. ' when there is a ball
  726. ' in play
  727. '**********************
  728.  
  729. Dim OldGiState, CurrCol
  730. OldGiState = -1 'start witht the Gi off
  731.  
  732. Sub ChangeGi(col) 'changes the gi color
  733. If debugGeneral Then debug.print "*****SUB:ChangeGi " & col
  734.  
  735. CurrCol = col
  736. ChangeGiTimer.Interval = 500
  737. ChangeGITimer.Enabled = True
  738. GIOff
  739. End Sub
  740.  
  741. Sub ChangeGiTimer_Timer
  742. If debugGeneral Then debug.print "*****SUB:ChangeGiTimer_Timer " & CurrCol
  743. Dim bulb
  744. ChangeGITimer.Enabled = False
  745.  
  746. For each bulb in aGILights
  747. SetLight bulb, CurrCol, -1
  748. Next
  749. GiOn
  750. End Sub
  751.  
  752. Sub ChangeGiImmediate (col)
  753. DOF UndercabColor, DOFOff
  754. If col = "white" Then
  755. UndercabColor = uwhite
  756. ElseIf col = "blue" Then
  757. UndercabColor = ublue
  758. ElseIf col = "red" Then
  759. UndercabColor = ured
  760. End If
  761. DOF UndercabColor, DOFOn
  762. Dim bulb
  763.  
  764. CurrCol = col
  765. For each bulb in aGILights
  766. SetLight bulb, col, -1
  767. Next
  768. End Sub
  769.  
  770. 'Sub GIUpdateTimer_Timer
  771. ' Dim tmp, obj
  772. ' tmp = Getballs
  773. ' If UBound(tmp) <> OldGiState Then
  774. ' OldGiState = Ubound(tmp)
  775. ' 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..)
  776. ' GiOff ' turn off the gi if no active balls on the table, we could also have used the variable ballsonplayfield.
  777. ' Else
  778. ' Gion
  779. ' End If
  780. ' End If
  781. 'End Sub
  782.  
  783. Sub GiOn
  784. 'If debugGeneral Then debug.print "*****SUB:GiOn"
  785. DOF UndercabColor, DOFOn
  786. Dim bulb
  787. For each bulb in aGiLights
  788. bulb.State = 1
  789. Next
  790. End Sub
  791.  
  792. Sub GiOff
  793. 'If debugGeneral Then debug.print "*****SUB:GiOff"
  794. DOF UndercabColor, DOFOff
  795. Dim bulb
  796. For each bulb in aGiLights
  797. bulb.State = 0
  798. Next
  799. End Sub
  800.  
  801.  
  802.  
  803. Sub GIReactor (col)
  804. Dim Bulb
  805. For each bulb in aGIReactorLights
  806. SetLight bulb, col, -1
  807. Next
  808. End Sub
  809.  
  810. Sub GIReactorStarted
  811. gi9.TimerInterval = 30
  812. gi9.TimerEnabled = True
  813. End Sub
  814.  
  815. Sub GIReactorStopped
  816. gi9.TimerEnabled = False
  817. gi10.TimerInterval = 2000
  818. gi10.TimerEnabled = True
  819. ChangeGIImmediate("white")
  820. LightSeqAttract.Play SeqRandom, 40, , 0
  821. End Sub
  822.  
  823. Sub GIReactorStoppedImmediate
  824. gi9.TimerEnabled = False
  825. ChangeGIImmediate("blue")
  826. End Sub
  827.  
  828.  
  829. Sub Gi10_Timer
  830. gi10.TimerEnabled = False
  831. LightSeqAttract.StopPlay
  832. ChangeGI("blue")
  833. End Sub
  834.  
  835. Dim GISpinNum
  836. GISpinNum=0
  837. Sub GI9_Timer
  838.  
  839. If ReactorState(CurrentPlayer) = 2 Then 'Reactor Started 'Circle animation
  840. SetLight aGiReactorLights((GISpinNum)mod 16), "blue", -1
  841. SetLight aGiReactorLights((GISpinNum+1)mod 16), "blue", -1
  842. SetLight aGiReactorLights((GISpinNum+2)mod 16), "blue", -1
  843. SetLight aGiReactorLights((GISpinNum+3)mod 16), "blue", -1
  844. SetLight aGiReactorLights((GISpinNum+4)mod 16), "red", -1
  845. SetLight aGiReactorLights((GISpinNum+5)mod 16), "red", -1
  846. SetLight aGiReactorLights((GISpinNum+6)mod 16), "red", -1
  847. SetLight aGiReactorLights((GISpinNum+7)mod 16), "red", -1
  848. SetLight aGiReactorLights((GISpinNum+8)mod 16), "red", -1
  849. SetLight aGiReactorLights((GISpinNum+9)mod 16), "red", -1
  850. SetLight aGiReactorLights((GISpinNum+10)mod 16), "red", -1
  851. SetLight aGiReactorLights((GISpinNum+11)mod 16), "red", -1
  852. SetLight aGiReactorLights((GISpinNum+12)mod 16), "red", -1
  853. SetLight aGiReactorLights((GISpinNum+13)mod 16), "red", -1
  854. SetLight aGiReactorLights((GISpinNum+14)mod 16), "red", -1
  855. SetLight aGiReactorLights((GISpinNum+15)mod 16), "red", -1
  856.  
  857. ElseIf ReactorState(CurrentPlayer) = 3 Then 'Reactor Critical 'blinking Red GI
  858. ChangeGiImmediate("red")
  859. GiON
  860.  
  861. ' Select Case GISpinNum
  862. ' Case 1,2,8,9
  863. ' GIOff 'GiReactorOff
  864. ' Case Else
  865. ' GiOn 'GIReactorOn
  866. ' End Select
  867. End If
  868. GISpinNum = (GISpinNum+1) Mod 16
  869.  
  870. End Sub
  871.  
  872. 'Sub GiReactorOn
  873. ' If debugGeneral Then debug.print "*****SUB:GiReactorOn"
  874. ' Dim bulb
  875. ' For each bulb in aGIReactorLights
  876. ' bulb.State = 1
  877. ' Next
  878. 'End Sub
  879. '
  880. 'Sub GiReactorOff
  881. ' If debugGeneral Then debug.print "*****SUB:GiReactorOff"
  882. ' Dim bulb
  883. ' For each bulb in aGIReactorLights
  884. ' bulb.State = 0
  885. ' Next
  886. 'End Sub
  887.  
  888.  
  889. '**** Blink Left GI Sling
  890. Dim GILeftSlingPrevCol, GIRightSlingPrevCol
  891. Sub GILeftSlingHit
  892. Dim Bulb
  893.  
  894. GILeftSlingPrevCol = CurrCol
  895. For each bulb in aGILeftSling
  896. SetLight bulb, "red", -1
  897. Next
  898.  
  899. GI3.TimerInterval = 250: GI3.TimerEnabled = True
  900. End Sub
  901.  
  902. Sub GI3_Timer
  903. Dim Bulb
  904.  
  905. For each bulb in aGILeftSling
  906. SetLight bulb, CurrCol, -1
  907. Next
  908.  
  909. GI3.TimerEnabled = False
  910. End Sub
  911.  
  912. '**** Blink Right GI Sling
  913. Sub GIRightSlingHit
  914. Dim Bulb
  915.  
  916. GIRightSlingPrevCol = CurrCol
  917. For each bulb in aGIRightSling
  918. SetLight bulb, "red", -1
  919. Next
  920.  
  921. GI1.TimerInterval = 250: GI1.TimerEnabled = True
  922. End Sub
  923.  
  924. Sub GI1_Timer
  925. Dim Bulb
  926.  
  927. For each bulb in aGIRightSling
  928. SetLight bulb, CurrCol, -1
  929. Next
  930.  
  931. GI1.TimerEnabled = False
  932. End Sub
  933.  
  934.  
  935.  
  936.  
  937. ' GI & light sequence effects
  938.  
  939. Sub GiEffect(n)
  940.  
  941. End Sub
  942.  
  943. Sub LightEffect(n)
  944.  
  945. End Sub
  946.  
  947. ' Flasher Effects
  948.  
  949. Dim FEStep, FEffect
  950. FEStep = 0
  951. FEffect = 0
  952.  
  953. Sub FlashEffect(n)
  954. Select case n
  955. Case 1:FEStep = 0:FEffect = 1:FlashEffectTimer.Enabled = 1 'all blink
  956. Case 2:FEStep = 0:FEffect = 2:FlashEffectTimer.Enabled = 1 'random
  957. Case 3:FEStep = 0:FEffect = 3:FlashEffectTimer.Enabled = 1 'upon
  958. Case 4:FEStep = 0:FEffect = 4:FlashEffectTimer.Enabled = 1 'ordered random :)
  959. End Select
  960. End Sub
  961.  
  962. Sub FlashEffectTimer_Timer()
  963. FEStep = FEStep + 1
  964. End Sub
  965.  
  966.  
  967. Sub ResetInserts
  968. Dim Obj
  969. 'Reactor Inserts
  970. For each obj in aInsertsReactor
  971. SetLight obj, "blue", 0
  972. Next
  973.  
  974. 'Bonus Inserts
  975. For each obj in aInsertsBonus
  976. SetLight obj, "white", 0
  977. Next
  978.  
  979. SetLight lSpinner, "blue", -1
  980. SetLight F1, "white", 0
  981. SetLight F2, "white", 0
  982. SetLight F3, "white", 0
  983. SetLight F4, "white", 0
  984. SetLight F5, "white", 0
  985. SetLight FD1, "white", 0
  986. SetLight FD2, "white", 0
  987. SetLight FRAD1, "white", 0
  988. SetLight FRAD2, "white", 0
  989. SetLight FRAD3, "white", 0
  990. End Sub
  991.  
  992. ' *********************************************************************
  993. ' Section; Supporting Ball & Sound Functions
  994. ' *********************************************************************
  995.  
  996. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  997. Vol = Csng(BallVel(ball) ^2 / 2000)
  998. End Function
  999.  
  1000. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1001. Dim tmp
  1002. tmp = ball.x * 2 / table1.width-1
  1003. If tmp > 0 Then
  1004. Pan = Csng(tmp ^10)
  1005. Else
  1006. Pan = Csng(-((- tmp) ^10))
  1007. End If
  1008. End Function
  1009.  
  1010. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1011. Pitch = BallVel(ball) * 20
  1012. End Function
  1013.  
  1014. Function BallVel(ball) 'Calculates the ball speed
  1015. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2)))
  1016. End Function
  1017.  
  1018. '*****************************************
  1019. ' Section; JP's VP10 Rolling Sounds
  1020. '*****************************************
  1021.  
  1022. Const tnob = 20 ' total number of balls
  1023. Const lob = 4 'number of locked balls
  1024. ReDim rolling(tnob)
  1025. InitRolling
  1026.  
  1027. Sub InitRolling
  1028. Dim i
  1029. For i = 0 to tnob
  1030. rolling(i) = False
  1031. Next
  1032. End Sub
  1033.  
  1034. Sub RollingUpdate()
  1035. Dim BOT, b, ballpitch
  1036. BOT = GetBalls
  1037.  
  1038. ' stop the sound of deleted balls
  1039. For b = UBound(BOT) + 1 to tnob
  1040. rolling(b) = False
  1041. StopSound("fx_ballrolling" & b)
  1042. Next
  1043.  
  1044. ' exit the sub if no balls on the table
  1045. If UBound(BOT) = 3 Then Exit Sub 'there are always 4 balls on this table
  1046.  
  1047. ' play the rolling sound for each ball
  1048. For b = lob to UBound(BOT)
  1049. If BallVel(BOT(b)) > 1 Then
  1050. If BOT(b).z < 30 Then
  1051. ballpitch = Pitch(BOT(b))
  1052. Else
  1053. ballpitch = Pitch(BOT(b)) * 100
  1054. End If
  1055. rolling(b) = True
  1056. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), Pan(BOT(b)), 0, ballpitch, 1, 0
  1057. Else
  1058. If rolling(b) = True Then
  1059. StopSound("fx_ballrolling" & b)
  1060. rolling(b) = False
  1061. End If
  1062. End If
  1063. Next
  1064. End Sub
  1065.  
  1066. '**********************
  1067. ' Section; Ball Collision Sound
  1068. '**********************
  1069.  
  1070. Sub OnBallBallCollision(ball1, ball2, velocity)
  1071. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1072. End Sub
  1073.  
  1074. '******************************
  1075. ' Section; Diverse Collection Hit Sounds
  1076. '******************************
  1077.  
  1078. Sub aTargets_Hit(idx):PlaySound "fx_Target_soft", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1079. Sub aBigTargets_Hit(idx):PlaySound "fx_Target", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1080. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1081. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1082. Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1083. Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1084. Sub aYellowPins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1085. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1086. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1087. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1088. Sub aCaptiveWalls_Hit(idx):PlaySound "fx_collide", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1089.  
  1090.  
  1091. Sub PlayQuote_timer() 'one quote each 2 minutes
  1092. Dim Quote
  1093. Quote = "gb_quote" & INT(RND * 56) + 1
  1094. PlaySound Quote
  1095. End Sub
  1096.  
  1097. ' Ramp Soundss
  1098. Sub RHelp1_Hit()
  1099. StopSound "fx_metalrolling"
  1100. PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall)
  1101. End Sub
  1102.  
  1103. Sub RHelp2_Hit()
  1104. StopSound "fx_metalrolling"
  1105. PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall)
  1106. End Sub
  1107.  
  1108. ' *********************************************************************
  1109. ' User Defined Script Events
  1110. ' *********************************************************************
  1111.  
  1112. ' Initialise the Table for a new Game
  1113. Dim RandomSongStart
  1114. Sub ResetForNewGame()
  1115. If debugGeneral Then Debug.print "*****SUB:ResetForNewGame()"
  1116.  
  1117. Dim i
  1118.  
  1119. RandomSongStart = INT(RND * 8)
  1120. bGameInPLay = True
  1121.  
  1122. 'resets the score display, and turn off attrack mode
  1123. StopAttractMode
  1124. StopRainbow
  1125. GiOn
  1126.  
  1127. TotalGamesPlayed = TotalGamesPlayed + 1
  1128. CurrentPlayer = 1
  1129. PlayersPlayingGame = 1
  1130. bOnTheFirstBall = True
  1131. For i = 1 To MaxPlayers
  1132. Score(i) = 0
  1133. BonusPoints(i) = 0
  1134. BonusHeldPoints(i) = 0
  1135. BonusMultiplier(i) = 1
  1136. BallsRemaining(i) = BallsPerGame
  1137. ExtraBallsAwards(i) = 0
  1138. Next
  1139.  
  1140. ' initialise any other flags
  1141. Tilt = 0
  1142.  
  1143. ' initialise Game variables
  1144. Game_Init()
  1145.  
  1146. ' you may wish to start some music, play a sound, do whatever at this point
  1147. ' set up the start delay to handle any Start of Game Attract Sequence
  1148. vpmtimer.addtimer 1500, "FirstBall '"
  1149.  
  1150. End Sub
  1151.  
  1152. ' This is used to delay the start of a game to allow any attract sequence to
  1153. ' complete. When it expires it creates a ball for the player to start playing with
  1154.  
  1155. Sub FirstBall
  1156. If debugGeneral Then Debug.print "*****SUB:FirstBall()"
  1157.  
  1158. ' reset the table for a new ball
  1159. ResetForNewPlayerBall()
  1160. ' create a new ball in the shooters lane
  1161. CreateNewBall()
  1162. End Sub
  1163.  
  1164. ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
  1165. ' lost one or we have moved onto the next player (if multiple are playing))
  1166.  
  1167. Sub ResetForNewPlayerBall()
  1168. If debugGeneral Then Debug.print "*****SUB:ResetForNewPlayerBall()"
  1169.  
  1170. ' make sure the correct display is upto date
  1171. AddScore 0
  1172.  
  1173. ' set the current players bonus multiplier back down to 1X
  1174. SetBonusMultiplier 1
  1175.  
  1176. ' reset any drop targets, lights, game modes etc..
  1177.  
  1178. BonusPoints(CurrentPlayer) = 0
  1179. bBonusHeld = False
  1180. bExtraBallWonThisBall = False
  1181. ResetNewBallLights()
  1182.  
  1183. 'Reset any table specific
  1184. ResetNewBallVariables
  1185.  
  1186. 'This is a new ball, so activate the ballsaver
  1187. bBallSaverReady = True
  1188.  
  1189. 'and the skillshot
  1190. SkillShotReady = 1
  1191.  
  1192. 'ResetModes : drain
  1193. If KeepLaneSaves = 0 Then ResetSAVE
  1194. ResetCORE
  1195. ResetGate
  1196. ResetBonusLights
  1197. ResetSuperSpinner
  1198. StartRAD
  1199. StartMaxTarget
  1200. ResetReactorBonus
  1201.  
  1202. 'Change the music ?
  1203. End Sub
  1204.  
  1205. ' Create a new ball on the Playfield
  1206.  
  1207. Sub CreateNewBall()
  1208. ' create a ball in the plunger lane kicker.
  1209. BallRelease.CreateSizedball BallSize / 2
  1210. ' There is a (or another) ball on the playfield
  1211. AddBallsOnPlayfield 1
  1212.  
  1213. If debugGeneral Then Debug.print "*****SUB:CreateNewBall, BallCnt = " & " : " & BallsOnPlayfield
  1214.  
  1215. 'ChangeGI "blue"
  1216.  
  1217. ' kick it out..
  1218. PlaySound SoundFXDOF("fx_Ballrel", 121, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1
  1219. BallRelease.Kick 90, 4
  1220.  
  1221. StartBackgroundMusic
  1222.  
  1223.  
  1224. If bBallSaverSingleUse = 1 then bBallSaverSingleUse = 0 'SAVE mode: Clear single ball save
  1225. End Sub
  1226.  
  1227. Sub CreateNewBallAfterBallLock()
  1228. ' create a ball in the plunger lane kicker.
  1229. BallRelease.CreateSizedball BallSize / 2
  1230. ' There is a (or another) ball on the playfield
  1231. 'BallsOnPlayfield = BallsOnPlayfield
  1232.  
  1233. If debugGeneral Then Debug.print "*****SUB:CreateNewBallAfterBallLock, BallCnt = " & " : " & BallsOnPlayfield
  1234.  
  1235. ' kick it out..
  1236. PlaySound SoundFXDOF("fx_Ballrel", 121, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1
  1237. BallRelease.Kick 90, 4
  1238. bAutoPlunger = True
  1239.  
  1240. End Sub
  1241.  
  1242.  
  1243. ' Add extra balls to the table with autoplunger
  1244. ' Use it as AddMultiball 4 to add 4 extra balls to the table
  1245.  
  1246. Sub AddMultiball(nballs)
  1247. If debugGeneral Then Debug.print "*****SUB:AddMultiball()"
  1248.  
  1249. mBalls2Eject = mBalls2Eject + nballs
  1250. CreateMultiballTimer.Interval = 1000
  1251. CreateMultiballTimer.Enabled = True
  1252. End Sub
  1253.  
  1254. ' Eject the ball after the delay, AddMultiballDelay
  1255. Sub CreateMultiballTimer_Timer()
  1256. If debugGeneral Then Debug.print "*****SUB:CreateMultiballTimer_Timer()"
  1257.  
  1258. ' wait if there is a ball in the plunger lane
  1259. If bBallInPlungerLane Then
  1260. debug.print "AAA"
  1261. Exit Sub
  1262. Else
  1263. If BallsOnPlayfield < MaxMultiballs Then
  1264. CreateNewBall()
  1265. mBalls2Eject = mBalls2Eject -1
  1266. If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
  1267. Me.Enabled = False
  1268. End If
  1269. Else 'the max number of multiballs is reached, so stop the timer
  1270. mBalls2Eject = 0
  1271. Me.Enabled = False
  1272. End If
  1273. End If
  1274. End Sub
  1275.  
  1276. ' The Player has lost his ball (there are no more balls on the playfield).
  1277. ' Handle any bonus points awarded
  1278.  
  1279. Sub EndOfBall()
  1280. Dim AwardPoints1, AwardPoints2, AwardPoints3, TotalBonus
  1281. Dim tmp
  1282. If debugGeneral Then Debug.print "*****SUB:EndOfBall()"
  1283.  
  1284. ' TNA bonus
  1285. ' Target bonus - 1000 * targets * bonus level
  1286. ' Unused BallSave bonus - ? 5000 each?
  1287. ' Reactor bonus
  1288. 'Total bonus
  1289.  
  1290. AwardPoints1 = 0
  1291. AwardPoints2 = 0
  1292. AwardPoints3 = 0
  1293. TotalBonus = 0
  1294.  
  1295. ' the first ball has been lost. From this point on no new players can join in
  1296. bOnTheFirstBall = False
  1297.  
  1298. 'Stop music
  1299. StopBackgroundMusic
  1300. If((BallsRemaining(CurrentPlayer) <= 1) AND (ExtraBallsAwards(CurrentPlayer) = 0)) Then 'If game ends with reactor critical
  1301. StopSound "tna_reactorcritical"
  1302. GIReactorStoppedImmediate
  1303. End If
  1304.  
  1305.  
  1306. ' only process any of this if the table is not tilted. (the tilt recovery
  1307. ' mechanism will handle any extra balls or end of game)
  1308.  
  1309. If(Tilted = False)Then
  1310.  
  1311. ' Count the bonus. This table uses several bonus
  1312. 'dmdflush
  1313.  
  1314. Playsound "tna_3xbonuswithend"
  1315. AwardPoints1 = LaneSaveBonusValue * LaneSaveCount(CurrentPlayer)
  1316. AwardPoints2 = TargetBonusValue * BonusPoints(CurrentPlayer) * BonusMultiplier(CurrentPlayer)
  1317. AwardPoints3 = ReactorBonus
  1318. TotalBonus = (LaneSaveBonusValue * LaneSaveCount(CurrentPlayer)) + (TargetBonusValue * BonusPoints(CurrentPlayer)) + ReactorBonus
  1319. AddScore TotalBonus
  1320.  
  1321. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "UNUSED BALLSAVE"), eNone, CenterLine(3, FormatScore(AwardPoints1)), eBlinkFast, 900, True, ""
  1322.  
  1323. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TARGET BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints2)), eBlinkFast, 1500, True, ""
  1324.  
  1325. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "REACTOR BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints3)), eBlinkFast, 1500, True, ""
  1326.  
  1327. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TOTAL BONUS"), eNone, CenterLine(3, FormatScore(TotalBonus)), eBlinkFast, 1500, True, ""
  1328.  
  1329.  
  1330.  
  1331. ' add a bit of a delay to allow for the bonus points to be shown & added up
  1332. vpmtimer.addtimer 9000, "EndOfBall2 '"
  1333. Else
  1334. vpmtimer.addtimer 100, "EndOfBall2 '"
  1335. End If
  1336. End Sub
  1337.  
  1338. ' The Timer which delays the machine to allow any bonus points to be added up
  1339. ' has expired. Check to see if there are any extra balls for this player.
  1340. ' if not, then check to see if this was the last ball (of the CurrentPlayer)
  1341. '
  1342. Sub EndOfBall2()
  1343. If debugGeneral Then Debug.print "*****SUB:EndOfBall2()"
  1344.  
  1345. ChangeGi "blue"
  1346.  
  1347. ' if were tilted, reset the internal tilted flag (this will also
  1348. ' set TiltWarnings back to zero) which is useful if we are changing player LOL
  1349. Tilted = False
  1350. Tilt = 0
  1351. DisableTable False 'enable again bumpers and slingshots
  1352.  
  1353. ' has the player won an extra-ball ? (might be multiple outstanding)
  1354. If(ExtraBallsAwards(CurrentPlayer) <> 0)Then
  1355. debug.print "Extra Ball"
  1356.  
  1357. ' yep got to give it to them
  1358. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer)- 1
  1359.  
  1360. ' if no more EB's then turn off any shoot again light
  1361. If(ExtraBallsAwards(CurrentPlayer) = 0)Then
  1362. 'lLightShootAgain.State = 0
  1363. ResetBallSaveDisplay
  1364. End If
  1365.  
  1366. ' You may wish to do a bit of a song AND dance at this point
  1367. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("EXTRA BALL")), eBlink, 1000, True, "tna_extraball"
  1368.  
  1369. ' Create a new ball in the shooters lane
  1370. ResetForNewPlayerBall
  1371. CreateNewBall()
  1372.  
  1373. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
  1374. fRones.TimerInterval = ReactorPercentLossTime * 1000
  1375. fRones.TimerEnabled = True
  1376. StartReactorRightLoopInserts
  1377. Else 'ReactorLevel(CurrentPlayer) 1 and 2 and e
  1378. StartReactorLoopInserts
  1379. End If
  1380.  
  1381. Else ' no extra balls
  1382.  
  1383. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer)- 1
  1384.  
  1385. ' was that the last ball ?
  1386. If(BallsRemaining(CurrentPlayer) <= 0)Then
  1387. debug.print "No More Balls, High Score Entry"
  1388.  
  1389. ' Submit the CurrentPlayers score to the High Score system
  1390. CheckHighScore()
  1391. ' you may wish to play some music at this point
  1392.  
  1393. Else
  1394.  
  1395. ' not the last ball (for that player)
  1396. ' if multiple players are playing then move onto the next one
  1397. EndOfBallComplete()
  1398. End If
  1399. End If
  1400. End Sub
  1401.  
  1402. ' This function is called when the end of bonus display
  1403. ' (or high score entry finished) AND it either end the game or
  1404. ' move onto the next player (or the next ball of the same player)
  1405. '
  1406. Sub EndOfBallComplete()
  1407. Dim NextPlayer
  1408.  
  1409. If debugGeneral Then debug.print "*****SUB: EndOfBallComplete()"
  1410.  
  1411. ' are there multiple players playing this game ?
  1412. If(PlayersPlayingGame > 1)Then
  1413. ' then move to the next player
  1414. NextPlayer = CurrentPlayer + 1
  1415. ' are we going from the last player back to the first
  1416. ' (ie say from player 4 back to player 1)
  1417. If(NextPlayer > PlayersPlayingGame)Then
  1418. NextPlayer = 1
  1419. End If
  1420. Else
  1421. NextPlayer = CurrentPlayer
  1422. End If
  1423.  
  1424. ' is it the end of the game ? (all balls been lost for all players)
  1425. If((BallsRemaining(CurrentPlayer) <= 0)AND(BallsRemaining(NextPlayer) <= 0))Then
  1426. ' you may wish to do some sort of Point Match free game award here
  1427. ' generally only done when not in free play mode
  1428.  
  1429. ' set the machine into game over mode
  1430. EndOfGame()
  1431.  
  1432. ' you may wish to put a Game Over message on the desktop/backglass
  1433.  
  1434. Else
  1435. ' Save any additional Player data
  1436. SavePlayerData
  1437.  
  1438. ' set the next player
  1439. CurrentPlayer = NextPlayer
  1440.  
  1441. ' Restore next player data or load default setting for ball 1
  1442. RestorePlayerData
  1443.  
  1444. ' make sure the correct display is up to date
  1445. AddScore 0
  1446.  
  1447. ' reset the playfield for the new player (or new ball)
  1448. ResetForNewPlayerBall()
  1449.  
  1450. ' AND create a new ball
  1451. CreateNewBall()
  1452.  
  1453. ' play a sound if more than 1 player
  1454. If PlayersPlayingGame > 1 Then
  1455. 'PlaySound "vo_player" &CurrentPlayer
  1456. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "PLAYER " &CurrentPlayer), eNone, 800, True, ""
  1457. End If
  1458. End If
  1459.  
  1460. If debugGeneral Then debug.print "Next Player = " & NextPlayer
  1461.  
  1462. End Sub
  1463.  
  1464. ' This function is called at the End of the Game, it should reset all
  1465. ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
  1466.  
  1467. Sub EndOfGame()
  1468. If debugGeneral Then debug.print "*****SUB:EndOfGame()"
  1469.  
  1470. bGameInPLay = False
  1471. ' just ended your game then play the end of game tune
  1472. If NOT bJustStarted Then
  1473. 'PlaySong "m_end", 1
  1474. End If
  1475. bJustStarted = False
  1476. ' ensure that the flippers are down
  1477. SolLFlipper 0
  1478. SolRFlipper 0
  1479.  
  1480. ' terminate all modes - eject locked balls
  1481. ' most of the modes/timers terminate at the end of the ball
  1482. PlayQuote.Enabled = 0
  1483.  
  1484. ' set any lights for the attract mode
  1485. GiOff
  1486. StartAttractMode 1
  1487. ' you may wish to light any Game Over Light you may have
  1488.  
  1489. DropTargetResetLockIsLit 0
  1490. End Sub
  1491.  
  1492. Function Balls
  1493. Dim tmp
  1494. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  1495. If tmp > BallsPerGame Then
  1496. Balls = BallsPerGame
  1497. Else
  1498. Balls = tmp
  1499. End If
  1500. End Function
  1501.  
  1502. ' *********************************************************************
  1503. ' Section; Drain / Plunger Functions
  1504. ' *********************************************************************
  1505.  
  1506. ' lost a ball ;-( check to see how many balls are on the playfield.
  1507. ' if only one then decrement the remaining count AND test for End of game
  1508. ' if more than 1 ball (multi-ball) then kill of the ball but don't create
  1509. ' a new one
  1510. '
  1511. Sub Drain_Hit()
  1512. DOF 116, DOFPulse
  1513. startB2S(7)
  1514. ' Destroy the ball
  1515. Drain.DestroyBall
  1516. ' Exit Sub ' only for debugging
  1517. AddBallsOnPlayfield -1
  1518.  
  1519. If debugGeneral Then Debug.print "Drain_Hit(), ballcnt=" & BallsOnPlayfield
  1520.  
  1521. ' pretend to knock the ball into the ball storage mech
  1522. PlaySound "fx_drain"
  1523. 'if Tilted the end Ball modes
  1524. If Tilted Then
  1525. StopEndOfBallModes
  1526. End If
  1527.  
  1528. ' if there is a game in progress AND it is not Tilted
  1529. If(bGameInPLay = True)AND(Tilted = False)Then
  1530.  
  1531. ' is the ball saver active,
  1532. If(bBallSaverActive = True) Then
  1533.  
  1534. ' yep, create a new ball in the shooters lane
  1535. ' we use the Addmultiball in case the multiballs are being ejected
  1536. AddMultiball 1
  1537. ' we kick the ball with the autoplunger
  1538. bAutoPlunger = True
  1539. ' you may wish to put something on a display or play a sound at this point
  1540. if (bMultiBallMode = False) Then
  1541. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, "tna_ballsaved"
  1542. End If
  1543.  
  1544. Else
  1545.  
  1546. 'Check if player used a SAVE to save ball
  1547. 'UseSAVE LastSwitchHit
  1548. If bBallSaverSingleUse = 1 Then
  1549. ' yep, create a new ball in the shooters lane
  1550. ' we use the Addmultiball in case the multiballs are being ejected
  1551. AddMultiball 1
  1552. ' we kick the ball with the autoplunger
  1553. bAutoPlunger = True
  1554. ' you may wish to put something on a display or play a sound at this point
  1555. 'DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, "tna_ballsaved"
  1556. Exit Sub
  1557. End If
  1558.  
  1559. ' cancel any multiball if on last ball (ie. lost all other balls)
  1560. If(BallsOnPlayfield = 1)Then
  1561. ' AND in a multi-ball??
  1562. If(bMultiBallMode = True)then
  1563. ' not in multiball mode any more
  1564. bMultiBallMode = False
  1565. ResetGate
  1566. EndMultiball
  1567. ChangeGi "blue"
  1568. ' you may wish to change any music over at this point and
  1569. ' turn off any multiball specific lights
  1570. 'DropTargetReset
  1571. End If
  1572. End If
  1573.  
  1574. ' was that the last ball on the playfield
  1575. If(BallsOnPlayfield = 0)Then
  1576. ' End Modes and timers
  1577. 'PlaySong "m_wait", 1
  1578. StopEndOfBallModes
  1579.  
  1580. fRones.TimerEnabled = False 'stop reactor decrement timer if running
  1581. ResetReactorLoopInserts
  1582.  
  1583. ChangeGi "red"
  1584. ' handle the end of ball (count bonus, change player, high score entry etc..)
  1585. vpmtimer.addtimer 1500, "EndOfBall '"
  1586. End If
  1587. End If
  1588. End If
  1589. End Sub
  1590.  
  1591. ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane
  1592. ' Check to see if a ball saver mechanism is needed and if so fire it up.
  1593.  
  1594. Sub swPlungerRest_Hit()
  1595. If debugGeneral Then debug.print "*****SUB:swPlungerRest_Hit, Resting"
  1596.  
  1597. Wall348.TimerInterval = AutoPlungeDelay*1000
  1598.  
  1599. ' some sound according to the ball position
  1600. PlaySound "fx_sensor", 0, 1, 0.15, 0.25
  1601. bBallInPlungerLane = True
  1602.  
  1603. If SkillshotReady = 2 Then 'Soft plunge failed. Cancel Skillshot and Autolaunch
  1604. bAutoPlunger = True
  1605. CheckSkillShot 0
  1606. PlaySound "gb_electricity1", 0, 1, -0.05, 0.05
  1607. Wall348.TimerInterval = 250
  1608. End If
  1609.  
  1610. ' turn on Launch light is there is one
  1611. 'LaunchLight.State = 2
  1612. ' kick the ball in play if the bAutoPlunger flag is on
  1613. If bAutoPlunger Then
  1614. If debugGeneral Then debug.print "*****SUB:swPlungerRest_Hit, AutoPlunge"
  1615. Wall348.TimerEnabled = True
  1616.  
  1617.  
  1618. If mBalls2Eject = 0 Then bAutoPlunger = False
  1619.  
  1620. LightSeqAutoLaunch.StopPlay
  1621. LightSeqAutoLaunch.UpdateInterval = 1
  1622. LightSeqAutoLaunch.Play SeqUpOn, 20, 1
  1623.  
  1624. End If
  1625.  
  1626. 'Start the Selection of the skillshot if ready
  1627. If SkillShotReady = 1 Then
  1628. StartSkillshot()
  1629. End If
  1630. ' remember last trigger hit by the ball.
  1631. SetLastSwitchHit "swPlungerRest"
  1632. End Sub
  1633.  
  1634. Sub Wall348_Timer
  1635. PlungerIM.AutoFire
  1636. PlaySound SoundFXDOF("fx_plunger",125,DOFPulse,DOFContactors)
  1637. DOF 123, DOFPulse
  1638. Wall348.TimerEnabled = False
  1639.  
  1640. End Sub
  1641.  
  1642. ' The ball is released from the plunger turn off some flags and check for skillshot
  1643.  
  1644. Dim bTimedSkillShot
  1645. Sub swPlungerRest_UnHit()
  1646. bBallInPlungerLane = False
  1647. If SkillShotReady = 1 Then
  1648. SkillShotReady = 2 'Ball plunged
  1649. bSkillShotSelect = False 'Skillshot frozen
  1650. swPlungerRest.TimerInterval = 5000
  1651. swPlungerRest.TimerEnabled = True
  1652. bTimedSkillShot = True
  1653. End If
  1654.  
  1655. If debugGeneral Then debug.print "*****SUB:swPlungerRest_UnHit, Ballcnt: " & BallsOnPlayfield
  1656. 'Debug.print "BallsonPlayfieldCheck" & " : " & BallsOnPlayfield
  1657.  
  1658. ' if there is a need for a ball saver, then start off a timer
  1659. ' only start if it is ready, and it is currently not running, else it will reset the time period
  1660. 'msgbox bBallSaverReady & ":" & BallSaverTime & ":" & bBallSaverActive
  1661. If(bBallSaverReady = True)AND(BallSaverTime <> 0)And(bBallSaverActive = False)Then
  1662. EnableBallSaver BallSaverTime
  1663. End If
  1664.  
  1665. JustPlunged = True
  1666. Gate1.TimerEnabled = False
  1667. Gate1.TimerInterval = 2000
  1668. Gate1.TimerEnabled = True
  1669.  
  1670. End Sub
  1671.  
  1672. Sub swPlungerRest_Timer 'Timed skillshot support
  1673. bTimedSkillShot = False
  1674. swPlungerRest.TimerEnabled = False
  1675. End Sub
  1676.  
  1677. Sub Gate1_Timer
  1678. JustPlunged = False
  1679. Gate1.TimerEnabled = False
  1680. End Sub
  1681.  
  1682. 'Version of Ballsaver using led display
  1683. Dim dbs1, dbs2, dbsdelta, dbstime, dbstens, dbsones, dbsdecimals
  1684. Sub EnableBallSaver(seconds)
  1685. seconds = seconds + .3 'padding
  1686. 'If debugGeneral Then debug.print "*****SUB:EnableBallSaver, seconds=" & seconds
  1687. ' set our game flag
  1688. bBallSaverActive = True
  1689. bBallSaverReady = False
  1690. ' start the timer
  1691.  
  1692. BallSaverTimerExpired.Interval = 1000 * seconds
  1693. BallSaverTimerExpired.Enabled = True
  1694.  
  1695. 'Set display to x seconds
  1696. dbstime = seconds
  1697. dbsdelta = .1
  1698. BallSaverUpdateTimer.Interval = 100
  1699.  
  1700. dbstens = Int(dbstime/10)
  1701. dbsones = Int(dbstime-dbstens*10)
  1702. dbsdecimals = Int((dbstime-dbstens*10-dbsones)*10)
  1703.  
  1704. debug.print dbsones
  1705. debug.print dbsdecimals
  1706. if dbstime > 10 then
  1707. fBStens.ImageA = Eval(dbstens)
  1708. fBSones.ImageA = Eval(dbsones)
  1709. else
  1710. fBStens.ImageA = Eval (dbsones + 10)
  1711. fBSones.ImageA = Eval(dbsdecimals)
  1712. end if
  1713. ' if dbstime > 10 then
  1714. ' dBallSave1.SetValue (dbstens + 1)
  1715. ' dBallSave2.SetValue (dbsones + 1)
  1716. ' else
  1717. ' dBallSave1.SetValue (dbsones + 1+10)
  1718. ' dBallSave2.SetValue (dbsdecimals + 1)
  1719. ' end if
  1720.  
  1721. dbstime = dbstime - dbsdelta
  1722. BallSaverUpdateTimer.Enabled = True
  1723.  
  1724.  
  1725. End Sub
  1726.  
  1727. ' The ball saver timer has expired. Turn it off AND reset the game flag
  1728. '
  1729. Sub BallSaverTimerExpired_Timer()
  1730. If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimerExpired_Timer"
  1731. BallSaverTimerExpired.Enabled = False
  1732. BallSaverUpdateTimer.Enabled = False
  1733.  
  1734. ' clear the LED display, give extra 1 second
  1735. If ExtraBallsAwards(CurrentPlayer) = 0 Then
  1736. ResetBallSaveDisplay
  1737. Else
  1738. SetExtraBallDisplay
  1739. End If
  1740. BallSaverTimer2Expired.Interval = 1000
  1741. BallSaverTimer2Expired.Enabled = True
  1742. End Sub
  1743.  
  1744. Sub ResetBallSaveDisplay
  1745. ' dBallSave1.SetValue 0
  1746. ' dBallSave2.SetValue 0
  1747. fBStens.ImageA = "blank"
  1748. fBSones.ImageA = "blank"
  1749. End Sub
  1750.  
  1751.  
  1752. Sub BallSaverTimer2Expired_Timer()
  1753. If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimer2Expired_Timer"
  1754. BallSaverTimer2Expired.Enabled = False
  1755.  
  1756. ' clear the flag
  1757. bBallSaverActive = False
  1758. End Sub
  1759.  
  1760. Sub BallSaverUpdateTimer_Timer()
  1761. Dim tmp
  1762. 'If debugGeneral Then debug.print "*****SUB:" & "BallSaverUpdateTimer_Timer " & dbstime
  1763.  
  1764. dbstens = Int(dbstime/10)
  1765. dbsones = Int(dbstime-dbstens*10)
  1766. dbsdecimals = Int((dbstime-dbstens*10-dbsones)*10)
  1767.  
  1768. if dbstime > 10 then
  1769. fBStens.ImageA = Eval(dbstens)
  1770. fBSones.ImageA = Eval(dbsones)
  1771. else
  1772. fBStens.ImageA = Eval (dbsones + 10)
  1773. fBSones.ImageA = Eval(dbsdecimals)
  1774. end if
  1775. ' if dbstime > 10 then
  1776. ' 'DEBUG.PRINT dbstime & " : " & dbstens & " : " & dbsones & " : " & dbsdecimals
  1777. ' dBallSave1.SetValue (dbstens + 1)
  1778. ' dBallSave2.SetValue (dbsones + 1)
  1779. ' else
  1780. ' 'DEBUG.PRINT dbstime & " : " & dbstens & " : " & dbsones & " : " & dbsdecimals
  1781. ' dBallSave1.SetValue (dbsones + 1+10)
  1782. ' dBallSave2.SetValue (dbsdecimals + 1)
  1783. ' end if
  1784. dbstime = dbstime - dbsdelta
  1785.  
  1786. End Sub
  1787.  
  1788. 'Version of Ballsaver using light insert
  1789. 'Sub EnableBallSaver(seconds)
  1790. ' If debugGeneral Then debug.print "*****SUB:EnableBallSaver, seconds=" & seconds
  1791. ' ' set our game flag
  1792. ' bBallSaverActive = True
  1793. ' bBallSaverReady = False
  1794. ' ' start the timer
  1795. ' BallSaverTimerExpired.Interval = 1000 * seconds
  1796. ' BallSaverTimerExpired.Enabled = True
  1797. ' BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
  1798. ' BallSaverSpeedUpTimer.Enabled = True
  1799. ' ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
  1800. ' lLightShootAgain.BlinkInterval = 160
  1801. ' lLightShootAgain.State = 2
  1802. 'End Sub
  1803. '
  1804. '' The ball saver timer has expired. Turn it off AND reset the game flag
  1805. ''
  1806. 'Sub BallSaverTimerExpired_Timer()
  1807. ' If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimerExpired_Timer"
  1808. ' BallSaverTimerExpired.Enabled = False
  1809. ' ' clear the flag
  1810. ' bBallSaverActive = False
  1811. ' ' if you have a ball saver light then turn it off at this point
  1812. ' lLightShootAgain.State = 0
  1813. 'End Sub
  1814. '
  1815. 'Sub BallSaverSpeedUpTimer_Timer()
  1816. ' If debugGeneral Then debug.print "*****SUB:" & "BallSaverSpeedUpTimer_Timer"
  1817. ' BallSaverSpeedUpTimer.Enabled = False
  1818. ' ' Speed up the blinking
  1819. ' lLightShootAgain.BlinkInterval = 80
  1820. ' lLightShootAgain.State = 2
  1821. 'End Sub
  1822. ' *********************************************************************
  1823. ' Supporting Score Functions
  1824. ' *********************************************************************
  1825.  
  1826. Dim checkones
  1827. Sub AddScore(points)
  1828. Dim xmultiplier
  1829. xMultiplier = BallsOnPlayfield
  1830. If xMultiplier = 0 then xMultiplier = 1
  1831.  
  1832. If(Tilted = False)Then
  1833. ' add the points to the current players score variable
  1834. Score(CurrentPlayer) = Score(CurrentPlayer) + (points * xMultiplier)
  1835.  
  1836. 'If (Score(CurrentPlayer) mod 10) > checkones Then
  1837. ' msgbox "Score changed by one"
  1838. ' checkones = (Score(CurrentPlayer) mod 10)
  1839. 'End if
  1840.  
  1841. ' update the score displays
  1842. DMDScore
  1843. End if
  1844.  
  1845. If debugGeneral Then debug.print "*****SUB:" & "AddScore(" & points * xMultiplier & "), Total=" & Score(CurrentPlayer)
  1846. ' you may wish to check to see if the player has gotten a replay
  1847. End Sub
  1848.  
  1849.  
  1850. Sub AddScoreForReactor()
  1851. If(Tilted = False)Then
  1852. ' add the points to the current players score variable
  1853. Score(CurrentPlayer) = Score(CurrentPlayer) + (1)
  1854.  
  1855. ' update the score displays
  1856. DMDScore
  1857. End if
  1858.  
  1859. If debugGeneral Then debug.print "*****SUB:" & "AddScore(1), Total=" & Score(CurrentPlayer)
  1860. End Sub
  1861.  
  1862. Sub AddScoreSpecial2(points, points2) 'Increase Score and Reactor value
  1863. If debugGeneral Then debug.print "*****SUB:" & "AddScoreSpecial(" & points & ")"
  1864.  
  1865. If(Tilted = False)Then
  1866. ' add the points to the current players score variable
  1867. 'Score(CurrentPlayer) = Score(CurrentPlayer) + points
  1868.  
  1869. If ReactorValue(CurrentPlayer) < ReactorValueMax(CurrentPlayer) Then
  1870.  
  1871. ReactorValue(CurrentPlayer) = ReactorValue(CurrentPlayer) + points2
  1872. If ReactorValue(CurrentPlayer) >= ReactorValueMax(CurrentPlayer) Then
  1873. ReactorValue(CurrentPlayer) = ReactorValueMax(CurrentPlayer)
  1874. End If
  1875. AddReactorBonus points2
  1876. tReactorValue.text = ReactorValue(CurrentPlayer)
  1877. End If
  1878.  
  1879. AddScore(points)
  1880.  
  1881. End if
  1882.  
  1883. ' you may wish to check to see if the player has gotten a replay
  1884. End Sub
  1885.  
  1886. Sub AddScoreSpecial(points) 'Increase Score and Reactor value
  1887. If debugGeneral Then debug.print "*****SUB:" & "AddScoreSpecial(" & points & ")"
  1888.  
  1889. AddScoreSpecial2 points, points
  1890.  
  1891. End Sub
  1892.  
  1893. Sub SetReactorMaxed
  1894. Dim delta
  1895. 'Update Reactor value to max
  1896. delta = ReactorValueMax(CurrentPlayer) - ReactorValue(CurrentPlayer)
  1897. ReactorValue(CurrentPlayer) = ReactorValueMax(CurrentPlayer)
  1898.  
  1899. 'Update Reactor Bonus Award
  1900. If delta > 0 Then
  1901. AddReactorBonus delta
  1902. End If
  1903. End Sub
  1904.  
  1905.  
  1906. ' Add bonus to the bonuspoints AND update the score board
  1907.  
  1908. 'Sub AddBonus(points)
  1909. ' If debugGeneral Then debug.print "*****SUB:" & "AddBonus(" & points & ")"
  1910. '
  1911. ' If(Tilted = False)Then
  1912. ' ' add the bonus to the current players bonus variable
  1913. ' BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points
  1914. ' ' update the score displays
  1915. ' DMDScore
  1916. ' End if
  1917. '
  1918. '' you may wish to check to see if the player has gotten a replay
  1919. 'End Sub
  1920. '
  1921. '' Add some points to the current Jackpot.
  1922. ''
  1923. 'Sub AddJackpot(points) 'not used in this table
  1924. 'End Sub
  1925.  
  1926.  
  1927.  
  1928. Sub AddBonusMultiplier(n)
  1929. If debugGeneral Then debug.print "*****SUB:" & "AddBonusMultiplier(" & n & ")"
  1930.  
  1931. Dim NewBonusLevel
  1932. ' if not at the maximum bonus level
  1933. if(BonusMultiplier(CurrentPlayer) + n <= MaxMultiplier)then
  1934. ' then add and set the lights
  1935. NewBonusLevel = BonusMultiplier(CurrentPlayer) + n
  1936. SetBonusMultiplier(NewBonusLevel)
  1937.  
  1938. End if
  1939. End Sub
  1940.  
  1941. ' Set the Bonus Multiplier to the specified level AND set any lights accordingly
  1942. ' There is no bonus multiplier lights in this table
  1943. Sub SetBonusMultiplier(Level)
  1944. Dim obj
  1945.  
  1946. If debugGeneral Then debug.print "*****SUB:" & "SetBonusMultiplier(" & Level & ")"
  1947. ' Set the multiplier to the specified level
  1948. BonusMultiplier(CurrentPlayer) = Level
  1949.  
  1950. ' Update the lights
  1951. Select Case Level:
  1952. Case 1:
  1953. l2X.State = 0
  1954. l3X.State = 0
  1955. l4X.State = 0
  1956. Case 2:
  1957. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 2X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
  1958. l2X.State = 1
  1959. l3X.State = 0
  1960. l4X.State = 0
  1961.  
  1962. GI37.TimerEnabled = True
  1963. GICoreCount = 0
  1964. For each obj in aGICore
  1965. obj.state = 0
  1966. Next
  1967. Case 3:
  1968. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 3X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
  1969. l2X.State = 1
  1970. l3X.State = 1
  1971. l4X.State = 0
  1972.  
  1973. GI37.TimerEnabled = True
  1974. GICoreCount = 0
  1975. For each obj in aGICore
  1976. obj.state = 0
  1977. Next
  1978. Case 4:
  1979. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 4X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
  1980. l2X.State = 1
  1981. l3X.State = 1
  1982. l4X.State = 1
  1983.  
  1984. GI37.TimerEnabled = True
  1985. For each obj in aGICore
  1986. obj.state = 0
  1987. Next
  1988. Case Else:
  1989. l2X.State = 1
  1990. l3X.State = 1
  1991. l4X.State = 1
  1992. End Select
  1993.  
  1994.  
  1995. End Sub
  1996.  
  1997. Dim GICoreCount,GICoredirection, GICoreSweep
  1998. GICoredirection = 1
  1999. GI37.TimerInterval=25
  2000. Sub GI37_Timer
  2001. Dim obj
  2002. For Each obj in aGICore
  2003. SetLight obj, "orange", 0
  2004. Next
  2005.  
  2006. aGICore((GICoreCount+0) Mod 13).state = 1
  2007. aGICore((GICoreCount+1) Mod 13).state = 1
  2008. aGICore((GICoreCount+2) Mod 13).state = 1
  2009. aGICore((GICoreCount+3) Mod 13).state = 0
  2010. aGICore((GICoreCount+4) Mod 13).state = 0
  2011. aGICore((GICoreCount+5) Mod 13).state = 0
  2012. aGICore((GICoreCount+6) Mod 13).state = 0
  2013. aGICore((GICoreCount+7) Mod 13).state = 0
  2014. aGICore((GICoreCount+8) Mod 13).state = 0
  2015. aGICore((GICoreCount+9) Mod 13).state = 0
  2016. aGICore((GICoreCount+10) Mod 13).state = 0
  2017. aGICore((GICoreCount+11) Mod 13).state = 0
  2018. aGICore((GICoreCount+12) Mod 13).state = 0
  2019. GICoreCount = GICoreCount + GICoredirection
  2020. If GICoreCount = 10 Then
  2021. GICoredirection = -1
  2022. GICoreSweep = GICoreSweep + 1
  2023. ElseIf GICoreCount = 0 Then
  2024. GICoreSweep = GICoreSweep + 1
  2025. GICoredirection = 1
  2026. End If
  2027.  
  2028. If GICoreSweep = 6 Then 'Sweep done, return lights to normal
  2029. GI37.TimerEnabled = False
  2030. GICoreDirection = 1
  2031. GICoreCount = 0
  2032. GICoreSweep = 0
  2033.  
  2034. For each obj in aGICore
  2035. obj.state = 1
  2036. SetLight obj, "blue", 1
  2037. Next
  2038.  
  2039. SetLight l1, "white", 0
  2040. SetLight l2, "white", 0
  2041. SetLight l3, "white", 0
  2042. SetLight l4, "white", 0
  2043. ' l1.state = 0
  2044. ' l2.state = 0
  2045. ' l3.state = 0
  2046. ' l4.state = 0
  2047. End If
  2048.  
  2049. End Sub
  2050.  
  2051.  
  2052.  
  2053. Sub AwardExtraBall()
  2054. ' If NOT bExtraBallWonThisBall Then 'Use if you want to limit to 1 extraball
  2055. DMDFlush
  2056. DMD "", eNone, "_", eNone, Centerline(2, "EXTRA BALL WON"), eBlink, "", eNone, 1000, True, "tna_extraball"
  2057. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  2058. debug.print "ExtraBall count " & ExtraBallsAwards(CurrentPlayer)
  2059. bExtraBallWonThisBall = True
  2060. GiEffect 1
  2061. LightEffect 2
  2062.  
  2063. 'Set Insert or Display
  2064. SetExtraBallDisplay
  2065. ' END If
  2066. End Sub
  2067.  
  2068. Sub AwardExtraBallNoCallout()
  2069. ' If NOT bExtraBallWonThisBall Then 'Use if you want to limit to 1 extraball
  2070. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  2071. debug.print "ExtraBall count " & ExtraBallsAwards(CurrentPlayer)
  2072. bExtraBallWonThisBall = True
  2073. GiEffect 1
  2074. LightEffect 2
  2075.  
  2076. 'Set Insert or Display
  2077. SetExtraBallDisplay
  2078. ' END If
  2079. End Sub
  2080.  
  2081. Sub SetExtraBallDisplay
  2082. ' dBallSave1.SetValue 21 'e
  2083. ' dBallSave2.SetValue 22 'b
  2084. fBStens.ImageA = "e"
  2085. fBSones.ImageA = "b"
  2086. End Sub
  2087.  
  2088. Sub AwardSpecial()
  2089. DMDFlush
  2090. DMD "", eNone, "_", eNone, Centerline(2, "EXTRA GAME WON"), eBlink, "", eNone, 1000, True, SoundFXDOF("fx_Knocker", 129, DOFPulse, DOFKnocker)
  2091. DOF 123, DOFPulse
  2092. Credits = Credits + 1
  2093. DOF 140, DOFOn
  2094. GiEffect 1
  2095. LightEffect 1
  2096. End Sub
  2097.  
  2098. Sub AwardJackpot() 'award a normal jackpot, double or triple jackpot
  2099. DMDFlush
  2100. DMD "", eNone, Centerline(1, ("JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(Jackpot)), eBlinkFast, 1000, True, "tna_jackpot"
  2101. AddScore Jackpot
  2102. GiEffect 1
  2103. LightEffect 2
  2104. FlashEffect 1
  2105. End Sub
  2106.  
  2107. Sub AwardDoubleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
  2108. DMDFlush
  2109. DMD "", eNone, Centerline(1, ("DOUBLE JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(DoubleJackpot)), eBlinkFast, 1000, True, "tna_doublejackpot"
  2110. AddScore DoubleJackpot
  2111. GiEffect 1
  2112. LightEffect 2
  2113. FlashEffect 1
  2114. End Sub
  2115.  
  2116. Sub AwardTripleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
  2117. DOF 132, DOFPulse
  2118. DMDFlush
  2119. DMD "", eNone, Centerline(1, ("TRIPLE JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(TripleJackpot)), eBlinkFast, 1000, True, "tna_triplejackpot"
  2120. AddScore TripleJackpot
  2121. GiEffect 1
  2122. LightEffect 2
  2123. FlashEffect 1
  2124. End Sub
  2125.  
  2126. Sub AwardSuperJackpot()
  2127. DOF 133, DOFPulse
  2128. DMDFlush
  2129. DMD "", eNone, Centerline(1, ("SUPER JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(SuperJackpot)), eBlinkFast, 1000, True, "tna_superjackpot"
  2130. AddScore SuperJackpot
  2131. GiEffect 1
  2132. LightEffect 2
  2133. FlashEffect 2
  2134. End Sub
  2135.  
  2136. 'Sub AwardDoubleSuperJackpot()
  2137. ' DOF 134, DOFPulse
  2138. ' DMDFlush
  2139. ' DMD "", eNone, Centerline(1, ("2X SUPER JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(SuperJackpot * 2)), eBlinkFast, 1000, True, "vo_doublesuperjackpot"
  2140. ' AddScore SuperJackpot * 2
  2141. ' GiEffect 1
  2142. ' LightEffect 2
  2143. ' FlashEffect 2
  2144. 'End Sub
  2145. '
  2146. 'Sub AwardTripleSuperJackpot()
  2147. ' DOF 135, DOFPulse
  2148. ' DMDFlush
  2149. ' DMD "", eNone, Centerline(1, ("3X SUPER JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(SuperJackpot * 3)), eBlinkFast, 1000, True, "vo_triplesuperjackpot"
  2150. ' AddScore SuperJackpot * 3
  2151. ' GiEffect 1
  2152. ' LightEffect 2
  2153. ' FlashEffect 2
  2154. 'End Sub
  2155.  
  2156. Sub AwardSkillshot()
  2157. DMDFlush
  2158. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SKILLSHOT"), eBlinkfast, 1000, True, "tna_lanesave"
  2159. debug.print "Skillshot"
  2160. AddScore SkillshotValue
  2161. GiEffect 1
  2162. LightEffect 2
  2163.  
  2164. AwardSAVE 1
  2165.  
  2166. End Sub
  2167.  
  2168.  
  2169. Sub AwardHandsFreeSkillshot()
  2170. DMDFlush
  2171. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SKILLSHOT"), eBlinkfast, 1000, True, "tna_superskillshot"
  2172. debug.print "Super Skillshot"
  2173. AddScore SkillshotValue
  2174. GiEffect 1
  2175. LightEffect 2
  2176.  
  2177. AwardSAVE 1
  2178. SetReactorReady
  2179. End Sub
  2180.  
  2181.  
  2182. 'Sub Congratulation()
  2183. ' Dim tmp
  2184. ' tmp = "vo_congrat" & INT(RND * 21 + 1)
  2185. ' PlaySound tmp
  2186. 'End Sub
  2187. '*****************************
  2188. ' Section; Load / Save / Highscore
  2189. '*****************************
  2190.  
  2191. Sub Loadhs
  2192. If debugHighScore Then debug.print "Sub:Loadhs"
  2193. Dim x
  2194. x = LoadValue(TableName, "HighScore1")
  2195. If(x <> "")Then HighScore(0) = CDbl(x)Else HighScore(0) = 100000 End If
  2196. x = LoadValue(TableName, "HighScore1Name")
  2197. If(x <> "")Then HighScoreName(0) = x Else HighScoreName(0) = "TNA" End If
  2198. x = LoadValue(TableName, "HighScore2")
  2199. If(x <> "")then HighScore(1) = CDbl(x)Else HighScore(1) = 100000 End If
  2200. x = LoadValue(TableName, "HighScore2Name")
  2201. If(x <> "")then HighScoreName(1) = x Else HighScoreName(1) = "TNA" End If
  2202. x = LoadValue(TableName, "HighScore3")
  2203. If(x <> "")then HighScore(2) = CDbl(x)Else HighScore(2) = 100000 End If
  2204. x = LoadValue(TableName, "HighScore3Name")
  2205. If(x <> "")then HighScoreName(2) = x Else HighScoreName(2) = "TNA" End If
  2206. x = LoadValue(TableName, "HighScore4")
  2207. If(x <> "")then HighScore(3) = CDbl(x)Else HighScore(3) = 100000 End If
  2208. x = LoadValue(TableName, "HighScore4Name")
  2209. If(x <> "")then HighScoreName(3) = x Else HighScoreName(3) = "TNA" End If
  2210. x = LoadValue(TableName, "Credits")
  2211. If(x <> "")then Credits = CInt(x)Else Credits = 0 End If
  2212. x = LoadValue(TableName, "TotalGamesPlayed")
  2213. If(x <> "")then TotalGamesPlayed = CInt(x)Else TotalGamesPlayed = 0 End If
  2214. End Sub
  2215.  
  2216. Sub Savehs
  2217. If debugHighScore Then debug.print "Sub:Savehs"
  2218.  
  2219. SaveValue TableName, "HighScore1", HighScore(0)
  2220. SaveValue TableName, "HighScore1Name", HighScoreName(0)
  2221. SaveValue TableName, "HighScore2", HighScore(1)
  2222. SaveValue TableName, "HighScore2Name", HighScoreName(1)
  2223. SaveValue TableName, "HighScore3", HighScore(2)
  2224. SaveValue TableName, "HighScore3Name", HighScoreName(2)
  2225. SaveValue TableName, "HighScore4", HighScore(3)
  2226. SaveValue TableName, "HighScore4Name", HighScoreName(3)
  2227. SaveValue TableName, "Credits", Credits
  2228. SaveValue TableName, "TotalGamesPlayed", TotalGamesPlayed
  2229. End Sub
  2230.  
  2231. ' ***********************************************************
  2232. ' High Score Initals Entry Functions - based on Black's code
  2233. ' ***********************************************************
  2234.  
  2235. Dim hsbModeActive
  2236. Dim hsEnteredName
  2237. Dim hsEnteredDigits(3)
  2238. Dim hsCurrentDigit
  2239. Dim hsValidLetters
  2240. Dim hsCurrentLetter
  2241. Dim hsLetterFlash
  2242.  
  2243. Sub CheckHighscore()
  2244. If debugHighScore Then debug.print "Sub:CheckHighscore"
  2245.  
  2246. Dim tmp
  2247. tmp = Score(1)
  2248. If Score(2) > tmp Then tmp = Score(2)
  2249. If Score(3) > tmp Then tmp = Score(3)
  2250. If Score(4) > tmp Then tmp = Score(4)
  2251.  
  2252. If tmp > HighScore(1)Then 'add 1 credit for beating the highscore
  2253. AwardSpecial
  2254. End If
  2255.  
  2256. If tmp > HighScore(3)Then
  2257. HighScore(3) = tmp
  2258. 'enter player's name
  2259. HighScoreEntryInit()
  2260. Else
  2261. EndOfBallComplete()
  2262. End If
  2263. End Sub
  2264.  
  2265. Sub HighScoreEntryInit()
  2266. If debugHighScore Then debug.print "Sub:HighScoreEntryInit"
  2267. hsbModeActive = True
  2268. 'PlaySound "vo_enteryourinitials"
  2269. hsLetterFlash = 0
  2270.  
  2271. hsEnteredDigits(0) = " "
  2272. hsEnteredDigits(1) = " "
  2273. hsEnteredDigits(2) = " "
  2274. hsCurrentDigit = 0
  2275.  
  2276. hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ'<>*+-/=\^0123456789`" ' ` is back arrow
  2277. hsCurrentLetter = 1
  2278. DMDFlush()
  2279. HighScoreDisplayNameNow()
  2280.  
  2281. HighScoreFlashTimer.Interval = 250
  2282. HighScoreFlashTimer.Enabled = True
  2283. End Sub
  2284.  
  2285. Sub EnterHighScoreKey(keycode)
  2286. If debugHighScore Then debug.print "Sub:EnterHighScoreKey"
  2287.  
  2288. If keycode = LeftFlipperKey Then
  2289. Playsound "fx_Previous"
  2290. hsCurrentLetter = hsCurrentLetter - 1
  2291. if(hsCurrentLetter = 0)then
  2292. hsCurrentLetter = len(hsValidLetters)
  2293. end if
  2294. HighScoreDisplayNameNow()
  2295. End If
  2296.  
  2297. If keycode = RightFlipperKey Then
  2298. Playsound "fx_Next"
  2299. hsCurrentLetter = hsCurrentLetter + 1
  2300. if(hsCurrentLetter > len(hsValidLetters))then
  2301. hsCurrentLetter = 1
  2302. end if
  2303. HighScoreDisplayNameNow()
  2304. End If
  2305.  
  2306. If keycode = PlungerKey Then
  2307. if(mid(hsValidLetters, hsCurrentLetter, 1) <> "`")then
  2308. playsound "fx_Enter"
  2309. hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
  2310. hsCurrentDigit = hsCurrentDigit + 1
  2311. if(hsCurrentDigit = 3)then
  2312. HighScoreCommitName()
  2313. else
  2314. HighScoreDisplayNameNow()
  2315. end if
  2316. else
  2317. playsound "fx_Esc"
  2318. hsEnteredDigits(hsCurrentDigit) = " "
  2319. if(hsCurrentDigit > 0)then
  2320. hsCurrentDigit = hsCurrentDigit - 1
  2321. end if
  2322. HighScoreDisplayNameNow()
  2323. end if
  2324. end if
  2325. End Sub
  2326.  
  2327. Sub HighScoreDisplayNameNow()
  2328. If debugHighScore Then debug.print "Sub:HighScoreDisplayNameNow"
  2329. HighScoreFlashTimer.Enabled = False
  2330. hsLetterFlash = 0
  2331. HighScoreDisplayName()
  2332. HighScoreFlashTimer.Enabled = True
  2333. End Sub
  2334.  
  2335. Sub HighScoreDisplayName()
  2336. If debugHighScore Then debug.print "Sub:HighScoreDisplayName"
  2337. Dim i
  2338. Dim TempTopStr
  2339. Dim TempBotStr
  2340.  
  2341. TempTopStr = "ENTER YOUR INITIALS"
  2342. dLine(1) = TempTopStr
  2343. DMDUpdate 1
  2344.  
  2345. TempBotStr = " > "
  2346. if(hsCurrentDigit > 0)then TempBotStr = TempBotStr & hsEnteredDigits(0)
  2347. if(hsCurrentDigit > 1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
  2348. if(hsCurrentDigit > 2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
  2349.  
  2350. if(hsCurrentDigit <> 3)then
  2351. if(hsLetterFlash <> 0)then
  2352. TempBotStr = TempBotStr & "_"
  2353. else
  2354. TempBotStr = TempBotStr & mid(hsValidLetters, hsCurrentLetter, 1)
  2355. end if
  2356. end if
  2357.  
  2358. if(hsCurrentDigit < 1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
  2359. if(hsCurrentDigit < 2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
  2360.  
  2361. TempBotStr = TempBotStr & " < "
  2362. dLine(2) = CenterLine(2, TempBotStr)
  2363. DMDUpdate 2
  2364. End Sub
  2365.  
  2366. Sub HighScoreFlashTimer_Timer()
  2367. If debugHighScore Then debug.print "Sub:HighScoreFlashTimer_Timer"
  2368. HighScoreFlashTimer.Enabled = False
  2369. hsLetterFlash = hsLetterFlash + 1
  2370. if(hsLetterFlash = 2)then hsLetterFlash = 0
  2371. HighScoreDisplayName()
  2372. HighScoreFlashTimer.Enabled = True
  2373. End Sub
  2374.  
  2375. Sub HighScoreCommitName()
  2376. If debugHighScore Then debug.print "Sub:HighScoreCommitName"
  2377. HighScoreFlashTimer.Enabled = False
  2378. hsbModeActive = False
  2379. hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
  2380. if(hsEnteredName = " ")then
  2381. hsEnteredName = "YOU"
  2382. end if
  2383.  
  2384. HighScoreName(3) = hsEnteredName
  2385. SortHighscore
  2386. EndOfBallComplete()
  2387. End Sub
  2388.  
  2389. Sub SortHighscore
  2390. If debugHighScore Then debug.print "Sub:SortHighscore"
  2391. Dim tmp, tmp2, i, j
  2392. For i = 0 to 3
  2393. For j = 0 to 2
  2394. If HighScore(j) < HighScore(j + 1)Then
  2395. tmp = HighScore(j + 1)
  2396. tmp2 = HighScoreName(j + 1)
  2397. HighScore(j + 1) = HighScore(j)
  2398. HighScoreName(j + 1) = HighScoreName(j)
  2399. HighScore(j) = tmp
  2400. HighScoreName(j) = tmp2
  2401. End If
  2402. Next
  2403. Next
  2404. End Sub
  2405.  
  2406. ' *****************************************************************************
  2407. ' JP's Reduced Display Driver Functions for Slimer (based on script by Black)
  2408. ' only 5 effects: none, scroll left, scroll right, blink and blinkfast
  2409. ' 4 Lines, treats all 4 lines as text
  2410. ' Example format:
  2411. ' DMD "backgnd", eNone,"text1", eNone,"text2", eNone, "centertext", eNone, 250, True, "sound"
  2412. ' Short names:
  2413. ' dq = display queue
  2414. ' de = display effect
  2415. ' "_" in a line means: do nothing
  2416. ' *****************************************************************************
  2417.  
  2418. Const eNone = 0 ' Instantly displayed
  2419. Const eScrollLeft = 1 ' scroll on from the right
  2420. Const eScrollRight = 2 ' scroll on from the left
  2421. Const eBlink = 3 ' Blink (blinks for 'TimeOn')
  2422. Const eBlinkFast = 4 ' Blink (blinks for 'TimeOn') at user specified intervals (fast speed)
  2423.  
  2424. Const dqSize = 64
  2425.  
  2426. Dim dqHead
  2427. Dim dqTail
  2428. Dim deSpeed
  2429. Dim deBlinkSlowRate
  2430. Dim deBlinkFastRate
  2431.  
  2432. Dim dCharsPerLine(3)
  2433. Dim dLine(3)
  2434. Dim deCount(3)
  2435. Dim deCountEnd(3)
  2436. Dim deBlinkCycle(3)
  2437.  
  2438. Dim dqText(3, 64)
  2439. Dim dqEffect(3, 64)
  2440. Dim dqTimeOn(64)
  2441. Dim dqbFlush(64)
  2442. Dim dqSound(64)
  2443.  
  2444. Sub DMD_Init() 'default/startup values
  2445. Dim i, j
  2446. DMDFlush()
  2447. deSpeed = 20
  2448. deBlinkSlowRate = 5
  2449. deBlinkFastRate = 2
  2450. dCharsPerLine(0) = 3
  2451. dCharsPerLine(1) = 19
  2452. dCharsPerLine(2) = 19
  2453. dCharsPerLine(3) = 13
  2454. For i = 0 to 3
  2455. dLine(i) = Space(dCharsPerLine(i))
  2456. deCount(i) = 0
  2457. deCountEnd(i) = 0
  2458. deBlinkCycle(i) = 0
  2459. dqTimeOn(i) = 0
  2460. dqbFlush(i) = True
  2461. dqSound(i) = ""
  2462. Next
  2463. For i = 0 to 3
  2464. For j = 0 to 64
  2465. dqText(i, j) = ""
  2466. dqEffect(i, j) = eNone
  2467. Next
  2468. Next
  2469. DMD "", eNone, "", eNone, "", eNone, "", eNone, 25, True, ""
  2470. End Sub
  2471.  
  2472. Sub DMDFlush()
  2473. Dim i
  2474. DMDTimer.Enabled = False
  2475. DMDEffectTimer.Enabled = False
  2476. dqHead = 0
  2477. dqTail = 0
  2478. For i = 0 to 3
  2479. deCount(i) = 0
  2480. deCountEnd(i) = 0
  2481. deBlinkCycle(i) = 0
  2482. Next
  2483. End Sub
  2484.  
  2485. Sub DMDScoreNow()
  2486. DMDFlush()
  2487. DMDScore()
  2488. End Sub
  2489.  
  2490. Sub DMDScore()
  2491. Dim tmp0, tmp1, tmp2, tmp3
  2492. if(dqHead = dqTail)Then
  2493. tmp0 = ""
  2494. tmp1 = FillLine(1, " PLAYER " & CurrentPlayer, FormatScore(Score(CurrentPlayer)))
  2495. 'tmp2 = FillLine(2, " ", " BALL " & Balls)
  2496. tmp2 = FillLine(2, " RVAL:" & FormatScore(ReactorValue(CurrentPlayer)), "BALL" & Balls)
  2497. tmp3 = ""
  2498. DMD tmp0, eNone, tmp1, eNone, tmp2, eNone, tmp3, eNone, 25, True, ""
  2499. End If
  2500. End Sub
  2501.  
  2502. Sub DMD(Text0, Effect0, Text1, Effect1, Text2, Effect2, Text3, Effect3, TimeOn, bFlush, Sound) 'the lines are background. top line, bottom line, and centerline
  2503. if(dqTail < dqSize)Then
  2504. if(Text0 = "_")Then
  2505. dqEffect(0, dqTail) = eNone
  2506. dqText(0, dqTail) = "_"
  2507. Else
  2508. dqEffect(0, dqTail) = Effect0
  2509. dqText(0, dqTail) = ExpandLine(Text0, 0)
  2510. End If
  2511.  
  2512. if(Text1 = "_")Then
  2513. dqEffect(1, dqTail) = eNone
  2514. dqText(1, dqTail) = "_"
  2515. Else
  2516. dqEffect(1, dqTail) = Effect1
  2517. dqText(1, dqTail) = ExpandLine(Text1, 1)
  2518. End If
  2519.  
  2520. if(Text2 = "_")Then
  2521. dqEffect(2, dqTail) = eNone
  2522. dqText(2, dqTail) = "_"
  2523. Else
  2524. dqEffect(2, dqTail) = Effect2
  2525. dqText(2, dqTail) = ExpandLine(Text2, 2)
  2526. End If
  2527.  
  2528. if(Text3 = "_")Then
  2529. dqEffect(3, dqTail) = eNone
  2530. dqText(3, dqTail) = "_"
  2531. Else
  2532. dqEffect(3, dqTail) = Effect3
  2533. dqText(3, dqTail) = ExpandLine(Text3, 3)
  2534. End If
  2535.  
  2536. dqTimeOn(dqTail) = TimeOn
  2537. dqbFlush(dqTail) = bFlush
  2538. dqSound(dqTail) = Sound
  2539. dqTail = dqTail + 1
  2540. if(dqTail = 1)Then
  2541. DMDHead()
  2542. End If
  2543. End If
  2544. End Sub
  2545.  
  2546. Sub DMDHead()
  2547. Dim i
  2548. deCount(0) = 0
  2549. deCount(1) = 0
  2550. deCount(2) = 0
  2551. deCount(3) = 0
  2552. DMDEffectTimer.Interval = deSpeed
  2553.  
  2554. For i = 0 to 3
  2555. Select Case dqEffect(i, dqHead)
  2556. Case eNone:deCountEnd(i) = 1
  2557. Case eScrollLeft:deCountEnd(i) = Len(dqText(i, dqHead))
  2558. Case eScrollRight:deCountEnd(i) = Len(dqText(i, dqHead))
  2559. Case eBlink:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  2560. deBlinkCycle(i) = 0
  2561. Case eBlinkFast:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  2562. deBlinkCycle(i) = 0
  2563. End Select
  2564. Next
  2565. if(dqSound(dqHead) <> "")Then
  2566. PlaySound(dqSound(dqHead))
  2567. End If
  2568. DMDEffectTimer.Enabled = True
  2569. End Sub
  2570.  
  2571. Sub DMDEffectTimer_Timer()
  2572. DMDEffectTimer.Enabled = False
  2573. DMDProcessEffectOn()
  2574. End Sub
  2575.  
  2576. Sub DMDTimer_Timer()
  2577. Dim Head
  2578. DMDTimer.Enabled = False
  2579. Head = dqHead
  2580. dqHead = dqHead + 1
  2581. if(dqHead = dqTail)Then
  2582. if(dqbFlush(Head) = True)Then
  2583. DMDFlush()
  2584. DMDScore()
  2585. Else
  2586. dqHead = 0
  2587. DMDHead()
  2588. End If
  2589. Else
  2590. DMDHead()
  2591. End If
  2592. End Sub
  2593.  
  2594. Sub DMDProcessEffectOn()
  2595. Dim i
  2596. Dim BlinkEffect
  2597. Dim Temp
  2598.  
  2599. BlinkEffect = False
  2600.  
  2601. For i = 0 to 3
  2602. if(deCount(i) <> deCountEnd(i))Then
  2603. deCount(i) = deCount(i) + 1
  2604.  
  2605. select case(dqEffect(i, dqHead))
  2606. case eNone:
  2607. Temp = dqText(i, dqHead)
  2608. case eScrollLeft:
  2609. Temp = Right(dLine(i), dCharsPerLine(i)- 1)
  2610. Temp = Temp & Mid(dqText(i, dqHead), deCount(i), 1)
  2611. case eScrollRight:
  2612. Temp = Mid(dqText(i, dqHead), (dCharsPerLine(i) + 1)- deCount(i), 1)
  2613. Temp = Temp & Left(dLine(i), dCharsPerLine(i)- 1)
  2614. case eBlink:
  2615. BlinkEffect = True
  2616. if((deCount(i)MOD deBlinkSlowRate) = 0)Then
  2617. deBlinkCycle(i) = deBlinkCycle(i)xor 1
  2618. End If
  2619.  
  2620. if(deBlinkCycle(i) = 0)Then
  2621. Temp = dqText(i, dqHead)
  2622. Else
  2623. Temp = Space(dCharsPerLine(i))
  2624. End If
  2625. case eBlinkFast:
  2626. BlinkEffect = True
  2627. if((deCount(i)MOD deBlinkFastRate) = 0)Then
  2628. deBlinkCycle(i) = deBlinkCycle(i)xor 1
  2629. End If
  2630.  
  2631. if(deBlinkCycle(i) = 0)Then
  2632. Temp = dqText(i, dqHead)
  2633. Else
  2634. Temp = Space(dCharsPerLine(i))
  2635. End If
  2636. End Select
  2637.  
  2638. if(dqText(i, dqHead) <> "_")Then
  2639. dLine(i) = Temp
  2640. DMDUpdate i
  2641. End If
  2642. End If
  2643. Next
  2644.  
  2645. if(deCount(0) = deCountEnd(0))and(deCount(1) = deCountEnd(1))and(deCount(2) = deCountEnd(2))and(deCount(3) = deCountEnd(3))Then
  2646.  
  2647. if(dqTimeOn(dqHead) = 0)Then
  2648. DMDFlush()
  2649. Else
  2650. if(BlinkEffect = True)Then
  2651. DMDTimer.Interval = 10
  2652. Else
  2653. DMDTimer.Interval = dqTimeOn(dqHead)
  2654. End If
  2655.  
  2656. DMDTimer.Enabled = True
  2657. End If
  2658. Else
  2659. DMDEffectTimer.Enabled = True
  2660. End If
  2661. End Sub
  2662.  
  2663. Function ExpandLine(TempStr, id) 'id is the number of the dmd line
  2664. If TempStr = "" Then
  2665. TempStr = Space(dCharsPerLine(id))
  2666. Else
  2667. if(Len(TempStr) > Space(dCharsPerLine(id)))Then
  2668. TempStr = Left(TempStr, Space(dCharsPerLine(id)))
  2669. Else
  2670. if(Len(TempStr) < dCharsPerLine(id))Then
  2671. TempStr = TempStr & Space(dCharsPerLine(id)- Len(TempStr))
  2672. End If
  2673. End If
  2674. End If
  2675. ExpandLine = TempStr
  2676. End Function
  2677.  
  2678. Function FormatScore(ByVal Num) 'it returns a string with commas (as in Black's original font)
  2679. dim i
  2680. dim NumString
  2681.  
  2682. NumString = CStr(abs(Num))
  2683.  
  2684. For i = Len(NumString)-3 to 1 step -3
  2685. if IsNumeric(mid(NumString, i, 1))then
  2686. NumString = left(NumString, i-1) & chr(asc(mid(NumString, i, 1)) + 48) & right(NumString, Len(NumString)- i)
  2687. end if
  2688. Next
  2689. FormatScore = NumString
  2690. End function
  2691.  
  2692. Function CenterLine(id, aString)
  2693. Dim tmp, tmpStr
  2694. tmp = (dCharsPerLine(id)- Len(aString)) \ 2
  2695. If(tmp + tmp + Len(aString)) < dCharsPerLine(id)Then
  2696. tmpStr = " " & Space(tmp) & aString & Space(tmp)
  2697. Else
  2698. tmpStr = Space(tmp) & aString & Space(tmp)
  2699. End If
  2700. CenterLine = tmpStr
  2701. End Function
  2702.  
  2703. Function FillLine(id, aString, bString)
  2704. Dim tmp, tmpStr
  2705. tmp = dCharsPerLine(id)- Len(aString)- Len(bString)
  2706. tmpStr = aString & Space(tmp) & bString
  2707. FillLine = tmpStr
  2708. End Function
  2709.  
  2710. Function RightLine(id, aString)
  2711. Dim tmp, tmpStr
  2712. tmp = dCharsPerLine(id)- Len(aString)
  2713. tmpStr = Space(tmp) & aString
  2714. RightLine = tmpStr
  2715. End Function
  2716.  
  2717. '*********************
  2718. ' Section; Update DMD - reels
  2719. '*********************
  2720. Dim DesktopMode:DesktopMode = Table1.ShowDT
  2721.  
  2722. Dim Digits(3)
  2723.  
  2724. DMDReels_Init
  2725.  
  2726. Sub DMDReels_Init
  2727. If DesktopMode Then
  2728. 'Desktop
  2729. Digits(0) = Array(d0, d1, d2) 'backdrop
  2730. Digits(1) = Array(d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19, d20, d21) 'upper line
  2731. Digits(2) = Array(d22, d23, d24, d25, d26, d27, d28, d29, d30, d31, d32, d33, d34, d35, d36, d37, d38, d39, d40) 'lower line
  2732. Digits(3) = Array(d41, d42, d43, d44, d45, d46, d47, d48, d49, d50, d51, d52, d53) ' center line
  2733. d54.Visible = 0:d55.Visible = 0:d56.Visible = 0
  2734. Else
  2735. 'FS
  2736. Digits(0) = Array(d54, d55, d56) 'backdrop
  2737. Digits(1) = Array(d57, d58, d59, d60, d61, d62, d63, d64, d65, d66, d67, d68, d69, d70, d71, d72, d73, d74, d75) 'upper line
  2738. Digits(2) = Array(d76, d77, d78, d79, d80, d81, d82, d83, d84, d85, d86, d87, d88, d89, d90, d91, d92, d93, d94) 'lower line
  2739. Digits(3) = Array(d95, d96, d97, d98, d99, d100, d101, d102, d103, d104, d105, d106, d107)
  2740. d0.Visible = 0:d1.Visible = 0:d2.Visible = 0
  2741. End If
  2742. End Sub
  2743.  
  2744. Sub DMDUpdate(id)
  2745. Dim digit, value
  2746. For digit = 0 to dCharsPerLine(id)-1
  2747. value = ASC(mid(dLine(id), digit + 1, 1))-32
  2748. Digits(id)(digit).SetValue value
  2749. Next
  2750. End Sub
  2751.  
  2752. '****************************************
  2753. ' Section; Real Time updatess using the GameTimer
  2754. '****************************************
  2755. 'used for all the real time updates
  2756.  
  2757. Sub GameTimer_Timer
  2758. RollingUpdate
  2759. ' add any other real time update subs, like gates or diverters
  2760. End Sub
  2761.  
  2762. '********************************************************************************************
  2763. ' Only for VPX 10.2 and higher.
  2764. ' Section; FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  2765. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  2766. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  2767. '********************************************************************************************
  2768.  
  2769. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first myVersion
  2770.  
  2771. If TypeName(MyLight) = "Light" Then
  2772.  
  2773. If FinalState = 2 Then
  2774. FinalState = MyLight.State 'Keep the current light state
  2775. End If
  2776. MyLight.BlinkInterval = BlinkPeriod
  2777. MyLight.Duration 2, TotalPeriod, FinalState
  2778. ElseIf TypeName(MyLight) = "Flasher" Then
  2779.  
  2780. Dim steps
  2781.  
  2782. ' Store all blink information
  2783. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  2784. If FinalState = 2 Then 'Keep the current flasher state
  2785. FinalState = ABS(MyLight.Visible)
  2786. End If
  2787. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  2788.  
  2789. ' Start blink timer and create timer subroutine
  2790. MyLight.TimerInterval = BlinkPeriod
  2791. MyLight.TimerEnabled = 0
  2792. MyLight.TimerEnabled = 1
  2793. 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"
  2794. End If
  2795. End Sub
  2796.  
  2797. Sub FlashForMsrgb(MyLight, TotalPeriod, BlinkPeriod, FinalState, Red, Green, Blue) 'thanks gtxjoe for the first myVersion
  2798.  
  2799. If TypeName(MyLight) = "Light" Then
  2800.  
  2801. If FinalState = 2 Then
  2802. FinalState = MyLight.State 'Keep the current light state
  2803. End If
  2804. MyLight.BlinkInterval = BlinkPeriod
  2805. MyLight.Duration 2, TotalPeriod, FinalState
  2806. ElseIf TypeName(MyLight) = "Flasher" Then
  2807.  
  2808. Dim steps
  2809.  
  2810. ' Store all blink information
  2811. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  2812. If FinalState = 2 Then 'Keep the current flasher state
  2813. FinalState = ABS(MyLight.Visible)
  2814. End If
  2815. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  2816.  
  2817. ' Start blink timer and create timer subroutine
  2818. MyLight.TimerInterval = BlinkPeriod
  2819. MyLight.TimerEnabled = 0
  2820. MyLight.TimerEnabled = 1
  2821. 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"
  2822. End If
  2823. End Sub
  2824. '******************************************
  2825. ' Section; Change light color - simulate color leds
  2826. ' changes the light color and state
  2827. ' colors: red, orange, yellow, green, blue, white
  2828. '******************************************
  2829.  
  2830. 'Sub SetLight(n, col, stat)
  2831. Sub SetLight(n, col, stat)
  2832. 'SEt Color
  2833. Select Case col
  2834. Case "red"
  2835. n.color = RGB(128, 0, 0)
  2836. n.colorfull = RGB(255, 0, 0)
  2837. Case "orange"
  2838. n.color = RGB(18, 3, 0)
  2839. n.colorfull = RGB(255, 64, 0)
  2840. Case "yellow"
  2841. n.color = RGB(18, 18, 0)
  2842. n.colorfull = RGB(255, 255, 0)
  2843. Case "green"
  2844. n.color = RGB(0, 32, 0)
  2845. n.colorfull = RGB(0, 200, 0)
  2846. Case "blue"
  2847. n.color = RGB(0, 0, 128)
  2848. n.colorfull = RGB(0, 0, 255)
  2849. Case "white"
  2850. n.color = RGB(255, 252, 224)
  2851. n.colorfull = RGB(193, 91, 0)
  2852. Case "purple"
  2853. n.color = RGB(128, 0, 128)
  2854. n.colorfull = RGB(255, 0, 255)
  2855. Case "amber"
  2856. n.color = RGB(193, 49, 0)
  2857. n.colorfull = RGB(255, 153, 0)
  2858. Case ""
  2859. End Select
  2860.  
  2861. 'Set State
  2862. If stat <> -1 Then
  2863. n.State = 0
  2864. n.State = stat
  2865. End If
  2866.  
  2867. End Sub
  2868.  
  2869. SetLight l10, "", -1
  2870.  
  2871. ' ********************************
  2872. ' Table info & Attract Mode
  2873. ' ********************************
  2874.  
  2875. Sub ShowTableInfo
  2876.  
  2877. 'info goes in a loop only stopped by the credits and the startkey
  2878. If Score(1)Then
  2879. DMD "", eNone, CenterLine(1, FormatScore(Score(1))), eNone, CenterLine(2, "PLAYER 1"), eNone, "", eNone, 3000, False, ""
  2880. End If
  2881. If Score(2)Then
  2882. DMD "", eNone, CenterLine(1, FormatScore(Score(2))), eNone, CenterLine(2, "PLAYER 2"), eNone, "", eNone, 3000, False, ""
  2883. End If
  2884. If Score(3)Then
  2885. DMD "", eNone, CenterLine(1, FormatScore(Score(3))), eNone, CenterLine(2, "PLAYER 3"), eNone, "", eNone, 3000, False, ""
  2886. End If
  2887. If Score(4)Then
  2888. DMD "", eNone, CenterLine(1, FormatScore(Score(4))), eNone, CenterLine(2, "PLAYER 4"), eNone, "", eNone, 3000, False, ""
  2889. End If
  2890. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "GAME OVER"), eBlink, 2000, False, "" 'game over
  2891. If bFreePlay Then
  2892. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "FREE PLAY"), eNone, 3000, False, ""
  2893. Else
  2894. If Credits > 0 Then
  2895. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "PRESS START"), eNone, "", eNone, 2000, False, ""
  2896. Else
  2897. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eNone, "", eNone, 2000, False, ""
  2898. End If
  2899. End If
  2900. DMD "", eNone, " VPX", eNone, " PRESENTS", eNone, "", eNone, 2000, False, ""
  2901. DMD "", eNone, " TOTAL NUCLEAR", eNone, " ANNIHILATION", eNone, "", eNone, 2000, False, ""
  2902.  
  2903. ' DMD "T N A", eScrollRight, "", eNone, "", eNone, "", eNone, 4000, False, ""
  2904. ' DMD """#$", eScrollRight, "", eNone, "", eNone, "", eNone, 4000, False, ""
  2905. DMD " ", eScrollLeft, "", eNone, "", eNone, "", eNone, 500, False, ""
  2906. DMD "", eNone, CenterLine(1, "HIGH SCORES"), eScrollLeft, Space(dCharsPerLine(2)), eScrollLeft, "", eNone, 20, False, ""
  2907. DMD "", eNone, CenterLine(1, "HIGH SCORES"), eBlinkFast, "", eNone, "", eNone, 1000, False, ""
  2908. DMD "", eNone, CenterLine(1, "HIGH SCORES"), eNone, " 1 " &HighScoreName(0) & " " &FormatScore(HighScore(0)), eScrollLeft, "", eNone, 2000, False, ""
  2909. DMD "", eNone, "_", eNone, " 2 " &HighScoreName(1) & " " &FormatScore(HighScore(1)), eScrollLeft, "", eNone, 2000, False, ""
  2910. DMD "", eNone, "_", eNone, " 3 " &HighScoreName(2) & " " &FormatScore(HighScore(2)), eScrollLeft, "", eNone, 2000, False, ""
  2911. DMD "", eNone, "_", eNone, " 4 " &HighScoreName(3) & " " &FormatScore(HighScore(3)), eScrollLeft, "", eNone, 2000, False, ""
  2912. DMD "", eNone, Space(dCharsPerLine(1)), eScrollLeft, Space(dCharsPerLine(2)), eScrollLeft, "", eNone, 500, False, ""
  2913. End Sub
  2914.  
  2915. Sub StartAttractMode(dummy)
  2916. StartLightSeq
  2917. DMDFlush
  2918. ShowTableInfo
  2919. ''' StartRainbow "arrows"
  2920. End Sub
  2921.  
  2922. Sub StopAttractMode
  2923. DMDFlush:DMD "", eNone, "", eNone, "", eNone, "", eNone, 500, True, ""
  2924. LightSeqAttract.StopPlay
  2925. ''' StopRainbow
  2926. 'StopSong
  2927.  
  2928. End Sub
  2929.  
  2930. Sub StartLightSeq()
  2931. 'lights sequences
  2932. LightSeqAttract.UpdateInterval = 2
  2933. LightSeqAttract.Play SeqBlinking, , 5, 150
  2934. LightSeqAttract.Play SeqRandom, 40, , 4000
  2935. LightSeqAttract.Play SeqAllOff
  2936. ' LightSeqAttract.UpdateInterval = 8
  2937. ' LightSeqAttract.Play SeqUpOn, 50, 1
  2938. LightSeqAttract.UpdateInterval = 2
  2939. LightSeqAttract.Play SeqDownOn, 25, 1
  2940. LightSeqAttract.UpdateInterval = 8
  2941. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2942. LightSeqAttract.UpdateInterval = 8
  2943. ' LightSeqAttract.Play SeqUpOn, 25, 1
  2944. ' LightSeqAttract.UpdateInterval = 8
  2945. LightSeqAttract.Play SeqDownOn, 25, 1
  2946. ' LightSeqAttract.UpdateInterval = 8
  2947. ' LightSeqAttract.Play SeqUpOn, 25, 1
  2948. ' LightSeqAttract.UpdateInterval = 8
  2949. ' LightSeqAttract.Play SeqDownOn, 25, 1
  2950. ' LightSeqAttract.UpdateInterval = 10
  2951. ' LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2952. LightSeqAttract.UpdateInterval = 5
  2953. LightSeqAttract.Play SeqRightOn, 50, 1
  2954. LightSeqAttract.UpdateInterval = 5
  2955. LightSeqAttract.Play SeqLeftOn, 50, 1
  2956. LightSeqAttract.UpdateInterval = 8
  2957. LightSeqAttract.Play SeqRightOn, 50, 1
  2958. LightSeqAttract.UpdateInterval = 8
  2959. LightSeqAttract.Play SeqLeftOn, 50, 1
  2960. LightSeqAttract.UpdateInterval = 8
  2961. LightSeqAttract.Play SeqRightOn, 40, 1
  2962. LightSeqAttract.UpdateInterval = 8
  2963. LightSeqAttract.Play SeqLeftOn, 40, 1
  2964. LightSeqAttract.UpdateInterval = 10
  2965. LightSeqAttract.Play SeqRightOn, 30, 1
  2966. LightSeqAttract.UpdateInterval = 10
  2967. LightSeqAttract.Play SeqLeftOn, 30, 1
  2968. LightSeqAttract.UpdateInterval = 8
  2969. LightSeqAttract.Play SeqRightOn, 25, 1
  2970. LightSeqAttract.UpdateInterval = 8
  2971. LightSeqAttract.Play SeqLeftOn, 25, 1
  2972. LightSeqAttract.UpdateInterval = 8
  2973. LightSeqAttract.Play SeqRightOn, 15, 1
  2974. LightSeqAttract.UpdateInterval = 8
  2975. LightSeqAttract.Play SeqLeftOn, 15, 1
  2976. LightSeqAttract.UpdateInterval = 10
  2977. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2978. LightSeqAttract.UpdateInterval = 8
  2979. LightSeqAttract.Play SeqLeftOn, 25, 1
  2980. LightSeqAttract.UpdateInterval = 8
  2981. LightSeqAttract.Play SeqRightOn, 25, 1
  2982. LightSeqAttract.UpdateInterval = 8
  2983. LightSeqAttract.Play SeqLeftOn, 25, 1
  2984. LightSeqAttract.UpdateInterval = 8
  2985. LightSeqAttract.Play SeqUpOn, 25, 1
  2986. LightSeqAttract.UpdateInterval = 8
  2987. LightSeqAttract.Play SeqDownOn, 25, 1
  2988. LightSeqAttract.UpdateInterval = 8
  2989. LightSeqAttract.Play SeqUpOn, 25, 1
  2990. LightSeqAttract.UpdateInterval = 8
  2991. LightSeqAttract.Play SeqDownOn, 25, 1
  2992. LightSeqAttract.UpdateInterval = 5
  2993. LightSeqAttract.Play SeqStripe1VertOn, 50, 2
  2994. LightSeqAttract.UpdateInterval = 8
  2995. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2996. LightSeqAttract.UpdateInterval = 8
  2997. LightSeqAttract.Play SeqStripe1VertOn, 50, 3
  2998. LightSeqAttract.UpdateInterval = 8
  2999. LightSeqAttract.Play SeqLeftOn, 25, 1
  3000. LightSeqAttract.UpdateInterval = 8
  3001. LightSeqAttract.Play SeqRightOn, 25, 1
  3002. LightSeqAttract.UpdateInterval = 8
  3003. LightSeqAttract.Play SeqLeftOn, 25, 1
  3004. LightSeqAttract.UpdateInterval = 8
  3005. LightSeqAttract.Play SeqUpOn, 25, 1
  3006. LightSeqAttract.UpdateInterval = 8
  3007. LightSeqAttract.Play SeqDownOn, 25, 1
  3008. LightSeqAttract.UpdateInterval = 8
  3009. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  3010. LightSeqAttract.UpdateInterval = 8
  3011. LightSeqAttract.Play SeqStripe2VertOn, 50, 3
  3012. LightSeqAttract.UpdateInterval = 8
  3013. LightSeqAttract.Play SeqLeftOn, 25, 1
  3014. LightSeqAttract.UpdateInterval = 8
  3015. LightSeqAttract.Play SeqRightOn, 25, 1
  3016. LightSeqAttract.UpdateInterval = 8
  3017. LightSeqAttract.Play SeqLeftOn, 25, 1
  3018. LightSeqAttract.UpdateInterval = 8
  3019. LightSeqAttract.Play SeqUpOn, 25, 1
  3020. LightSeqAttract.UpdateInterval = 8
  3021. LightSeqAttract.Play SeqDownOn, 25, 1
  3022. LightSeqAttract.UpdateInterval = 8
  3023. LightSeqAttract.Play SeqUpOn, 25, 1
  3024. LightSeqAttract.UpdateInterval = 8
  3025. LightSeqAttract.Play SeqDownOn, 25, 1
  3026. LightSeqAttract.UpdateInterval = 8
  3027. LightSeqAttract.Play SeqStripe1VertOn, 25, 3
  3028. LightSeqAttract.UpdateInterval = 8
  3029. LightSeqAttract.Play SeqStripe2VertOn, 25, 3
  3030. LightSeqAttract.UpdateInterval = 8
  3031. LightSeqAttract.Play SeqUpOn, 15, 1
  3032. LightSeqAttract.UpdateInterval = 8
  3033. LightSeqAttract.Play SeqDownOn, 15, 1
  3034. LightSeqAttract.UpdateInterval = 8
  3035. LightSeqAttract.Play SeqUpOn, 15, 1
  3036. LightSeqAttract.UpdateInterval = 8
  3037. LightSeqAttract.Play SeqDownOn, 15, 1
  3038. LightSeqAttract.UpdateInterval = 8
  3039. LightSeqAttract.Play SeqUpOn, 15, 1
  3040. LightSeqAttract.UpdateInterval = 8
  3041. LightSeqAttract.Play SeqDownOn, 15, 1
  3042. LightSeqAttract.UpdateInterval = 8
  3043. LightSeqAttract.Play SeqRightOn, 15, 1
  3044. LightSeqAttract.UpdateInterval = 8
  3045. LightSeqAttract.Play SeqLeftOn, 15, 1
  3046. LightSeqAttract.UpdateInterval = 8
  3047. LightSeqAttract.Play SeqRightOn, 15, 1
  3048. LightSeqAttract.UpdateInterval = 8
  3049. LightSeqAttract.Play SeqLeftOn, 15, 1
  3050. End Sub
  3051.  
  3052. Sub LightSeqAttract_PlayDone()
  3053. StartLightSeq()
  3054. End Sub
  3055.  
  3056. Sub LightSeqTilt_PlayDone()
  3057. 'LightSeqTilt.Play SeqAllOff
  3058. End Sub
  3059.  
  3060. Sub LightSeqSkillshot_PlayDone()
  3061. LightSeqSkillshot.Play SeqAllOff
  3062. End Sub
  3063.  
  3064. '*************************
  3065. ' Section; Rainbow Changing Lights
  3066. '*************************
  3067.  
  3068. Dim RGBStep, RGBFactor, Red, Green, Blue, RainbowLights
  3069.  
  3070. Sub StartRainbow(n)
  3071. RainbowLights = n
  3072. RGBStep = 0
  3073. RGBFactor = 10
  3074. Red = 255
  3075. Green = 0
  3076. Blue = 0
  3077. RainbowTimer.Enabled = 1
  3078. End Sub
  3079.  
  3080. Sub StopRainbow()
  3081. Dim obj
  3082. RainbowTimer.Enabled = 0
  3083. If RainbowLights = "all" Then
  3084. For each obj in aRGBLights
  3085. SetLight obj, "white", 0
  3086. Next
  3087. ElseIf RainbowLights = "gi" Then
  3088. For each obj in aGiLights
  3089. SetLight obj, "white", 0
  3090. Next
  3091. End If
  3092. End Sub
  3093.  
  3094. Sub RainbowTimer_Timer 'rainbow led light color changing
  3095. Dim obj
  3096. Select Case RGBStep
  3097. Case 0 'Green
  3098. Green = Green + RGBFactor
  3099. If Green > 255 then
  3100. Green = 255
  3101. RGBStep = 1
  3102. End If
  3103. Case 1 'Red
  3104. Red = Red - RGBFactor
  3105. If Red < 0 then
  3106. Red = 0
  3107. RGBStep = 2
  3108. End If
  3109. Case 2 'Blue
  3110. Blue = Blue + RGBFactor
  3111. If Blue > 255 then
  3112. Blue = 255
  3113. RGBStep = 3
  3114. End If
  3115. Case 3 'Green
  3116. Green = Green - RGBFactor
  3117. If Green < 0 then
  3118. Green = 0
  3119. RGBStep = 4
  3120. End If
  3121. Case 4 'Red
  3122. Red = Red + RGBFactor
  3123. If Red > 255 then
  3124. Red = 255
  3125. RGBStep = 5
  3126. End If
  3127. Case 5 'Blue
  3128. Blue = Blue - RGBFactor
  3129. If Blue < 0 then
  3130. Blue = 0
  3131. RGBStep = 0
  3132. End If
  3133. End Select
  3134. If RainbowLights = "all" Then
  3135. For each obj in aRGBLights
  3136. obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10)
  3137. obj.colorfull = RGB(Red, Green, Blue)
  3138. Next
  3139. ElseIf RainbowLights = "gi" Then
  3140. For each obj in aGiLights
  3141. obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10)
  3142. obj.colorfull = RGB(Red, Green, Blue)
  3143. Next
  3144. End If
  3145. End Sub
  3146.  
  3147. '***********************************************************************
  3148. ' *********************************************************************
  3149. ' Section; Table Specific Script Starts Here
  3150. ' *********************************************************************
  3151. '***********************************************************************
  3152.  
  3153. ' droptargets, animations, etc
  3154. Sub VPObjects_Init
  3155.  
  3156. End Sub
  3157.  
  3158. ' tables variables and modes init
  3159. Dim bSuperJackpot
  3160. Dim bDoubleSuperJackpot
  3161. Dim bTripleSuperJackpot
  3162. Dim bJackpot
  3163. 'Dim bLoopinSupers
  3164. Dim SpinnerValue
  3165. Dim SpinnerReactorValue
  3166. Dim Multiplier2x
  3167. Dim Multiplier3x
  3168. Dim LaneBonus
  3169. Dim BallLockScore
  3170.  
  3171. Dim COREScore
  3172. Dim InlaneScore
  3173. Dim BumperScore
  3174. Dim OutlaneScore
  3175. Dim LowerSlingshotScore
  3176. Dim UpperSlingshotScore
  3177. Dim Jackpot
  3178. Dim DoubleJackpot
  3179. Dim TripleJackpot
  3180. Dim SuperJackpot
  3181. Dim RADSCore
  3182. Dim DESTROYScore
  3183. Dim GridTargetScore
  3184. Dim TargetScore
  3185. Const TargetBonusValue = 1000
  3186. Const LaneSaveBonusValue = 10000
  3187.  
  3188.  
  3189. Sub Game_Init() 'called at the start of a new game
  3190. Dim i
  3191. bExtraBallWonThisBall = False
  3192. TurnOffPlayfieldLights()
  3193.  
  3194. 'Init Variables
  3195. bSkillshotSelect = False
  3196. SkillshotReady = 0
  3197. DropTargetResetLockIsLit 1
  3198.  
  3199. '****************************
  3200. 'SubSection; Scoring Values
  3201. '***************************
  3202. SpinnerValue = 110
  3203. SpinnerReactorValue = 200
  3204.  
  3205. COREScore = 500
  3206. UpperSlingshotScore = 500
  3207. LowerSlingshotScore = 200
  3208. GridTargetScore = 500
  3209. TargetScore = 500
  3210. SkillshotValue = 1000
  3211. BallLockScore = 20000
  3212. Jackpot = 15000
  3213. DoubleJackpot = 30000
  3214. TripleJackpot = 45000
  3215. SuperJackpot = 75000
  3216.  
  3217. 'DropTargetScore
  3218.  
  3219. BumperScore = 500
  3220. InlaneScore = 500
  3221. OutlaneScore = 500
  3222. RADScore = 500
  3223. DESTROYScore = 500
  3224.  
  3225.  
  3226.  
  3227. 'Initialize Player Data
  3228. InitializePlayerData
  3229.  
  3230. ResetCORE
  3231. ResetSAVE
  3232. ResetGrid
  3233. ResetReactor
  3234. ResetReactorBonus
  3235. ResetRAD
  3236. ResetMaxTarget
  3237. ResetMysteryAward
  3238. ResetDESTROY
  3239. ResetGate
  3240. ResetBonusLights
  3241. ResetReactorLoopInserts
  3242. ResetBallSaveDisplay
  3243. ResetSuperSpinner
  3244. ResetInserts
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250. bMultiBallMode = False
  3251. bBonusHeld = False
  3252. Multiplier2x = 1
  3253. Multiplier3x = 1
  3254.  
  3255.  
  3256. 'Init Delays/Timers
  3257. If Quotemode = 1 Then PlayQuote.Enabled = 1
  3258.  
  3259. 'Play some Music
  3260. StartBackgroundMusic
  3261.  
  3262. 'GI color
  3263. ChangeGI "blue"
  3264. End Sub
  3265.  
  3266. Sub StopEndOfBallModes() 'this sub is called after the last ball is drained
  3267.  
  3268. 'If Modes(0)Then StopMode Modes(0) 'a mode is active so stop it
  3269. End Sub
  3270.  
  3271. Sub ResetNewBallVariables() 'reset variables for a new ball or player
  3272. bSuperJackpot = False
  3273. bDoubleSuperJackpot = False
  3274. bTripleSuperJackpot = False
  3275. bJackpot = False
  3276. LaneBonus = 0
  3277. End Sub
  3278.  
  3279. Sub ResetNewBallLights() 'turn on or off the needed lights before a new ball is released
  3280. End Sub
  3281.  
  3282. Sub TurnOffPlayfieldLights()
  3283. Dim a
  3284. For each a in aLights
  3285. a.State = 0
  3286. Next
  3287. ''' Bumper1Light.Visible = 0
  3288. End Sub
  3289.  
  3290.  
  3291. '**************************
  3292. ' Section; SAVE - Inlanes Outlanes
  3293. '**************************
  3294. Dim LaneSaveCount(4)
  3295. Dim PlayerLa1(4)
  3296. Dim PlayerLa2(4)
  3297. Dim PlayerLa3(4)
  3298. Dim PlayerLa4(4)
  3299. Const LaneSaveCountMax = 6
  3300. Dim bBallSaverSingleUse
  3301.  
  3302. Sub ResetSave() ' ClearSave on end ball or start ball
  3303. LaneSaveCount(CurrentPlayer) = 0
  3304.  
  3305. SetLight la1, "red", 0
  3306. SetLight la2, "red", 0
  3307. SetLight la3, "red", 0
  3308. SetLight la4, "red", 0
  3309.  
  3310.  
  3311. ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
  3312. End Sub
  3313.  
  3314. Sub CheckSAVE()
  3315. dim tmp
  3316. tmp = 0
  3317.  
  3318. if la1.state = 1 then tmp = tmp + 1
  3319. if la2.state = 1 then tmp = tmp + 1
  3320. if la3.state = 1 then tmp = tmp + 1
  3321. if la4.state = 1 then tmp = tmp + 1
  3322.  
  3323. If tmp = 3 then '3 targets lit, earn a SAVE
  3324. AwardSAVE 1
  3325. End If
  3326.  
  3327. End Sub
  3328.  
  3329. Sub AwardSAVE (value)
  3330. Dim SaveInsertAlreadyLit, savecolor
  3331. SaveInsertAlreadyLit = 0
  3332.  
  3333. LaneSaveCount(CurrentPlayer) = LaneSaveCount(CurrentPlayer) + value
  3334. If LaneSaveCount(CurrentPlayer) > LaneSaveCountMax Then
  3335. LaneSaveCount(CurrentPlayer) = LaneSaveCountMax
  3336. Else
  3337. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "LANE SAVE"), eBlinkfast, 800, True, "tna_lanesave"
  3338. End If
  3339. Debug.Print "LaneSaveCount(CurrentPlayer) = " & LaneSaveCount(CurrentPlayer)
  3340. ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
  3341.  
  3342.  
  3343. 'Select new Insert color
  3344. SetSaveColor
  3345.  
  3346. 'Check if any Save insert already blinking and change color based on Save count (Red, Orange, Yellow,Green, Blue, Purple)
  3347. if la1.state = 2 then
  3348. SaveInsertAlreadyLit = 1
  3349. elseif la2.state = 2 then
  3350. SaveInsertAlreadyLit = 1
  3351. elseif la3.state = 2 then
  3352. SaveInsertAlreadyLit = 1
  3353. elseif la4.state = 2 then
  3354. SaveInsertAlreadyLit = 1
  3355. end if
  3356.  
  3357. 'If First Save awarded, set Flashing save insert
  3358. if SaveInsertAlreadyLit=0 Then
  3359. if la1.state = 0 then
  3360. la1.state = 2
  3361. elseif la2.state = 0 then
  3362. la2.state = 2
  3363. elseif la3.state = 0 then
  3364. la3.state = 2
  3365. elseif la4.state = 0 then
  3366. la4.state = 2
  3367. end if
  3368. End If
  3369.  
  3370. 'Reset the rest of the SAVE inserts
  3371. if la1.state = 1 then
  3372. la1.state = 0
  3373. end if
  3374. if la2.state = 1 then
  3375. la2.state = 0
  3376. end if
  3377. if la3.state = 1 then
  3378. la3.state = 0
  3379. end if
  3380. if la4.state = 1 then
  3381. la4.state = 0
  3382. end if
  3383.  
  3384. End Sub
  3385.  
  3386.  
  3387. Sub UseSAVE (sw) ' On outlane, check for ballsave condition
  3388. dim savecolor
  3389. dim tmp
  3390. tmp = ""
  3391. if LaneSaveCount(CurrentPlayer) > 0 Then
  3392. 'Check if SAVE insert is matching the drain outlane
  3393. if la1.state = 2 then
  3394. tmp = "swOutlaneL"
  3395. elseif la4.state = 2 then
  3396. tmp = "swOutlaneR"
  3397. end if
  3398.  
  3399. 'debug.print "Entering usesave " & LaneSaveCount(CurrentPlayer) & " : " & sw & " ; " & tmp
  3400.  
  3401. if (StrComp(sw, tmp) = 0)then 'Ball Saved!
  3402.  
  3403. 'debug.print "ballSavesingle!"
  3404. bBallSaverSingleUse = 1
  3405. LaneSaveCount(CurrentPlayer) = LaneSaveCount(CurrentPlayer) - 1
  3406.  
  3407. Playsound "tna_ballsaved"
  3408. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, ""
  3409.  
  3410. if LaneSaveCount(CurrentPlayer) <=0 Then ' Turn off Save insert
  3411. LaneSaveCount(CurrentPlayer) = 0
  3412. if la1.state = 2 then
  3413. la1.state = 0
  3414. elseif la2.state = 2 then
  3415. la2.state = 0
  3416. elseif la3.state = 2 then
  3417. la3.state = 0
  3418. elseif la4.state = 2 then
  3419. la4.state = 0
  3420. end if
  3421. End If
  3422.  
  3423. 'Select new Insert color
  3424. SetSaveColor
  3425.  
  3426. End If
  3427. End If
  3428. ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
  3429.  
  3430. DMDScoreNow
  3431. End Sub
  3432.  
  3433.  
  3434. Sub SetSaveColor
  3435. dim savecolor
  3436.  
  3437. 'Select new Insert color
  3438. Select Case LaneSaveCount(CurrentPlayer)
  3439. Case 0: savecolor = "red"
  3440. Case 1: savecolor = "red"
  3441. Case 2: savecolor = "orange"
  3442. Case 3: savecolor = "yellow"
  3443. Case 4: savecolor = "green"
  3444. Case 5: savecolor = "blue"
  3445. Case else: savecolor = "purple"
  3446. End Select
  3447.  
  3448. 'Set insert color
  3449. SetLight la1, savecolor, -1
  3450. SetLight la2, savecolor, -1
  3451. SetLight la3, savecolor, -1
  3452. SetLight la4, savecolor, -1
  3453. End Sub
  3454.  
  3455. Sub InitLaneSaveData
  3456. Dim i
  3457. For i = 1 To MaxPlayers
  3458. LaneSaveCount(i) = 0
  3459. PlayerLa1(i) = 0
  3460. PlayerLa2(i) = 0
  3461. PlayerLa3(i) = 0
  3462. PlayerLa4(i) = 0
  3463. Next
  3464. End Sub
  3465.  
  3466. Sub SaveLaneSaveData
  3467. PlayerLa1(CurrentPlayer) = la1.state
  3468. PlayerLa2(CurrentPlayer) = la2.state
  3469. PlayerLa3(CurrentPlayer) = la3.state
  3470. PlayerLa4(CurrentPlayer) = la4.state
  3471. End Sub
  3472.  
  3473. Sub RestoreLaneSaveData
  3474. la1.state = PlayerLa1(CurrentPlayer)
  3475. la2.state = PlayerLa2(CurrentPlayer)
  3476. la3.state = PlayerLa3(CurrentPlayer)
  3477. la4.state = PlayerLa4(CurrentPlayer)
  3478.  
  3479. SetSaveColor
  3480.  
  3481. End Sub
  3482.  
  3483.  
  3484. '**************************
  3485. ' Section; Skillshot
  3486. '**************************
  3487. Sub StartSkillShot() 'Updates the DMD & lights with the chosen skillshots
  3488. DMDFlush
  3489. bSkillShotSelect = True
  3490. HandsFreeSkillshotInsert = INT(RND * 4) +1
  3491.  
  3492. Select Case HandsFreeSkillshotInsert
  3493. Case 1:
  3494. l1.state = 2
  3495. f1.state = 2
  3496. f2.state = 2
  3497. f3.state = 0
  3498. f4.state = 0
  3499. f5.state = 0
  3500. Case 2:
  3501. l2.state = 2
  3502. f1.state = 0
  3503. f2.state = 2
  3504. f3.state = 2
  3505. f4.state = 0
  3506. f5.state = 0
  3507. Case 3:
  3508. l3.state = 2
  3509. f1.state = 0
  3510. f2.state = 0
  3511. f3.state = 2
  3512. f4.state = 2
  3513. f5.state = 0
  3514. Case 4:
  3515. l4.state = 2
  3516. f1.state = 0
  3517. f2.state = 0
  3518. f3.state = 0
  3519. f4.state = 2
  3520. f5.state = 2
  3521. End Select
  3522.  
  3523. End Sub
  3524.  
  3525. Sub SelectSkillshot(index)
  3526. If index = 1 Then
  3527. Playsound "fx_Previous"
  3528. End If
  3529. If index = 2 Then
  3530. Playsound "fx_Next"
  3531. End If
  3532.  
  3533. if l1.state = 2 then
  3534. HandsFreeSkillshotInsert = 1
  3535. f1.state = 0
  3536. f2.state = 0
  3537. f3.state = 0
  3538. f4.state = 0
  3539. f5.state = 0
  3540. f1.state = 2
  3541. f2.state = 2
  3542. elseif l2.state = 2 then
  3543. HandsFreeSkillshotInsert = 2
  3544. f1.state = 0
  3545. f2.state = 0
  3546. f3.state = 0
  3547. f4.state = 0
  3548. f5.state = 0
  3549. f2.state = 2
  3550. f3.state = 2
  3551. elseif l3.state = 2 then
  3552. HandsFreeSkillshotInsert = 3
  3553. f1.state = 0
  3554. f2.state = 0
  3555. f3.state = 0
  3556. f4.state = 0
  3557. f5.state = 0
  3558. f3.state = 2
  3559. f4.state = 2
  3560. elseif l4.state = 2 then
  3561. HandsFreeSkillshotInsert = 4
  3562. f1.state = 0
  3563. f2.state = 0
  3564. f3.state = 0
  3565. f4.state = 0
  3566. f5.state = 0
  3567. f4.state = 2
  3568. f5.state = 2
  3569. end if
  3570. End Sub
  3571.  
  3572. Sub CheckSkillShot (index) ' reset the skillshot lights & variables
  3573. If index = HandsFreeSkillshotInsert then
  3574. AwardHandsFreeSkillshot
  3575. Else
  3576. Select Case index
  3577. Case 1:
  3578. if l1.state = 2 then AwardSkillshot
  3579. Case 2:
  3580. if l2.state = 2 then AwardSkillshot
  3581. Case 3:
  3582. if l3.state = 2 then AwardSkillshot
  3583. Case 4:
  3584. if l4.state = 2 then AwardSkillshot
  3585. End Select
  3586. End if
  3587.  
  3588. if l1.state = 2 then
  3589. l1.state = 0
  3590. elseif l2.state = 2 then
  3591. l2.state = 0
  3592. elseif l3.state = 2 then
  3593. l3.state = 0
  3594. elseif l4.state = 2 then
  3595. l4.state = 0
  3596. end if
  3597.  
  3598. f1.state = 0
  3599. f2.state = 0
  3600. f3.state = 0
  3601. f4.state = 0
  3602. f5.state = 0
  3603.  
  3604. SkillShotReady = 0
  3605. bSkillShotSelect = False
  3606. HandsFreeSkillshotInsert = 0
  3607.  
  3608. DMDScoreNow
  3609. End Sub
  3610.  
  3611.  
  3612.  
  3613. ' *********************************************************************
  3614. ' Table Object Hit Events
  3615. '
  3616. ' Any target hit Sub will follow this:
  3617. ' - play a sound
  3618. ' - do some physical movement
  3619. ' - add a score, bonus
  3620. ' - check some variables/modes this trigger is a member of
  3621. ' - set the "LastSwicthHit" variable in case it is needed later
  3622. ' *********************************************************************
  3623.  
  3624. ' Slingshots has been hit
  3625.  
  3626. Dim LStep, RStep
  3627.  
  3628. Sub LeftSlingShot_Slingshot
  3629. If Tilted Then Exit Sub
  3630. PlaySound SoundFXDOF("fx_slingshot", 103, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
  3631. PlaySound "tna_reactorslingloud"
  3632. DOF 104, DOFPulse
  3633. LeftSling4.Visible = 1:LeftSling1.Visible = 0
  3634. Lemk.RotX = 26
  3635. LStep = 0
  3636. LeftSlingShot.TimerEnabled = True
  3637. ' add some points
  3638. AddScore LowerSlingshotScore
  3639.  
  3640. ' add some effect to the table?
  3641. GILeftSlingHit
  3642.  
  3643. SwitchReactorLoopInserts
  3644.  
  3645. ' remember last trigger hit by the ball
  3646. SetLastSwitchHit "LeftSlingShot"
  3647. End Sub
  3648.  
  3649. Sub LeftSlingShot_Timer
  3650. Select Case LStep
  3651. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  3652. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  3653. Case 3:LeftSLing2.Visible = 0:LeftSling1.Visible = 1:Lemk.RotX = -10:Gi2.State = 1:LeftSlingShot.TimerEnabled = False
  3654. End Select
  3655. LStep = LStep + 1
  3656. End Sub
  3657.  
  3658. Sub RightSlingShot_Slingshot
  3659. If Tilted Then Exit Sub
  3660. PlaySound SoundFXDOF("fx_slingshot", 105, DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
  3661. PlaySound "tna_reactorslingloud"
  3662. DOF 106, DOFPulse
  3663. RightSling4.Visible = 1:RightSling1.Visible = 0
  3664. Remk.RotX = 26
  3665. RStep = 0
  3666. RightSlingShot.TimerEnabled = True
  3667. ' add some points
  3668. AddScore LowerSlingshotScore
  3669.  
  3670. ' add some effect to the table?
  3671. GIRightSlingHit
  3672.  
  3673. SwitchReactorLoopInserts
  3674.  
  3675. ' remember last trigger hit by the ball
  3676. SetLastSwitchHit "RightSlingShot"
  3677. End Sub
  3678.  
  3679. Sub RightSlingShot_Timer
  3680. Select Case RStep
  3681. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14:
  3682. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2:
  3683. Case 3:RightSLing2.Visible = 0:RightSLing1.Visible = 1:Remk.RotX = -10:Gi1.State = 1:RightSlingShot.TimerEnabled = False
  3684. End Select
  3685. RStep = RStep + 1
  3686. End Sub
  3687.  
  3688.  
  3689.  
  3690.  
  3691. '******************
  3692. ' Section; Spinner
  3693. '******************
  3694. Dim SpinCount, SuperSpinnerValue
  3695. Sub Spinner1_Spin()
  3696. If Tilted Then Exit Sub
  3697. DOF 112, DOFPulse
  3698. PlaySound "tna_spinner", 0, 1, -0.1
  3699. SpinCount = SpinCount + 1
  3700. ttspin.text = SpinCount
  3701. If SpinCount >= 50 Then
  3702. SetSuperSpinner
  3703. End If
  3704.  
  3705. AddScoreSpecial2 SpinnerValue*SuperSpinnerValue, SpinnerReactorValue
  3706. If SkillShotReady <> 0 Then CheckSkillShot 0
  3707.  
  3708. If ReactorState(CurrentPlayer) = 2 Then
  3709. AddReactorPercentForSpinner
  3710. End If
  3711.  
  3712. End Sub
  3713.  
  3714. 'Decide to remove or keep
  3715. Sub Spinner2_Spin()
  3716. DOF 113, DOFPulse
  3717. If Tilted Then Exit Sub
  3718. PlaySound "tna_spinner", 0, 1, -0.1
  3719. ' increase super jackpot if light l66 is blinking
  3720. AddScoreSpecial2 SpinnerValue, SpinnerReactorValue
  3721. If SkillShotReady <> 0 Then CheckSkillShot 0
  3722. End Sub
  3723.  
  3724. Sub SetSuperSpinner
  3725. If SuperSpinnerValue <> 2 Then
  3726. SuperSpinnerValue = 2
  3727. lSpinner.state = 2
  3728. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SUPER SPINNER"), eBlinkfast, 1800, True, "tna_superspinner"
  3729. End If
  3730. End Sub
  3731. Sub ResetSuperSpinner
  3732. SpinCount = 0
  3733. ttspin.text = SpinCount
  3734. SuperSpinnerValue = 1
  3735. lSpinner.state = 0
  3736. End Sub
  3737. '*********************
  3738. ' Section; Inlanes - Outlanes
  3739. '*********************
  3740. Sub swOutlaneL_Hit()
  3741. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3742. If Tilted Then Exit Sub
  3743. AddScore OutlaneScore
  3744.  
  3745. ' change some light
  3746. If la1.State = 0 Then
  3747. la1.State = 1
  3748. PlaySound "tna_toplane"
  3749. End If
  3750. SetLastSwitchHit "swOutlaneL"
  3751.  
  3752. 'Check if Lane Save being used
  3753. UseSAVE LastSwitchHit
  3754.  
  3755. 'Check if Lane Save earned
  3756. CheckSAVE
  3757. End Sub
  3758.  
  3759. Sub swOutlaneR_Hit()
  3760. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3761. If Tilted Then Exit Sub
  3762. AddScore OutlaneScore
  3763.  
  3764. ' change some light
  3765. If la4.State = 0 Then
  3766. la4.State = 1
  3767. PlaySound "tna_toplane"
  3768. End If
  3769. SetLastSwitchHit "swOutlaneR"
  3770.  
  3771. 'Check if Lane Save being used
  3772. UseSAVE LastSwitchHit
  3773.  
  3774. 'Check if Lane Save earned
  3775. CheckSAVE
  3776. End Sub
  3777.  
  3778. Sub swInlaneL_Hit()
  3779. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3780. If Tilted Then Exit Sub
  3781. AddScore InlaneScore
  3782.  
  3783. ' change some light
  3784. If la2.State = 0 Then
  3785. la2.State = 1
  3786. PlaySound "tna_toplane"
  3787. End If
  3788.  
  3789. StartReactorRightLoopInserts
  3790.  
  3791. SetLastSwitchHit "swInlaneL"
  3792.  
  3793. ' do some check
  3794. CheckSAVE
  3795. End Sub
  3796.  
  3797. Sub swInlaneR_Hit()
  3798. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3799. If Tilted Then Exit Sub
  3800. AddScore InlaneScore
  3801.  
  3802. ' change some light
  3803. If la3.State = 0 Then
  3804. la3.State = 1
  3805. PlaySound "tna_toplane"
  3806. End If
  3807.  
  3808. StartReactorLeftLoopInserts
  3809.  
  3810. SetLastSwitchHit "swInlaneR"
  3811.  
  3812. ' do some check
  3813. CheckSAVE
  3814. End Sub
  3815.  
  3816.  
  3817. '*********************
  3818. ' Section; Top Lanes
  3819. '*********************
  3820. Sub sw1_Hit()
  3821. DOF 150, DOFPulse
  3822. ResetGate
  3823. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3824. If Tilted Then Exit Sub
  3825.  
  3826. ' change some light
  3827. SetLastSwitchHit "sw1"
  3828. If SkillShotReady <> 0 Then CheckSkillShot 1
  3829. If L1.state <> 1 then playsound "tna_toplane"
  3830.  
  3831. L1.state = 1
  3832.  
  3833. AddScoreSpecial COREScore
  3834.  
  3835. If ReactorState(CurrentPlayer) = 2 Then
  3836. AddReactorPercentForSwitch
  3837. End If
  3838.  
  3839. ' do some check
  3840. CheckCORE
  3841. End Sub
  3842.  
  3843. Sub sw2_Hit()
  3844. DOF 151, DOFPulse
  3845. ResetGate
  3846. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3847. If Tilted Then Exit Sub
  3848.  
  3849. ' change some light
  3850. ' FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0
  3851. SetLastSwitchHit "sw2"
  3852. If SkillShotReady <> 0 Then CheckSkillShot 2
  3853. If l2.state <> 1 then playsound "tna_toplane"
  3854.  
  3855. L2.state = 1
  3856.  
  3857. AddScoreSpecial COREScore
  3858.  
  3859. If ReactorState(CurrentPlayer) = 2 Then
  3860. AddReactorPercentForSwitch
  3861. End If
  3862.  
  3863. ' do some check
  3864. CheckCORE
  3865. End Sub
  3866.  
  3867. Sub sw3_Hit()
  3868. DOF 152, DOFPulse
  3869. ResetGate
  3870. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3871. If Tilted Then Exit Sub
  3872.  
  3873. ' change some light
  3874. ' FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0
  3875. SetLastSwitchHit "sw3"
  3876. If SkillShotReady <> 0 Then CheckSkillShot 3
  3877. If l3.state <> 1 then playsound "tna_toplane"
  3878.  
  3879. L3.state = 1
  3880.  
  3881. AddScoreSpecial COREScore
  3882.  
  3883. If ReactorState(CurrentPlayer) = 2 Then
  3884. AddReactorPercentForSwitch
  3885. End If
  3886. ' do some check
  3887. CheckCORE
  3888. End Sub
  3889.  
  3890. Sub sw4_Hit()
  3891. DOF 153, DOFPulse
  3892. ResetGate
  3893. PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
  3894. If Tilted Then Exit Sub
  3895.  
  3896. ' change some light
  3897. ' FlashForms l6f, 1000, 40, 0:FlashForms l6, 1000, 40, 0
  3898. SetLastSwitchHit "sw4"
  3899. If SkillShotReady <> 0 Then CheckSkillShot 4
  3900. If l4.state <> 1 then playsound "tna_toplane"
  3901.  
  3902. L4.state = 1
  3903.  
  3904. AddScoreSpecial COREScore
  3905.  
  3906. If ReactorState(CurrentPlayer) = 2 Then
  3907. AddReactorPercentForSwitch
  3908. End If
  3909.  
  3910. ' do some check
  3911. CheckCORE
  3912. End Sub
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920. Sub LeftScoop_Hit()
  3921. Dim MysteryAwarded
  3922. PlaySound "fx_kicker_enter", 0, 1, -0.07, 0.15
  3923. 'Activeball.x = 296: Activeball.y = 692 'Center ball in scoop
  3924. If Tilted Then
  3925. LeftScoopExit
  3926. Exit Sub
  3927. End If
  3928.  
  3929. MysteryAwarded = CollectMysteryAward()
  3930.  
  3931. if MysteryAwarded=0 Then
  3932. vpmtimer.addtimer 500, "LeftScoopExit '"
  3933. End If
  3934.  
  3935. LeftScoop.Enabled = False
  3936.  
  3937. SetLastSwitchHit "LeftScoop"
  3938. End Sub
  3939. '
  3940. 'Sub FlashLeftScoop
  3941. ' FlashForms l5f, 1000, 40, 0
  3942. ' FlashForms LibraryFlasher, 1000, 40, 0
  3943. ' DOF 206, DOFPulse
  3944. 'End Sub
  3945. '
  3946. Sub LeftScoopExit
  3947. CheckReactorStart
  3948. LightSeqLeftScoop.StopPlay
  3949. LightSeqLeftScoop.UpdateInterval = 1
  3950. 'LightSeqLeftScoop.Play SeqCircleOutOn, 20, 1
  3951. PlaySound SoundFXDOF("fx_kicker", 122, DOFPulse, DOFContactors), 0, 1, -0.07, 0.15
  3952. PlaySound "tna_leftscoopeject"
  3953. DOF 123, DOFPulse
  3954. leftScoop.Kick 162.7, 34
  3955. LeftScoop.Enabled = True
  3956. 'Enable BallSave
  3957. 'EnableBallSaver 3
  3958. End Sub
  3959.  
  3960. Sub RightScoop_Hit()
  3961. Dim tmp
  3962. PlaySound "fx_kicker_enter", 0, 1, -0.07, 0.15
  3963. If Tilted Then
  3964. vpmtimer.addtimer 150, "RightScoopExit '"
  3965. Exit Sub
  3966. End If
  3967.  
  3968. vpmtimer.addtimer 500, "RightScoopExit '"
  3969. RightScoop.Enabled = False
  3970.  
  3971. If bMultiBallMode = False Then 'Normal Play
  3972. RightScoopEjected.Enabled = True
  3973. Else 'Multiball Play
  3974. StartDropTargetResetTimer
  3975. AwardSuperJackpot
  3976.  
  3977. 'Multiball add
  3978. AddMultiball 1
  3979. End If
  3980.  
  3981. AddBonusLights
  3982.  
  3983. SetLastSwitchHit "RightScoop"
  3984. End Sub
  3985.  
  3986. Sub RightScoopExit
  3987. PlaySound SoundFXDOF("fx_kicker", 124, DOFPulse, DOFContactors), 0, 1, -0.07, 0.15
  3988. DOF 123, DOFPulse
  3989. RightScoop.Kick 190, 40
  3990. RightScoop.Enabled = True
  3991. End Sub
  3992.  
  3993. Sub RightScoopEjected_Hit
  3994. DropTargetResetLockIsLit 0
  3995. RightScoopEjected.Enabled = False
  3996. End Sub
  3997.  
  3998. ''*********************
  3999. ' Section; Multiball Drop Targets
  4000. ''*********************
  4001. ' One Target up to start Normal Play. Lock Lit
  4002. ' Multiball when DropTarget 3 hit
  4003. ' When Multiball started, all targets up, jackpot/super jackpot
  4004. ' When Multiball ends, 1 target up and scoop needed to light lock
  4005. Dim bLockIsLit
  4006.  
  4007. Sub StartMultiball
  4008. If debugMultiball Then debug.print "*****SUB:StartMultiball"
  4009. bMultiBallMode = True
  4010. DOF 115, DOFPulse
  4011. MultiballTargetReset
  4012. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MULTI-BALL!!!"), eBlinkfast, 1800, True, "tna_multiball"
  4013.  
  4014. End Sub
  4015.  
  4016. Sub EndMultiball 'Multiball ending
  4017. If debugMultiball Then debug.print "*****SUB:EndMultiball"
  4018. ChangeGI "blue"
  4019.  
  4020. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MBALL TOTAL"), eBlinkfast, 1800, True, ""
  4021.  
  4022. 'If all targets down, reset to lock is lit
  4023. If (DropTarget1.IsDropped = 1 and DropTarget2.IsDropped = 1 and DropTarget3.IsDropped = 1) Then
  4024. DropTargetResetLockIsNotLit
  4025. Else
  4026. DropTargetPartialResetLockIsNotLit
  4027. End If
  4028.  
  4029. End Sub
  4030.  
  4031. Sub DropTargetResetLockIsLit (value) 'Normal Play - Only Target 1 up - Lock is lit
  4032. If debugMultiball Then debug.print "*****SUB:DropTargetResetLockIsLit"
  4033.  
  4034. If bGameInPlay = True then
  4035. bLockIsLit = True
  4036. SetLight lLockIsLit1, "blue", 2
  4037. SetLight lLockIsLit2, "blue", 2
  4038. SetLight lLockIsLit3, "blue", 2
  4039. If value = 0 Then
  4040. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "LOCKS ARE LIT"), eBlinkfast, 1000, True, "tna_lockislit"
  4041. Else
  4042. lLockIsLit2.TimerInterval = 500
  4043. lLockIsLit2.TimerEnabled = True
  4044. End If
  4045. End If
  4046.  
  4047. DropTarget1.UserValue = 1
  4048. DropTarget1.IsDropped = 0
  4049. TargetBlocker1.IsDropped = 0
  4050. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4051.  
  4052. DropTarget2.UserValue = 0
  4053. DropTarget2.IsDropped = 1
  4054. TargetBlocker2.IsDropped = 1
  4055. PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
  4056.  
  4057. DropTarget3.UserValue = 0
  4058. DropTarget3.IsDropped = 1
  4059. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4060. End Sub
  4061.  
  4062. Sub lLockIsLit2_Timer
  4063. lLockIsLit2.TimerEnabled = False
  4064. PlaySound "TNAWelcomeFuture"
  4065. End Sub
  4066.  
  4067. Sub DropTargetResetLockIsNotLit 'Normal Play - Only Target 1 up - Lock is NOT lit
  4068. If debugMultiball Then debug.print "*****SUB:DropTargetResetLockIsNotLit"
  4069.  
  4070. bLockIsLit = False
  4071. lLockIsLit1.state = 0
  4072. lLockIsLit2.state = 0
  4073. lLockIsLit3.state = 0
  4074.  
  4075. DropTarget1.UserValue = 1
  4076. DropTarget1.IsDropped = 0
  4077. TargetBlocker1.IsDropped = 1
  4078. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4079.  
  4080. DropTarget2.UserValue = 0
  4081. DropTarget2.IsDropped = 1
  4082. TargetBlocker2.IsDropped = 1
  4083. PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
  4084.  
  4085. DropTarget3.UserValue = 0
  4086. DropTarget3.IsDropped = 1
  4087. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4088. End Sub
  4089.  
  4090.  
  4091. Sub DropTargetPartialResetLockIsNotLit 'Normal Play - Any targets left up - Lock is NOT lit
  4092. If debugMultiball Then debug.print "*****SUB:DropTargetPartialResetLockIsNotLit"
  4093.  
  4094. bLockIsLit = False
  4095. lLockIsLit1.state = 0
  4096. lLockIsLit2.state = 0
  4097. lLockIsLit3.state = 0
  4098.  
  4099. DropTarget1.UserValue = 1
  4100. DropTarget1.IsDropped = 0
  4101. TargetBlocker1.IsDropped = 1
  4102. End Sub
  4103.  
  4104. Sub MultiballTargetReset 'Multiball Play - All targets up
  4105. If debugMultiball Then debug.print "*****SUB:MultiballTargetReset"
  4106. DropTarget1.TimerInterval = 3000
  4107. DropTarget1.TimerEnabled = True
  4108.  
  4109. SetLight lLockIsLit1, "red", 2
  4110. SetLight lLockIsLit2, "red", 2
  4111. SetLight lLockIsLit3, "red", 2
  4112. End Sub
  4113.  
  4114. Sub DropTarget1_Timer 'Multiball Play - All targets up
  4115. If debugMultiball Then debug.print "*****SUB:DropTarget1_Timer"
  4116. DropTarget1.TimerEnabled = False
  4117.  
  4118. bLockIsLit = False
  4119.  
  4120. DropTarget1.UserValue = 1
  4121. DropTarget1.IsDropped = 0
  4122. TargetBlocker1.IsDropped = 1
  4123. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4124.  
  4125. DropTarget2.UserValue = 1
  4126. DropTarget2.IsDropped = 0
  4127. TargetBlocker2.IsDropped = 1
  4128. PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
  4129.  
  4130. DropTarget3.UserValue = 1
  4131. DropTarget3.IsDropped = 0
  4132. DropTarget3.HasHitEvent = 1
  4133. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4134. End Sub
  4135.  
  4136. Sub DropTargetOpto2_Hit 'Locks ball 1
  4137. If debugMultiball Then debug.print "*****SUB:DropTargetOpto2_Hit"
  4138.  
  4139. If bLockIsLit = True Then 'Normal Play
  4140. If DropTarget2.UserValue = 0 And DropTarget1.UserValue = 1 Then
  4141. If bTimedSkillShot = False Then
  4142. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL LOCK 1"), eBlinkfast, 1800, True, "tna_balllock1"
  4143. Addscore BallLockScore
  4144.  
  4145. Else
  4146. DMD "", eNone, "", eNone, CenterLine(2, FormatScore(BallLockScore*2)), eNone, CenterLine(3, "SKILL LOCK"), eBlinkfast, 1800, True, "tna_secretskillshot2"
  4147. Addscore BallLockScore*2
  4148. bTimedSkillShot = False
  4149. End If
  4150.  
  4151. AddBonusLights
  4152. PlaySound SoundFXDOF("fx_resetdrop", 137, DOFPulse, DOFContactors)
  4153. DropTarget2.UserValue = 1
  4154. DropTarget2.IsDropped = 0
  4155. TargetBlocker2.IsDropped = 0
  4156. If bGameInPlay Then CreateNewBallAfterBallLock
  4157. End If
  4158. End If
  4159.  
  4160. SetLastSwitchHit "DropTargetOpto2"
  4161. End Sub
  4162.  
  4163. Sub DropTargetOpto3_Hit 'Locks ball 2
  4164. If debugMultiball Then debug.print "*****SUB:DropTargetOpto3_Hit"
  4165.  
  4166. If bLockIsLit = True Then 'Normal Play
  4167.  
  4168. If DropTarget3.UserValue = 0 And DropTarget2.UserValue = 1 Then
  4169.  
  4170.  
  4171. If bTimedSkillShot = False Then
  4172. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL LOCK 2"), eBlinkfast, 1800, True, "tna_balllock2"
  4173. Addscore BallLockScore
  4174. Else
  4175. DMD "", eNone, "", eNone, CenterLine(2, FormatScore(BallLockScore*2)), eNone, CenterLine(3, "SKILL LOCK"), eBlinkfast, 1800, True, "tna_secretskillshot2"
  4176. Addscore BallLockScore*2
  4177. bTimedSkillShot = False
  4178. End If
  4179.  
  4180. AddBonusLights
  4181. PlaySound SoundFXDOF("fx_resetdrop", 138, DOFPulse, DOFContactors)
  4182. DropTarget3.UserValue = 1
  4183. DropTarget3.IsDropped = 0
  4184. If bGameInPlay Then CreateNewBallAfterBallLock
  4185. End If
  4186. End If
  4187. SetLastSwitchHit "DropTargetOpto3"
  4188. End Sub
  4189.  
  4190. Sub DropTarget1_Hit
  4191. If debugMultiball Then debug.print "*****SUB:DropTarget1_Hit"
  4192.  
  4193. AddBonusLights
  4194.  
  4195. If bMultiBallMode = False Then 'Normal Play
  4196. 'Addscore DropTargetScore
  4197. If (DropTarget1.UserValue = 1) Then
  4198. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4199. PlaySound "tna_toptarget"
  4200. Else 'Game init reset
  4201. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4202. End If
  4203. Else 'Multiball Play
  4204. DropTarget1.UserValue = 0
  4205. AwardTripleJackpot
  4206. StartDropTargetResetTimer
  4207. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4208. End If
  4209. SetLastSwitchHit "DropTarget1"
  4210. End Sub
  4211.  
  4212. Sub DropTarget2_Hit
  4213. If debugMultiball Then debug.print "*****SUB:DropTarget2_Hit"
  4214.  
  4215. AddBonusLights
  4216.  
  4217. If bMultiBallMode = False Then 'Normal Play
  4218. 'Addscore DropTargetScore
  4219. If (DropTarget2.UserValue = 1) Then
  4220. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4221. PlaySound "tna_toptarget"
  4222. Else 'Game init reset
  4223. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4224. End If
  4225. Else 'Multiball Play
  4226. DropTarget2.UserValue = 0
  4227. AwardDoubleJackpot
  4228. StartDropTargetResetTimer
  4229. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4230. End If
  4231. SetLastSwitchHit "DropTarget2"
  4232. End Sub
  4233.  
  4234. Sub DropTarget3_Hit
  4235. If debugMultiball Then debug.print "*****SUB:DropTarget3_Hit"
  4236.  
  4237. AddBonusLights
  4238.  
  4239. If bMultiBallMode = False Then 'If in Normal Play
  4240. 'Addscore DropTargetScore
  4241. If (bLockIsLit = True) Then 'Multiball start
  4242. SetBallsOnPlayfield 3
  4243. Debug.print "BallsonPlayfieldMulti" & " : " & BallsOnPlayfield
  4244. bBallSaverReady = True
  4245. bAutoPlunger = True
  4246. EnableBallSaver BallSaverTime
  4247. ChangeGI "green"
  4248. vpmtimer.addtimer 1000, "StartMultiball '"
  4249. DMD "", eNone, Centerline(1, ("MULTIBALL")), eNone, "", eNone, CenterLine(3, FormatScore(Jackpot)), eBlinkFast, 1000, True, "tna_multiball"
  4250.  
  4251. 'if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations)
  4252. 'set the bAutoPlunger flag to kick the ball in play automatically
  4253. DOF 129, DOFPulse
  4254. 'PlaySong "m_multiball", 1
  4255.  
  4256. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4257. DropTarget1.UserValue = 0
  4258. DropTarget1.IsDropped = 1
  4259. TargetBlocker1.IsDropped = 1
  4260. PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
  4261. DropTarget2.UserValue = 0
  4262. DropTarget2.IsDropped = 1
  4263. TargetBlocker2.IsDropped = 1
  4264. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4265. DropTarget3.UserValue = 0
  4266. DropTarget3.IsDropped = 1
  4267. Else 'Game init reset
  4268. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4269. PlaySound "tna_toptarget"
  4270. End If
  4271. Else 'Multiball Play
  4272. DropTarget3.UserValue = 0
  4273. AwardJackpot
  4274. StartDropTargetResetTimer
  4275. PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
  4276.  
  4277. End If
  4278. SetLastSwitchHit "DropTarget3"
  4279. End Sub
  4280.  
  4281. Sub MultiballOptoCheck_Hit 'During Multiball, raise a drop target after x sec of no target hits
  4282. If debugMultiball Then debug.print "*****SUB:MultiballOptoCheck_Hit"
  4283.  
  4284. If bMultiBallMode = True Then
  4285. If debugMultiball Then debug.print "Calling StartDropTargetResetTimer"
  4286. StartDropTargetResetTimer
  4287. End If
  4288. If (DropTarget1.TimerEnabled = True) Then
  4289. If debugMultiball Then debug.print "Reseting DropTarget1 3 sec timer"
  4290. DropTarget1.TimerEnabled = True
  4291. DropTarget1.TimerInterval = 3000
  4292. DropTarget1.TimerEnabled = True
  4293. End If
  4294. End Sub
  4295.  
  4296.  
  4297. Sub StartDropTargetResetTimer 'During Multiball, raise a drop target after x sec of no target hits
  4298. If debugMultiball Then debug.print "*****SUB:StartDropTargetResetTimer"
  4299.  
  4300. DropTarget3.TimerEnabled = False
  4301. DropTarget3.TimerInterval = DropTargetResetTime*1000
  4302. DropTarget3.TimerEnabled = True
  4303. End Sub
  4304.  
  4305. Sub DropTarget3_Timer 'During Multiball, raise a drop target after x sec of no target hits
  4306. If debugMultiball Then debug.print "*****SUB:DropTarget3_Timer"
  4307.  
  4308. If bMultiBallMode = False Then 'Multiball over so stop resetting target
  4309. DropTarget3.TimerEnabled = False
  4310. Else
  4311. If DropTarget1.IsDropped = 1 Then
  4312. DropTarget1.IsDropped = 0
  4313. DropTarget1.UserValue = 1
  4314. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4315. ElseIf DropTarget2.IsDropped = 1 Then
  4316. DropTarget2.IsDropped = 0
  4317. DropTarget2.UserValue = 1
  4318. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4319. ElseIf DropTarget3.IsDropped = 1 Then
  4320. DropTarget3.IsDropped = 0
  4321. DropTarget3.UserValue = 1
  4322. PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
  4323. End If
  4324. End If
  4325. End Sub
  4326.  
  4327.  
  4328.  
  4329.  
  4330. ''*********************
  4331. '' Section; Section; Grid Targets
  4332. ''*********************
  4333. Dim bGridReady
  4334.  
  4335. Sub GridTargetx_hit()
  4336. PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
  4337. If debugGrid Then debug.print "*****SUB:" & "GridTargetx_hit"
  4338. Select Case ReactorState(CurrentPlayer)
  4339. Case 0: 'Targeted
  4340. If lx1.State = 2 then
  4341. SetLight lx1, "green", 1
  4342. SetLight lx2, "blue", 2
  4343. 'lx1.state = 1
  4344. 'lx2.state = 2
  4345. AddScore GridTargetScore
  4346. AddBonusLights2
  4347. ElseIf lx2.State = 2 then
  4348. SetLight lx2, "green", 1
  4349. SetLight lx3, "blue", 2
  4350. 'lx2.state = 1
  4351. 'lx3.state = 2
  4352. AddScore GridTargetScore
  4353. AddBonusLights2
  4354. ElseIf lx3.State = 2 then
  4355. SetLight lx3, "green", 1
  4356. 'lx3.state = 1
  4357. AddScore GridTargetScore
  4358. AddBonusLights2
  4359. Else
  4360. Playsound "tna_targetreject"
  4361. End If
  4362. CheckGrid
  4363.  
  4364. Case 1: 'Ready
  4365. Playsound "tna_targetreject"
  4366.  
  4367. Case 2: 'Started
  4368. If lx1.State = 2 then
  4369. SetLight lx1, "purple", 1
  4370. SetLight lx2, "blue", 2
  4371. AddScore GridTargetScore
  4372. AddBonusLights2
  4373. ElseIf lx2.State = 2 then
  4374. SetLight lx2, "purple", 1
  4375. SetLight lx3, "blue", 2
  4376. AddScore GridTargetScore
  4377. AddBonusLights2
  4378. ElseIf lx3.State = 2 then
  4379. SetLight lx3, "purple", 1
  4380. AddScore GridTargetScore
  4381. AddBonusLights2
  4382. Else
  4383. Playsound "tna_targetreject"
  4384. End If
  4385. CheckGrid
  4386.  
  4387. Case 3: 'Critical
  4388. If lx1.State = 2 then
  4389. SetLight lx1, "purple", 1
  4390. SetLight lx2, "blue", 2
  4391. AddScore GridTargetScore
  4392. AddBonusLights2
  4393. ElseIf lx2.State = 2 then
  4394. SetLight lx2, "purple", 1
  4395. SetLight lx3, "blue", 2
  4396. AddScore GridTargetScore
  4397. AddBonusLights2
  4398. ElseIf lx3.State = 2 then
  4399. SetLight lx3, "purple", 1
  4400. AddScore GridTargetScore
  4401. AddBonusLights2
  4402. Else
  4403. Playsound "tna_targetreject"
  4404. End If
  4405. CheckGrid
  4406.  
  4407. Case 4: 'Destroyed
  4408. End Select
  4409. SetLastSwitchHit "GridTargetx"
  4410. End Sub
  4411.  
  4412. Sub GridTargety_hit()
  4413. PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
  4414. If debugGrid Then debug.print "*****SUB:" & "GridTargety_hit"
  4415. Select Case ReactorState(CurrentPlayer)
  4416. Case 0: 'Targeted
  4417. If ly1.State = 2 then
  4418. SetLight ly1, "green", 1
  4419. SetLight ly2, "blue", 2
  4420. AddScore GridTargetScore
  4421. AddBonusLights2
  4422. ElseIf ly2.State = 2 then
  4423. SetLight ly2, "green", 1
  4424. SetLight ly3, "blue", 2
  4425. AddScore GridTargetScore
  4426. AddBonusLights2
  4427. ElseIf ly3.State = 2 then
  4428. SetLight ly3, "green", 1
  4429. AddScore GridTargetScore
  4430. AddBonusLights2
  4431. Else
  4432. Playsound "tna_targetreject"
  4433. End If
  4434. CheckGrid
  4435.  
  4436. Case 1: 'Ready
  4437. Playsound "tna_targetreject"
  4438. Case 2: 'Started
  4439. If ly1.State = 2 then
  4440. SetLight ly1, "purple", 1
  4441. SetLight ly2, "blue", 2
  4442. AddScore GridTargetScore
  4443. AddBonusLights2
  4444. ElseIf ly2.State = 2 then
  4445. SetLight ly2, "purple", 1
  4446. SetLight ly3, "blue", 2
  4447. AddScore GridTargetScore
  4448. AddBonusLights2
  4449. ElseIf ly3.State = 2 then
  4450. SetLight ly3, "purple", 1
  4451. AddScore GridTargetScore
  4452. AddBonusLights2
  4453. Else
  4454. Playsound "tna_targetreject"
  4455. End If
  4456. CheckGrid
  4457.  
  4458. Case 3: 'Critical
  4459. If ly1.State = 2 then
  4460. SetLight ly1, "purple", 1
  4461. SetLight ly2, "blue", 2
  4462. AddScore GridTargetScore
  4463. AddBonusLights2
  4464. ElseIf ly2.State = 2 then
  4465. SetLight ly2, "purple", 1
  4466. SetLight ly3, "blue", 2
  4467. AddScore GridTargetScore
  4468. AddBonusLights2
  4469. ElseIf ly3.State = 2 then
  4470. SetLight ly3, "purple", 1
  4471. AddScore GridTargetScore
  4472. AddBonusLights2
  4473. Else
  4474. Playsound "tna_targetreject"
  4475. End If
  4476. CheckGrid
  4477.  
  4478. Case 4: 'Destroyed
  4479.  
  4480. End Select
  4481. SetLastSwitchHit "GridTargety"
  4482. End Sub
  4483.  
  4484. Sub GridTargetz_hit()
  4485. PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
  4486. If debugGrid Then debug.print "*****SUB:" & "GridTargetz_hit"
  4487. Select Case ReactorState(CurrentPlayer)
  4488. Case 0: 'Targeted
  4489. If lz1.State = 2 then
  4490. SetLight lz1, "green", 1
  4491. SetLight lz2, "blue", 2
  4492. AddScore GridTargetScore
  4493. AddBonusLights2
  4494. ElseIf lz2.State = 2 then
  4495. SetLight lz2, "green", 1
  4496. SetLight lz3, "blue", 2
  4497. AddScore GridTargetScore
  4498. AddBonusLights2
  4499. ElseIf lz3.State = 2 then
  4500. SetLight lz3, "green", 1
  4501. AddScore GridTargetScore
  4502. AddBonusLights2
  4503. Else
  4504. Playsound "tna_targetreject"
  4505. End If
  4506. CheckGrid
  4507.  
  4508. Case 1: 'Ready
  4509. Playsound "tna_targetreject"
  4510.  
  4511. Case 2: 'Started
  4512. If lz1.State = 2 then
  4513. SetLight lz1, "purple", 1
  4514. SetLight lz2, "blue", 2
  4515. AddScore GridTargetScore
  4516. AddBonusLights2
  4517. ElseIf lz2.State = 2 then
  4518. SetLight lz2, "purple", 1
  4519. SetLight lz3, "blue", 2
  4520. AddScore GridTargetScore
  4521. AddBonusLights2
  4522. ElseIf lz3.State = 2 then
  4523. SetLight lz3, "purple", 1
  4524. AddScore GridTargetScore
  4525. AddBonusLights2
  4526. Else
  4527. Playsound "tna_targetreject"
  4528. End If
  4529. CheckGrid
  4530.  
  4531. Case 3: 'Critical
  4532. If lz1.State = 2 then
  4533. SetLight lz1, "purple", 1
  4534. SetLight lz2, "blue", 2
  4535. AddScore GridTargetScore
  4536. AddBonusLights2
  4537. ElseIf lz2.State = 2 then
  4538. SetLight lz2, "purple", 1
  4539. SetLight lz3, "blue", 2
  4540. AddScore GridTargetScore
  4541. AddBonusLights2
  4542. ElseIf lz3.State = 2 then
  4543. SetLight lz3, "purple", 1
  4544. AddScore GridTargetScore
  4545. AddBonusLights2
  4546. Else
  4547. Playsound "tna_targetreject"
  4548. End If
  4549. CheckGrid
  4550.  
  4551. Case 4: 'Destroyed
  4552.  
  4553. End Select
  4554. SetLastSwitchHit "GridTargetz"
  4555. End Sub
  4556.  
  4557. Dim GridSetup
  4558. Sub ResetGrid()
  4559. GridSetup = ReactorLevel(CurrentPlayer) + ReactorDifficulty - 1
  4560. If debugGrid Then debug.print "*****SUB:" & "ResetGrid " & GridSetup
  4561. bGridReady = 0
  4562.  
  4563. Select Case GridSetup:
  4564.  
  4565. Case 1: '3 targets
  4566. SetLight lx1, "green", 1
  4567. SetLight lx2, "green", 1
  4568. SetLight lx3, "blue", 2
  4569.  
  4570. SetLight ly1, "green", 1
  4571. SetLight ly2, "green", 1
  4572. SetLight ly3, "blue", 2
  4573.  
  4574. SetLight lz1, "green", 1
  4575. SetLight lz2, "green", 1
  4576. SetLight lz3, "blue", 2
  4577. Case 2: '4 targets
  4578. SetLight lx1, "green", 1
  4579. SetLight lx2, "blue", 2
  4580. SetLight lx3, "green", 0
  4581.  
  4582. SetLight ly1, "green", 1
  4583. SetLight ly2, "green", 1
  4584. SetLight ly3, "blue", 2
  4585.  
  4586. SetLight lz1, "green", 1
  4587. SetLight lz2, "green", 1
  4588. SetLight lz3, "blue", 2
  4589. Case 3: '5 targets
  4590. SetLight lx1, "green", 1
  4591. SetLight lx2, "blue", 2
  4592. SetLight lx3, "green", 0
  4593.  
  4594. SetLight ly1, "green", 1
  4595. SetLight ly2, "blue", 2
  4596. SetLight ly3, "green", 0
  4597.  
  4598. SetLight lz1, "green", 1
  4599. SetLight lz2, "green", 1
  4600. SetLight lz3, "blue", 2
  4601. Case 4: '6 targets
  4602. SetLight lx1, "green", 1
  4603. SetLight lx2, "blue", 2
  4604. SetLight lx3, "green", 0
  4605.  
  4606. SetLight ly1, "green", 1
  4607. SetLight ly2, "blue", 2
  4608. SetLight ly3, "green", 0
  4609.  
  4610. SetLight lz1, "green", 1
  4611. SetLight lz2, "blue", 2
  4612. SetLight lz3, "green", 0
  4613. Case 5: '7 targets
  4614. SetLight lx1, "blue", 2
  4615. SetLight lx2, "green", 0
  4616. SetLight lx3, "green", 0
  4617.  
  4618. SetLight ly1, "green", 1
  4619. SetLight ly2, "blue", 2
  4620. SetLight ly3, "green", 0
  4621.  
  4622. SetLight lz1, "green", 1
  4623. SetLight lz2, "blue", 2
  4624. SetLight lz3, "green", 0
  4625. Case 6: '8 targets
  4626. SetLight lx1, "blue", 2
  4627. SetLight lx2, "green", 0
  4628. SetLight lx3, "green", 0
  4629.  
  4630. SetLight ly1, "blue", 2
  4631. SetLight ly2, "green", 0
  4632. SetLight ly3, "green", 0
  4633.  
  4634. SetLight lz1, "green", 1
  4635. SetLight lz2, "blue", 2
  4636. SetLight lz3, "green", 0
  4637. Case Else:
  4638. SetLight lx1, "blue", 2
  4639. SetLight lx2, "green", 0
  4640. SetLight lx3, "green", 0
  4641.  
  4642. SetLight ly1, "blue", 2
  4643. SetLight ly2, "green", 0
  4644. SetLight ly3, "green", 0
  4645.  
  4646. SetLight lz1, "blue", 2
  4647. SetLight lz2, "green", 0
  4648. SetLight lz3, "green", 0
  4649. End Select
  4650.  
  4651. End Sub
  4652.  
  4653. Sub StartGridJackpot()
  4654. If debugGrid Then debug.print "*****SUB:" & "StartGridJackpot"
  4655.  
  4656. 'Set Grid Color
  4657. SetLight lx1, "blue", 2
  4658. SetLight lx2, "purple", 0
  4659. SetLight lx3, "purple", 0
  4660. SetLight ly1, "blue", 2
  4661. SetLight ly2, "purple", 0
  4662. SetLight ly3, "purple", 0
  4663. SetLight lz1, "blue", 2
  4664. SetLight lz2, "purple", 0
  4665. SetLight lz3, "purple", 0
  4666. '
  4667. ' lx1.State = 2
  4668. ' lx2.State = 0
  4669. ' lx3.State = 0
  4670. '
  4671. ' ly1.State = 2
  4672. ' ly2.State = 0
  4673. ' ly3.State = 0
  4674. '
  4675. ' lz1.State = 2
  4676. ' lz2.State = 0
  4677. ' lz3.State = 0
  4678. End Sub
  4679.  
  4680. Dim Playerx1(4)
  4681. Dim Playerx2(4)
  4682. Dim Playerx3(4)
  4683. Dim Playery1(4)
  4684. Dim Playery2(4)
  4685. Dim Playery3(4)
  4686. Dim Playerz1(4)
  4687. Dim Playerz2(4)
  4688. Dim Playerz3(4)
  4689.  
  4690. Sub InitGridPlayerData
  4691. Dim i
  4692. For i = 1 To MaxPlayers
  4693. Playerx1(i) = 0
  4694. Playerx2(i) = 0
  4695. Playerx3(i) = 0
  4696. Playery1(i) = 0
  4697. Playery2(i) = 0
  4698. Playery3(i) = 0
  4699. Playerz1(i) = 0
  4700. Playerz2(i) = 0
  4701. Playerz3(i) = 0
  4702. Next
  4703. End Sub
  4704.  
  4705. Sub SaveGridData
  4706. If debugGrid Then debug.print "*****SUB:" & "SaveGridState"
  4707. Playerx1(CurrentPlayer) = lx1.State
  4708. Playerx2(CurrentPlayer) = lx2.State
  4709. Playerx3(CurrentPlayer) = lx3.State
  4710. Playery1(CurrentPlayer) = ly1.State
  4711. Playery2(CurrentPlayer) = ly2.State
  4712. Playery3(CurrentPlayer) = ly3.State
  4713. Playerz1(CurrentPlayer) = lz1.State
  4714. Playerz2(CurrentPlayer) = lz2.State
  4715. Playerz3(CurrentPlayer) = lz3.State
  4716. End Sub
  4717.  
  4718. Sub RestoreGridData
  4719.  
  4720. If (BallsRemaining(CurrentPlayer) = BallsPerGame) Then 'If first ball for new player
  4721. ResetGrid
  4722. ElseIf ReactorState(CurrentPlayer) >= 2 Then
  4723. SetLightGrid lx1, "purple", Playerx1(CurrentPlayer)
  4724. SetLightGrid lx2, "purple", Playerx2(CurrentPlayer)
  4725. SetLightGrid lx3, "purple", Playerx3(CurrentPlayer)
  4726. SetLightGrid ly1, "purple", Playery1(CurrentPlayer)
  4727. SetLightGrid ly2, "purple", Playery2(CurrentPlayer)
  4728. SetLightGrid ly3, "purple", Playery3(CurrentPlayer)
  4729. SetLightGrid lz1, "purple", Playerz1(CurrentPlayer)
  4730. SetLightGrid lz2, "purple", Playerz2(CurrentPlayer)
  4731. SetLightGrid lz3, "purple", Playerz3(CurrentPlayer)
  4732. Else
  4733. SetLightGrid lx1, "green", Playerx1(CurrentPlayer)
  4734. SetLightGrid lx2, "green", Playerx2(CurrentPlayer)
  4735. SetLightGrid lx3, "green", Playerx3(CurrentPlayer)
  4736. SetLightGrid ly1, "green", Playery1(CurrentPlayer)
  4737. SetLightGrid ly2, "green", Playery2(CurrentPlayer)
  4738. SetLightGrid ly3, "green", Playery3(CurrentPlayer)
  4739. SetLightGrid lz1, "green", Playerz1(CurrentPlayer)
  4740. SetLightGrid lz2, "green", Playerz2(CurrentPlayer)
  4741. SetLightGrid lz3, "green", Playerz3(CurrentPlayer)
  4742. End If
  4743.  
  4744. End Sub
  4745.  
  4746. Sub SetLightGrid (obj, col, state)
  4747. If state = 2 then
  4748. SetLight obj, "blue", state
  4749. Else
  4750. SetLight obj, col, state
  4751. End If
  4752. End Sub
  4753.  
  4754. Sub TestHitTarget
  4755. If debugGrid Then debug.print "*****SUB:" & "TestHitTarget"
  4756. GridTargetx_hit
  4757. GridTargetx_hit
  4758. GridTargetx_hit
  4759. GridTargety_hit
  4760. GridTargety_hit
  4761. GridTargety_hit
  4762. GridTargetz_hit
  4763. GridTargetz_hit
  4764. GridTargetz_hit
  4765. ' lx1.State = 1
  4766. ' lx2.State = 1
  4767. ' lx3.State = 1
  4768. '
  4769. ' ly1.State = 1
  4770. ' ly2.State = 1
  4771. ' ly3.State = 1
  4772. '
  4773. ' lz1.State = 1
  4774. ' lz2.State = 1
  4775. ' lz3.State = 1
  4776. CheckGrid
  4777. end Sub
  4778.  
  4779. Sub CheckGrid
  4780.  
  4781. dim tmp
  4782. tmp = 0
  4783.  
  4784.  
  4785. If lx1.State = 1 then tmp = tmp + 1
  4786. If lx2.State = 1 then tmp = tmp + 1
  4787. If lx3.State = 1 then tmp = tmp + 1
  4788.  
  4789. If ly1.State = 1 then tmp = tmp + 1
  4790. If ly2.State = 1 then tmp = tmp + 1
  4791. If ly3.State = 1 then tmp = tmp + 1
  4792.  
  4793. If lz1.State = 1 then tmp = tmp + 1
  4794. If lz2.State = 1 then tmp = tmp + 1
  4795. If lz3.State = 1 then tmp = tmp + 1
  4796.  
  4797. If debugGrid Then debug.print "*****SUB:CheckGrid(), Grid=" & tmp
  4798.  
  4799. If tmp = 9 Then
  4800. If ReactorState(CurrentPlayer) = 0 Then
  4801. SetReactorReady
  4802. ElseIf (ReactorState(CurrentPlayer) = 2) or (ReactorState(CurrentPlayer) = 3) Then
  4803. ReactorJackpot
  4804. End If
  4805.  
  4806. AddBonusLights
  4807. End If
  4808. End Sub
  4809.  
  4810. Sub ByPassGrid
  4811. If debugGrid Then debug.print "*****SUB:ByPassGrid"
  4812. If ReactorState(CurrentPlayer) = 0 Then
  4813. SetReactorReady
  4814. End If
  4815. End Sub
  4816.  
  4817. Sub ReactorJackpot
  4818. If debugGrid Then debug.print "*****SUB:" & "ReactorJackpot"
  4819.  
  4820. DMD "", eNone, Centerline(1, ("REACTOR JKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(.5*ReactorValue(CurrentPlayer))), eBlinkFast, 1000, True, "tna_reactorjackpot"
  4821. AddScore (.5*ReactorValue(CurrentPlayer))
  4822. StartGridJackpot
  4823. End Sub
  4824.  
  4825. Sub ReadyGrid 'Blinking to Left Scoop
  4826. If debugGrid Then debug.print "*****SUB:" & "ReadyGrid"
  4827. SetLight lx1, "", 0
  4828. SetLight lx2, "", 0
  4829. SetLight lx3, "", 0
  4830.  
  4831. SetLight ly1, "", 0
  4832. SetLight ly2, "", 0
  4833. SetLight ly3, "", 0
  4834.  
  4835. SetLight lz1, "", 0
  4836. SetLight lz2, "", 0
  4837. SetLight lz3, "", 0
  4838.  
  4839. SetLight lx3, "blue", 2
  4840. SetLight ly2, "blue", 2
  4841. SetLight lz1, "blue", 2
  4842.  
  4843. bGridReady = 1
  4844. End Sub
  4845.  
  4846.  
  4847. ''*********************
  4848. '' Section; Bonus Lights
  4849. ''*********************
  4850.  
  4851. 'Bonus light TEST
  4852. lbonus1.timerinterval = 500
  4853. 'lbonus1.timerenabled = 1
  4854. Sub lBonus1_timer
  4855. AddBonusLights
  4856. End Sub
  4857.  
  4858. Sub AddBonusLights2
  4859. playsound "tna_target"
  4860. AddBonusLights
  4861. End Sub
  4862.  
  4863. Sub AddBonusLights
  4864. Dim tmp
  4865. ' Dim xmultiplier
  4866. ' xMultiplier = BallsOnPlayfield
  4867. ' If xMultiplier = 0 then xMultiplier = 1
  4868.  
  4869. BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + 1 '+ (1 * xMultiplier)
  4870.  
  4871. tmp = BonusPoints(CurrentPlayer) mod 10
  4872. Select Case tmp
  4873. Case 1:
  4874. lBonus1.State = 1
  4875. lBonus2.State = 0
  4876. lBonus3.State = 0
  4877. lBonus4.State = 0
  4878. lBonus5.State = 0
  4879. lBonus6.State = 0
  4880. lBonus7.State = 0
  4881. lBonus8.State = 0
  4882. lBonus9.State = 0
  4883. lBonus0.State= 0
  4884. Case 2:
  4885. lBonus1.State = 1
  4886. lBonus2.State = 1
  4887. lBonus3.State = 0
  4888. lBonus4.State = 0
  4889. lBonus5.State = 0
  4890. lBonus6.State = 0
  4891. lBonus7.State = 0
  4892. lBonus8.State = 0
  4893. lBonus9.State = 0
  4894. lBonus0.State= 0
  4895. Case 3:
  4896. lBonus1.State = 1
  4897. lBonus2.State = 1
  4898. lBonus3.State = 1
  4899. lBonus4.State = 0
  4900. lBonus5.State = 0
  4901. lBonus6.State = 0
  4902. lBonus7.State = 0
  4903. lBonus8.State = 0
  4904. lBonus9.State = 0
  4905. lBonus0.State= 0
  4906. Case 4:
  4907. lBonus1.State = 1
  4908. lBonus2.State = 1
  4909. lBonus3.State = 1
  4910. lBonus4.State = 1
  4911. lBonus5.State = 0
  4912. lBonus6.State = 0
  4913. lBonus7.State = 0
  4914. lBonus8.State = 0
  4915. lBonus9.State = 0
  4916. lBonus0.State= 0
  4917. Case 5:
  4918. lBonus1.State = 1
  4919. lBonus2.State = 1
  4920. lBonus3.State = 1
  4921. lBonus4.State = 1
  4922. lBonus5.State = 1
  4923. lBonus6.State = 0
  4924. lBonus7.State = 0
  4925. lBonus8.State = 0
  4926. lBonus9.State = 0
  4927. lBonus0.State= 0
  4928. Case 6:
  4929. lBonus1.State = 1
  4930. lBonus2.State = 1
  4931. lBonus3.State = 1
  4932. lBonus4.State = 1
  4933. lBonus5.State = 1
  4934. lBonus6.State = 1
  4935. lBonus7.State = 0
  4936. lBonus8.State = 0
  4937. lBonus9.State = 0
  4938. lBonus0.State= 0
  4939. Case 7:
  4940. lBonus1.State = 1
  4941. lBonus2.State = 1
  4942. lBonus3.State = 1
  4943. lBonus4.State = 1
  4944. lBonus5.State = 1
  4945. lBonus6.State = 1
  4946. lBonus7.State = 1
  4947. lBonus8.State = 0
  4948. lBonus9.State = 0
  4949. lBonus0.State= 0
  4950. Case 8:
  4951. lBonus1.State = 1
  4952. lBonus2.State = 1
  4953. lBonus3.State = 1
  4954. lBonus4.State = 1
  4955. lBonus5.State = 1
  4956. lBonus6.State = 1
  4957. lBonus7.State = 1
  4958. lBonus8.State = 1
  4959. lBonus9.State = 0
  4960. lBonus0.State= 0
  4961. Case 9:
  4962. lBonus1.State = 1
  4963. lBonus2.State = 1
  4964. lBonus3.State = 1
  4965. lBonus4.State = 1
  4966. lBonus5.State = 1
  4967. lBonus6.State = 1
  4968. lBonus7.State = 1
  4969. lBonus8.State = 1
  4970. lBonus9.State = 1
  4971. lBonus0.State= 0
  4972. Case 0:
  4973. If BonusPoints(CurrentPlayer) > 0 Then
  4974. lBonus1.State = 1
  4975. lBonus2.State = 1
  4976. lBonus3.State = 1
  4977. lBonus4.State = 1
  4978. lBonus5.State = 1
  4979. lBonus6.State = 1
  4980. lBonus7.State = 1
  4981. lBonus8.State = 1
  4982. lBonus9.State = 1
  4983. lBonus0.State= 1
  4984. End If
  4985. End Select
  4986.  
  4987. If BonusPoints(CurrentPlayer) > 150 Then
  4988. lBonus50.State= 1
  4989. lBonus40.State= 1
  4990. lBonus30.State= 1
  4991. lBonus20.State= 1
  4992. lBonus10.State= 1
  4993. ElseIf BonusPoints(CurrentPlayer) > 140 Then
  4994. lBonus50.State= 1
  4995. lBonus40.State= 1
  4996. lBonus30.State= 1
  4997. lBonus20.State= 1
  4998. lBonus10.State= 0
  4999. ElseIf BonusPoints(CurrentPlayer) > 130 Then
  5000. lBonus50.State= 1
  5001. lBonus40.State= 1
  5002. lBonus30.State= 1
  5003. lBonus20.State= 0
  5004. lBonus10.State= 1
  5005. ElseIf BonusPoints(CurrentPlayer) > 120 Then
  5006. lBonus50.State= 1
  5007. lBonus40.State= 1
  5008. lBonus30.State= 1
  5009. lBonus20.State= 0
  5010. lBonus10.State= 0
  5011. ElseIf BonusPoints(CurrentPlayer) > 110 Then
  5012. lBonus50.State= 1
  5013. lBonus40.State= 1
  5014. lBonus30.State= 0
  5015. lBonus20.State= 1
  5016. lBonus10.State= 0
  5017. ElseIf BonusPoints(CurrentPlayer) > 100 Then
  5018. lBonus50.State= 1
  5019. lBonus40.State= 1
  5020. lBonus30.State= 0
  5021. lBonus20.State= 0
  5022. lBonus10.State= 1
  5023. ElseIf BonusPoints(CurrentPlayer) > 90 Then
  5024. lBonus50.State= 1
  5025. lBonus40.State= 1
  5026. lBonus30.State= 0
  5027. lBonus20.State= 0
  5028. lBonus10.State= 0
  5029. ElseIf BonusPoints(CurrentPlayer) > 80 Then
  5030. lBonus50.State= 1
  5031. lBonus40.State= 0
  5032. lBonus30.State= 1
  5033. lBonus20.State= 0
  5034. lBonus10.State= 0
  5035. ElseIf BonusPoints(CurrentPlayer) > 70 Then
  5036. lBonus50.State= 1
  5037. lBonus40.State= 0
  5038. lBonus30.State= 0
  5039. lBonus20.State= 1
  5040. lBonus10.State= 0
  5041. ElseIf BonusPoints(CurrentPlayer) > 60 Then
  5042. lBonus50.State= 1
  5043. lBonus40.State= 0
  5044. lBonus30.State= 0
  5045. lBonus20.State= 0
  5046. lBonus10.State= 1
  5047. ElseIf BonusPoints(CurrentPlayer) > 50 Then
  5048. lBonus50.State= 1
  5049. lBonus40.State= 0
  5050. lBonus30.State= 0
  5051. lBonus20.State= 0
  5052. lBonus10.State= 0
  5053. ElseIf BonusPoints(CurrentPlayer) > 40 Then
  5054. lBonus50.State= 0
  5055. lBonus40.State= 1
  5056. lBonus30.State= 0
  5057. lBonus20.State= 0
  5058. lBonus10.State= 0
  5059. ElseIf BonusPoints(CurrentPlayer) > 30 Then
  5060. lBonus50.State= 0
  5061. lBonus40.State= 0
  5062. lBonus30.State= 1
  5063. lBonus20.State= 0
  5064. lBonus10.State= 0
  5065. ElseIf BonusPoints(CurrentPlayer) > 20 Then
  5066. lBonus50.State= 0
  5067. lBonus40.State= 0
  5068. lBonus30.State= 0
  5069. lBonus20.State= 1
  5070. lBonus10.State= 0
  5071. ElseIf BonusPoints(CurrentPlayer) > 10 Then
  5072. lBonus50.State= 0
  5073. lBonus40.State= 0
  5074. lBonus30.State= 0
  5075. lBonus20.State= 0
  5076. lBonus10.State= 1
  5077. Else
  5078. lBonus50.State= 0
  5079. lBonus40.State= 0
  5080. lBonus30.State= 0
  5081. lBonus20.State= 0
  5082. lBonus10.State= 0
  5083. End If
  5084. End Sub
  5085.  
  5086. Sub ResetBonusLights
  5087. BonusPoints(CurrentPlayer) = 0
  5088. lBonus1.State = 0
  5089. lBonus2.State = 0
  5090. lBonus3.State = 0
  5091. lBonus4.State = 0
  5092. lBonus5.State = 0
  5093. lBonus6.State = 0
  5094. lBonus7.State = 0
  5095. lBonus8.State = 0
  5096. lBonus9.State = 0
  5097. lBonus0.State= 0
  5098. lBonus10.State= 0
  5099. lBonus20.State= 0
  5100. lBonus30.State= 0
  5101. lBonus40.State= 0
  5102. lBonus50.State= 0
  5103. End Sub
  5104.  
  5105. ''*********************
  5106. '' Section; Reactor
  5107. ''*********************
  5108. ' ReactorState overview
  5109. 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
  5110. 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
  5111. 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
  5112. 'Critical 3 - targets not active, no check grid, gates 2-way
  5113. 'Destroyed 4 -
  5114. Dim ReactorState(4)
  5115. Dim ReactorLevel(4)
  5116. Dim ReactorPercent(4)
  5117. Dim ReactorDestroyCount(4)
  5118. Dim ReactorValue(4)
  5119. Dim ReactorValueMax(4)
  5120. Dim LastReactorBeforeDifficultyKicksIn
  5121.  
  5122. Const ReactorSpinnerPercent = 2
  5123. Const ReactorSwitchPercent = 16
  5124. Const ReactorValue1 = 25000
  5125. Const ReactorValue2 = 37500
  5126. Const ReactorValue3 = 50000 'Max = 150,000
  5127. Const ReactorValue4 = 62500
  5128. Const ReactorValue5 = 75000
  5129. Const ReactorValue6 = 87500
  5130. Const ReactorValue7 = 100000
  5131. Const ReactorValue8 = 112500
  5132. Const ReactorValue9 = 125000
  5133. Const ReactorMaxMultiplier = 3
  5134.  
  5135. Sub ResetReactor
  5136. debug.print "*****SUB:" & "ResetReactor [ReactorState(CurrentPlayer)=0]"
  5137. dim tmp
  5138.  
  5139. ReactorState(CurrentPlayer) = 0
  5140. SetReactorPercent -1
  5141. SetReactorDestroyCount 0
  5142. SetReactorInserts 0
  5143. RestoreRAD
  5144.  
  5145. If ReactorDifficulty = 1 Then
  5146. LastReactorBeforeDifficultyKicksIn = 6
  5147. Else
  5148. LastReactorBeforeDifficultyKicksIn = 3
  5149. End If
  5150.  
  5151. 'Value of this reactor
  5152. tmp = "ReactorValue" & ReactorLevel(CurrentPlayer) 'ReactorValue1 - 9
  5153. ReactorValue(CurrentPlayer) = eval(tmp)
  5154. ReactorValueMax(CurrentPlayer) = ReactorValue(CurrentPlayer) * ReactorMaxMultiplier
  5155. tReactorValue.text = ReactorValue(CurrentPlayer)
  5156.  
  5157. 'Light Reactor
  5158. Select Case ReactorLevel(CurrentPlayer)
  5159. Case 1:
  5160. SetLight lReactor1, "green", 2
  5161. Case 2:
  5162. SetLight lReactor1, "red", 1
  5163. SetLight lReactor2, "green", 2
  5164. Case 3:
  5165. SetLight lReactor2, "red", 1
  5166. SetLight lReactor3, "green", 2
  5167. Case 4:
  5168. SetLight lReactor3, "red", 1
  5169. SetLight lReactor4, "green", 2
  5170. Case 5:
  5171. SetLight lReactor4, "red", 1
  5172. SetLight lReactor5, "green", 2
  5173. Case 6:
  5174. SetLight lReactor5, "red", 1
  5175. SetLight lReactor6, "green", 2
  5176. Case 7
  5177. SetLight lReactor6, "red", 1
  5178. SetLight lReactor7, "green", 2
  5179. Case 8:
  5180. SetLight lReactor7, "red", 1
  5181. SetLight lReactor8, "green", 2
  5182. Case 9:
  5183. SetLight lReactor8, "red", 1
  5184. SetLight lReactor9, "green", 2
  5185. Case 10:
  5186. SetLight lReactor9, "red", 1
  5187. End Select
  5188. End Sub
  5189.  
  5190. 'Sub DisableReactor
  5191. ' If debugReactor then debug.print "*****SUB:" & "DisableReactor [ReactorState(CurrentPlayer)=0]"
  5192. ' ReactorState(CurrentPlayer) = 0
  5193. ' AddReactorPercent 0
  5194. 'End Sub
  5195.  
  5196. Sub SetReactorReady 'Called when Grid is complete
  5197. If debugReactor then debug.print "*****SUB:" & "SetReactorReady [ReactorState(CurrentPlayer)=1]"
  5198. ReactorState(CurrentPlayer) = 1
  5199. lStart.state = 2
  5200. ReadyGrid
  5201. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "REACTOR READY"), eBlinkfast, 1800, True, "tna_reactorready"
  5202. End Sub
  5203.  
  5204.  
  5205. Sub CheckReactorStart 'Checked when left scoop hit
  5206. If ReactorState(CurrentPlayer) = 1 Then
  5207. ReactorState(CurrentPlayer) = 2 'Reactor Started
  5208. lStart.state = 0
  5209. GIReactorStarted
  5210.  
  5211. StartGridJackpot
  5212. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "REACTOR START"), eBlinkfast, 1800, True, "tna_reactorunlockedmod"
  5213. SetReactorInserts 2
  5214.  
  5215. ' If MaxTargetFlag = False Then
  5216. AddReactorPercent 0
  5217.  
  5218. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
  5219. fRones.TimerInterval = ReactorPercentLossTime * 1000
  5220. fRones.TimerEnabled = True
  5221. StartReactorLeftLoopInserts
  5222. Else 'ReactorLevel(CurrentPlayer) 1 and 2 and e
  5223. StartReactorLoopInserts
  5224. End If
  5225. ' Else
  5226. ' SetReactorPercent 100
  5227. ' StartMAxTarget
  5228. ' End If
  5229.  
  5230. End If
  5231. If debugReactor then debug.print "*****SUB:" & "CheckReactorStart [ReactorState(CurrentPlayer)=" & ReactorState(CurrentPlayer) & "]"
  5232. End Sub
  5233.  
  5234. Sub fRones_Timer
  5235. AddReactorPercent - 1
  5236. End Sub
  5237.  
  5238. Sub StartReactorLoopInserts
  5239. lLoopL.state = 2
  5240. lLoopR.state = 2
  5241. lTria1.state = 2
  5242. lTria2.state = 2
  5243. lTria3.state = 2
  5244. lTria4.state = 2
  5245. lTria5.state = 2
  5246. lTria6.state = 2
  5247. End Sub
  5248. Sub ResetReactorLoopInserts
  5249. lLoopL.state = 0
  5250. lLoopR.state = 0
  5251. lTria1.state = 0
  5252. lTria2.state = 0
  5253. lTria3.state = 0
  5254. lTria4.state = 0
  5255. lTria5.state = 0
  5256. lTria6.state = 0
  5257. End Sub
  5258.  
  5259. Sub StartReactorLeftLoopInserts
  5260. If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
  5261. lLoopL.state = 2
  5262. lTria1.state = 2
  5263. lTria2.state = 2
  5264. lTria3.state = 2
  5265.  
  5266. lLoopR.state = 0
  5267. lTria4.state = 0
  5268. lTria5.state = 0
  5269. lTria6.state = 0
  5270. End If
  5271. End Sub
  5272.  
  5273. Sub StartReactorRightLoopInserts
  5274. If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
  5275. lLoopR.state = 2
  5276. lTria4.state = 2
  5277. lTria5.state = 2
  5278. lTria6.state = 2
  5279.  
  5280. lLoopL.state = 0
  5281. lTria1.state = 0
  5282. lTria2.state = 0
  5283. lTria3.state = 0
  5284. End If
  5285. End Sub
  5286.  
  5287. Sub SwitchReactorLoopInserts
  5288. If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
  5289. If lLoopL.State = 2 Then
  5290. StartReactorRightLoopInserts
  5291. ElseIf lLoopR.State = 2 Then
  5292. StartReactorLeftLoopInserts
  5293. End If
  5294. End If
  5295. End Sub
  5296.  
  5297. Sub ClearReactorPercent
  5298. fRtens.ImageA = "blank"
  5299. fRones.ImageA = "blank"
  5300. End Sub
  5301.  
  5302. Dim drtens, drones
  5303. Sub SetReactorPercent (value)
  5304. If debugReactor then debug.print "*****SUB:" & "SetReactorPercent " & value
  5305. ReactorPercent(CurrentPlayer) = value
  5306. If ReactorPercent(CurrentPlayer) > 100 Then ReactorPercent(CurrentPlayer) = 100
  5307.  
  5308. If ReactorPercent(CurrentPlayer) = -1 Then
  5309. ClearReactorPercent
  5310. ReactorPercent(CurrentPlayer) = 0
  5311. fRtens.TimerEnabled = False
  5312. fRones.TimerEnabled = False
  5313. ElseIf ((ReactorPercent(CurrentPlayer) = 0) and (ReactorState(CurrentPlayer) <> 2)) Then
  5314. ClearReactorPercent
  5315. ElseIf ReactorPercent(CurrentPlayer) < 100 Then
  5316. drtens = Int(ReactorPercent(CurrentPlayer)/10)
  5317. drones = Int(ReactorPercent(CurrentPlayer)-drtens*10)
  5318. ' dReactor1.SetValue (drtens + 1)
  5319. ' dReactor2.SetValue (drones + 1)
  5320. fRtens.ImageA = Eval(drtens)
  5321. fRones.ImageA = Eval(drones)
  5322. Else 'ReactorPercent(CurrentPlayer) = 100
  5323. dReactor1.SetValue (0)
  5324. dReactor2.SetValue (0)
  5325. fRtens.ImageA = "-"
  5326. fRones.ImageA = "---"
  5327. fRtens.TimerInterval = 250
  5328. fRtens.TimerEnabled = True
  5329.  
  5330. fRones.TimerEnabled = False
  5331. End If
  5332. CheckReactorCritical
  5333. End Sub
  5334.  
  5335. Sub AddReactorPercent (value)
  5336. Dim obj
  5337. If debugReactor then debug.print "*****SUB:" & "AddReactorPercent " & value
  5338. ReactorPercent(CurrentPlayer) = ReactorPercent(CurrentPlayer) + value
  5339. If ReactorPercent(CurrentPlayer) > 100 Then
  5340. ReactorPercent(CurrentPlayer) = 100
  5341. ElseIf ReactorPercent(CurrentPlayer) < 0 Then
  5342. ReactorPercent(CurrentPlayer) = 0
  5343. End If
  5344.  
  5345. If ReactorPercent(CurrentPlayer) < 100 Then
  5346. drtens = Int(ReactorPercent(CurrentPlayer)/10)
  5347. drones = Int(ReactorPercent(CurrentPlayer)-drtens*10)
  5348. ' dReactor1.SetValue (drtens + 1)
  5349. ' dReactor2.SetValue (drones + 1)
  5350. fRtens.ImageA = Eval(drtens)
  5351. fRones.ImageA = Eval(drones)
  5352. Else
  5353. ' dReactor1.SetValue (0)
  5354. ' dReactor2.SetValue (0)
  5355. fRtens.ImageA = "-"
  5356. fRones.ImageA = "---"
  5357. fRtens.TimerInterval = 250
  5358. fRtens.TimerEnabled = True
  5359.  
  5360. fRones.TimerEnabled = False
  5361. End If
  5362.  
  5363. 'Increase reactor inserts as percentage goes up
  5364. ' For each obj in aInsertsReactor
  5365. ' If ReactorPercent(CurrentPlayer) < 60 Then
  5366. ' obj.intensityscale = ReactorPercent(CurrentPlayer)/200
  5367. ' Else
  5368. ' obj.intensityscale = ReactorPercent(CurrentPlayer)/100
  5369. ' End If
  5370. ' Next
  5371.  
  5372. CheckReactorCritical
  5373. End Sub
  5374.  
  5375. Dim fRtenscount
  5376. Sub fRtens_Timer
  5377. fRtenscount = (fRtenscount + 1) Mod 2
  5378. If fRtenscount = 0 Then
  5379. fRtens.ImageA = "---"
  5380. fRones.ImageA = "-"
  5381. Else
  5382. fRtens.ImageA = "-"
  5383. fRones.ImageA = "---"
  5384. End If
  5385. End Sub
  5386. Sub AddReactorPercentForSpinner
  5387. AddReactorPercent ReactorSpinnerPercent
  5388. End Sub
  5389.  
  5390. Sub AddReactorPercentForSwitch
  5391. debug.print
  5392. Dim value
  5393. If ReactorLevel(CurrentPlayer) < 7 Then
  5394. value = ReactorSwitchPercent - ((ReactorLevel(CurrentPlayer) - 1)*2)
  5395. Else
  5396. value = 5
  5397. End IF
  5398. AddReactorPercent value
  5399. End Sub
  5400.  
  5401. Sub CheckReactorCritical 'Called when reactor targets percent increased
  5402. If debugReactor then debug.print "*****SUB:" & "CheckReactorCritical"
  5403. If ReactorState(CurrentPlayer) = 2 Then
  5404. If ReactorPercent(CurrentPlayer) >= 100 Then
  5405. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CRITICAL"), eBlinkfast, 1800, True, "tna_reactorcriticalvoice"
  5406. SetReactorCritical
  5407. StartReactorCriticalMusic
  5408.  
  5409. End If
  5410. End If
  5411. End Sub
  5412.  
  5413. Sub SetReactorCritical
  5414. If debugReactor then debug.print "*****SUB:" & "SetReactorCritical [ReactorState(CurrentPlayer)=3]"
  5415. SaveRAD
  5416. ReactorState(CurrentPlayer) = 3 'Reactor Critical
  5417. SetReactorDestroyCount ReactorLevel(CurrentPlayer)
  5418. SetReactorInserts 1
  5419. ResetReactorLoopInserts
  5420. 'Light Reactor
  5421.  
  5422. 'Extra ball Award
  5423. If ReactorLevel(CurrentPlayer) = ExtraBallAward1 Then
  5424. AwardExtraBall
  5425. ElseIf ReactorLevel(CurrentPlayer) = ExtraBallAward2 Then
  5426. AwardExtraBall
  5427. End If
  5428.  
  5429. Select Case ReactorLevel(CurrentPlayer)
  5430. Case 1:
  5431. SetLight lReactor1, "red", 2
  5432. Case 2:
  5433. SetLight lReactor2, "red", 2
  5434. Case 3:
  5435. SetLight lReactor3, "red", 2
  5436. Case 4:
  5437. SetLight lReactor4, "red", 2
  5438. Case 5:
  5439. SetLight lReactor5, "red", 2
  5440. Case 6:
  5441. SetLight lReactor6, "red", 2
  5442. Case 7
  5443. SetLight lReactor7, "red", 2
  5444. Case 8:
  5445. SetLight lReactor8, "red", 2
  5446. Case 9:
  5447. SetLight lReactor9, "red", 2
  5448. End Select
  5449.  
  5450. End Sub
  5451.  
  5452.  
  5453. Sub SetReactorDestroyCount (value) 'Setup the reactor critical inserts 1-9
  5454. If debugReactor then debug.print "*****SUB:" & "SetReactorDestroyCount " & value
  5455. dim tmp, tmp2
  5456. ReactorDestroyCount(CurrentPlayer) = 0
  5457.  
  5458. tmp2 = value
  5459. if tmp2 > 7 then tmp2 = 7 'There are only 7 targets so blink up to 7 inserts
  5460.  
  5461. do while ReactorDestroyCount(CurrentPlayer) < tmp2
  5462. tmp = INT(RND * 7)
  5463. If debugReactor then debug.print "Reactor Target = " & tmp
  5464.  
  5465. if ReactorLevel(CurrentPlayer) < 3 AND tmp < 3 then 'Dont light the RAD targets on first 2 reactor levels
  5466. tmp = tmp + 3
  5467. If debugReactor then debug.print "Reactor Target Changed = " & tmp
  5468. end if
  5469.  
  5470. If debugReactor then debug.print tmp &" : "& tmp2
  5471. if aDTGT(tmp).state = 0 then
  5472. 'aDTGT(tmp).state = 2
  5473. SetLight aDTGT(tmp), "white", 2
  5474.  
  5475. if (tmp < 5) Then
  5476. aDFTGT(tmp).state = 2
  5477. Else
  5478. aDFTGT(5).state = 2
  5479. End If
  5480. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) + 1
  5481. End If
  5482. loop
  5483.  
  5484. ReactorDestroyCount(CurrentPlayer) = value
  5485. If debugReactor then debug.print " " & "ReactorDestroyCount(CurrentPlayer) " & value
  5486. ''ttReactorTgt.text = "Tgts = " &ReactorDestroyCount(CurrentPlayer)
  5487. End Sub
  5488.  
  5489. Sub DecreaseReactorDestroyCount (obj, obj2)
  5490. If ReactorState(CurrentPlayer) = 3 Then
  5491. If ReactorDestroyCount(CurrentPlayer) <=7 Then
  5492.  
  5493. 'Special case since Bumper has 2 inserts. Check both
  5494. If obj.name = "lD3" Then
  5495. If lD3.state = 2 Then
  5496. lD3.state = 0
  5497. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  5498. PlaySound "tna_toptarget"
  5499. ElseIf lD4.state = 2 Then
  5500. lD4.state = 0
  5501. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  5502. PlaySound "tna_toptarget"
  5503. End If
  5504.  
  5505. 'Check if bumper should be turned off
  5506. If (ld3.state = 0) AND (ld4.state = 0) then obj2.state = 0
  5507.  
  5508. ElseIf obj.State = 2 Then
  5509. obj.State = 0
  5510. obj2.State = 0
  5511. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  5512. PlaySound "tna_toptarget"
  5513. Else 'target not lit
  5514. Playsound "tna_targetreject"
  5515. End If
  5516. Else 'Keep all inserts lit, decrease count until below 7
  5517. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  5518. PlaySound "tna_toptarget"
  5519. End If
  5520.  
  5521.  
  5522. If debugReactor then debug.print "*****SUB:" & "DecreaseReactorDestroyCount:(), ReactorDestroyCount(CurrentPlayer)=" & ReactorDestroyCount(CurrentPlayer)
  5523.  
  5524. if ReactorDestroyCount(CurrentPlayer) = 0 Then
  5525. If debugReactor then debug.print " Reactor Destroyed!!!"
  5526.  
  5527.  
  5528. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "DESTROYED!!!"), eBlinkfast, 1800, True, "tna_reactordestroyed"
  5529. AddScore ReactorValue(CurrentPlayer)
  5530. AddScoreForReactor
  5531. AddReactorBonus ReactorValue(CurrentPlayer)
  5532. AddBonusLights
  5533.  
  5534. ReactorLevel(CurrentPlayer) = ReactorLevel(CurrentPlayer) + 1
  5535.  
  5536. 'Enable BallSave
  5537. EnableBallSaver 10
  5538.  
  5539. If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
  5540. GiReactorStopped
  5541. ResetReactor
  5542. ResetGrid
  5543. StartMAxTarget
  5544. stopsound "tna_reactorcritical"
  5545. StartBackgroundMusic
  5546. 'See if GRID completed previously
  5547. 'vpmtimer.addtimer 1000, "CheckGrid '"
  5548. Else 'Game Over! Game Over! Game Over
  5549. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "GAME OVER,MAN"), eBlinkfast, 60000, True, "tna_totalannihilation"
  5550. ResetReactor
  5551. ResetGrid
  5552. stopsound "TNAreactorcritical"
  5553. ReactorLevel(CurrentPlayer) = 10
  5554. StartBackgroundMusic
  5555. StartRainbow "all"
  5556. LightSeqAttract.Play SeqRandom, 40, 1000, 0
  5557. End If
  5558.  
  5559. End if
  5560. Else
  5561. Playsound "tna_targetreject"
  5562. End If
  5563.  
  5564. 'ttReactorTgt.text = "ReacTgts = " &ReactorDestroyCount(CurrentPlayer)
  5565.  
  5566. End Sub
  5567.  
  5568. Sub SetReactorInserts (newstate)
  5569. If debugReactor then debug.print "*****SUB:" & "SetReactorInserts " & newstate
  5570.  
  5571. l5.state = newstate
  5572. l6.state = newstate
  5573. l7.state = newstate
  5574. l8.state = newstate
  5575. l9.state = newstate
  5576. l10.state = newstate
  5577. l11.state = newstate
  5578. End sub
  5579.  
  5580.  
  5581. Dim ReactorBonus
  5582. Sub AddReactorBonus (value)
  5583.  
  5584. ReactorBonus = ReactorBonus + value
  5585. debug.print ReactorBonus
  5586. End Sub
  5587.  
  5588. Sub ResetReactorBonus
  5589. ReactorBonus = 0
  5590. End Sub
  5591. '=============================================
  5592.  
  5593.  
  5594.  
  5595.  
  5596. Dim LUStep
  5597. Sub Slingshot1_Slingshot
  5598. If debugReactor then debug.print "*****SUB:Slingshot1_Slingshot"
  5599. PlaySound SoundFXDOF("fx_slingshot", 117, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
  5600. AddscoreSpecial UpperSlingshotScore
  5601.  
  5602. LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
  5603. l8.TimerEnabled = True
  5604.  
  5605. PlaySound "tna_reactorslingloud"
  5606.  
  5607. LeftUpSling4.Visible = 1:LeftUpSling1.Visible = 0
  5608. LUemk.RotX = 26
  5609. LUStep = 0
  5610. Slingshot1.TimerEnabled = True
  5611.  
  5612. If ReactorState(CurrentPlayer) = 2 Then
  5613. AddReactorPercentForSwitch
  5614. End If
  5615. SetLastSwitchHit "Slingshot1"
  5616. End Sub
  5617.  
  5618. Sub SlingShot1_Timer
  5619. Select Case LUStep
  5620. Case 1:LeftUpSLing4.Visible = 0:LeftUpSLing3.Visible = 1:LUemk.RotX = 14:
  5621. Case 2:LeftUpSLing3.Visible = 0:LeftUpSLing2.Visible = 1:LUemk.RotX = 2:
  5622. Case 3:LeftUpSLing2.Visible = 0:LeftUpSLing1.Visible = 1:LUemk.RotX = -10:SlingShot1.TimerEnabled = False
  5623. End Select
  5624. LUStep = LUStep + 1
  5625. End Sub
  5626.  
  5627.  
  5628. Dim RUStep
  5629. Sub Slingshot2_Slingshot
  5630. If debugReactor then debug.print "*****SUB:Slingshot2_Slingshot"
  5631. PlaySound SoundFXDOF("fx_slingshot", 118, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
  5632. AddscoreSpecial UpperSlingshotScore
  5633.  
  5634. LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
  5635. l8.TimerEnabled = True
  5636.  
  5637. PlaySound "tna_reactorslingloud"
  5638.  
  5639. RightUpSling4.Visible = 1:RightUpSling1.Visible = 0
  5640. RUemk.RotX = 26
  5641. RUStep = 0
  5642. Slingshot2.TimerEnabled = True
  5643.  
  5644. If ReactorState(CurrentPlayer) = 2 Then
  5645. AddReactorPercentForSwitch
  5646. End If
  5647. SetLastSwitchHit "Slingshot2"
  5648. End Sub
  5649.  
  5650. Sub SlingShot2_Timer
  5651. Select Case RUStep
  5652. Case 1:RightUpSLing4.Visible = 0:RightUpSLing3.Visible = 1:RUemk.RotX = 14:
  5653. Case 2:RightUpSLing3.Visible = 0:RightUpSLing2.Visible = 1:RUemk.RotX = 2:
  5654. Case 3:RightUpSLing2.Visible = 0:RightUpSLing1.Visible = 1:RUemk.RotX = -10:SlingShot2.TimerEnabled = False
  5655. End Select
  5656. RUStep = RUStep + 1
  5657. End Sub
  5658.  
  5659. Sub ReactorWall_Hit
  5660. If debugReactor then debug.print "*****SUB:ReactorWall_Hit"
  5661. AddscoreSpecial UpperSlingshotScore
  5662.  
  5663. LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
  5664. l8.TimerEnabled = True
  5665.  
  5666. PlaySound "tna_reactorslingloud"
  5667.  
  5668. If ReactorState(CurrentPlayer) = 2 Then
  5669. AddReactorPercentForSwitch
  5670. End If
  5671. SetLastSwitchHit "ReactorWall"
  5672. End Sub
  5673.  
  5674. L8.TimerInterval = 500
  5675. Sub l8_Timer
  5676. LightSeqReactorInserts.StopPlay
  5677. l8.TimerEnabled = False
  5678. End Sub
  5679.  
  5680. ''*********************
  5681. '' Section; Reactor Max Targets
  5682. ''*********************
  5683. Sub Target1_Hit
  5684. PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
  5685. AddScoreSpecial TargetScore
  5686.  
  5687. If ReactorState(CurrentPlayer) = 2 Then
  5688. AddReactorPercentForSwitch
  5689. End If
  5690.  
  5691. Check123MaxTarget lt1
  5692.  
  5693. SetLastSwitchHit "Target1"
  5694. End Sub
  5695.  
  5696. Sub Target2_Hit
  5697. PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
  5698. AddScoreSpecial TargetScore
  5699.  
  5700. If ReactorState(CurrentPlayer) = 2 Then
  5701. AddReactorPercentForSwitch
  5702. End If
  5703.  
  5704. Check123MaxTarget lt2
  5705.  
  5706. SetLastSwitchHit "Target2"
  5707. End Sub
  5708.  
  5709. Sub Target3_Hit
  5710. PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
  5711. AddScoreSpecial TargetScore
  5712.  
  5713. If ReactorState(CurrentPlayer) = 2 Then
  5714. AddReactorPercentForSwitch
  5715. End If
  5716.  
  5717. Check123MaxTarget lt3
  5718.  
  5719. SetLastSwitchHit "Target3"
  5720. End Sub
  5721.  
  5722. 'Dim MaxTargetFlag
  5723. Sub ResetMaxTarget
  5724. If debugReactor Then debug.print "*****SUB:ResetMaxTarget"
  5725. SetLight lt1, "red", 0
  5726. SetLight lt2, "red", 0
  5727. SetLight lt3, "red", 0
  5728. 'MaxTargetFlag = False
  5729.  
  5730. End Sub
  5731.  
  5732. Sub StartMAxTarget
  5733. If debugReactor Then debug.print "*****SUB:StartMaxTarget"
  5734. SetLight lt1, "red", 2
  5735. SetLight lt2, "red", 0
  5736. SetLight lt3, "red", 0
  5737. 'MaxTargetFlag = False
  5738. End Sub
  5739.  
  5740. Sub Check123MaxTarget (obj)
  5741. If debugReactor Then debug.print "*****SUB:Check123MaxTarget"
  5742. If Obj.state = 2 Then
  5743. obj.state = 1
  5744. playsound "tna_toptarget"
  5745. Else
  5746. playsound "tna_targetreject"
  5747. End If
  5748.  
  5749. If (lt1.State = 1 and lt2.State = 1 and lt3.State = 1) Then
  5750.  
  5751. ' If ReactorState(CurrentPlayer) = 2 Then
  5752. ' SetReactorPercent 100
  5753. ' StartMAxTarget
  5754. ' Else
  5755. ' MaxTargetFlag = True
  5756. ' End If
  5757.  
  5758. SetReactorMaxed
  5759. AddBonusLights
  5760. StartMAxTarget
  5761.  
  5762. 'to do lightseq
  5763. DMDFlush
  5764. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MAX REACTOR"), eBlinkfast, 1800, True, "tna_superskillshot"
  5765.  
  5766. FlashForMs lt1, 2000, 100, 2
  5767. FlashForMs lt2, 2000, 100, 2
  5768. FlashForMs lt3, 2000, 100, 2
  5769. lt1.TimerInterval = 2000
  5770. lt1.TimerEnabled = True
  5771. ElseIf lt2.state = 1 Then
  5772. lt3.state = 2
  5773. ElseIf lt1.state = 1 Then
  5774. lt2.state = 2
  5775. End If
  5776. End Sub
  5777. '
  5778. Sub lt1_timer
  5779. If debugReactor Then debug.print "*****SUB:lt1_timer"
  5780. lt1.TimerEnabled = False
  5781. 'do something
  5782. End Sub
  5783. ''*********************
  5784. '' Section; Gate control
  5785. ''*********************
  5786. ' REactor Targeted mode
  5787. ' Plunge - full loop. Lgate up on plunge. Lgate down after a switch
  5788. ' Right Loop - full loop. Lgate up on RLswitch. Lgate down after a switch
  5789. ' Left Loop - into toplanes.
  5790. 'Reactor Started mode
  5791. 'Both into toplanes
  5792.  
  5793. 'Multiball
  5794. 'both loops do full loop
  5795. 'Reactor Critical
  5796. ' Left Loop - full loop
  5797.  
  5798. Dim loopDirection '1 = CW, -1 = CCW
  5799. Sub swLLoop_Hit
  5800. LoopEnter 1
  5801. SetLastSwitchHit "swLLoop"
  5802. End Sub
  5803.  
  5804. Sub swRLoop_Hit
  5805. LoopEnter -1
  5806. SetLastSwitchHit "swRLoop"
  5807. End Sub
  5808.  
  5809. Dim JustPlunged
  5810. Sub LoopEnter (value)
  5811. LoopDirection = loopDirection + value
  5812.  
  5813. If JustPlunged = True Then
  5814. GateL.open = 1
  5815. GateR.open = 1
  5816. JustPlunged = False
  5817. ElseIf bMultiBallMode = True Then
  5818. GateL.open = 1
  5819. GateR.open = 1
  5820. ElseIf ReactorState(CurrentPlayer) = 2 Then'Reactor Started
  5821. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then
  5822. If lLoopR.state = 2 Then 'CCW goes to reactor
  5823. If loopDirection = -1 Then
  5824. GateL.open = 0
  5825. GateR.open = 0
  5826. Else
  5827. GateL.open = 1
  5828. GateR.open = 1
  5829. End If
  5830. Else 'lLoopL.state = 2
  5831. If loopDirection = -1 Then
  5832. GateL.open = 1
  5833. GateR.open = 1
  5834. Else
  5835. GateL.open = 0
  5836. GateR.open = 0
  5837. End If
  5838. End If
  5839. Else '< 3 both gates open
  5840. GateR.open = 0
  5841. GateL.open = 0
  5842. End If
  5843. ElseIf loopDirection = -1 Then 'ball is going CCW
  5844. GateL.open = 1
  5845. GateR.open = 0
  5846. ElseIf loopDirection = 1 Then
  5847. GateR.open = 0
  5848. ElseIf loopDirection = 0 Then
  5849. GateR.open = 0
  5850. GateL.open = 0
  5851. Else
  5852. LoopDirection = 0
  5853. GateR.open = 0
  5854. GateL.open = 0
  5855. End If
  5856. End Sub
  5857.  
  5858. Sub ResetGate
  5859. loopDirection = 0
  5860. GateL.open = 0
  5861. GateR.open = 0
  5862. End Sub
  5863.  
  5864.  
  5865.  
  5866. ''*********************
  5867. '' Section; RAD target
  5868. ''*********************
  5869. Sub TargetRAD1_HIt
  5870. PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
  5871. If debugDestroyRAD Then debug.print "*****SUB:TargetRAD1_HIt"
  5872. 'Addscore RADScore
  5873. CheckRADMysteryAward (lRad1)
  5874. DecreaseReactorDestroyCount lRad1, fRad1
  5875. SetLastSwitchHit "TargetRAD1"
  5876. End Sub
  5877.  
  5878. Sub TargetRAD2_HIt
  5879. PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
  5880. If debugDestroyRAD Then debug.print "*****SUB:TargetRAD2_HIt"
  5881. 'Addscore RADScore
  5882. CheckRADMysteryAward (lRad2)
  5883. DecreaseReactorDestroyCount lRad2, fRad2
  5884. SetLastSwitchHit "TargetRAD2"
  5885. End Sub
  5886.  
  5887. Sub TargetRAD3_HIt
  5888. PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
  5889. If debugDestroyRAD Then debug.print "*****SUB:TargetRAD3_HIt"
  5890. 'Addscore RADScore
  5891. CheckRADMysteryAward(lRad3)
  5892. DecreaseReactorDestroyCount lRad3, fRad3
  5893. SetLastSwitchHit "TargetRAD3"
  5894. End Sub
  5895.  
  5896. Sub ResetRAD
  5897. If debugDestroyRAD Then debug.print "*****SUB:ResetRAD"
  5898.  
  5899. SetLight lRAD1, "red", 0
  5900. SetLight lRAD2, "red", 0
  5901. SetLight lRAD3, "red", 0
  5902. End Sub
  5903.  
  5904. Sub StartRad
  5905. If debugDestroyRAD Then debug.print "*****SUB:StartRad"
  5906. If ReactorState(CurrentPlayer) <> 3 Then
  5907. SetLight lRAD1, "red", 0
  5908. SetLight lRAD2, "red", 0
  5909. SetLight lRAD3, "red", 2
  5910. End If
  5911. End Sub
  5912.  
  5913. Dim PausedRAD1
  5914. Dim PausedRAD2
  5915. Dim PausedRAD3
  5916. Sub SaveRAD
  5917. PausedRAD1 = lRAD1.State
  5918. PausedRAD2 = lRAD2.State
  5919. PausedRAD3 = lRAD3.State
  5920. lRAD1.State = 0
  5921. lRAD2.State = 0
  5922. lRAD3.State = 0
  5923. End Sub
  5924.  
  5925. Sub RestoreRAD
  5926. SetLight lRAD1, "red", PausedRAD1
  5927. SetLight lRAD2, "red", PausedRAD2
  5928. SetLight lRAD3, "red", PausedRAD3
  5929.  
  5930. If (lRAD3.State = 0) Then
  5931. lRAD1.State = 0
  5932. lRAD2.State = 0
  5933. lRAD3.State = 2
  5934. End If
  5935. End Sub
  5936.  
  5937. ''*********************
  5938. '' Section; Mystery Award
  5939. ''*********************
  5940. Dim MysteryState(4)
  5941.  
  5942. Sub ResetMysteryAward
  5943. If debugMysteryAward Then debug.print "*****SUB:ResetMysteryAward"
  5944. MysteryState(CurrentPlayer) = 0
  5945. lMystery.State = 0
  5946. End Sub
  5947.  
  5948. Sub DecrementMysteryAward
  5949. If debugMysteryAward Then debug.print "*****SUB:DecrementMysteryAward"
  5950. If MysteryState(CurrentPlayer) > 0 Then
  5951. MysteryState(CurrentPlayer) = MysteryState(CurrentPlayer) - 1
  5952. End If
  5953. If MysteryState(CurrentPlayer) <= 0 then
  5954. ResetMysteryAward
  5955. End If
  5956. End Sub
  5957.  
  5958. Sub SetMysteryAward
  5959. If debugMysteryAward Then debug.print "*****SUB:SetMysteryAward"
  5960. MysteryState(CurrentPlayer) = MysteryState(CurrentPlayer) + 1
  5961. lMystery.State = 2
  5962. End Sub
  5963.  
  5964. Sub InitMysteryAwardData
  5965. Dim i
  5966. For i = 1 to MaxPlayers
  5967. MysteryState(i) = 0
  5968. Next
  5969. End Sub
  5970.  
  5971. Sub SaveMysteryAwardData
  5972. 'Nothing needed as always stored in MysteryState(4)
  5973. End Sub
  5974.  
  5975. Sub RestoreMysteryAwardData
  5976. If MysteryState(CurrentPlayer) > 0 then
  5977. lMystery.State = 2
  5978. Else
  5979. lMystery.State = 0
  5980. End If
  5981.  
  5982. End Sub
  5983.  
  5984. 'CheckMysteryAward
  5985. Sub CheckRADMysteryAward (obj)
  5986. If debugMysteryAward Then debug.print "*****SUB:CheckMysteryAward"
  5987. If ReactorState(CurrentPlayer) <> 3 Then
  5988. If Obj.state = 2 Then
  5989. obj.state = 1
  5990. playsound "tna_toptarget"
  5991. Addscore RADScore
  5992. End If
  5993.  
  5994. If (lRAD1.State = 1 and lRAD2.State = 1 and lRAD3.State = 1) Then
  5995. StartRAD
  5996. AddBonusLights
  5997.  
  5998. 'to do lightseq
  5999. DMDFlush
  6000. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MYSTERY LIT"), eBlinkfast, 1800, True, "tna_superskillshot"
  6001.  
  6002. FlashForMs lRAD1, 2000, 100, 2
  6003. FlashForMs lRAD2, 2000, 100, 2
  6004. FlashForMs lRAD3, 2000, 100, 2
  6005. lRAD1.TimerInterval = 2000
  6006. lRAD1.TimerEnabled = True
  6007. ElseIf lRAD2.state = 1 Then
  6008. lRAD1.state = 2
  6009. ElseIf lRAD3.state = 1 Then
  6010. lRAD2.state = 2
  6011. End If
  6012. End If
  6013. End Sub
  6014.  
  6015. Sub lRAD1_Timer
  6016. If debugMysteryAward Then debug.print "*****SUB:lRAD1_Timer"
  6017. lRAD1.TimerEnabled = False
  6018. SetMysteryAward
  6019. End Sub
  6020.  
  6021. 'CollectMysterAward (Video: More4k 9:28)
  6022. Dim MysteryStep, MysRandom0, MysRandom1, MysRandom2, MysRandom3
  6023. Const MaxMysteryItems = 13
  6024. Function CollectMysteryAward
  6025. If debugMysteryAward Then debug.print "*****SUB:CollectMysteryAward"
  6026. If MysteryState(CurrentPlayer) > 0 Then
  6027.  
  6028. PlaySound "tna_mysteryselect"
  6029. MysteryStep = 0
  6030.  
  6031. 'Generate 4 random awards. avoid duplicates
  6032. MysRandom0 = INT(RND * MaxMysteryItems)
  6033. MysRandom1 = INT(RND * MaxMysteryItems)
  6034. MysRandom2 = INT(RND * MaxMysteryItems)
  6035. MysRandom3 = INT(RND * MaxMysteryItems)
  6036. If debugMysteryAward Then debug.print MysRandom0 & "-" & MysRandom1 & "-" & MysRandom2 & "-" & MysRandom3
  6037.  
  6038. If MysRandom1 = MysRandom0 Then MysRandom1 = (MysRandom1+1) Mod MaxMysteryItems
  6039.  
  6040. If ((MysRandom2 = MysRandom0) or (MysRandom2 = MysRandom1)) Then MysRandom2 = (MysRandom2+1) Mod MaxMysteryItems
  6041. If ((MysRandom2 = MysRandom0) or (MysRandom2 = MysRandom1)) Then MysRandom2 = (MysRandom2+1) Mod MaxMysteryItems
  6042.  
  6043. If ((MysRandom3 = MysRandom0) or (MysRandom3 = MysRandom1) or (MysRandom3 = MysRandom2)) Then MysRandom3 = (MysRandom3+1) Mod MaxMysteryItems
  6044. If ((MysRandom3 = MysRandom0) or (MysRandom3 = MysRandom1) or (MysRandom3 = MysRandom2)) Then MysRandom3 = (MysRandom3+1) Mod MaxMysteryItems
  6045.  
  6046. If debugMysteryAward Then debug.print MysRandom0 & "-" & MysRandom1 & "-" & MysRandom2 & "-" & MysRandom3
  6047.  
  6048. ListMysteryAward MysRandom0, displayTime, 0
  6049. DecrementMysteryAward
  6050. lMystery.TimerInterval = 750
  6051. lMystery.TimerEnabled = True
  6052.  
  6053. CollectMysteryAward = 1 'Return 1
  6054. End If
  6055. End Function
  6056.  
  6057. Const DisplayTime = 400
  6058. Sub lMystery_Timer
  6059. If debugMysteryAward Then debug.print "*****SUB:lMystery_Timer"
  6060.  
  6061.  
  6062. MysteryStep = MysteryStep + 1
  6063. Select Case MysteryStep
  6064. Case 1
  6065. ListMysteryAward MysRandom1, displayTime, 0
  6066. Case 2
  6067. ListMysteryAward MysRandom2, displayTime, 0
  6068. Case 3
  6069. ListMysteryAward MysRandom3, displayTime * 3, 1
  6070. Case 4
  6071. PlaySound "TNALeftScoopAwardEject"
  6072.  
  6073. lMystery.TimerEnabled = False
  6074. LeftScoop.TimerInterval = 1100
  6075. LeftScoop.TimerEnabled = True
  6076. 'LightSeqAutoLaunch.Play SeqDownOn, 10, 1, 0
  6077. End Select
  6078.  
  6079. End Sub
  6080.  
  6081. Dim DelayedBallSaver
  6082. Sub LeftScoop_Timer
  6083. If DelayedBallSaver = 1 Then
  6084. DelayedBallSaver = 0
  6085. EnableBallSaver BallSaverTime
  6086. End If
  6087. LeftScoop.TimerEnabled = False
  6088. 'eject ball
  6089. LeftScoopExit
  6090.  
  6091. End Sub
  6092.  
  6093. Sub ListMysteryAward (value, duration, giveaward)
  6094. Select Case value
  6095. Case 0,MaxMysteryItems
  6096. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+10,000")), eBlink, duration, True, ""
  6097. Case 1
  6098. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+25,000")), eBlink, duration, True, ""
  6099. Case 2
  6100. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+150,000")), eBlink, duration, True, ""
  6101. Case 3
  6102. If ReactorState(CurrentPlayer) = 0 Then
  6103. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("START REACTOR")), eBlink, duration, True, ""
  6104. 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
  6105. 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
  6106. 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
  6107. 'Critical 3 - targets not active, no check grid, gates 2-way
  6108. ElseIf giveaward = 0 Then
  6109. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("WARP TO LVL 9")), eBlink, duration, True, ""
  6110. Else
  6111. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+50,000")), eBlink, duration, True, ""
  6112. End If
  6113. Case 4
  6114. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("BALLSAVER")), eBlink, duration, True, ""
  6115. Case 5
  6116. If bLockIsLit = False Then
  6117. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("LOCKS ARE LIT")), eBlink, duration, True, ""
  6118. ElseIf giveaward = 0 Then
  6119. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("LIONMAN!!!")), eBlink, duration, True, ""
  6120. Else
  6121. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+40,000")), eBlink, duration, True, ""
  6122. End If
  6123. Case 6
  6124. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+1 LANESAVE")), eBlink, duration, True, ""
  6125. Case 7
  6126. If SuperSpinnerValue <> 2 Then
  6127. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("SUPER SPINNER")), eBlink, duration, True, ""
  6128. Else
  6129. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+30,000")), eBlink, duration, True, ""
  6130. End If
  6131. Case 8
  6132. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  6133. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+1X BONUS")), eBlink, duration, True, ""
  6134. Else
  6135. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+20,000")), eBlink, duration, True, ""
  6136. End If
  6137. Case 9
  6138. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  6139. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("4X MAX BONUS")), eBlink, duration, True, ""
  6140. Else
  6141. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+35,000")), eBlink, duration, True, ""
  6142. End If
  6143. Case 10
  6144. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("EXTRA BALL")), eBlink, duration, True, ""
  6145. Case 11
  6146. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("MAX REACTOR")), eBlink, duration, True, ""
  6147. Case 12
  6148. If ReactorState(CurrentPlayer) = 0 Then
  6149. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("KEYPAD UNLOCK")), eBlink, duration, True, ""
  6150. 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
  6151. 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
  6152. 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
  6153. 'Critical 3 - targets not active, no check grid, gates 2-way
  6154. ElseIf giveaward = 0 Then
  6155. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("GAME OVER")), eBlink, duration, True, ""
  6156. Else
  6157. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+50,000")), eBlink, duration, True, ""
  6158. End If
  6159. End Select
  6160.  
  6161. If giveaward = 1 Then
  6162. Select Case value
  6163. Case 0,MaxMysteryItems
  6164. AddScore 10000
  6165. Case 1
  6166. AddScore 25000
  6167. Case 2
  6168. AddScore 150000
  6169. Case 3
  6170. If ReactorState(CurrentPlayer) = 0 Then
  6171. ByPassGrid
  6172. CheckReactorStart
  6173. Else
  6174. AddScore 50000
  6175. End If
  6176. Case 4
  6177. DelayedBallSaver = 1
  6178. Case 5
  6179. If bLockIsLit = False Then
  6180. DropTargetResetLockIsLit 0
  6181. Else
  6182. AddScore 40000
  6183. End If
  6184. Case 6
  6185. AwardSAVE 1
  6186. Case 7
  6187. If SuperSpinnerValue <> 2 Then
  6188. SetSuperSpinner
  6189. Else
  6190. AddScore 30000
  6191. End If
  6192. Case 8
  6193. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  6194. AddBonusMultiplier 1
  6195. Else
  6196. AddScore 20000
  6197. End If
  6198. Case 9
  6199. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  6200. SetBonusMultiplier(MaxMultiplier)
  6201. Else
  6202. AddScore 35000
  6203. End If
  6204. Case 10
  6205. AwardExtraBallNoCallout
  6206. Case 11
  6207. SetReactorMaxed
  6208. Case 12
  6209. If ReactorState(CurrentPlayer) = 0 Then
  6210. ByPassGrid
  6211. Else
  6212. AddScore 50000
  6213. End If
  6214. End Select
  6215. End If
  6216.  
  6217. End Sub
  6218.  
  6219.  
  6220. ''*********************
  6221. '' Section; DESTROY target
  6222. ''*********************
  6223. Sub TargetD1_Hit
  6224. PlaySound SoundFXDOF("", 110, DOFPulse, DOFTargets)
  6225. If debugDestroyRAD Then debug.print "*****SUB:TargetD1_Hit"
  6226. Addscore DESTROYScore
  6227. DecreaseReactorDestroyCount lD1, fD1
  6228. SetLastSwitchHit "TargetD1"
  6229. End Sub
  6230.  
  6231. Sub TargetD2_Hit
  6232. PlaySound SoundFXDOF("", 111, DOFPulse, DOFTargets)
  6233. If debugDestroyRAD Then debug.print "*****SUB:TargetD2_Hit"
  6234. Addscore DESTROYScore
  6235. DecreaseReactorDestroyCount lD2, fD2
  6236. SetLastSwitchHit "TargetD2"
  6237.  
  6238. End Sub
  6239.  
  6240. Sub ResetDESTROY
  6241. If debugDestroyRAD Then debug.print "*****SUB:ResetDESTROY"
  6242. lD1.State = 0
  6243. lD2.State = 0
  6244. lD3.State = 0
  6245. lD4.State = 0
  6246. End Sub
  6247.  
  6248. '********
  6249. ' Section; Bumper
  6250. '********
  6251. Sub Bumper1_Hit
  6252. If debugDestroyRAD Then debug.print "*****SUB:Bumper1_Hit"
  6253. If Tilted Then Exit Sub
  6254. PlaySound SoundFXDOF("fx_bumper", 107, DOFPulse, DOFContactors), 0, 1, pan(ActiveBall)
  6255. PlaySound "tna_bumperloud"
  6256. DOF 119, DOFPulse
  6257. ' FlashForMs lBumperFlash, 500, 50, 0:FlashForMs lBumperFlash1, 500, 50, 0
  6258. AddScore BumperScore
  6259. DecreaseReactorDestroyCount lD3, lBumperflash
  6260. LightSeqBumper.StopPlay
  6261. LightSeqBumper.UpdateInterval = 1
  6262. LightSeqBumper.Play SeqCircleOutOn, 5, 1
  6263.  
  6264. SwitchReactorLoopInserts
  6265.  
  6266. SetLastSwitchHit "Bumper1"
  6267. End Sub
  6268.  
  6269.  
  6270.  
  6271. ''*********************
  6272. '' Section; Debug routines
  6273. ''*********************
  6274. 'BlockerWall for debug testing
  6275. Dim BLState
  6276. BLW1.IsDropped=1:BLP1.Visible=0:BLR1.Visible=0: BLW2.IsDropped=1:BLP2.Visible=0:BLR2.Visible=0: BLW3.IsDropped=1:BLP3.Visible=0:BLR3.Visible=0
  6277. Sub BlockerWalls
  6278.  
  6279. BLState = (BLState + 1) Mod 4
  6280. debug.print "BlockerWalls"
  6281. Playsound "fx_next"
  6282. Select Case BLState:
  6283. Case 0
  6284. BLW1.IsDropped=1:BLP1.Visible=0:BLR1.Visible=0: BLW2.IsDropped=1:BLP2.Visible=0:BLR2.Visible=0: BLW3.IsDropped=1:BLP3.Visible=0:BLR3.Visible=0
  6285. Case 1:
  6286. BLW1.IsDropped=0:BLP1.Visible=1:BLR1.Visible=1: BLW2.IsDropped=0:BLP2.Visible=1:BLR2.Visible=1: BLW3.IsDropped=0:BLP3.Visible=1:BLR3.Visible=1
  6287. Case 2:
  6288. BLW1.IsDropped=0:BLP1.Visible=1:BLR1.Visible=1: BLW2.IsDropped=0:BLP2.Visible=1:BLR2.Visible=1: BLW3.IsDropped=1:BLP3.Visible=0:BLR3.Visible=0
  6289. Case 3:
  6290. BLW1.IsDropped=1:BLP1.Visible=0:BLR1.Visible=0: BLW2.IsDropped=1:BLP2.Visible=0:BLR2.Visible=0: BLW3.IsDropped=0:BLP3.Visible=1:BLR3.Visible=1
  6291. End Select
  6292. End Sub
  6293.  
  6294. '************TODO
  6295. 'fix multi player
  6296. 'ball x multiplier during multiball
  6297.  
  6298. ' do a sound check of all objects
  6299.  
  6300.  
  6301. ' loop combo
  6302. ' lock is lit add target and scoop hit before lit
  6303.  
  6304.  
  6305. 'ReactorStarted is carried over after drain
  6306. 'ReactorCritical is carried over after drain
  6307.  
  6308. 'Hands free skill shot awards 3 ball saves and Reactor Ready.
  6309. '5 second delay when Reactor Starting (scoop shot)
  6310.  
  6311. 'multiball lane - all targets up at multiball start. need to knock down all 3 and hit scoop to Light Lock
  6312.  
  6313. 'Reactor Value
  6314. 'Reactor 1 20,000
  6315.  
  6316. '
  6317. 'ReactorPercent(CurrentPlayer) 16, 17, 17, 16, 17, 17 (16,33,50,66,83,100)
  6318. 'BR=16 then 17, T = 34, L = 17
  6319. 'maybe goes 16 then 17 then
  6320.  
  6321. 'Everything 2X during multiball
  6322. 'Handsfree skillshot for 3 ball saves
  6323. '??? stars and standups increase reactor
  6324. 'add reactor jackpot if grid comleted again
  6325.  
  6326.  
  6327. ' 500 points for CORE lanes, slings, stars reactor
  6328. ' bonus increase for completing CORE
  6329. ' 50,000 for getting skillshot using flipper
  6330. ' ???? for hands free skillshot
  6331.  
  6332. 'Extra Ball earned at 3rd reactor and 6th
  6333.  
  6334. ' 20,000 for multiball lock
  6335. ' 1st reactor core 25,000
  6336. 'Common for all players
  6337. ' Multiball targets carry over unchanged
  6338.  
  6339. 'TRACK for EACH PLAYER
  6340. ' Grid is player specific
  6341. ' Reactor complete
  6342. ' Reactor percent
  6343. 'Reactor level
  6344.  
  6345. 'Reset on new
  6346. ' CORE is player specific
  6347. '
  6348. 'Black playfield
  6349. 'RGB inserts from Orbital
  6350. 'Glowball
  6351. 'Shadows
  6352. 'Match not implemented
  6353.  
  6354. 'SKIP 'reactor core should increase in intensity
  6355. 'DONE 'grid lights diff color when blinking (blue)
  6356. 'YELLOW ' should bonus inserts be white?
  6357. 'DONE mball inserts green. red during multiball/jackpot
  6358. 'DONE reactor inserts blue
  6359. 'DONE reactor light turn red blinking when critical
  6360. 'DONE loop lights turn off when reactor gets critical
  6361. 'DONEloop lights and triangle rotate
  6362. 'DONE super spiner insert blue
  6363. 'core switch gi blink also during skill shot
  6364. 'drain on scoop eject will do a ballsave
  6365. 'gi by rad, destroy bumper blink during criticalreactor
  6366.  
  6367.  
  6368. Sub SetBallsOnPlayfield (value)
  6369. If value < 0 Then
  6370. value = 0
  6371. End If
  6372.  
  6373. BallsOnPlayfield = value
  6374. Select Case BallsOnPlayfield
  6375. Case 1: 'Not multiball so resume based current X multiplier
  6376. Select Case BonusMultiplier(CurrentPlayer):
  6377. Case 1:
  6378. SetLight l2x, "white", 0
  6379. SetLight l3x, "white", 0
  6380. SetLight l4x, "white", 0
  6381.  
  6382. Case 2:
  6383. SetLight l2x, "white", 1
  6384. SetLight l3x, "white", 0
  6385. SetLight l4x, "white", 0
  6386.  
  6387. Case 3:
  6388. SetLight l2x, "white", 1
  6389. SetLight l3x, "white", 1
  6390. SetLight l4x, "white", 0
  6391.  
  6392. Case 4:
  6393. SetLight l2x, "white", 1
  6394. SetLight l3x, "white", 1
  6395. SetLight l4x, "white", 1
  6396.  
  6397. Case Else:
  6398. SetLight l2x, "white", 1
  6399. SetLight l3x, "white", 1
  6400. SetLight l4x, "white", 1
  6401. End Select
  6402.  
  6403.  
  6404. Case 2:
  6405. SetLight l2x, "red", 2
  6406. SetLight l3x, "red", 0
  6407. SetLight l4x, "red", 0
  6408. Case 3:
  6409. SetLight l2x, "red", 0
  6410. SetLight l3x, "red", 2
  6411. SetLight l4x, "red", 0
  6412. Case 4:
  6413. SetLight l2x, "red", 0
  6414. SetLight l3x, "red", 0
  6415. SetLight l4x, "red", 2
  6416. End Select
  6417.  
  6418. End Sub
  6419.  
  6420. Sub AddBallsOnPlayfield (value)
  6421. Dim tmp
  6422. tmp = BallsOnPlayfield + value
  6423.  
  6424. SetBallsOnPlayfield tmp
  6425. End Sub
  6426.  
  6427.  
  6428. 'Section; Save Player Data
  6429. '1. Create player array
  6430. '2. Create Save routine
  6431. '3. Create Restore routine
  6432. '4. Add to Master Save routine
  6433. '5. Add to Master Restore routine
  6434.  
  6435. Sub InitializePlayerData
  6436. InitLaneSaveData
  6437. InitMysteryAwardData
  6438. InitGridPlayerData
  6439. InitReactorData
  6440. InitiReactorDestroyData
  6441. End Sub
  6442.  
  6443. Sub SavePlayerData
  6444. SaveLaneSaveData
  6445. SaveMysteryAwardData
  6446. SaveGridData
  6447. 'SaveReactorData - already saved
  6448. SaveReactorDestroyData
  6449. End Sub
  6450.  
  6451. Sub RestorePlayerData
  6452. RestoreLaneSaveData
  6453. RestoreMysteryAwardData
  6454. RestoreGridData
  6455. RestoreReactorData
  6456. RestoreReactorDestroyData
  6457.  
  6458. End Sub
  6459.  
  6460.  
  6461. Sub InitReactorData
  6462. Dim i
  6463. For i = 1 To MaxPlayers
  6464. ReactorState(i) = 0
  6465. ReactorLevel(i) = 1
  6466. ReactorPercent(i) = -1
  6467. ReactorDestroyCount(i) = 0
  6468. ReactorValue(i) = ReactorValue1
  6469. ReactorValueMax(i) = ReactorValue1 * ReactorMaxMultiplier
  6470. ResetReactorLoopInserts
  6471. Next
  6472. End Sub
  6473.  
  6474. Sub SaveReactorData
  6475. Line 5071: Dim ReactorState(4)
  6476. Line 5072: Dim ReactorLevel(4)
  6477. Line 5073: Dim ReactorPercent(4)
  6478. Line 5074: Dim ReactorDestroyCount(4)
  6479. Line 5075: Dim ReactorValue(4)
  6480. Line 5076: Dim ReactorValueMax(4)
  6481.  
  6482. End Sub
  6483.  
  6484. Sub RestoreReactorData
  6485. Dim tmpcolor
  6486. Dim i
  6487.  
  6488. 'Set all inserts off, light destroyed reactor green, then current reactor blinking red or green
  6489. If ReactorState(CurrentPlayer) = 3 Then 'Critical
  6490. tmpcolor = "red"
  6491. Else
  6492. tmpcolor = "green"
  6493. End If
  6494. For i = 0 to 8
  6495. SetLight aReactorLevelInserts(i), "red", 0
  6496. Next
  6497. For i = 0 to (ReactorLevel(CurrentPlayer) - 2)
  6498. If i >=0 Then SetLight aReactorLevelInserts(i), "red", 1
  6499. Next
  6500. i = ReactorLevel(CurrentPlayer) - 1
  6501. If i >=0 Then
  6502. SetLight aReactorLevelInserts(i), tmpcolor, 2
  6503. End If
  6504.  
  6505. 'Set table to default state
  6506. ResetReactorLoopInserts
  6507. lStart.State = 0
  6508. SetReactorInserts 0
  6509. SetReactorPercent ReactorPercent(CurrentPlayer)
  6510. fRones.TimerEnabled = False
  6511. GIReactorStoppedImmediate
  6512. stopsound "tna_reactorcritical"
  6513.  
  6514. 'Set up active items
  6515. Select Case ReactorState(CurrentPlayer)
  6516. Case 0: 'Targeted
  6517.  
  6518. Case 1: 'Ready
  6519. SetReactorReady
  6520.  
  6521. Case 2: 'Started
  6522. SetReactorInserts 2
  6523. GIReactorStarted
  6524.  
  6525. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
  6526. fRones.TimerInterval = ReactorPercentLossTime * 1000
  6527. fRones.TimerEnabled = True
  6528. StartReactorRightLoopInserts
  6529. Else 'ReactorLevel(CurrentPlayer) 1 and 2 and 3
  6530. StartReactorLoopInserts
  6531. End If
  6532.  
  6533. Case 3: 'Critical
  6534. SetReactorInserts 1
  6535. ChangeGiImmediate("red")
  6536. StartReactorCriticalMusic
  6537.  
  6538. 'Need to restore Destroy targets count and inserts
  6539.  
  6540. End Select
  6541. End Sub
  6542.  
  6543.  
  6544. Dim PlayeraDTGT1(4)
  6545. Dim PlayeraDTGT2(4)
  6546. Dim PlayeraDTGT3(4)
  6547. Dim PlayeraDTGT4(4)
  6548. Dim PlayeraDTGT5(4)
  6549. Dim PlayeraDTGT6(4)
  6550. Dim PlayeraDTGT7(4)
  6551.  
  6552. Sub InitiReactorDestroyData
  6553. Dim i
  6554. For i = 1 To MaxPlayers
  6555. PlayeraDTGT1(i) = 0
  6556. PlayeraDTGT2(i) = 0
  6557. PlayeraDTGT3(i) = 0
  6558. PlayeraDTGT4(i) = 0
  6559. PlayeraDTGT5(i) = 0
  6560. PlayeraDTGT6(i) = 0
  6561. PlayeraDTGT7(i) = 0
  6562. Next
  6563. End Sub
  6564.  
  6565. Sub SaveReactorDestroyData
  6566. If ReactorState(CurrentPlayer) = 3 Then
  6567. PlayeraDTGT1(CurrentPlayer) = lRAD1.State
  6568. PlayeraDTGT2(CurrentPlayer) = lRAD2.State
  6569. PlayeraDTGT3(CurrentPlayer) = lRAD3.State
  6570. PlayeraDTGT4(CurrentPlayer) = lD1.State
  6571. PlayeraDTGT5(CurrentPlayer) = lD2.State
  6572. PlayeraDTGT6(CurrentPlayer) = lD3.State
  6573. PlayeraDTGT7(CurrentPlayer) = lD4.State
  6574. Else
  6575. PlayeraDTGT1(CurrentPlayer) = 0
  6576. PlayeraDTGT2(CurrentPlayer) = 0
  6577. PlayeraDTGT3(CurrentPlayer) = 0
  6578. PlayeraDTGT4(CurrentPlayer) = 0
  6579. PlayeraDTGT5(CurrentPlayer) = 0
  6580. PlayeraDTGT6(CurrentPlayer) = 0
  6581. PlayeraDTGT7(CurrentPlayer) = 0
  6582. End If
  6583. End Sub
  6584.  
  6585. Sub RestoreReactorDestroyData
  6586.  
  6587. ' SetLight lRAD1, "white", PlayeraDTGT1(CurrentPlayer)
  6588. ' SetLight lRAD2, "white", PlayeraDTGT2(CurrentPlayer)
  6589. ' SetLight lRAD3, "white", PlayeraDTGT3(CurrentPlayer)
  6590. ' SetLight lD1, "white", PlayeraDTGT4(CurrentPlayer)
  6591. ' SetLight lD2, "white", PlayeraDTGT5(CurrentPlayer)
  6592. ' SetLight lD3, "white", PlayeraDTGT6(CurrentPlayer)
  6593. ' SetLight lD4, "white", PlayeraDTGT7(CurrentPlayer)
  6594.  
  6595. SetLight aDTGT(0), "white", PlayeraDTGT1(CurrentPlayer)
  6596. SetLight aDTGT(1), "white", PlayeraDTGT2(CurrentPlayer)
  6597. SetLight aDTGT(2), "white", PlayeraDTGT3(CurrentPlayer)
  6598. SetLight aDTGT(3), "white", PlayeraDTGT4(CurrentPlayer)
  6599. SetLight aDTGT(4), "white", PlayeraDTGT5(CurrentPlayer)
  6600. SetLight aDTGT(5), "white", PlayeraDTGT6(CurrentPlayer)
  6601. SetLight aDTGT(6), "white", PlayeraDTGT7(CurrentPlayer)
  6602.  
  6603.  
  6604. SetLight aDFTGT(0), "white", PlayeraDTGT1(CurrentPlayer)
  6605. SetLight aDFTGT(1), "white", PlayeraDTGT2(CurrentPlayer)
  6606. SetLight aDFTGT(2), "white", PlayeraDTGT3(CurrentPlayer)
  6607. SetLight aDFTGT(3), "white", PlayeraDTGT4(CurrentPlayer)
  6608. SetLight aDFTGT(4), "white", PlayeraDTGT5(CurrentPlayer)
  6609. SetLight aDFTGT(5), "white", PlayeraDTGT6(CurrentPlayer)
  6610. SetLight aDFTGT(5), "white", PlayeraDTGT7(CurrentPlayer) 'bumper shared with dtgt6 and 7
  6611.  
  6612. End Sub
Advertisement
Add Comment
Please, Sign In to add comment