Advertisement
Guest User

Untitled

a guest
Mar 6th, 2020
1,154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 278.69 KB | None | 0 0
  1. ' ****************************************************************
  2. ' Total Nuclear Annihilation v1.4
  3. ' ****************************************************************
  4. Option Explicit
  5. Randomize
  6.  
  7. Const Disable_TNA_Message = 1 'CHANGE THIS TO 1 TO DISABLE THE TNA START UP MESSAGE
  8. ' This release comes with the free song from the TNA soundtrack available here: http://www.scottdanesi.com/?page_id=19
  9. ' For the full music experience, you will need to BUY the TNA Album and convert the songs from FLAC format to mp3 format
  10. ' with a tool like this: https://www.freac.org/ Rename all mp3 files to TNA1.mp3 through TNA10.mp3
  11. ' and replace the existing mp3 files. (Scarlet.mp3 is not used)
  12.  
  13.  
  14. Const UseUltraDMD = 0 '0 = Off. 1 = Enable UltraDMD. 2 - Try 2 if enabling UltraDMD crashes (Windows locale setting issue for non-English setting)
  15. Const UseApronDMD = 0 '0 = Off. 1 = Enable DMD on Apron
  16. Const UsePinup = 1 '0 = Off. 1 = Enable PinUp
  17.  
  18. Const BallsPerGame = 3 'Default: 3 balls
  19. Const ReactorDifficulty = 1 'Default: 2 (1-Easy, 2-Med, 3-Hard)
  20. Const ReactorLevelMax = 9 'Default: 9 (1-9 Reactors)
  21. Const SongVolume = 0.7
  22. Const bFreePlay = False 'True = FreePlay. False = Coins
  23. Const GIcolor = "blue" 'Colors: "white", "blue"
  24.  
  25. Const BallSaverTime = 12 'Default: 12 seconds
  26. Const DropTargetResetTime = 5 'Default: 5 seconds during Multiball Jackpot
  27. Const ReactorPercentLossTime= 3 'Default: After Reactor 3, Reactor Percent drops back down by 1 every 3 seconds
  28. Const ExtraBallAward1 = 3 'Default: Extra Ball at Reactor 3 Critical stage
  29. Const ExtraBallAward2 = 6 'Default: Extra Ball at Reactor 6 Critical stage
  30. Const KeepLaneSaves = 1 'Default: 1 (Yes. 0=No)
  31. Const AutoPlungeDelay = 1.0 'Default: 1.0 seconds
  32. Const LeftScoopStrength = 50 'Default: 50 adjust stregth of left scoop KickOut
  33. Const RightScoopStrength = 45 'Default: 45 adjust stregth of right scoop KickOut
  34. Const BallSearchTime = 20 'Missing Ball search kicks in after xx seconds (Default: 20), if flippers not used and no switch hits
  35.  
  36. Const AddRightSpinner = 1 ' 0 = Original table has 1 spinner. 1 = If you like more cowbell, I mean more spinner
  37. Const ChooseBall = 2 ' *** Ball Settings **********
  38. ' *** 0 = Normal Ball
  39. ' *** 1 = White GlowBall
  40. ' *** 2 = Magma GlowBall
  41. ' *** 3 = Blue GlowBall
  42. ' *** 4 = HDR Ball
  43. ' *** 5 = Earth Ball
  44. ' *** 6 = Green Glowball
  45. ' *** 7 = Light blue Glowball
  46. ' *** 8 = Red Glowball
  47. ' *** 9 = Shiny Ball
  48. Const FlipperPhysicsMode = 1 '1 = VPX Flippers, 2 = NFozzy flipper tweaks
  49. Const Reactor1Music = 1 '1 = Always play TNA song first then random songs. 2 = Random song from the beginning
  50. Const ResetHighScore = 0 '0 = Keep Scores. 1 = Reset all high scores. START TABLE ONCE to reset high scores and then set this back to 0
  51. Const UltraDMDUpdateTime = 5000 'UltraDMD update time (msec). Increase value if you encounter stutter with UltraDMD on
  52.  
  53. '============================
  54. ' DOF Events for this table are listed at the bottom of this script
  55. '============================
  56.  
  57.  
  58. ' ****************************************************************
  59. Const Testmode = 1 'Testing only
  60. Const debugGeneral = 0 'For debug only
  61. Const debugReactor = 0 'For debug only
  62. Const debugMultiball = 0 'For debug only
  63. Const debugGrid = 0 'For debug only
  64. Const debugDestroyRAD = 0 'For debug only
  65. Const debugMysteryAward = 0 'For debug only
  66. Const debugHighScore = 0 'For debug only
  67.  
  68.  
  69. ' Improved directional sounds 2019 October : ' !! NOTE : Table not verified yet !!
  70. ' Volume devided by - lower gets higher sound
  71.  
  72. Const VolDiv = 2000 ' Lower number, louder ballrolling/collition sound
  73. Const VolCol = 10 ' Ball collition divider ( voldiv/volcol )
  74.  
  75. ' The rest of the values are multipliers
  76. '
  77. ' .5 = lower volume
  78. ' 1.5 = higher volume
  79. Const VolBump = 2 ' Bumpers volume.
  80. Const VolRol = 1 ' Rollovers volume.
  81. Const VolGates = 1 ' Gates volume.
  82. Const VolMetal = 1 ' Metals volume.
  83. Const VolRB = 1 ' Rubber bands volume.
  84. Const VolRH = 1 ' Rubber hits volume.
  85. Const VolPo = 1 ' Rubber posts volume.
  86. Const VolPi = 1 ' Rubber pins volume.
  87. Const VolPlast = 1 ' Plastics volume.
  88. Const VolTarg = 1 ' Targets volume.
  89. Const VolWood = 1 ' Woods volume.
  90. Const VolKick = 1 ' Kicker volume.
  91. Const VolSpin = 1.5 ' Spinners volume.
  92. Const VolFlip = 1 ' Flipper volume.
  93.  
  94. '============================
  95. ' PinUp Player USER Config
  96. '============================
  97. Const PuPDMDDriverType = 2 ' 2=FULLDMD (large/High LCD)
  98. Const useRealDMDScale = 0
  99. Const useDMDVideos = true ' true or false to use DMD splash videos.
  100. Const pGameName = "tna" 'pupvideos foldername, probably set to cGameName in realworld
  101.  
  102.  
  103.  
  104. On Error Resume Next
  105. ExecuteGlobal GetTextFile("controller.vbs")
  106. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  107. On Error Goto 0
  108.  
  109. Dim UltraDMD
  110. Sub LoadUltraDMD
  111. Set UltraDMD = CreateObject("UltraDMD.DMDObject")
  112. UltraDMD.Init
  113. uDMDScoreTimer.Interval = UltraDMDUpdateTime
  114. uDMDScoreTimer.Enabled = 1
  115. uDMDScoreUpdate
  116. End Sub
  117.  
  118. Sub uDMDScoreTimer_Timer
  119. uDMDScoreUpdate
  120. End Sub
  121.  
  122. Sub uDMDScoreUpdate
  123. If UseUltraDMD = 1 Then
  124. If TestMode = 0 Then
  125. UltraDMD.DisplayScoreboard00 PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "Reactor Val:" & ReactorValue(CurrentPlayer), "Ball " & Balls
  126. Else
  127. UltraDMD.DisplayScoreboard00 PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "RV:" & ReactorValue(CurrentPlayer) & ":BP:" & BallsOnPlayfield, "Ball " & Balls
  128. End If
  129. ElseIf UseUltraDMD = 2 Then
  130. If TestMode = 0 Then
  131. UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "Reactor Val:" & ReactorValue(CurrentPlayer), "Ball " & Balls
  132. Else
  133. UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "RV:" & ReactorValue(CurrentPlayer) & ":BP:" & BallsOnPlayfield, "Ball " & Balls
  134. End If
  135. End If
  136.  
  137. End Sub
  138.  
  139.  
  140. Const cGameName = "tna"
  141. Const BallSize = 50 ' 50 is the normal size
  142.  
  143. ' Load the core.vbs for supporting Subs and functions
  144. LoadCoreVBS
  145.  
  146. Sub LoadCoreVBS
  147. On Error Resume Next
  148. ExecuteGlobal GetTextFile("core.vbs")
  149. If Err Then MsgBox "Can't open core.vbs"
  150. On Error Goto 0
  151. End Sub
  152.  
  153. Sub startB2S(aB2S)
  154. If B2SOn Then
  155. Controller.B2SSetData 1, 0
  156. Controller.B2SSetData 2, 0
  157. Controller.B2SSetData 3, 0
  158. Controller.B2SSetData 4, 0
  159. Controller.B2SSetData 5, 0
  160. Controller.B2SSetData 6, 0
  161. Controller.B2SSetData 7, 0
  162. Controller.B2SSetData 8, 0
  163. Controller.B2SSetData aB2S, 1
  164. End If
  165. End Sub
  166.  
  167. ' Define any Constants
  168. Const TableName = "TNA"
  169. Const myVersion = "1.0.0"
  170. Const MaxPlayers = 4
  171. Const MaxMultiplier = 4 'limit to 4x in this game
  172. Const MaxMultiballs = 4 ' max number of balls during multiballs
  173.  
  174. ' Define Global Variables
  175. Dim PlayersPlayingGame
  176. Dim CurrentPlayer
  177. Dim Credits
  178. Dim BonusPoints(4)
  179. Dim BonusHeldPoints(4)
  180. Dim BonusMultiplier(4)
  181. Dim bBonusHeld
  182. Dim BallsRemaining(4)
  183. Dim ExtraBallsAwards(4)
  184. Dim Score(4)
  185. Dim ReactorScore(4)
  186. Dim HighScore(4)
  187. Dim HighScoreName(4)
  188. Dim Tilt
  189. Dim TiltSensitivity
  190. Dim Tilted
  191. Dim TotalGamesPlayed
  192. Dim mBalls2Eject
  193. Dim SkillshotValue
  194. Dim HandsFreeSkillshotInsert
  195. Dim bAutoPlunger
  196. Dim bInstantInfo
  197. Const Quotemode = 0
  198.  
  199. ' Define Game Control Variables
  200. Dim LastSwitchHit
  201. Dim BallsOnPlayfield
  202. Dim BallsInLock
  203. Dim BallsInHole
  204.  
  205. ' Define Game Flags
  206. Dim bGameInPlay
  207. Dim bOnTheFirstBall
  208. Dim bBallInPlungerLane
  209. Dim bBallSaverActive
  210. Dim bBallSaverReady
  211. Dim bMultiBallMode
  212. Dim DrainBonusReady
  213. Dim bMusicOn
  214. Dim GIcolorOpposite
  215.  
  216. 'Skillshot
  217. Dim SkillshotReady '0 = Off, 1 = Start, 2 = Plunged
  218. Dim bSkillshotSelect 'used to select the skillshot you want
  219.  
  220. Dim bExtraBallWonThisBall
  221. Dim bJustStarted
  222.  
  223. Dim plungerIM 'used mostly as an autofire plunger
  224. 'Dim ttable, cbleft, cbright
  225.  
  226. ' *********************************************************************
  227. ' Visual Pinball Defined Script Events
  228. ' *********************************************************************
  229. Sub Table1_Init()
  230. Dim i
  231.  
  232. Randomize
  233. If UsePinup = 1 Then
  234. PUPInit
  235.  
  236. End If
  237.  
  238. LoadEM
  239.  
  240. If ResetHighScore = 1 then Reseths
  241.  
  242. Spinner2Enable
  243.  
  244. If Disable_TNA_Message = 1 Then
  245. flasher001.visible = False
  246. Else
  247. flasher001.visible = True: flasher001.TimerInterval = 15000: flasher001.TimerEnabled = True
  248. End If
  249. If TestMode = 1 Then flasher001.visible = True: flasher001.TimerInterval = 500: flasher001.TimerEnabled = False: flasher001.TimerEnabled = True
  250.  
  251. 'Impulse Plunger as autoplunger
  252. Const IMPowerSetting = 43 ' Plunger Power
  253. Const IMTime = 1.1 ' Time in seconds for Full Plunge
  254. Set plungerIM = New cvpmImpulseP
  255. With plungerIM
  256. .InitImpulseP swplunger, IMPowerSetting, IMTime
  257. .Random 1.5
  258. .InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_solenoid", DOFContactors)
  259. .CreateEvents "plungerIM"
  260. End With
  261.  
  262. If GIcolor = "blue" Then
  263. GIColorOpposite = "white"
  264. Else
  265. GIColorOpposite = "blue"
  266. End If
  267.  
  268. 'load saved values, highscore, names, jackpot
  269. Loadhs
  270. If ((bFreePlay = True) Or (Credits > 0)) Then DOF 140, DOFOn
  271.  
  272. 'Init main variables
  273.  
  274. ' start the UltraDMD
  275. If UseUltraDMD > 0 Then LoadUltraDMD
  276.  
  277. ' initalise the DMD display
  278. DMD_Init
  279.  
  280.  
  281. ' initialse any other flags
  282. CoopMode = 0
  283. bOnTheFirstBall = False
  284. bBallInPlungerLane = False
  285. bBallSaverActive = False
  286. bBallSaverReady = False
  287. bMultiBallMode = False
  288. bGameInPlay = False
  289. bAutoPlunger = False
  290. bMusicOn = True
  291. SetBallsOnPlayfield 0
  292. BallsInLock = 0
  293. BallsInHole = 0
  294. LastSwitchHit = ""
  295. Tilt = 0
  296. TiltSensitivity = 1
  297. Tilted = False
  298. bBonusHeld = False
  299. bJustStarted = True
  300. bInstantInfo = False
  301.  
  302.  
  303. 'EndOfGame()
  304. StartRainbow "all"
  305. PlaySong "tna10.mp3", 2
  306. ShowTableInfo
  307. 'LightSeqAttract.Play SeqRandom, 40, 1000, 0
  308. StartAttractMode 1
  309.  
  310. ' Misc. VP table objects Initialisation, droptargets, animations...
  311. VPObjects_Init
  312.  
  313. ' Remove the cabinet rails if in FS mode
  314. If Table1.ShowDT = False then
  315. lrail.Visible = False
  316. rrail.Visible = False
  317.  
  318. End If
  319.  
  320. 'Glowball
  321. ChangeBall(ChooseBall)
  322.  
  323. If GlowBall Then GraphicsTimer.enabled = True End If
  324.  
  325. End Sub
  326. Sub flasher001_Timer: Flasher001.visible = False: Flasher001.TimerEnabled = False: End Sub
  327.  
  328. Dim ComboLoopFlag
  329.  
  330. Sub SetLastSwitchHit (value)
  331. Dim comboscore
  332.  
  333. 'check for combo first
  334. If (StrComp(value, "swRLoop") = 0) Then
  335. If ComboLoopFlag > 0 Then 'check if value is right loop switch
  336.  
  337. comboscore = 5000 * (2 ^ ComboLoopFlag)
  338. If comboscore > 160000 then comboscore = 160000
  339.  
  340. AddScore (comboscore)
  341. 'MSGBOX "COMBO " & ComboLoopFlag & "!"
  342. DOF 160, DOFPulse: DMD "", eNone, Centerline(1, ("COMBO")), eNone, "", eNone, CenterLine(3, FormatScore(comboscore)), eBlinkFast, 800, True, "tna_combo"
  343. UDMD " COMBO ", comboscore, 800
  344. GiGameImmediate 6, "orange"
  345. PuPEvent 9
  346. end if
  347.  
  348. elseif (StrComp(value, "swLLoop") = 0) AND (StrComp(LastSwitchHit, "swRLoop") = 0) then 'Loop detected
  349. ComboLoopFlag = ComboLoopFlag + 1
  350. else
  351. ComboLoopFlag = 0
  352. End If
  353.  
  354. LastSwitchHit = value
  355.  
  356. 'Reset Ball Search Timer
  357. If (bGameInPlay AND NOT Tilted AND BallsOnPlayfield > 0) Then
  358. BallSearchTimer.Enabled = False
  359. BallSearchTimer.Interval = BallSearchTime * 1000
  360. BallSearchTimer.Enabled = True
  361. End If
  362. End Sub
  363.  
  364. Sub BallSearchTimer_Timer 'only triggered if no switches hit for x seconds
  365.  
  366. If (bGameInPlay AND NOT Tilted AND BallsOnPlayfield > 0) Then
  367. If ((LeftFlipper.CurrentAngle > 90 ) AND (RightFlipper.CurrentAngle < -90)) Then 'If flippers are not up holding a ball
  368. If bBallInPlungerLane = 0 Then 'If ball not resting in plungerlane
  369.  
  370. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SEARCH"), eNone, 2000, True, "tna_leftscoopawardeject"
  371. UDMD "BALL SEARCH", "Ejecting ball", 2000
  372. vpmtimer.addtimer 1100, "BallSearchEject '"
  373. End If
  374. End If
  375. End If
  376. End Sub
  377.  
  378. Sub BallSearchEject
  379. LeftScoop.Createball
  380. LeftScoop.Kick 165, LeftScoopStrength, 1.56
  381. LeftScoop.Enabled = True
  382. End Sub
  383.  
  384. '******
  385. ' Section; Keys
  386. '******
  387. Dim CoopMode
  388. Dim kickertest
  389. kickertest = 8
  390. Sub Table1_KeyDown(ByVal Keycode)
  391. If Keycode = ((AddCreditKey) AND (bFreePlay = 0))Then
  392. Credits = Credits + 1
  393. DOF 140, DOFOn
  394. If(Tilted = False)Then
  395. If hsbModeActive = False Then
  396. DMDFlush
  397. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CREDITS: " & Credits), eNone, 500, True, "fx_coin"
  398. UDMD "CREDITS: " & Credits, "", 500
  399. If NOT bGameInPlay Then ShowTableInfo
  400. End If
  401. End If
  402. End If
  403.  
  404. ' If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
  405. If keycode = PlungerKey Then
  406. Plunger.Pullback
  407. PlaySound "fx_plungerpull"
  408.  
  409. End If
  410. ' End If
  411. ' ************ DEBUG KEYS Sect *******
  412. ' ************ DEBUG KEYS Sect *******
  413. If Keycode = 3 Then
  414. BlockerWalls
  415. End If
  416. If TestMode = 1 Then
  417. If keycode = 17 Then 'W key
  418. ByPassGrid
  419. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR READY: GridTargets set"
  420. End If
  421. If keycode = 18 Then 'E key
  422. CheckReactorStart
  423. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR STARTED: CheckReactorStart"
  424. End If
  425. If keycode = 19 Then 'R key
  426. SetReactorPercent 100
  427. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR CRITICAL: SetReactorPercent 100"
  428. End If
  429. If keycode = 20 Then 'T key
  430. DecreaseReactorDestroyCount lD3, lBumperFlash
  431. DecreaseReactorDestroyCount lD3, lBumperFlash
  432. DecreaseReactorDestroyCount lRad1, fRad1
  433. DecreaseReactorDestroyCount lRad2, fRad2
  434. DecreaseReactorDestroyCount lRad3, fRad3
  435. DecreaseReactorDestroyCount lD1, fD1
  436. DecreaseReactorDestroyCount lD2, fD2
  437. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR DESTROYED: DecreaseReactorDestroyCount"
  438. End If
  439. If keycode = 21 Then kickerdebug.enabled = true 'Y key: Loop shots: Press 3 to put up blocking walls. Press and hold to catch ball. Release to shoot ball
  440. If keycode = 22 Then kickerdebug.enabled = true 'U key: LeftScoop shot: Press 3 to put up blocking walls. Press and hold to catch ball. Release to shoot ball
  441. If keycode = 23 Then kickerdebug.enabled = true 'I key: Grid targets: Press 3 to put up blocking walls. Press and hold to catch ball. Release to shoot ball
  442. If keycode = 25 Then kickerdebug.enabled = true 'P key: Lock shot: Press 3 to put up blocking walls. Press and hold to catch ball. Release to shoot ball
  443. If keycode = 30 Then 'A key
  444. RotateLaneLightsRight
  445. Sw1_hit
  446. End If
  447. If keycode = 31 Then 'S key
  448. TargetRAD3_Hit
  449. TargetRAD2_Hit
  450. TargetRAD1_Hit
  451. End If
  452.  
  453. If keycode = 33 Then 'F key
  454. AddBonusMultiplier 1
  455. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:AddBonusMultiplier 1"
  456. End If
  457.  
  458. If keycode = 34 Then 'G key
  459. AwardSave 1
  460. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:AwardSave 1"
  461. End If
  462. If keycode = 35 Then 'H key
  463. TestHitTarget
  464. debug.print "*****SUB:" & "Table1_KeyDown, Testmode:TestHitTarget"
  465. End If
  466. End If
  467. ' ************ DEBUG KEYS Sect *******
  468. ' ************ DEBUG KEYS Sect *******
  469.  
  470. If hsbModeActive Then
  471. EnterHighScoreKey(keycode)
  472. Exit Sub
  473. End If
  474.  
  475. ' Table specific
  476.  
  477. ' Normal flipper action
  478.  
  479. If bGameInPlay AND NOT Tilted Then
  480.  
  481. If keycode = LeftTiltKey Then Nudge 90, 6:Playsound SoundFX("fx_nudge",0), 0, 1, -0.1, 0.25:CheckTilt
  482. If keycode = RightTiltKey Then Nudge 270, 6:Playsound SoundFX("fx_nudge",0), 0, 1, 0.1, 0.25:CheckTilt
  483. If keycode = CenterTiltKey Then Nudge 0, 7:Playsound SoundFX("fx_nudge",0), 0, 1, 1, 0.25:CheckTilt
  484. If keycode = MechanicalTilt Then Playsound SoundFX("fx_nudge",0),0,1,1,0,25:CheckTilt
  485.  
  486. If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
  487. If keycode = LeftFlipperKey Then SolLFlipper 1:InstantInfoTimer.Enabled = False
  488. If keycode = RightFlipperKey Then SolRFlipper 1:InstantInfoTimer.Enabled = False
  489. End If
  490.  
  491. If keycode = StartGameKey Then
  492. If((PlayersPlayingGame < MaxPlayers)AND(bOnTheFirstBall = True))Then
  493.  
  494. If(bFreePlay = True)Then
  495. PlayersPlayingGame = PlayersPlayingGame + 1
  496. If B2SOn Then Controller.B2SSetScorePlayer PlayersPlayingGame, 0
  497. TotalGamesPlayed = TotalGamesPlayed + 1
  498. PlaySound "tna_superskillshot"
  499. DMD "", eNone, "_", eNone, CenterLine(2, PlayersPlayingGame & " PLAYERS"), eBlink, "", eNone, 500, True, ""
  500. UDMD PlayersPlayingGame & " PLAYERS", "", 500
  501. Else
  502. If(Credits > 0)then
  503. PlayersPlayingGame = PlayersPlayingGame + 1
  504. If B2SOn Then Controller.B2SSetScorePlayer PlayersPlayingGame, 0
  505. TotalGamesPlayed = TotalGamesPlayed + 1
  506. Credits = Credits - 1
  507. If Credits = 0 Then DOF 140, DOFOff
  508. PlaySound "tna_superskillshot"
  509. DMD "", eNone, "_", eNone, CenterLine(2, PlayersPlayingGame & " PLAYERS"), eBlink, "", eNone, 500, True, ""
  510. UDMD PlayersPlayingGame & " PLAYERS", "", 500
  511. Else
  512. ' Not Enough Credits to start a game.
  513. DOF 140, DOFOff
  514. DMDFlush
  515. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eNone, "", eNone, 500, True, "tna_electricity1"
  516. UDMD "INSERT COIN", "", 500
  517. End If
  518. End If
  519. End If
  520. End If
  521. Else ' If (GameInPlay) Game not started yet
  522.  
  523. If keycode = StartGameKey Then
  524. If(bFreePlay = True)Then
  525. If(BallsOnPlayfield = 0)Then
  526. ResetForNewGame()
  527. End If
  528. Else
  529. If(Credits > 0)Then
  530. If(BallsOnPlayfield = 0)Then
  531. Credits = Credits - 1
  532. If Credits = 0 Then DOF 140, DOFOff
  533. ResetForNewGame()
  534. End If
  535. Else
  536. ' Not Enough Credits to start a game.
  537. DOF 140, DOFOff
  538. DMDFlush
  539. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eBlink, "", eNone, 500, True, ""
  540. UDMD "INSERT COIN", "", 500:PuPEvent 3
  541. PlaySound "tna_electricity1", 0, 1, -0.05, 0.05
  542. ShowTableInfo
  543. End If
  544. End If
  545. End If
  546. If keycode = LeftMagnaSave or keycode = RightMagnaSave Then
  547. If CoopMode = 0 Then
  548. CoopMode = 1
  549. DMDFlush
  550. DMD "", eNone, CenterLine(1, "CO-OP MODE"), eNone, CenterLine(2, "ALL VS MACHINE"), eBlink, "", eNone, 10000, True, "tna_superskillshot"
  551. UDMD "CO-OP MODE", "ALL VS MACHINE", 10000
  552. Elseif CoopMode = 1 Then
  553. CoopMode = 2
  554. DMDFlush
  555. DMD "", eNone, CenterLine(1, "CO-OP MODE"), eNone, CenterLine(2, "P1 P3 VS P2 P4"), eBlink, "", eNone, 10000, True, "tna_superskillshot"
  556. UDMD "CO-OP MODE", "P1 P3 VS P2 P4", 10000
  557. Else
  558. CoopMode = 0
  559. DMDFlush
  560. DMD "", eNone, CenterLine(1, "NORMAL MODE"), eNone, CenterLine(2, "NO CO-OP"), eBlink, "", eNone, 10000, True, "tna_target"
  561. UDMD "NORMAL MODE", "NO CO-OP", 10000
  562. End If
  563. End If
  564.  
  565. End If ' If (GameInPlay)
  566. End Sub
  567.  
  568.  
  569. Sub Table1_KeyUp(ByVal keycode)
  570.  
  571. If keycode = PlungerKey Then
  572. Plunger.Fire
  573. PlaySoundAtVol "fx_plunger", Plunger, 1
  574. End If
  575.  
  576. 'Testkeys
  577. If keycode = 21 Then 'Y key
  578. kickerdebug.enabled = false
  579. If kickertest = -18 then
  580. kickertest = 19
  581. Else
  582. kickertest = -18
  583. End If
  584. kickerdebug.kick kickertest, 40
  585. End If
  586. If keycode = 22 Then 'U key
  587. kickerdebug.enabled = false
  588. kickertest = -8
  589. kickerdebug.kick kickertest, 40
  590. End If
  591. If keycode = 23 Then 'I key
  592. kickerdebug.enabled = false
  593. If kickertest = -2 then
  594. kickertest = 0
  595. ElseIf kickertest = 0 then
  596. kickertest = 4
  597. Else
  598. kickertest = -2
  599. End If
  600. kickerdebug.kick kickertest, 40
  601. End If
  602. If keycode = 25 Then 'P key
  603. kickerdebug.enabled = false
  604. kickertest = 10
  605. kickerdebug.kick kickertest, 40
  606. End If
  607.  
  608. If hsbModeActive Then
  609. Exit Sub
  610. End If
  611.  
  612. ' Table specific
  613.  
  614. If (bGameInPLay AND NOT Tilted AND (ReactorTNAAchieved(CurrentPlayer) = 0)) Then
  615. If keycode = LeftFlipperKey Then
  616. SolLFlipper 0
  617. InstantInfoTimer.Enabled = False
  618. If bInstantInfo Then
  619. bInstantInfo = False
  620. DMDScoreNow
  621. End If
  622. End If
  623. If keycode = RightFlipperKey Then
  624. SolRFlipper 0
  625. InstantInfoTimer.Enabled = False
  626. If bInstantInfo Then
  627. bInstantInfo = False
  628. DMDScoreNow
  629. End If
  630.  
  631. End If
  632. End If
  633.  
  634. End Sub
  635.  
  636. Sub InstantInfoTimer_Timer
  637. InstantInfoTimer.Enabled = False
  638. bInstantInfo = True
  639. Jackpot = 1000000 + Round(Score(CurrentPlayer) / 10, 0)
  640. DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "JACKPOT"), eScrollLeft, CenterLine(3, FormatScore(Jackpot)), eScrollLeft, 800, False, ""
  641. DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "SUPERJACKPOT"), eScrollLeft, CenterLine(3, FormatScore(SuperJackpot)), eScrollLeft, 800, False, ""
  642. DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "BONUS MULTIPLIER"), eScrollLeft, CenterLine(3, BonusMultiplier(CurrentPlayer)), eScrollLeft, 800, False, ""
  643. End Sub
  644.  
  645. Sub EndFlipperStatus
  646. If bInstantInfo Then
  647. bInstantInfo = False
  648. DMDScoreNow
  649. End If
  650. End Sub
  651.  
  652. '*************
  653. ' Section; Pause Table
  654. '*************
  655.  
  656. Sub table1_Paused
  657. End Sub
  658.  
  659. Sub table1_unPaused
  660. End Sub
  661.  
  662. Sub table1_Exit
  663. Savehs
  664. If B2SOn Then Controller.Stop
  665. End Sub
  666.  
  667. '********************
  668. ' Section; Flippers
  669. '********************
  670.  
  671. Sub SolLFlipper(Enabled)
  672. If Enabled Then
  673. PlaySoundAtVol SoundFXDOF("fxz_flipperupL", 101, DOFOn, DOFFlippers), LeftFlipper, 1
  674. PlaySoundAtVol SoundFXDOF("fxz_flipperupL", 101, DOFOn, DOFFlippers), LeftFlipper2, 1
  675. If FlipperPhysicsMode = 1 Then
  676. LeftFlipper.RotateToEnd
  677. Else
  678. LF.Fire 'LeftFlipper.RotateToEnd
  679. End If
  680. LeftFlipper2.RotateToEnd
  681. RotateLaneLightsLeft
  682. Else
  683. PlaySoundAtVol SoundFXDOF("fxz_flipperdownL", 101, DOFOff, DOFFlippers), LeftFlipper, 1
  684. PlaySoundAtVol SoundFXDOF("fxz_flipperdownL", 101, DOFOff, DOFFlippers), LeftFlipper2, 1
  685. LeftFlipper.RotateToStart
  686. LeftFlipper2.RotateToStart
  687. End If
  688. End Sub
  689.  
  690. Sub SolLFlipper2(Enabled)
  691. If Enabled Then
  692. LeftFlipper.RotateToEnd
  693. Else
  694. LeftFlipper.RotateToStart
  695. End If
  696. End Sub
  697.  
  698. Sub SolRFlipper(Enabled)
  699. If Enabled Then
  700. PlaySoundAtVol SoundFXDOF("fxz_flipperupr", 102, DOFOn, DOFFlippers), RightFlipper, 1
  701. If FlipperPhysicsMode = 1 Then
  702. RightFlipper.RotateToEnd
  703. Else
  704. RF.Fire 'RightFlipper.RotateToEnd
  705. End If
  706. RotateLaneLightsRight
  707. Else
  708. PlaySoundAtVol SoundFXDOF("fxz_flipperdownr", 102, DOFOff, DOFFlippers), RightFlipper, 1
  709. RightFlipper.RotateToStart
  710. End If
  711. End Sub
  712.  
  713. ' flippers hit Sound
  714.  
  715. Sub LeftFlipper_Collide(parm)
  716. PlaySoundAtBallVol "flip_hit_1", parm / 10
  717. End Sub
  718.  
  719. Sub RightFlipper_Collide(parm)
  720. PlaySoundAtBallVol "flip_hit_1", parm / 10
  721. End Sub
  722.  
  723. Sub LeftFlipper2_Collide(parm)
  724. PlaySoundAtBallVol "flip_hit_1", parm / 10
  725. End Sub
  726.  
  727. Sub RightFlipper2_Collide(parm)
  728. PlaySoundAtBallVol "flip_hit_1", parm / 10
  729. End Sub
  730.  
  731.  
  732. '*****************************
  733. ' Section; CORE Targets - Bonus Multiplier
  734. '*****************************
  735. Sub ResetCORE()
  736. L1.State = 0
  737. L2.State = 0
  738. L3.State = 0
  739. L4.State = 0
  740. End Sub
  741.  
  742. Sub CheckCORE
  743. If (L1.State = 1 and L2.State = 1 and L3.State = 1 and L4.State = 1) Then
  744. ResetCORE
  745.  
  746. ' 'to do lightseq
  747. ' FlashForMs l1, 2000, 100, 0
  748. ' FlashForMs l2, 2000, 100, 0
  749. ' FlashForMs l3, 2000, 100, 0
  750. ' FlashForMs l4, 2000, 100, 0
  751. '
  752. AddBonusMultiplier 1
  753. End If
  754. End Sub
  755.  
  756. Sub RotateLaneLightsLeft()
  757. Dim tmp
  758. tmp = l1.State
  759. l1.state = l2.State
  760. l2.State = l3.State
  761. l3.State = l4.State
  762. l4.State = tmp
  763.  
  764. tmp = la1.State
  765. la1.state = la2.State
  766. la2.State = la3.State
  767. la3.State = la4.State
  768. la4.State = tmp
  769.  
  770. If bSkillshotSelect Then
  771. SelectSkillshot(1)
  772. Else
  773. HandsFreeSkillshotInsert = -1
  774. End If
  775. End Sub
  776.  
  777. Sub RotateLaneLightsRight()
  778. Dim tmp
  779. tmp = la4.State
  780. la4.state = la3.State
  781. la3.State = la2.State
  782. la2.State = la1.State
  783. la1.State = tmp
  784.  
  785. tmp = l4.State
  786. l4.state = l3.State
  787. l3.State = l2.State
  788. l2.State = l1.State
  789. l1.State = tmp
  790.  
  791. If bSkillshotSelect Then
  792. SelectSkillshot(2)
  793. Else
  794. HandsFreeSkillshotInsert = -1
  795. End If
  796. End Sub
  797.  
  798. '*********
  799. ' Section; TILT
  800. '*********
  801.  
  802. 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
  803.  
  804. Sub CheckTilt 'Called when table is nudged
  805. Tilt = Tilt + TiltSensitivity 'Add to tilt count
  806. TiltDecreaseTimer.Enabled = True
  807. If(Tilt > TiltSensitivity)AND(Tilt < 15)Then 'show a warning
  808. DOF 161, DOFPulse: DMD "", eNone, "_", eNone, CenterLine(2, "DANGER!"), eBlinkFast, "", eNone, 500, True, "tna_tilt"
  809. UDMD " DANGER! ", "", 500
  810. PUPEVENT 105
  811. End if
  812. If Tilt > 15 Then 'If more that 15 then TILT the table
  813. Tilted = True
  814. 'display Tilt
  815. ' DMDFlush
  816. DOF 162, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "TILT!"), eBlinkFast, 500, False, "tna_tilt"
  817. UDMD " TILT! ", "", 500
  818. PuPEvent 106
  819. DisableTable True
  820. TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
  821. End If
  822. End Sub
  823.  
  824. Sub TiltDecreaseTimer_Timer
  825. ' DecreaseTilt
  826. If Tilt > 0 Then
  827. Tilt = Tilt - 0.1
  828. Else
  829. TiltDecreaseTimer.Enabled = False
  830. End If
  831. End Sub
  832.  
  833. Sub DisableTable(Enabled)
  834. If Enabled Then
  835. 'turn off GI and turn off all the lights
  836. GiOff
  837. 'LightSeqTilt.Play SeqAllOff
  838. 'Disable slings, bumpers etc
  839. LeftFlipper.RotateToStart
  840. RightFlipper.RotateToStart
  841.  
  842. LeftSlingshot.Disabled = 1
  843. RightSlingshot.Disabled = 1
  844. Else
  845. 'turn back on GI and the lights
  846. 'GiOn
  847. ' 'LightSeqTilt.StopPlay
  848. LeftSlingshot.Disabled = 0
  849. RightSlingshot.Disabled = 0
  850. 'clean up the buffer display
  851. DMDFlush
  852. End If
  853. End Sub
  854.  
  855. Sub TiltRecoveryTimer_Timer()
  856. ' if all the balls have been drained then..
  857. If(BallsOnPlayfield = 0)Then
  858. ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
  859. EndOfBall()
  860. TiltRecoveryTimer.Enabled = False
  861. End If
  862. ' else retry (checks again in another second or so)
  863. End Sub
  864.  
  865. '********************
  866. ' Section; Music
  867. '********************
  868.  
  869. Dim Song
  870. Song = ""
  871. Dim m_main
  872.  
  873. Sub StartBackgroundMusic 'Reactor 1 always plays TNA1.mp3
  874. Dim tmp
  875.  
  876. If Reactor1Music = 1 Then
  877. tmp = ((ReactorLevel(CurrentPlayer) + RandomSongStart) Mod 8) + 2
  878. If debugGeneral Then debug.print "StartBackgroundMusic, ReactorState(CurrentPlayer)=" & ReactorState(CurrentPlayer)
  879. If ReactorState(CurrentPlayer) <> 3 Then 'Critical
  880. If ReactorLevel(CurrentPlayer) = 1 Then 'If player is on reactor 1, then always play first song
  881. m_main = "TNA" & ReactorLevel(CurrentPlayer) & ".mp3"
  882. Else
  883. m_main = "TNA" & tmp & ".mp3"
  884. End If
  885. debug.print m_main
  886. PlaySong m_main, 2
  887. End If
  888. Else
  889. StartBackgroundMusicAlt
  890. End If
  891. End Sub
  892.  
  893. Sub StartBackgroundMusicAlt 'ramdom songs even for TNA Reactor 1 also
  894. Dim tmp: tmp = ((ReactorLevel(CurrentPlayer) + RandomSongStart) Mod 9) + 1
  895. If ReactorState(CurrentPlayer) <> 3 Then m_main = "TNA" & tmp & ".mp3"
  896. PlaySong m_main, 2
  897. End Sub
  898.  
  899.  
  900. 'Sub ResumeBackgroundMusic
  901. ' Dim tmp
  902. '
  903. ' tmp = ((ReactorLevel(CurrentPlayer) + RandomSongStart) Mod 8) + 2
  904. ' If debugGeneral Then debug.print "StartBackgroundMusic, ReactorState(CurrentPlayer)=" & ReactorState(CurrentPlayer)
  905. ' If ReactorState(CurrentPlayer) <> 3 Then 'Critical
  906. ' If ReactorLevel(CurrentPlayer) = 1 Then 'If player is on reactor 1, then always play first song
  907. ' m_main = "TNA" & ReactorLevel(CurrentPlayer) & ".mp3"
  908. ' Else
  909. ' m_main = "TNA" & tmp & ".mp3"
  910. ' End If
  911. ' debug.print m_main
  912. ' PlaySong m_main, 100
  913. ' End If
  914. 'End Sub
  915.  
  916.  
  917. Sub StopBackgroundMusic
  918. If debugGeneral Then debug.print "StopBackgroundMusic"
  919. EndMusic
  920. Song = ""
  921. End Sub
  922.  
  923. Dim ReactorCriticalMusicOn
  924. Sub StartReactorCriticalMusic
  925. If debugGeneral Then debug.print "StartReactorCriticalMusic"
  926. DOF 178, DOFOn
  927. If MultiballMusicOn = True and bMultiBallMode = True Then
  928. 'do nothing
  929. ElseIf ReactorCriticalMusicOn = False Then
  930. StopBackgroundMusic
  931. StopMultiballMusic
  932. playsound "tna_reactorcritical", -1:PuPEvent 20
  933. ReactorCriticalMusicOn = True
  934. End If
  935. End Sub
  936.  
  937. Dim MultiballMusicOn
  938. Sub StartMultiballMusic
  939. If debugGeneral Then debug.print "StartMultiballMusic"
  940. If MultiballMusicOn = False Then
  941. StopBackgroundMusic
  942. StopReactorCriticalMusic
  943. playsound "tna_multiballcallout"
  944. playsound "tna_multiballmusic", -1
  945. MultiballMusicOn = True
  946. End If
  947. End Sub
  948.  
  949. Sub StopReactorCriticalMusic
  950. If debugGeneral Then debug.print "StopReactorCriticalMusic"
  951. DOF 178, DOFOff
  952. stopsound "tna_reactorcritical"
  953. ReactorCriticalMusicOn = False
  954. End Sub
  955.  
  956. Sub StopMultiballMusic
  957. If debugGeneral Then debug.print "StopMultiballMusic"
  958. stopsound "tna_multiballmusic"
  959. MultiballMusicOn = False
  960. End Sub
  961.  
  962. Sub PlaySong(name, ttype)
  963. If debugGeneral Then debug.print "PlaySong " & name & " " & Song
  964. If bMusicOn Then
  965. If ((Song <> name) Or (ttype = 100)) Then
  966. StopSound Song
  967. StopBackgroundMusic
  968. Song = name
  969. If ttype = 1 Then
  970. If Song = "m_end" Then
  971. PlaySound Song, 0, 0.1 'this last number is the volume, from 0 to 1
  972. Else
  973. PlaySound Song, -1, 1 'this last number is the volume, from 0 to 1
  974. End If
  975. Else
  976. PlayMusic Song, SongVolume
  977. End If
  978. End If
  979. End If
  980. End Sub
  981.  
  982. '**********************
  983. ' Section; GI effects
  984. ' independent routine
  985. ' it turns on the gi
  986. ' when there is a ball
  987. ' in play
  988. '**********************
  989. Const DOFuyellow= 144
  990. Const DOFuwhite = 145
  991. Const DOFublue = 146
  992. Const DOFured = 147
  993. Const DOFugreen = 148
  994. Const DOFupurple= 149
  995. Dim UndercabColor : UndercabColor = DOFublue
  996.  
  997. Dim OldGiState, CurrCol
  998. Dim PrevCol, NextCol, NextPerm
  999. OldGiState = -1 'start witht the Gi off
  1000.  
  1001. Sub ChangeGi(col, perm) 'changes the gi color, perm specifies if permanent base gi change (1) or temp change(0)
  1002. If debugGeneral Then debug.print "*****SUB:ChangeGi " & col
  1003.  
  1004. NextCol = col
  1005. NextPerm = perm
  1006. ChangeGiTimer.Interval = 500
  1007. ChangeGITimer.Enabled = True
  1008.  
  1009. GIOff
  1010. End Sub
  1011.  
  1012. Sub ChangeGiTimer_Timer
  1013. If debugGeneral Then debug.print "*****SUB:ChangeGiTimer_Timer " & NextCol
  1014. ChangeGITimer.Enabled = False
  1015.  
  1016. ChangeGiImmediate NextCol, NextPerm
  1017. GiOn
  1018. End Sub
  1019.  
  1020. Sub ChangeGiImmediate (col, perm) 'Perm=1 then save
  1021. If debugGeneral Then debug.print "*****SUB:ChangeGiImmediate " & col
  1022. If col = "white" Then col = "whitegi"
  1023.  
  1024. If (perm = 1) Then
  1025. CurrCol = col
  1026. End If
  1027.  
  1028. Dim bulb
  1029. For each bulb in aGILights
  1030. SetLight bulb, col, -1
  1031. Next
  1032.  
  1033.  
  1034. DOF UndercabColor, DOFOff
  1035. If col = "white" Then
  1036. UndercabColor = DOFuwhite
  1037. ElseIf col = "whitegi" Then
  1038. UndercabColor = DOFuwhite
  1039. ElseIf col = "blue" Then
  1040. UndercabColor = DOFublue
  1041. ElseIf col = "red" Then
  1042. UndercabColor = DOFured
  1043. ElseIf col = "green" Then
  1044. UndercabColor = DOFugreen
  1045. ElseIf col = "purple" Then
  1046. UndercabColor = DOFupurple
  1047. ElseIf col = "yellow" Then
  1048. UndercabColor = DOFuyellow
  1049. End If
  1050. DOF UndercabColor, DOFOn
  1051.  
  1052. End Sub
  1053.  
  1054.  
  1055. 'Sub ChangeGiTemp (col)
  1056. ' PrevCol = CurrCol
  1057. ' ChangeGiImmediate col
  1058. 'End Sub
  1059.  
  1060. Sub PreviousGI
  1061. ChangeGiImmediate CurrCol, 1
  1062. End Sub
  1063.  
  1064. Sub GiOn
  1065. 'If debugGeneral Then debug.print "*****SUB:GiOn"
  1066. DOF UndercabColor, DOFOn
  1067. Dim bulb
  1068. For each bulb in aGiLights
  1069. bulb.State = 1
  1070. Next
  1071. End Sub
  1072.  
  1073. Sub GiOff
  1074. 'If debugGeneral Then debug.print "*****SUB:GiOff"
  1075. DOF UndercabColor, DOFOff
  1076. Dim bulb
  1077. For each bulb in aGiLights
  1078. bulb.State = 0
  1079. Next
  1080. End Sub
  1081.  
  1082.  
  1083.  
  1084. Sub GIReactor (col)
  1085. Dim Bulb
  1086. For each bulb in aGIReactorLights
  1087. SetLight bulb, col, -1
  1088. Next
  1089. End Sub
  1090.  
  1091. Sub GIReactorStarted
  1092. gi9.TimerInterval = 30
  1093. gi9.TimerEnabled = True
  1094. End Sub
  1095.  
  1096. Sub GIReactorStopped
  1097. gi9.TimerEnabled = False
  1098. gi10.TimerInterval = 2000
  1099. gi10.TimerEnabled = True
  1100.  
  1101. 'Temp GI change and ramdom lights
  1102. ChangeGIImmediate GIcolorOpposite, 0
  1103. LightSeqGame.Play SeqRandom, 40, , 0
  1104. End Sub
  1105.  
  1106. Sub GIReactorStoppedImmediate
  1107. gi9.TimerEnabled = False
  1108. ChangeGIImmediate GIcolor, 1
  1109. End Sub
  1110.  
  1111.  
  1112. Sub Gi10_Timer
  1113. gi10.TimerEnabled = False
  1114. LightSeqGame.StopPlay
  1115. If bMultiBallMode = False Then
  1116. ChangeGI GIcolor, 1
  1117. Else
  1118. ChangeGi "green", 1
  1119. End If
  1120. End Sub
  1121.  
  1122. Dim GISpinNum
  1123. GISpinNum=0
  1124. Sub GI9_Timer
  1125.  
  1126. If ReactorState(CurrentPlayer) = 2 Then 'Reactor Started 'Circle animation
  1127. SetLight aGiReactorLights((GISpinNum)mod 16), GIcolor, -1
  1128. SetLight aGiReactorLights((GISpinNum+1)mod 16), GIcolor, -1
  1129. SetLight aGiReactorLights((GISpinNum+2)mod 16), GIcolor, -1
  1130. SetLight aGiReactorLights((GISpinNum+3)mod 16), GIcolor, -1
  1131. SetLight aGiReactorLights((GISpinNum+4)mod 16), "red", -1
  1132. SetLight aGiReactorLights((GISpinNum+5)mod 16), "red", -1
  1133. SetLight aGiReactorLights((GISpinNum+6)mod 16), "red", -1
  1134. SetLight aGiReactorLights((GISpinNum+7)mod 16), "red", -1
  1135. SetLight aGiReactorLights((GISpinNum+8)mod 16), "red", -1
  1136. SetLight aGiReactorLights((GISpinNum+9)mod 16), "red", -1
  1137. SetLight aGiReactorLights((GISpinNum+10)mod 16), "red", -1
  1138. SetLight aGiReactorLights((GISpinNum+11)mod 16), "red", -1
  1139. SetLight aGiReactorLights((GISpinNum+12)mod 16), "red", -1
  1140. SetLight aGiReactorLights((GISpinNum+13)mod 16), "red", -1
  1141. SetLight aGiReactorLights((GISpinNum+14)mod 16), "red", -1
  1142. SetLight aGiReactorLights((GISpinNum+15)mod 16), "red", -1
  1143.  
  1144. ElseIf ReactorState(CurrentPlayer) = 3 Then 'Reactor Critical 'blinking Red GI
  1145.  
  1146. ' GiReactorCritical
  1147. ' ChangeGiImmediate "red", 1
  1148. ' GIGameImmediate 5, "red"
  1149. ' GiON
  1150.  
  1151. Gi9.TimerEnabled = False 'stop reactor spin timer
  1152. End If
  1153. GISpinNum = (GISpinNum+1) Mod 16
  1154.  
  1155. End Sub
  1156.  
  1157. Sub GiReactorOn
  1158. If debugGeneral Then debug.print "*****SUB:GiReactorOn"
  1159. Dim bulb
  1160. For each bulb in aGIReactorLights
  1161. bulb.State = 1
  1162. Next
  1163. End Sub
  1164.  
  1165. Sub GiReactorOff
  1166. If debugGeneral Then debug.print "*****SUB:GiReactorOff"
  1167. Dim bulb
  1168. For each bulb in aGIReactorLights
  1169. bulb.State = 0
  1170. Next
  1171. End Sub
  1172.  
  1173. Sub GiReactorCritical ' Turn on beacon
  1174. ChangeGiImmediate "red", 1
  1175. GIGameImmediate 5, "red"
  1176. GiON
  1177. End Sub
  1178.  
  1179. ' GI & light sequence effects
  1180. Dim GiReactorNum
  1181. Sub GiReactorEffect(n)
  1182. Select case n
  1183. Case 2:
  1184. GiReactorOff
  1185. GiReactorNum=0
  1186. GiReactorEffectTimer.Interval = 50
  1187. Case 3:
  1188. GiReactorOff
  1189. GiReactorNum = 10
  1190. GiReactorEffectTimer.Interval = 150
  1191.  
  1192. End Select
  1193.  
  1194. GiReactorEffectTimer.Enabled = True
  1195. End Sub
  1196.  
  1197. Sub GiReactorEffectTimer_Timer
  1198. Select case GiReactorNum
  1199. Case 0, 2, 4, 6, 8:
  1200. GiReactorOn
  1201. Case 10
  1202. GiReactorOn
  1203. GiReactorEffectTimer.Enabled = False
  1204. Case Else
  1205. GiReactorOff
  1206. End Select
  1207. GiReactorNum = GiReactorNum + 1
  1208. End Sub
  1209.  
  1210.  
  1211. '**** Blink Left GI Sling
  1212. Sub GILeftSlingHit
  1213. Dim Bulb
  1214. debug.print "GILeftSlingHit" & gametime
  1215.  
  1216. For each bulb in aGILeftSling
  1217. If ReactorState(CurrentPlayer) = 3 Then
  1218. SetLight bulb, "blue", -1
  1219. 'debug.print "blue" & gametime
  1220.  
  1221. Else
  1222. SetLight bulb, "red", -1
  1223. 'debug.print "red" & gametime
  1224. End If
  1225. Next
  1226.  
  1227. GI3.TimerInterval = 250: GI3.TimerEnabled = True
  1228. End Sub
  1229.  
  1230. Sub GI3_Timer
  1231. debug.print "GI3_Timer" & gametime
  1232. Dim Bulb
  1233.  
  1234. For each bulb in aGILeftSling
  1235. SetLight bulb, CurrCol, -1
  1236. Next
  1237.  
  1238. GI3.TimerEnabled = False
  1239. End Sub
  1240.  
  1241. '**** Blink Right GI Sling
  1242. Sub GIRightSlingHit
  1243. Dim Bulb
  1244.  
  1245. For each bulb in aGIRightSling
  1246. If ReactorState(CurrentPlayer) <> 3 Then
  1247. SetLight bulb, "red", -1
  1248. Else
  1249. SetLight bulb, "blue", -1
  1250. End If
  1251. Next
  1252.  
  1253. GI1.TimerInterval = 250: GI1.TimerEnabled = True
  1254. End Sub
  1255.  
  1256. Sub GI1_Timer
  1257. Dim Bulb
  1258.  
  1259. For each bulb in aGIRightSling
  1260. SetLight bulb, CurrCol, -1
  1261. Next
  1262.  
  1263. GI1.TimerEnabled = False
  1264. End Sub
  1265.  
  1266.  
  1267.  
  1268. 'Gi - Newer GI effects
  1269. Dim EffectNum
  1270. Sub GIGame (num, col)
  1271. debug.print "GIGAme: " & num & " : " & col & "(" & CurrCol
  1272. GIOff
  1273. EffectNum = num
  1274. NextCol = col
  1275. GIGameTimer.Interval = 250
  1276. GIGameTimer.Enabled = True
  1277. End Sub
  1278.  
  1279. Sub GIGameTimer_Timer
  1280. GiGameImmediate EffectNum, NextCol
  1281. GIGameTimer.Enabled = False
  1282. End Sub
  1283.  
  1284. Dim currGIGame
  1285. Sub GiGameImmediate (num, col) 'temporary gi animations
  1286. debug.print "GiGameImmediate: " & num & " : " & col & "(" & CurrCol
  1287. GIOff
  1288. currGIGame = col
  1289. Select Case Num 'yyy
  1290. Case 1 'Skillshot, HFSkillshot, Lane save, Jackpot
  1291. ChangeGIImmediate col, 0
  1292. LightSeqGame.UpdateInterval = 2
  1293. LightSeqGame.Play SeqDownOn, 50, 1
  1294. Case 2 'Scoop Eject
  1295. ChangeGIImmediate col, 0
  1296. LightSeqGame.UpdateInterval = 2
  1297. LightSeqGame.Play SeqDownOff, 50, 1
  1298. Case 3 'Ball Lock part 1`
  1299. ChangeGIImmediate col, 0
  1300. LightSeqMball.UpdateInterval = 13
  1301. LightSeqMball.Play SeqCircleOutOn, 150, 1
  1302. Case 4 'mball
  1303. ChangeGIImmediate col, 0
  1304. GIOn
  1305. LightSeqMball.UpdateInterval = 2
  1306. LightSeqMball.Play SeqDownOff, 30, 5
  1307. 'LightSeqMball.Play SeqCircleOutOff, 50, 1
  1308. Case 5 'Reactor Critical
  1309. LightSeqCritical.UpdateInterval = 20
  1310. LightSeqCritical.Play SeqUpOff, 15, 1000
  1311. Case 6 'ComboLoop
  1312. ChangeGIImmediate col, 0
  1313. GIOn
  1314. LightSeqGame.UpdateInterval = 1
  1315. LightSeqGame.Play SeqClockLeftOff, 150, 2
  1316. Case 7 'Reactor Ready Part 1
  1317. ChangeGIImmediate col, 0
  1318. LightSeqReady.UpdateInterval = 3
  1319. LightSeqReady.Play SeqStripe2VertOn, 50, 6
  1320. Case 8 ' Reactor Ready Part 2
  1321. ChangeGIImmediate col, 0
  1322. playsound "tna_leftscoopawardeject"
  1323. LightSeqReady.UpdateInterval = 2
  1324. LightSeqReady.Play SeqDownOn, 30, 3
  1325. Case 9 'Double Jackpot
  1326. ChangeGIImmediate col, 0
  1327. LightSeqGame.UpdateInterval = 2
  1328. LightSeqGame.Play SeqDownOn, 50, 2
  1329. Case 10 'Triple Jackpot
  1330. ChangeGIImmediate col, 0
  1331. LightSeqGame.UpdateInterval = 2
  1332. LightSeqGame.Play SeqDownOn, 50, 3
  1333. Case 11 'Super Jackpot
  1334. ChangeGIImmediate col, 0
  1335. LightSeqGame.UpdateInterval = 2
  1336. LightSeqGame.Play SeqDownOn, 50, 4
  1337. Case 12 'Lane save
  1338. ChangeGIImmediate col, 0
  1339. LightSeqGame.UpdateInterval = 3
  1340. LightSeqGame.Play SeqDownOn, 100, 1
  1341. End Select
  1342. End Sub
  1343.  
  1344.  
  1345. Sub LightSeqReady_PlayDone
  1346. If CurrCol = "green" Then
  1347. GigameImmediate 8, "white"
  1348. Else
  1349. PreviousGI
  1350. LightSeqReady.TimerInterval = 500
  1351. LightSeqReady.TimerEnabled = True
  1352. End If
  1353. End Sub
  1354.  
  1355. Sub LightSeqReady_Timer
  1356. GiOn
  1357. LightSeqReady.TimerEnabled = False
  1358. End Sub
  1359.  
  1360.  
  1361. ' GI & light sequence effects
  1362. Dim GiNum
  1363. Sub GiEffect(n)
  1364. Select case n
  1365. Case 2: 'GI blink 5 times at 100 msec rate
  1366. GiOff
  1367. GiNum=0
  1368. GiEffectTimer.Interval = 50
  1369. Case 3: 'GI Blink 1 time for 100 msec
  1370. GiOff
  1371. GiNum = 10
  1372. GiEffectTimer.Interval = 100
  1373. End Select
  1374.  
  1375. GiEffectTimer.Enabled = True
  1376. End Sub
  1377.  
  1378. Sub GiEffectTimer_Timer
  1379. Select case GiNum
  1380. Case 0, 2, 4, 6, 8: 'Toggle GI On
  1381. GiOn
  1382. Case 10 'Stop timer
  1383. GiOn
  1384. GiEffectTimer.Enabled = False
  1385. Case 20,30,40,100,500,1000 'Stop timer
  1386. GiOn
  1387. GiEffectTimer.Enabled = False
  1388. Case Else 'Toggle GO Off
  1389. GiOff
  1390. End Select
  1391. GiNum = GiNum + 1
  1392. End Sub
  1393.  
  1394.  
  1395.  
  1396. Sub LightEffect(n)
  1397.  
  1398. End Sub
  1399.  
  1400. ' Flasher Effects
  1401.  
  1402. Dim FEStep, FEffect
  1403. FEStep = 0
  1404. FEffect = 0
  1405.  
  1406. Sub FlashEffect(n)
  1407. Select case n
  1408. Case 1:FEStep = 0:FEffect = 1:FlashEffectTimer.Enabled = 1 'all blink
  1409. Case 2:FEStep = 0:FEffect = 2:FlashEffectTimer.Enabled = 1 'random
  1410. Case 3:FEStep = 0:FEffect = 3:FlashEffectTimer.Enabled = 1 'upon
  1411. Case 4:FEStep = 0:FEffect = 4:FlashEffectTimer.Enabled = 1 'ordered random :)
  1412. End Select
  1413. End Sub
  1414.  
  1415. Sub FlashEffectTimer_Timer()
  1416. FEStep = FEStep + 1
  1417. FlashEffectTimer.Enabled = 0
  1418. End Sub
  1419.  
  1420.  
  1421. Sub ResetInserts
  1422. Dim Obj
  1423. 'Reactor Inserts
  1424. For each obj in aInsertsReactor
  1425. SetLight obj, "blue", 0
  1426. Next
  1427.  
  1428. 'Bonus Inserts
  1429. For each obj in aInsertsBonus
  1430. SetLight obj, "white", 0
  1431. Next
  1432.  
  1433. SetLight lSpinner, "blue", -1
  1434. SetLight F1, "white", 0
  1435. SetLight F2, "white", 0
  1436. SetLight F3, "white", 0
  1437. SetLight F4, "white", 0
  1438. SetLight F5, "white", 0
  1439. SetLight FD1, "white", 0
  1440. SetLight FD2, "white", 0
  1441. SetLight FRAD1, "white", 0
  1442. SetLight FRAD2, "white", 0
  1443. SetLight FRAD3, "white", 0
  1444. End Sub
  1445.  
  1446. ' *******************************************************************************************************
  1447. ' Positional Sound Playback Functions by DJRobX and Rothbauerw
  1448. ' PlaySound sound, 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  1449. ' *******************************************************************************************************
  1450.  
  1451. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  1452. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  1453. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  1454.  
  1455. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  1456. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  1457. End Sub
  1458.  
  1459. ' Set position as table object (Use object or light but NOT wall) and Vol to 1
  1460.  
  1461. Sub PlaySoundAt(soundname, tableobj)
  1462. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1463. End Sub
  1464.  
  1465. 'Set all as per ball position & speed.
  1466.  
  1467. Sub PlaySoundAtBall(soundname)
  1468. PlaySoundAt soundname, ActiveBall
  1469. End Sub
  1470.  
  1471. 'Set position as table object and Vol manually.
  1472.  
  1473. Sub PlaySoundAtVol(sound, tableobj, Volume)
  1474. PlaySound sound, 1, Volume, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1475. End Sub
  1476.  
  1477. 'Set all as per ball position & speed, but Vol Multiplier may be used eg; PlaySoundAtBallVol "sound",3
  1478.  
  1479. Sub PlaySoundAtBallVol(sound, VolMult)
  1480. PlaySound sound, 0, Vol(ActiveBall) * VolMult, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  1481. End Sub
  1482.  
  1483. 'Set position as bumperX and Vol manually.
  1484.  
  1485. Sub PlaySoundAtBumperVol(sound, tableobj, Vol)
  1486. PlaySound sound, 1, Vol, AudioPan(tableobj), 0,0,1, 1, AudioFade(tableobj)
  1487. End Sub
  1488.  
  1489. Sub PlaySoundAtBOTBallZ(sound, BOT)
  1490. PlaySound sound, 0, ABS(BOT.velz)/17, Pan(BOT), 0, Pitch(BOT), 1, 0, AudioFade(BOT)
  1491. End Sub
  1492.  
  1493. ' play a looping sound at a location with volume
  1494. Sub PlayLoopSoundAtVol(sound, tableobj, Vol)
  1495. PlaySound sound, -1, Vol, AudioPan(tableobj), 0, 0, 1, 0, AudioFade(tableobj)
  1496. End Sub
  1497.  
  1498. ' *********************************************************************
  1499. ' Section; Supporting Ball & Sound Functions
  1500. ' *********************************************************************
  1501.  
  1502. Function RndNum(min, max)
  1503. RndNum = Int(Rnd() * (max-min + 1) ) + min ' Sets a random number between min and max
  1504. End Function
  1505.  
  1506. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  1507. Dim tmp
  1508. On Error Resume Next
  1509. tmp = tableobj.y * 2 / table1.height-1
  1510. If tmp > 0 Then
  1511. AudioFade = Csng(tmp ^10)
  1512. Else
  1513. AudioFade = Csng(-((- tmp) ^10) )
  1514. End If
  1515. End Function
  1516.  
  1517. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  1518. Dim tmp
  1519. On Error Resume Next
  1520. tmp = tableobj.x * 2 / table1.width-1
  1521. If tmp > 0 Then
  1522. AudioPan = Csng(tmp ^10)
  1523. Else
  1524. AudioPan = Csng(-((- tmp) ^10) )
  1525. End If
  1526. End Function
  1527.  
  1528. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1529. Dim tmp
  1530. On Error Resume Next
  1531. tmp = ball.x * 2 / table1.width-1
  1532. If tmp > 0 Then
  1533. Pan = Csng(tmp ^10)
  1534. Else
  1535. Pan = Csng(-((- tmp) ^10))
  1536. End If
  1537. End Function
  1538.  
  1539. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1540. Vol = Csng(BallVel(ball) ^2 / VolDiv)
  1541. End Function
  1542.  
  1543. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1544. Pitch = BallVel(ball) * 20
  1545. End Function
  1546.  
  1547. Function BallVel(ball) 'Calculates the ball speed
  1548. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2)))
  1549. End Function
  1550.  
  1551. Function BallVelZ(ball) 'Calculates the ball speed in the -Z
  1552. BallVelZ = INT((ball.VelZ) * -1 )
  1553. End Function
  1554.  
  1555. Function VolZ(ball) ' Calculates the Volume of the sound based on the ball speed in the Z
  1556. VolZ = Csng(BallVelZ(ball) ^2 / 200)*1.2
  1557. End Function
  1558.  
  1559. '*** Determines if a Points (px,py) is inside a 4 point polygon A-D in Clockwise/CCW order
  1560.  
  1561. Function InRect(px,py,ax,ay,bx,by,cx,cy,dx,dy)
  1562. Dim AB, BC, CD, DA
  1563. AB = (bx*py) - (by*px) - (ax*py) + (ay*px) + (ax*by) - (ay*bx)
  1564. BC = (cx*py) - (cy*px) - (bx*py) + (by*px) + (bx*cy) - (by*cx)
  1565. CD = (dx*py) - (dy*px) - (cx*py) + (cy*px) + (cx*dy) - (cy*dx)
  1566. DA = (ax*py) - (ay*px) - (dx*py) + (dy*px) + (dx*ay) - (dy*ax)
  1567.  
  1568. If (AB <= 0 AND BC <=0 AND CD <= 0 AND DA <= 0) Or (AB >= 0 AND BC >=0 AND CD >= 0 AND DA >= 0) Then
  1569. InRect = True
  1570. Else
  1571. InRect = False
  1572. End If
  1573. End Function
  1574.  
  1575.  
  1576. '*****************************************
  1577. ' Section; JP's VP10 Rolling Sounds
  1578. '*****************************************
  1579.  
  1580. Const tnob = 20 ' total number of balls
  1581. Const lob = 4 'number of locked balls
  1582. ReDim rolling(tnob)
  1583. InitRolling
  1584.  
  1585. Sub InitRolling
  1586. Dim i
  1587. For i = 0 to tnob
  1588. rolling(i) = False
  1589. Next
  1590. End Sub
  1591.  
  1592. Sub RollingUpdate()
  1593. Dim BOT, b, ballpitch
  1594. BOT = GetBalls
  1595.  
  1596. ' stop the sound of deleted balls
  1597. For b = UBound(BOT) + 1 to tnob
  1598. rolling(b) = False
  1599. StopSound("fx_ballrolling" & b)
  1600. Next
  1601.  
  1602. ' exit the sub if no balls on the table
  1603. If UBound(BOT) = 3 Then Exit Sub 'there are always 4 balls on this table
  1604.  
  1605. ' play the rolling sound for each ball
  1606. For b = 0 to UBound(BOT)
  1607. If BallVel(BOT(b)) > 1 Then
  1608. rolling(b) = True
  1609. if BOT(b).z < 30 Then ' Ball on playfield
  1610. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), AudioPan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0, AudioFade(BOT(b) )
  1611. Else ' Ball on raised ramp
  1612. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) )*.5, AudioPan(BOT(b) ), 0, Pitch(BOT(b) )+50000, 1, 0, AudioFade(BOT(b) )
  1613. End If
  1614. Else
  1615. If rolling(b) = True Then
  1616. StopSound("fx_ballrolling" & b)
  1617. rolling(b) = False
  1618. End If
  1619. End If
  1620. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  1621. PlaySoundAtBOTBallZ "fx_ball_drop" & b, BOT(b)
  1622. 'debug.print BOT(b).velz
  1623. End If
  1624. Next
  1625. End Sub
  1626.  
  1627. '**********************
  1628. ' Section; Ball Collision Sound
  1629. '**********************
  1630.  
  1631. Sub OnBallBallCollision(ball1, ball2, velocity)
  1632. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / (VolDiv/VolCol), AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  1633. End Sub
  1634.  
  1635. '******************************
  1636. ' Section; Diverse Collection Hit Sounds
  1637. '******************************
  1638.  
  1639. Sub aTargets_Hit(idx):PlaySound "fx_Target_soft", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1640. Sub aBigTargets_Hit(idx):PlaySound "fx_Target", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1641. Sub aMetals_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1642. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1643. Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1644. Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1645. Sub aYellowPins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1646. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1647. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1648. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1649. Sub aCaptiveWalls_Hit(idx):PlaySound "fx_collide", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall):End Sub
  1650.  
  1651.  
  1652. Sub PlayQuote_timer() 'one quote each 2 minutes
  1653. Dim Quote
  1654. Quote = "xxxxxx" & INT(RND * 56) + 1
  1655. PlaySound Quote
  1656. End Sub
  1657.  
  1658. ' Ramp Soundss
  1659. Sub RHelp1_Hit()
  1660. StopSound "fx_metalrolling"
  1661. PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1662. End Sub
  1663.  
  1664. Sub RHelp2_Hit()
  1665. StopSound "fx_metalrolling"
  1666. PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1667. End Sub
  1668.  
  1669. ' *********************************************************************
  1670. ' User Defined Script Events
  1671. ' *********************************************************************
  1672.  
  1673. ' Initialise the Table for a new Game
  1674. Dim RandomSongStart
  1675. Sub ResetForNewGame()
  1676. If debugGeneral Then Debug.print "*****SUB:ResetForNewGame()"
  1677.  
  1678. Dim i
  1679.  
  1680. RandomSongStart = INT(RND * 8)
  1681. bGameInPLay = True
  1682.  
  1683. 'resets the score display, and turn off attrack mode
  1684. StopAttractMode
  1685. StopRainbow
  1686. GiOn
  1687.  
  1688. TotalGamesPlayed = TotalGamesPlayed + 1
  1689. CurrentPlayer = 1
  1690.  
  1691. 'Resets all the led reels - hack
  1692. If PlayersPlayingGame > 1 Then
  1693. If B2SOn Then Controller.stop: Controller.Run
  1694. 'If B2SOn Then Controller.B2SSetScorePlayer 1, 0
  1695. 'If B2SOn Then Controller.B2SSetScorePlayer 2, 0
  1696. 'If B2SOn Then Controller.B2SSetScorePlayer 3, 0
  1697. 'If B2SOn Then Controller.B2SSetScorePlayer 4, 0
  1698. End If
  1699.  
  1700. PlayersPlayingGame = 1
  1701. bOnTheFirstBall = True
  1702. For i = 1 To MaxPlayers
  1703. Score(i) = 0
  1704. ReactorScore(i) = 0
  1705. BonusPoints(i) = 0
  1706. BonusHeldPoints(i) = 0
  1707. BonusMultiplier(i) = 1
  1708. BallsRemaining(i) = BallsPerGame
  1709. ExtraBallsAwards(i) = 0
  1710. Next
  1711. If B2SOn Then Controller.B2SSetScorePlayer 1, 0
  1712.  
  1713.  
  1714. ' initialise any other flags
  1715. Tilt = 0
  1716.  
  1717. ' initialise Game variables
  1718. Game_Init()
  1719.  
  1720.  
  1721. ' you may wish to start some music, play a sound, do whatever at this point
  1722. ' set up the start delay to handle any Start of Game Attract Sequence
  1723. UDMD "Welcome To", "The Future", 1500
  1724. vpmtimer.addtimer 1500, "FirstBall '"
  1725.  
  1726. End Sub
  1727.  
  1728. ' This is used to delay the start of a game to allow any attract sequence to
  1729. ' complete. When it expires it creates a ball for the player to start playing with
  1730.  
  1731. Sub FirstBall
  1732. If debugGeneral Then Debug.print "*****SUB:FirstBall()"
  1733.  
  1734. ' reset the table for a new ball
  1735. ResetForNewPlayerBall()
  1736. ' create a new ball in the shooters lane
  1737. CreateNewBall()
  1738. End Sub
  1739.  
  1740. ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
  1741. ' lost one or we have moved onto the next player (if multiple are playing))
  1742.  
  1743. Sub ResetForNewPlayerBall()
  1744. If debugGeneral Then Debug.print "*****SUB:ResetForNewPlayerBall()"
  1745.  
  1746. ' make sure the correct display is upto date
  1747. AddScore 0
  1748.  
  1749. ' set the current players bonus multiplier back down to 1X
  1750. SetBonusMultiplier 1
  1751.  
  1752. ' reset any drop targets, lights, game modes etc..
  1753.  
  1754. BonusPoints(CurrentPlayer) = 0
  1755. bBonusHeld = False
  1756. bExtraBallWonThisBall = False
  1757. ResetNewBallLights()
  1758.  
  1759. 'Reset any table specific
  1760. ResetNewBallVariables
  1761.  
  1762. 'This is a new ball, so activate the ballsaver
  1763. bBallSaverReady = True
  1764.  
  1765. 'and the skillshot
  1766. SkillShotReady = 1
  1767.  
  1768. 'and Drain bonus Ready
  1769. DrainBonusReady = 1
  1770.  
  1771. 'ResetModes : drain
  1772. If KeepLaneSaves = 0 Then ResetSAVE
  1773. ResetCORE
  1774. ResetGate
  1775. ResetBonusLights
  1776. ResetSuperSpinner
  1777. StartRAD
  1778. StartMaxTarget
  1779. ResetReactorBonus
  1780.  
  1781. If bLockIsLit = False Then
  1782. DropTargetResetLockIsLit 2
  1783. End If
  1784.  
  1785. 'Change the music ?
  1786. End Sub
  1787.  
  1788. ' Create a new ball on the Playfield
  1789.  
  1790. Sub CreateNewBall()
  1791. ' create a ball in the plunger lane kicker.
  1792. BallRelease.CreateSizedball BallSize / 2
  1793. ' There is a (or another) ball on the playfield
  1794. AddBallsOnPlayfield 1
  1795.  
  1796.  
  1797. If debugGeneral Then Debug.print "*****SUB:CreateNewBall, BallCnt = " & " : " & BallsOnPlayfield
  1798.  
  1799. ' kick it out..
  1800. PlaySound SoundFXDOF("fxz_Ballrel", 121, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1, AudioFade(BallRelease)
  1801. BallRelease.Kick 90, 4
  1802.  
  1803. If bMultiBallMode = False and ReactorState(CurrentPlayer) <> 3 Then
  1804. StartBackgroundMusic
  1805. Elseif ReactorState(CurrentPlayer) = 3 Then
  1806. StartReactorCriticalMusic
  1807. GiReactorCritical
  1808. End If
  1809.  
  1810.  
  1811. If bBallSaverSingleUse = 1 then bBallSaverSingleUse = 0 'SAVE mode: Clear single ball save
  1812. End Sub
  1813.  
  1814. Sub CreateNewBallAfterBallLock()
  1815. ' create a ball in the plunger lane kicker.
  1816. BallRelease.CreateSizedball BallSize / 2
  1817.  
  1818. If debugGeneral Then Debug.print "*****SUB:CreateNewBallAfterBallLock, BallCnt = " & " : " & BallsOnPlayfield
  1819.  
  1820. ' kick it out..
  1821. PlaySound SoundFXDOF("fx_Ballrel", 121, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1, AudioFade(BallRelease)
  1822. BallRelease.Kick 90, 4
  1823. bAutoPlunger = True
  1824.  
  1825. End Sub
  1826.  
  1827.  
  1828. ' Add extra balls to the table with autoplunger
  1829. ' Use it as AddMultiball 4 to add 4 extra balls to the table
  1830.  
  1831. Sub AddMultiball(nballs)
  1832. If debugGeneral Then Debug.print "*****SUB:AddMultiball()"
  1833.  
  1834. mBalls2Eject = mBalls2Eject + nballs
  1835. CreateMultiballTimer.Interval = 1000
  1836. CreateMultiballTimer.Enabled = True
  1837. End Sub
  1838.  
  1839. ' Eject the ball after the delay, AddMultiballDelay
  1840. Sub CreateMultiballTimer_Timer()
  1841. If debugGeneral Then Debug.print "*****SUB:CreateMultiballTimer_Timer()"
  1842.  
  1843. ' wait if there is a ball in the plunger lane
  1844. If bBallInPlungerLane Then
  1845. 'uuuu debug.print "AAA"
  1846. Exit Sub
  1847. Else
  1848. If BallsOnPlayfield < MaxMultiballs Then
  1849. CreateNewBall()
  1850. mBalls2Eject = mBalls2Eject -1
  1851. If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
  1852. Me.Enabled = False
  1853. End If
  1854. Else 'the max number of multiballs is reached, so stop the timer
  1855. mBalls2Eject = 0
  1856. Me.Enabled = False
  1857. End If
  1858. End If
  1859. End Sub
  1860.  
  1861. ' The Player has lost his ball (there are no more balls on the playfield).
  1862. ' Handle any bonus points awarded
  1863.  
  1864. Sub EndOfBall()
  1865. Dim AwardPoints1, AwardPoints2, AwardPoints3, TotalBonus, TNABonus
  1866. Dim tmp
  1867. If debugGeneral Then Debug.print "*****SUB:EndOfBall()"
  1868.  
  1869. ' TNA bonus
  1870. ' Target bonus - 1000 * targets * bonus level
  1871. ' Unused BallSave bonus - ? 5000 each?
  1872. ' Reactor bonus
  1873. ' Total bonus
  1874. AwardPoints1 = 0
  1875. AwardPoints2 = 0
  1876. AwardPoints3 = 0
  1877. TotalBonus = 0
  1878.  
  1879. ' the first ball has been lost. From this point on no new players can join in
  1880. bOnTheFirstBall = False
  1881.  
  1882. 'Stop music
  1883. StopBackgroundMusic
  1884. StopReactorCriticalMusic
  1885. If((BallsRemaining(CurrentPlayer) <= 1) AND (ExtraBallsAwards(CurrentPlayer) = 0)) Then 'If game ends with reactor critical
  1886. GIReactorStoppedImmediate
  1887. End If
  1888.  
  1889. bAutoPlunger = False
  1890.  
  1891. ' only process any of this if the table is not tilted. (the tilt recovery
  1892. ' mechanism will handle any extra balls or end of game)
  1893.  
  1894. If(Tilted = False)Then
  1895.  
  1896. ' Count the bonus. This table uses several bonus
  1897. 'dmdflush
  1898.  
  1899. If(ExtraBallsAwards(CurrentPlayer) <> 0)Then
  1900. 'Playsound "tna_standbyandbonus"
  1901. DOF 163, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("STAND BY...")), eBlink, 2000, True, "tna_standbyforextraball"
  1902. UDMD "STAND BY...", "", 2000
  1903. lBonus20cnt = -1
  1904. Elseif ReactorTNAAchieved(CurrentPlayer) = 1 Then 'TNA Achieved
  1905. lBonus20cnt = -2
  1906. Else ' Normal Bouss MOde
  1907. 'Playsound "tna_3xbonuswithend"
  1908. lBonus20cnt = 0
  1909. End If
  1910. LightSeqCritical.StopPlay
  1911. LightSeqBonus.Play SeqRandom, 40, 1, 0
  1912. lBonus20.TimerInterval = 2000
  1913. lBonus20.TimerEnabled = True
  1914.  
  1915.  
  1916.  
  1917. AwardPoints1 = LaneSaveBonusValue * LaneSaveCount(CurrentPlayer)
  1918. AwardPoints2 = TargetBonusValue * BonusPoints(CurrentPlayer) * BonusMultiplier(CurrentPlayer)
  1919. AwardPoints3 = ReactorBonus * BonusMultiplier(CurrentPlayer)
  1920. TotalBonus = (LaneSaveBonusValue * LaneSaveCount(CurrentPlayer)) + (TargetBonusValue * BonusPoints(CurrentPlayer)) + (ReactorBonus * BonusMultiplier(CurrentPlayer))
  1921. AddScore TotalBonus
  1922.  
  1923. DOF 164, DOFPulse
  1924. pDMDmode="endofballbonus"
  1925. pDMD_Sequence.Interval = 100
  1926. pDMD_Sequence.Enabled = True 'added by TerryRed
  1927. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "UNUSED BALLSAVE"), eNone, CenterLine(3, FormatScore(AwardPoints1)), eBlinkFast, 2000, True, "tna_3xbonuswithend"
  1928. UDMD "UNUSED BALLSAVE", AwardPoints1, 2000
  1929.  
  1930. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TARGET BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints2)), eBlinkFast, 2000, True, ""
  1931. UDMD "TARGET BONUS", AwardPoints2,2000
  1932.  
  1933. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "REACTOR BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints3)), eBlinkFast, 2000, True, ""
  1934. UDMD "REACTOR BONUS", AwardPoints3, 2000
  1935.  
  1936. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TOTAL BONUS"), eNone, CenterLine(3, FormatScore(TotalBonus)), eBlinkFast, 2000, True, ""
  1937. UDMD "TOTAL BONUS", TotalBonus, 2000
  1938.  
  1939. ' add a bit of a delay to allow for the bonus points to be shown & added up
  1940. If ReactorTNAAchieved(CurrentPlayer) <> 1 Then
  1941. vpmtimer.addtimer 9000, "EndOfBall2 '"
  1942. Else 'TNA achieved!!!! zzz
  1943. TNABonus = ReactorReactorTotalReward(CurrentPlayer)
  1944. 'msgbox ReactorReactorTotalReward(CurrentPlayer)
  1945. DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TNA BONUS"), eNone, CenterLine(3, FormatScore(TNABonus)), eBlinkFast, 4000, True, "tna_totalannihilation"
  1946. UDMD "TNA BONUS", TNABonus, 4000
  1947. AddScore TNABonus
  1948. vpmtimer.addtimer 13000, "EndOfBall2 '"
  1949. End If
  1950.  
  1951. Else
  1952. vpmtimer.addtimer 100, "EndOfBall2 '"
  1953. End If
  1954. End Sub
  1955.  
  1956.  
  1957. Dim lBonus20cnt
  1958. Sub lBonus20_Timer
  1959. Select Case lBonus20cnt
  1960. Case -2
  1961. ChangeGiImmediate "purple", 0
  1962. Case -1
  1963. ChangeGiImmediate "green", 0
  1964. Case 0
  1965. ChangeGiImmediate "yellow", 0
  1966. Case 1
  1967. ChangeGiImmediate "blue", 0
  1968. Case 2
  1969. ChangeGiImmediate "purple", 0
  1970. lBonus20.TimerEnabled = False
  1971. lBonus20.TimerInterval = 3000
  1972. lBonus20.TimerEnabled = True
  1973.  
  1974. Case 3
  1975. lBonus20.TimerEnabled = False
  1976. LightSeqBonus.StopPlay
  1977. lBonus20cnt = 0
  1978. End Select
  1979.  
  1980. lBonus20cnt = lBonus20cnt + 1
  1981. End Sub
  1982.  
  1983. ' The Timer which delays the machine to allow any bonus points to be added up
  1984. ' has expired. Check to see if there are any extra balls for this player.
  1985. ' if not, then check to see if this was the last ball (of the CurrentPlayer)
  1986. '
  1987. Sub EndOfBall2()
  1988. If debugGeneral Then Debug.print "*****SUB:EndOfBall2()"
  1989.  
  1990. 'ChangeGi GIcolor, 1
  1991.  
  1992. ' if were tilted, reset the internal tilted flag (this will also
  1993. ' set TiltWarnings back to zero) which is useful if we are changing player LOL
  1994. Tilted = False
  1995. Tilt = 0
  1996. DisableTable False 'enable again bumpers and slingshots
  1997.  
  1998. ' has the player won an extra-ball ? (might be multiple outstanding)
  1999. If(ExtraBallsAwards(CurrentPlayer) <> 0)Then
  2000. debug.print "Extra Ball"
  2001.  
  2002. ' yep got to give it to them
  2003. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer)- 1
  2004.  
  2005. ' if no more EB's then turn off any shoot again light
  2006. If(ExtraBallsAwards(CurrentPlayer) = 0)Then
  2007. 'lLightShootAgain.State = 0
  2008. ResetBallSaveDisplay
  2009. End If
  2010.  
  2011. ' You may wish to do a bit of a song AND dance at this point
  2012. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("SHOOT AGAIN")), eBlink, 1000, True, "tna_shootagain"
  2013. UDMD "SHOOT AGAIN", "", 1000
  2014.  
  2015. ' Create a new ball in the shooters lane
  2016. ResetForNewPlayerBall
  2017. CreateNewBall()
  2018.  
  2019. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
  2020. fRones.TimerInterval = ReactorPercentLossTime * 1000
  2021. fRones.TimerEnabled = True
  2022. StartReactorRightLoopInserts
  2023. Else 'ReactorLevel(CurrentPlayer) 1 and 2 and e
  2024. StartReactorLoopInserts
  2025. End If
  2026.  
  2027. Else ' no extra balls
  2028.  
  2029. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer)- 1
  2030.  
  2031. ' was that the last ball ?
  2032. If(BallsRemaining(CurrentPlayer) <= 0)Then
  2033. debug.print "No More Balls, High Score Entry"
  2034.  
  2035. ' Submit the CurrentPlayers score to the High Score system
  2036. CheckHighScore()
  2037. ' you may wish to play some music at this point
  2038.  
  2039. Else
  2040.  
  2041. ' not the last ball (for that player)
  2042. ' if multiple players are playing then move onto the next one
  2043. EndOfBallComplete()
  2044. End If
  2045. End If
  2046. End Sub
  2047.  
  2048. ' This function is called when the end of bonus display
  2049. ' (or high score entry finished) AND it either end the game or
  2050. ' move onto the next player (or the next ball of the same player)
  2051. '
  2052. Sub EndOfBallComplete()
  2053. Dim NextPlayer
  2054.  
  2055. If debugGeneral Then debug.print "*****SUB: EndOfBallComplete()"
  2056.  
  2057. ' are there multiple players playing this game ?
  2058. If(PlayersPlayingGame > 1)Then
  2059. ' then move to the next player
  2060. NextPlayer = CurrentPlayer + 1
  2061. ' are we going from the last player back to the first
  2062. ' (ie say from player 4 back to player 1)
  2063. If(NextPlayer > PlayersPlayingGame)Then
  2064. NextPlayer = 1
  2065. End If
  2066. Else
  2067. NextPlayer = CurrentPlayer
  2068. End If
  2069.  
  2070. ' is it the end of the game ? (all balls been lost for all players)
  2071. If((BallsRemaining(CurrentPlayer) <= 0)AND(BallsRemaining(NextPlayer) <= 0))Then
  2072. ' you may wish to do some sort of Point Match free game award here
  2073. ' generally only done when not in free play mode
  2074.  
  2075. ' set the machine into game over mode
  2076. EndOfGame()
  2077.  
  2078. ' you may wish to put a Game Over message on the desktop/backglass
  2079.  
  2080. Else
  2081. ' Save any additional Player data
  2082. SavePlayerData
  2083.  
  2084. ' Extra Save step for co-op mode. Copies data to other players
  2085. If CoopMode = 1 Then
  2086. 'Copy player data to all Players
  2087. CopyPlayerData CurrentPlayer, 1
  2088. CopyPlayerData CurrentPlayer, 2
  2089. CopyPlayerData CurrentPlayer, 3
  2090. CopyPlayerData CurrentPlayer, 4
  2091. ElseIf CoopMode = 2 Then
  2092. 'Copy score to alternate Players
  2093. Select Case CurrentPlayer
  2094. Case 1
  2095. CopyPlayerData CurrentPlayer, 3
  2096. Case 2
  2097. CopyPlayerData CurrentPlayer, 4
  2098. Case 3
  2099. CopyPlayerData CurrentPlayer, 1
  2100. Case 4
  2101. CopyPlayerData CurrentPlayer, 2
  2102. End Select
  2103. End If
  2104.  
  2105. ' set the next player
  2106. CurrentPlayer = NextPlayer
  2107.  
  2108. ' Restore next player data or load default setting for ball 1
  2109. RestorePlayerData
  2110.  
  2111. ' make sure the correct display is up to date
  2112. AddScore 0
  2113.  
  2114. ' reset the playfield for the new player (or new ball)
  2115. ResetForNewPlayerBall()
  2116.  
  2117. ' AND create a new ball
  2118. CreateNewBall()
  2119.  
  2120. ' play a sound if more than 1 player
  2121. If PlayersPlayingGame > 1 Then
  2122. 'PlaySound "vo_player" &CurrentPlayer
  2123. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "PLAYER " &CurrentPlayer), eNone, 800, True, ""
  2124. UDMD "PLAYER " & CurrentPlayer, "", 800
  2125. End If
  2126. End If
  2127.  
  2128. If debugGeneral Then debug.print "Next Player = " & NextPlayer
  2129.  
  2130. End Sub
  2131.  
  2132. ' This function is called at the End of the Game, it should reset all
  2133. ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
  2134.  
  2135. Sub EndOfGame()
  2136. If debugGeneral Then debug.print "*****SUB:EndOfGame()"
  2137. PuPEvent 101
  2138. bGameInPLay = False
  2139. BallSearchTimer.Enabled = False
  2140. CoopMode = 0
  2141. ' just ended your game then play the end of game tune
  2142. If NOT bJustStarted Then
  2143. 'PlaySong "m_end", 1
  2144. End If
  2145. bJustStarted = False
  2146. ' ensure that the flippers are down
  2147. SolLFlipper 0
  2148. SolRFlipper 0
  2149.  
  2150. ' terminate all modes - eject locked balls
  2151. ' most of the modes/timers terminate at the end of the ball
  2152. PlayQuote.Enabled = 0
  2153.  
  2154. ' set any lights for the attract mode
  2155. GiOff
  2156. StartRainbow "all"
  2157. StartAttractMode 1
  2158.  
  2159. ' you may wish to light any Game Over Light you may have
  2160. 'Release any balls left on playfield at end of game
  2161. If bLockIsLit = true then
  2162. SetBallsOnPlayfield (DropTarget2.UserValue + DropTarget3.UserValue)
  2163. End If
  2164. DropTargetResetLockIsLit 0
  2165.  
  2166. End Sub
  2167.  
  2168. Dim BallinPlay
  2169. Function Balls
  2170. Dim tmp
  2171. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  2172. If tmp > BallsPerGame Then
  2173. Balls = BallsPerGame
  2174. BallinPlay = BallsPerGame
  2175. Else
  2176. Balls = tmp
  2177. BallinPlay = tmp
  2178. End If
  2179. End Function
  2180.  
  2181. ' *********************************************************************
  2182. ' Section; Drain / Plunger Functions
  2183. ' *********************************************************************
  2184.  
  2185. ' lost a ball ;-( check to see how many balls are on the playfield.
  2186. ' if only one then decrement the remaining count AND test for End of game
  2187. ' if more than 1 ball (multi-ball) then kill of the ball but don't create
  2188. ' a new one
  2189. '
  2190. Sub Drain_Hit()
  2191. DOF 116, DOFPulse
  2192. startB2S(7)
  2193. ' Destroy the ball
  2194. Drain.DestroyBall
  2195. ' Exit Sub ' only for debugging
  2196. AddBallsOnPlayfield -1
  2197. PuPEvent 107
  2198.  
  2199. If debugGeneral Then Debug.print "Drain_Hit(), ballcnt=" & BallsOnPlayfield
  2200.  
  2201. ' pretend to knock the ball into the ball storage mech
  2202. PlaySoundAtVol "fxz_drain", Drain, 1
  2203. 'if Tilted the end Ball modes
  2204. If Tilted Then
  2205. StopEndOfBallModes
  2206. End If
  2207.  
  2208. ' if there is a game in progress AND it is not Tilted
  2209. If(bGameInPLay = True)AND(Tilted = False)Then
  2210.  
  2211. ' is the ball saver active,
  2212. If(bBallSaverActive = True) Then
  2213.  
  2214. ' yep, create a new ball in the shooters lane
  2215. ' we use the Addmultiball in case the multiballs are being ejected
  2216. AddMultiball 1
  2217. ' we kick the ball with the autoplunger
  2218. bAutoPlunger = True
  2219. ' you may wish to put something on a display or play a sound at this point
  2220. if (bMultiBallMode = False) Then
  2221. DOF 165, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, "tna_ballsaved"
  2222. UDMD "BALL SAVED", "", 800
  2223. PuPEvent 92
  2224. End If
  2225.  
  2226. Else
  2227.  
  2228. 'Check if player used a SAVE to save ball
  2229. 'UseSAVE LastSwitchHit
  2230. If bBallSaverSingleUse = 1 Then
  2231. ' yep, create a new ball in the shooters lane
  2232. ' we use the Addmultiball in case the multiballs are being ejected
  2233. AddMultiball 1
  2234. ' we kick the ball with the autoplunger
  2235. bAutoPlunger = True
  2236. ' you may wish to put something on a display or play a sound at this point
  2237. 'DOF 165, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, "tna_ballsaved"
  2238. Exit Sub
  2239. End If
  2240.  
  2241. ' cancel any multiball if on last ball (ie. lost all other balls)
  2242. If(BallsOnPlayfield = 1)Then
  2243. ' AND in a multi-ball??
  2244. If(bMultiBallMode = True)then
  2245. ' not in multiball mode any more
  2246. bMultiBallMode = False
  2247. ResetGate
  2248. EndMultiball
  2249. If ReactorState(CurrentPlayer) = 3 Then
  2250. GiReactorCritical
  2251. ' ChangeGiImmediate "red", 1
  2252. Else
  2253. ChangeGi GIcolor, 1
  2254. end If
  2255. ' you may wish to change any music over at this point and
  2256. ' turn off any multiball specific lights
  2257. 'DropTargetReset
  2258. End If
  2259. End If
  2260.  
  2261. ' was that the last ball on the playfield
  2262. If(BallsOnPlayfield = 0)Then
  2263. ' End Modes and timers
  2264. 'PlaySong "m_wait", 1
  2265. StopEndOfBallModes
  2266. PuPEvent 100
  2267.  
  2268. fRones.TimerEnabled = False 'stop reactor decrement timer if running
  2269. ResetReactorLoopInserts
  2270. stopReactorLEDblink
  2271.  
  2272. ChangeGi "red", 0
  2273. ' handle the end of ball (count bonus, change player, high score entry etc..)
  2274. If DrainBonusReady = 1 Then
  2275. DrainBonusReady = 0
  2276. vpmtimer.addtimer 1500, "EndOfBall '"
  2277. End If
  2278. End If
  2279. End If
  2280. End If
  2281. End Sub
  2282.  
  2283. ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane
  2284. ' Check to see if a ball saver mechanism is needed and if so fire it up.
  2285.  
  2286. Dim BallRestingInPlungerLane
  2287. Sub swPlungerRest_Hit()
  2288. If debugGeneral Then debug.print "*****SUB:swPlungerRest_Hit, Resting"
  2289.  
  2290. Wall348.TimerInterval = AutoPlungeDelay*1000
  2291.  
  2292. ' some sound according to the ball position
  2293. PlaySound "fx_sensor", 0, 1, 0.15, 0.25
  2294. bBallInPlungerLane = True
  2295.  
  2296. If SkillshotReady = 2 Then 'Soft plunge failed. Cancel Skillshot and Autolaunch
  2297. bAutoPlunger = True
  2298. CheckSkillShot 0
  2299. PlaySound "tna_electricity1", 0, 1, -0.05, 0.05
  2300. Wall348.TimerInterval = 300
  2301. Wall348.TimerEnabled = False
  2302. Wall348.TimerEnabled = True
  2303. End If
  2304.  
  2305. ' turn on Launch light is there is one
  2306. 'LaunchLight.State = 2
  2307. ' kick the ball in play if the bAutoPlunger flag is on
  2308. If bAutoPlunger Then
  2309. If debugGeneral Then debug.print "*****SUB:swPlungerRest_Hit, AutoPlunge"
  2310. Wall348.TimerEnabled = False
  2311. Wall348.TimerEnabled = True
  2312.  
  2313.  
  2314. If mBalls2Eject = 0 Then bAutoPlunger = False
  2315.  
  2316. ElseIf ReactorTNAAchieved(CurrentPlayer) = 1 Then
  2317. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "GAME OVER,MAN"), eBlinkfast, 5000, True, "tna_totalannihilation"
  2318. UDMD "CONGRATULATIONS", "GAME OVER MAN", 5000
  2319. If debugGeneral Then debug.print "*****SUB:swPlungerRest_Hit, AutoPlunge"
  2320. Wall348.TimerEnabled = False
  2321. Wall348.TimerEnabled = True
  2322.  
  2323. ' LightSeqAutoLaunch.StopPlay
  2324. ' LightSeqAutoLaunch.UpdateInterval = 5
  2325. ' LightSeqAutoLaunch.Play SeqUpOn, 25, 1
  2326. End If
  2327.  
  2328.  
  2329. 'Start the Selection of the skillshot if ready
  2330. If SkillShotReady = 1 Then
  2331. StartSkillshot()
  2332. End If
  2333.  
  2334. ' remember last trigger hit by the ball.
  2335. SetLastSwitchHit "swPlungerRest"
  2336.  
  2337. uDMDScoreUpdate
  2338.  
  2339. End Sub
  2340.  
  2341. Sub Wall348_Timer
  2342. If debugGeneral Then debug.print "*****SUB:Wall348_Timer, AutoPlunge"
  2343.  
  2344. PlungerIM.AutoFire
  2345. PlaySound SoundFXDOF("fxz_autoplunger",125,DOFPulse,DOFContactors)
  2346. DOF 123, DOFPulse
  2347. Wall348.TimerEnabled = False
  2348. 'LightSeqAutoLaunch.StopPlay
  2349. LightSeqAutoLaunch.Play SeqAllOff
  2350. LightSeqAutoLaunch.UpdateInterval = 4
  2351. LightSeqAutoLaunch.Play SeqUpOn, 25, 1
  2352.  
  2353. End Sub
  2354.  
  2355. ' The ball is released from the plunger turn off some flags and check for skillshot
  2356.  
  2357. Dim bTimedSkillShot
  2358. Sub swPlungerRest_UnHit()
  2359. bBallInPlungerLane = False
  2360. If SkillShotReady = 1 Then
  2361. SkillShotReady = 2 'Ball plunged
  2362. bSkillShotSelect = False 'Skillshot frozen
  2363. swPlungerRest.TimerInterval = 5000
  2364. swPlungerRest.TimerEnabled = True
  2365. bTimedSkillShot = True
  2366. End If
  2367.  
  2368. If debugGeneral Then debug.print "*****SUB:swPlungerRest_UnHit, Ballcnt: " & BallsOnPlayfield
  2369. 'Debug.print "BallsonPlayfieldCheck" & " : " & BallsOnPlayfield
  2370.  
  2371. ' if there is a need for a ball saver, then start off a timer
  2372. ' only start if it is ready, and it is currently not running, else it will reset the time period
  2373. 'msgbox bBallSaverReady & ":" & BallSaverTime & ":" & bBallSaverActive
  2374. If(bBallSaverReady = True)AND(BallSaverTime <> 0)And(bBallSaverActive = False) AND (ReactorTNAAchieved(CurrentPlayer) = 0) Then
  2375. EnableBallSaver BallSaverTime
  2376. End If
  2377.  
  2378.  
  2379. JustPlunged = True
  2380. Gate1.TimerEnabled = False
  2381. Gate1.TimerInterval = 2000
  2382. Gate1.TimerEnabled = True
  2383.  
  2384. End Sub
  2385.  
  2386. Sub swPlungerRest_Timer 'Timed skillshot support
  2387. bTimedSkillShot = False
  2388. swPlungerRest.TimerEnabled = False
  2389. End Sub
  2390.  
  2391. Sub Gate1_Timer
  2392. JustPlunged = False
  2393. Gate1.TimerEnabled = False
  2394. End Sub
  2395.  
  2396. 'Version of Ballsaver using led display
  2397. Dim dbs1, dbs2, dbsdelta, dbstime, dbstens, dbsones, dbsdecimals
  2398. Sub EnableBallSaver(seconds)
  2399. seconds = seconds + 0.3 'padding
  2400. 'If debugGeneral Then debug.print "*****SUB:EnableBallSaver, seconds=" & seconds
  2401. ' set our game flag
  2402. bBallSaverActive = True
  2403. bBallSaverReady = False
  2404. ' start the timer
  2405.  
  2406. BallSaverTimerExpired.Interval = 1000 * seconds
  2407. BallSaverTimerExpired.Enabled = True
  2408.  
  2409. 'Set display to x seconds
  2410. dbstime = seconds
  2411. dbsdelta = .1
  2412. BallSaverUpdateTimer.Interval = 100
  2413.  
  2414. dbstens = Int(dbstime/10)
  2415. dbsones = Int(dbstime-dbstens*10)
  2416. dbsdecimals = Int((dbstime-dbstens*10-dbsones)*10)
  2417.  
  2418. debug.print dbsones
  2419. debug.print dbsdecimals
  2420. if dbstime > 10 then
  2421. fBStens.ImageA = Eval(dbstens)
  2422. fBSones.ImageA = Eval(dbsones)
  2423. else
  2424. fBStens.ImageA = Eval (dbsones + 10)
  2425. fBSones.ImageA = Eval(dbsdecimals)
  2426. end if
  2427. ' if dbstime > 10 then
  2428. ' dBallSave1.SetValue (dbstens + 1)
  2429. ' dBallSave2.SetValue (dbsones + 1)
  2430. ' else
  2431. ' dBallSave1.SetValue (dbsones + 1+10)
  2432. ' dBallSave2.SetValue (dbsdecimals + 1)
  2433. ' end if
  2434.  
  2435. dbstime = dbstime - dbsdelta
  2436. BallSaverUpdateTimer.Enabled = True
  2437. End Sub
  2438.  
  2439. Sub StopBallSaver
  2440. BallSaverUpdateTimer.Enabled = False
  2441. BallSaverTimer2Expired.Enabled = False
  2442. If ExtraBallsAwards(CurrentPlayer) = 0 Then
  2443. ResetBallSaveDisplay
  2444. Else
  2445. SetExtraBallDisplay
  2446. End If
  2447. bBallSaverActive = False
  2448. End Sub
  2449.  
  2450.  
  2451. ' The ball saver timer has expired. Turn it off AND reset the game flag
  2452. '
  2453. Sub BallSaverTimerExpired_Timer()
  2454. If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimerExpired_Timer"
  2455. BallSaverTimerExpired.Enabled = False
  2456. BallSaverUpdateTimer.Enabled = False
  2457.  
  2458. ' clear the LED display, give extra 2 second
  2459. If ExtraBallsAwards(CurrentPlayer) = 0 Then
  2460. ResetBallSaveDisplay
  2461. Else
  2462. SetExtraBallDisplay
  2463. End If
  2464. BallSaverTimer2Expired.Interval = 2000
  2465. BallSaverTimer2Expired.Enabled = True
  2466. End Sub
  2467.  
  2468. Sub ResetBallSaveDisplay
  2469. ' dBallSave1.SetValue 0
  2470. ' dBallSave2.SetValue 0
  2471. fBStens.ImageA = "blank"
  2472. fBSones.ImageA = "blank"
  2473. End Sub
  2474.  
  2475.  
  2476. Sub BallSaverTimer2Expired_Timer()
  2477. If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimer2Expired_Timer"
  2478. BallSaverTimer2Expired.Enabled = False
  2479.  
  2480. ' clear the flag
  2481. bBallSaverActive = False
  2482. End Sub
  2483.  
  2484. Sub BallSaverUpdateTimer_Timer()
  2485. Dim tmp
  2486. 'If debugGeneral Then debug.print "*****SUB:" & "BallSaverUpdateTimer_Timer " & dbstime
  2487.  
  2488. dbstens = Int(dbstime/10)
  2489. dbsones = Int(dbstime-dbstens*10)
  2490. dbsdecimals = Int((dbstime-dbstens*10-dbsones)*10)
  2491.  
  2492. if dbstime > 10 then
  2493. fBStens.ImageA = Eval(dbstens)
  2494. fBSones.ImageA = Eval(dbsones)
  2495. else
  2496. fBStens.ImageA = Eval (dbsones + 10)
  2497. fBSones.ImageA = Eval(dbsdecimals)
  2498. end if
  2499. ' if dbstime > 10 then
  2500. ' 'DEBUG.PRINT dbstime & " : " & dbstens & " : " & dbsones & " : " & dbsdecimals
  2501. ' dBallSave1.SetValue (dbstens + 1)
  2502. ' dBallSave2.SetValue (dbsones + 1)
  2503. ' else
  2504. ' 'DEBUG.PRINT dbstime & " : " & dbstens & " : " & dbsones & " : " & dbsdecimals
  2505. ' dBallSave1.SetValue (dbsones + 1+10)
  2506. ' dBallSave2.SetValue (dbsdecimals + 1)
  2507. ' end if
  2508. dbstime = dbstime - dbsdelta
  2509.  
  2510. End Sub
  2511.  
  2512. 'Version of Ballsaver using light insert
  2513. 'Sub EnableBallSaver(seconds)
  2514. ' If debugGeneral Then debug.print "*****SUB:EnableBallSaver, seconds=" & seconds
  2515. ' ' set our game flag
  2516. ' bBallSaverActive = True
  2517. ' bBallSaverReady = False
  2518. ' ' start the timer
  2519. ' BallSaverTimerExpired.Interval = 1000 * seconds
  2520. ' BallSaverTimerExpired.Enabled = True
  2521. ' BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
  2522. ' BallSaverSpeedUpTimer.Enabled = True
  2523. ' ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
  2524. ' lLightShootAgain.BlinkInterval = 160
  2525. ' lLightShootAgain.State = 2
  2526. 'End Sub
  2527. '
  2528. '' The ball saver timer has expired. Turn it off AND reset the game flag
  2529. ''
  2530. 'Sub BallSaverTimerExpired_Timer()
  2531. ' If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimerExpired_Timer"
  2532. ' BallSaverTimerExpired.Enabled = False
  2533. ' ' clear the flag
  2534. ' bBallSaverActive = False
  2535. ' ' if you have a ball saver light then turn it off at this point
  2536. ' lLightShootAgain.State = 0
  2537. 'End Sub
  2538. '
  2539. 'Sub BallSaverSpeedUpTimer_Timer()
  2540. ' If debugGeneral Then debug.print "*****SUB:" & "BallSaverSpeedUpTimer_Timer"
  2541. ' BallSaverSpeedUpTimer.Enabled = False
  2542. ' ' Speed up the blinking
  2543. ' lLightShootAgain.BlinkInterval = 80
  2544. ' lLightShootAgain.State = 2
  2545. 'End Sub
  2546. ' *********************************************************************
  2547. ' Supporting Score Functions
  2548. ' *********************************************************************
  2549.  
  2550. Dim checkones
  2551. Sub AddScore(points)
  2552. Dim xmultiplier
  2553. xMultiplier = BallsOnPlayfield
  2554. If xMultiplier = 0 then xMultiplier = 1
  2555.  
  2556. If(Tilted = False)Then
  2557. ' add the points to the current players score variable
  2558. Score(CurrentPlayer) = Score(CurrentPlayer) + (points * xMultiplier)
  2559.  
  2560. 'If (Score(CurrentPlayer) mod 10) > checkones Then
  2561. ' msgbox "Score changed by one"
  2562. ' checkones = (Score(CurrentPlayer) mod 10)
  2563. 'End if
  2564.  
  2565. ' update the score displays
  2566. DMDScore
  2567. End if
  2568.  
  2569. If debugGeneral Then debug.print "*****SUB:" & "AddScore(" & points * xMultiplier & "), Total=" & Score(CurrentPlayer)
  2570. ' you may wish to check to see if the player has gotten a replay
  2571. End Sub
  2572.  
  2573.  
  2574. Sub AddScoreForReactor()
  2575. ' add the points to the current players score variable
  2576. Score(CurrentPlayer) = Score(CurrentPlayer) + (1)
  2577. ReactorScore(CurrentPlayer) = ReactorScore(CurrentPlayer) + 1
  2578.  
  2579. ' update the score displays
  2580. DMDScore
  2581.  
  2582. If debugGeneral Then debug.print "*****SUB:" & "AddScore(1), Total=" & Score(CurrentPlayer)
  2583. End Sub
  2584.  
  2585. Sub AddToTotalReactorReward
  2586.  
  2587. Dim xmultiplier, rtmp
  2588. xMultiplier = BallsOnPlayfield
  2589. If xMultiplier = 0 then xMultiplier = 1
  2590.  
  2591. rtmp = ReactorValue(CurrentPlayer) * xMultiplier
  2592. ReactorReactorTotalReward(CurrentPlayer) = ReactorReactorTotalReward(CurrentPlayer) + rtmp
  2593.  
  2594. debug.print "AddToTotalReactorReward " & ReactorValue(CurrentPlayer) & ": Multiplier " & xMultiplier & "= " & rtmp & ": Sum = " & ReactorReactorTotalReward(CurrentPlayer)
  2595. 'msgbox ReactorValue(CurrentPlayer) & ": Multiplier " & xMultiplier & "= " & rtmp & ": Sum = " & ReactorReactorTotalReward(CurrentPlayer)
  2596. End Sub
  2597.  
  2598. Sub AddScoreSpecial2(points, points2) 'Increase Score and Reactor value
  2599. If debugGeneral Then debug.print "*****SUB:" & "AddScoreSpecial(" & points & ")"
  2600.  
  2601. If(Tilted = False)Then
  2602. ' add the points to the current players score variable
  2603. 'Score(CurrentPlayer) = Score(CurrentPlayer) + points
  2604.  
  2605. If ReactorValue(CurrentPlayer) < ReactorValueMax(CurrentPlayer) Then
  2606.  
  2607. ReactorValue(CurrentPlayer) = ReactorValue(CurrentPlayer) + points2
  2608. If ReactorValue(CurrentPlayer) >= ReactorValueMax(CurrentPlayer) Then
  2609. ReactorValue(CurrentPlayer) = ReactorValueMax(CurrentPlayer)
  2610. End If
  2611. AddReactorBonus points2
  2612. tReactorValue.text = ReactorValue(CurrentPlayer)
  2613. End If
  2614.  
  2615. AddScore(points)
  2616.  
  2617. End if
  2618.  
  2619. ' you may wish to check to see if the player has gotten a replay
  2620. End Sub
  2621.  
  2622. Sub AddScoreSpecial(points) 'Increase Score and Reactor value
  2623. If debugGeneral Then debug.print "*****SUB:" & "AddScoreSpecial(" & points & ")"
  2624.  
  2625. AddScoreSpecial2 points, points
  2626.  
  2627. End Sub
  2628.  
  2629. Sub SetReactorMaxed
  2630. Dim delta
  2631. 'Update Reactor value to max
  2632. delta = ReactorValueMax(CurrentPlayer) - ReactorValue(CurrentPlayer)
  2633. ReactorValue(CurrentPlayer) = ReactorValueMax(CurrentPlayer)
  2634.  
  2635. 'Update Reactor Bonus Award
  2636. If delta > 0 Then
  2637. AddReactorBonus delta
  2638. End If
  2639. End Sub
  2640.  
  2641.  
  2642. ' Add bonus to the bonuspoints AND update the score board
  2643.  
  2644. 'Sub AddBonus(points)
  2645. ' If debugGeneral Then debug.print "*****SUB:" & "AddBonus(" & points & ")"
  2646. '
  2647. ' If(Tilted = False)Then
  2648. ' ' add the bonus to the current players bonus variable
  2649. ' BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points
  2650. ' ' update the score displays
  2651. ' DMDScore
  2652. ' End if
  2653. '
  2654. '' you may wish to check to see if the player has gotten a replay
  2655. 'End Sub
  2656. '
  2657. '' Add some points to the current Jackpot.
  2658. ''
  2659. 'Sub AddJackpot(points) 'not used in this table
  2660. 'End Sub
  2661.  
  2662.  
  2663.  
  2664. Sub AddBonusMultiplier(n)
  2665. If debugGeneral Then debug.print "*****SUB:" & "AddBonusMultiplier(" & n & ")"
  2666.  
  2667. Dim NewBonusLevel
  2668. ' if not at the maximum bonus level
  2669. if(BonusMultiplier(CurrentPlayer) + n <= MaxMultiplier)then
  2670. ' then add and set the lights
  2671. NewBonusLevel = BonusMultiplier(CurrentPlayer) + n
  2672. SetBonusMultiplier(NewBonusLevel)
  2673.  
  2674. End if
  2675. End Sub
  2676.  
  2677. ' Set the Bonus Multiplier to the specified level AND set any lights accordingly
  2678. ' There is no bonus multiplier lights in this table
  2679. Sub SetBonusMultiplier(Level)
  2680. Dim obj
  2681.  
  2682. If debugGeneral Then debug.print "*****SUB:" & "SetBonusMultiplier(" & Level & ")"
  2683. ' Set the multiplier to the specified level
  2684. BonusMultiplier(CurrentPlayer) = Level
  2685.  
  2686. ' Update the lights
  2687. Select Case Level:
  2688. Case 1:
  2689. l2X.State = 0
  2690. l3X.State = 0
  2691. l4X.State = 0
  2692. Case 2:
  2693. DOF 166, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 2X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
  2694. UDMD "BONUS 2X", "", 1800
  2695. l2X.State = 1
  2696. l3X.State = 0
  2697. l4X.State = 0
  2698.  
  2699. GI37.TimerEnabled = True
  2700. GICoreCount = 0
  2701. For each obj in aGICore
  2702. obj.state = 0
  2703. PuPEvent 5
  2704. Next
  2705. Case 3:
  2706. DOF 166, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 3X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
  2707. UDMD "BONUS 3X", "", 1800
  2708. l2X.State = 1
  2709. l3X.State = 1
  2710. l4X.State = 0
  2711.  
  2712. GI37.TimerEnabled = True
  2713. GICoreCount = 0
  2714. For each obj in aGICore
  2715. obj.state = 0
  2716. PuPEvent 6
  2717. Next
  2718. Case 4:
  2719. DOF 166, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 4X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
  2720. UDMD "BONUS 4X", "", 1800
  2721. l2X.State = 1
  2722. l3X.State = 1
  2723. l4X.State = 1
  2724.  
  2725. GI37.TimerEnabled = True
  2726. For each obj in aGICore
  2727. obj.state = 0
  2728. PuPEvent 7
  2729. Next
  2730. Case Else:
  2731. l2X.State = 1
  2732. l3X.State = 1
  2733. l4X.State = 1
  2734. End Select
  2735.  
  2736.  
  2737. End Sub
  2738.  
  2739. Dim GICoreCount,GICoredirection, GICoreSweep
  2740. GICoredirection = 1
  2741. GI37.TimerInterval=25
  2742. Sub GI37_Timer
  2743. Dim obj
  2744. For Each obj in aGICore
  2745. SetLight obj, "orange", 0
  2746. Next
  2747.  
  2748. aGICore((GICoreCount+0) Mod 13).state = 1
  2749. aGICore((GICoreCount+1) Mod 13).state = 1
  2750. aGICore((GICoreCount+2) Mod 13).state = 1
  2751. aGICore((GICoreCount+3) Mod 13).state = 0
  2752. aGICore((GICoreCount+4) Mod 13).state = 0
  2753. aGICore((GICoreCount+5) Mod 13).state = 0
  2754. aGICore((GICoreCount+6) Mod 13).state = 0
  2755. aGICore((GICoreCount+7) Mod 13).state = 0
  2756. aGICore((GICoreCount+8) Mod 13).state = 0
  2757. aGICore((GICoreCount+9) Mod 13).state = 0
  2758. aGICore((GICoreCount+10) Mod 13).state = 0
  2759. aGICore((GICoreCount+11) Mod 13).state = 0
  2760. aGICore((GICoreCount+12) Mod 13).state = 0
  2761. GICoreCount = GICoreCount + GICoredirection
  2762. If GICoreCount = 10 Then
  2763. GICoredirection = -1
  2764. GICoreSweep = GICoreSweep + 1
  2765. ElseIf GICoreCount = 0 Then
  2766. GICoreSweep = GICoreSweep + 1
  2767. GICoredirection = 1
  2768. End If
  2769.  
  2770. If GICoreSweep = 6 Then 'Sweep done, return lights to normal
  2771. GI37.TimerEnabled = False
  2772. GICoreDirection = 1
  2773. GICoreCount = 0
  2774. GICoreSweep = 0
  2775.  
  2776. For each obj in aGICore
  2777. obj.state = 1
  2778. SetLight obj, GiColor, 1
  2779. Next
  2780.  
  2781. SetLight l1, "white", 0
  2782. SetLight l2, "white", 0
  2783. SetLight l3, "white", 0
  2784. SetLight l4, "white", 0
  2785.  
  2786. End If
  2787.  
  2788. End Sub
  2789.  
  2790.  
  2791.  
  2792. Sub AwardExtraBall()
  2793. If CoopMode = 0 Then
  2794. If NOT bExtraBallWonThisBall Then 'Use if you want to limit to 1 extraball
  2795. DMDFlush
  2796. DOF 167, DOFPulse: DMD "", eNone, "_", eNone, Centerline(2, "EXTRA BALL WON"), eBlink, "", eNone, 1000, True, "tna_extraball"
  2797. UDMD "EXTRA BALL", "AWARDED", 1000
  2798. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  2799. debug.print "ExtraBall count " & ExtraBallsAwards(CurrentPlayer)
  2800. ' bExtraBallWonThisBall = True
  2801.  
  2802. 'Set Insert or Display
  2803. SetExtraBallDisplay
  2804. End If
  2805. End If
  2806. End Sub
  2807.  
  2808. Sub AwardExtraBallNoCallout()
  2809. If CoopMode = 0 Then
  2810. If NOT bExtraBallWonThisBall Then 'Use if you want to limit to 1 extraball
  2811. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  2812. debug.print "ExtraBall count " & ExtraBallsAwards(CurrentPlayer)
  2813. ' bExtraBallWonThisBall = True
  2814.  
  2815. 'Set Insert or Display
  2816. SetExtraBallDisplay
  2817. End If
  2818. End If
  2819. End Sub
  2820.  
  2821. Sub SetExtraBallDisplay
  2822. fBStens.ImageA = "e"
  2823. fBSones.ImageA = "b"
  2824. End Sub
  2825.  
  2826. Sub AwardSpecial()
  2827. DMDFlush
  2828. DMD "", eNone, "_", eNone, Centerline(2, "EXTRA GAME WON"), eBlink, "", eNone, 1000, True, SoundFXDOF("fx_knocker", 129, DOFPulse, DOFKnocker)
  2829. UDMD "EXTRA GAME", "AWARDED", 1000
  2830. Credits = Credits + 1
  2831. DOF 123, DOFPulse
  2832. DOF 140, DOFOn
  2833. End Sub
  2834.  
  2835. Sub AwardJackpot() 'award a normal jackpot, double or triple jackpot
  2836. DMDFlush
  2837. DOF 123, DOFPulse
  2838. DMD "", eNone, Centerline(1, ("JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(Jackpot)), eBlinkFast, 1000, True, "tna_jackpot"
  2839. UDMD "JACKPOT", Jackpot, 1000
  2840. AddScore Jackpot
  2841. GIGame 1, "purple"
  2842. Pupevent 70
  2843.  
  2844. End Sub
  2845.  
  2846. Sub AwardDoubleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
  2847. DMDFlush
  2848. DOF 123, DOFPulse
  2849. DMD "", eNone, Centerline(1, ("DOUBLE JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(DoubleJackpot)), eBlinkFast, 1000, True, "tna_doublejackpot"
  2850. UDMD "DOUBLE JACKPOT", DoubleJackpot, 1000
  2851. AddScore DoubleJackpot
  2852. GIGame 9, "purple"
  2853. Pupevent 71
  2854. End Sub
  2855.  
  2856. Sub AwardTripleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
  2857. DOF 132, DOFPulse
  2858. DMDFlush
  2859. DMD "", eNone, Centerline(1, ("TRIPLE JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(TripleJackpot)), eBlinkFast, 1000, True, "tna_triplejackpot"
  2860. UDMD "TRIPLE JACKPOT", TripleJackpot, 1000
  2861. AddScore TripleJackpot
  2862. GIGame 10, "purple"
  2863. Pupevent 72
  2864. End Sub
  2865.  
  2866. Sub AwardSuperJackpot()
  2867. DOF 133, DOFPulse
  2868. DMDFlush
  2869. DMD "", eNone, Centerline(1, ("SUPER JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(SuperJackpot)), eBlinkFast, 1000, True, "tna_superjackpot"
  2870. UDMD "SUPER JACKPOT", SuperJackpot, 1000
  2871. AddScore SuperJackpot
  2872. GIGame 11, "purple"
  2873. Pupevent 73
  2874. End Sub
  2875.  
  2876.  
  2877. Sub AwardSkillshot()
  2878. DMDFlush
  2879. ' If LaneSaveCount(CurrentPlayer) = 1 Then
  2880. DOF 168, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SKILLSHOT"), eBlinkfast, 1000, True, "tna_lanesavelevelone"
  2881. UDMD "SKILLSHOT", "LANE SAVE +1", 1000
  2882. ' Else
  2883. ' DOF 168, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SKILLSHOT"), eBlinkfast, 1000, True, "tna_lanesaveincreased"
  2884. ' End If
  2885. debug.print "Skillshot"
  2886. AddScore SkillshotValue
  2887. GiEffect 2
  2888. PuPEvent 32
  2889.  
  2890. AwardSAVE 1
  2891.  
  2892. End Sub
  2893.  
  2894.  
  2895. Sub AwardHandsFreeSkillshot()
  2896. DMDFlush
  2897. DOF 169, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SKILLSHOT"), eBlinkfast, 1000, True, "tna_superskillshot"
  2898. debug.print "Super Skillshot"
  2899. UDMD "SUPER", "SKILLSHOT", 1000
  2900. AddScore SkillshotValue
  2901. GiEffect 2
  2902. Pupevent 33
  2903.  
  2904. AwardSAVE 1
  2905. SetReactorReady
  2906. End Sub
  2907.  
  2908.  
  2909.  
  2910. '*****************************
  2911. ' Section; Load / Save / Highscore
  2912. '*****************************
  2913.  
  2914. Sub Reseths
  2915. If debugHighScore Then debug.print "Sub:Reseths"
  2916. Dim x
  2917. x = ""
  2918. If(x <> "")Then HighScore(0) = CDbl(x)Else HighScore(0) = 100000 End If
  2919. If(x <> "")Then HighScoreName(0) = x Else HighScoreName(0) = "TNA" End If
  2920. If(x <> "")then HighScore(1) = CDbl(x)Else HighScore(1) = 100000 End If
  2921. If(x <> "")then HighScoreName(1) = x Else HighScoreName(1) = "TNA" End If
  2922. If(x <> "")then HighScore(2) = CDbl(x)Else HighScore(2) = 100000 End If
  2923. If(x <> "")then HighScoreName(2) = x Else HighScoreName(2) = "TNA" End If
  2924. If(x <> "")then HighScore(3) = CDbl(x)Else HighScore(3) = 100000 End If
  2925. If(x <> "")then HighScoreName(3) = x Else HighScoreName(3) = "TNA" End If
  2926. If(x <> "")then Credits = CInt(x)Else Credits = 0 End If
  2927. ' If(x <> "")then TotalGamesPlayed = CInt(x)Else TotalGamesPlayed = 0 End If
  2928. Savehs
  2929. End Sub
  2930.  
  2931. Sub Loadhs
  2932. If debugHighScore Then debug.print "Sub:Loadhs"
  2933. Dim x
  2934. x = LoadValue(TableName, "HighScore1")
  2935. If(x <> "")Then HighScore(0) = CDbl(x)Else HighScore(0) = 100000 End If
  2936. x = LoadValue(TableName, "HighScore1Name")
  2937. If(x <> "")Then HighScoreName(0) = x Else HighScoreName(0) = "TNA" End If
  2938. x = LoadValue(TableName, "HighScore2")
  2939. If(x <> "")then HighScore(1) = CDbl(x)Else HighScore(1) = 100000 End If
  2940. x = LoadValue(TableName, "HighScore2Name")
  2941. If(x <> "")then HighScoreName(1) = x Else HighScoreName(1) = "TNA" End If
  2942. x = LoadValue(TableName, "HighScore3")
  2943. If(x <> "")then HighScore(2) = CDbl(x)Else HighScore(2) = 100000 End If
  2944. x = LoadValue(TableName, "HighScore3Name")
  2945. If(x <> "")then HighScoreName(2) = x Else HighScoreName(2) = "TNA" End If
  2946. x = LoadValue(TableName, "HighScore4")
  2947. If(x <> "")then HighScore(3) = CDbl(x)Else HighScore(3) = 100000 End If
  2948. x = LoadValue(TableName, "HighScore4Name")
  2949. If(x <> "")then HighScoreName(3) = x Else HighScoreName(3) = "TNA" End If
  2950. x = LoadValue(TableName, "Credits")
  2951. If(x <> "")then Credits = CInt(x)Else Credits = 0 End If
  2952. x = LoadValue(TableName, "TotalGamesPlayed")
  2953. If(x <> "")then TotalGamesPlayed = CInt(x)Else TotalGamesPlayed = 0 End If
  2954. End Sub
  2955.  
  2956. Sub Savehs
  2957. If debugHighScore Then debug.print "Sub:Savehs"
  2958.  
  2959. SaveValue TableName, "HighScore1", HighScore(0)
  2960. SaveValue TableName, "HighScore1Name", HighScoreName(0)
  2961. SaveValue TableName, "HighScore2", HighScore(1)
  2962. SaveValue TableName, "HighScore2Name", HighScoreName(1)
  2963. SaveValue TableName, "HighScore3", HighScore(2)
  2964. SaveValue TableName, "HighScore3Name", HighScoreName(2)
  2965. SaveValue TableName, "HighScore4", HighScore(3)
  2966. SaveValue TableName, "HighScore4Name", HighScoreName(3)
  2967. SaveValue TableName, "Credits", Credits
  2968. SaveValue TableName, "TotalGamesPlayed", TotalGamesPlayed
  2969. End Sub
  2970.  
  2971. ' ***********************************************************
  2972. ' High Score Initals Entry Functions - based on Black's code
  2973. ' ***********************************************************
  2974.  
  2975. Dim hsbModeActive
  2976. Dim hsEnteredName
  2977. Dim hsEnteredDigits(3)
  2978. Dim hsCurrentDigit
  2979. Dim hsValidLetters
  2980. Dim hsCurrentLetter
  2981. Dim hsLetterFlash
  2982.  
  2983. Sub CheckHighscore()
  2984. If debugHighScore Then debug.print "Sub:CheckHighscore"
  2985.  
  2986. If CoopMode = 0 Then
  2987. Dim tmp
  2988. ' tmp = Score(1)
  2989. ' If Score(2) > tmp Then tmp = Score(2)
  2990. ' If Score(3) > tmp Then tmp = Score(3)
  2991. ' If Score(4) > tmp Then tmp = Score(4)
  2992.  
  2993. tmp = Score(CurrentPlayer)
  2994.  
  2995. If tmp > HighScore(1)Then 'add 1 credit for beating the highscore
  2996. AwardSpecial
  2997. End If
  2998.  
  2999. If tmp > HighScore(3) Then
  3000. HighScore(3) = tmp
  3001. 'enter player's name
  3002. HighScoreEntryInit()
  3003. Else
  3004. EndOfBallComplete()
  3005. End If
  3006. Else 'Co op mode running so no high score allowed
  3007. EndOfBallComplete()
  3008. End If
  3009. End Sub
  3010.  
  3011. Sub HighScoreEntryInit()
  3012. If debugHighScore Then debug.print "Sub:HighScoreEntryInit"
  3013. hsbModeActive = True
  3014. PlaySound SoundFXDOF("fx_knocker", 129, DOFPulse, DOFKnocker)
  3015.  
  3016. Credits = Credits + 1
  3017. DOF 123, DOFPulse
  3018.  
  3019. hsLetterFlash = 0
  3020.  
  3021. hsEnteredDigits(0) = " "
  3022. hsEnteredDigits(1) = " "
  3023. hsEnteredDigits(2) = " "
  3024. hsCurrentDigit = 0
  3025.  
  3026. hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ'<>*+-/=\^0123456789`" ' ` is back arrow
  3027. hsCurrentLetter = 1
  3028. DMDFlush()
  3029. HighScoreDisplayNameNow()
  3030.  
  3031. HighScoreFlashTimer.Interval = 250
  3032. HighScoreFlashTimer.Enabled = True
  3033. End Sub
  3034.  
  3035. Sub EnterHighScoreKey(keycode)
  3036. If debugHighScore Then debug.print "Sub:EnterHighScoreKey"
  3037.  
  3038. If keycode = LeftFlipperKey Then
  3039. Playsound "fx_Previous"
  3040. hsCurrentLetter = hsCurrentLetter - 1
  3041. if(hsCurrentLetter = 0)then
  3042. hsCurrentLetter = len(hsValidLetters)
  3043. end if
  3044. HighScoreDisplayNameNow()
  3045. End If
  3046.  
  3047. If keycode = RightFlipperKey Then
  3048. Playsound "fx_Next"
  3049. hsCurrentLetter = hsCurrentLetter + 1
  3050. if(hsCurrentLetter > len(hsValidLetters))then
  3051. hsCurrentLetter = 1
  3052. end if
  3053. HighScoreDisplayNameNow()
  3054. End If
  3055.  
  3056. If keycode = StartGameKey Then
  3057. if(mid(hsValidLetters, hsCurrentLetter, 1) <> "`")then
  3058. playsound "fx_Enter"
  3059. hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
  3060. hsCurrentDigit = hsCurrentDigit + 1
  3061. if(hsCurrentDigit = 3)then
  3062. HighScoreCommitName()
  3063. else
  3064. HighScoreDisplayNameNow()
  3065. end if
  3066. else
  3067. playsound "fx_Esc"
  3068. hsEnteredDigits(hsCurrentDigit) = " "
  3069. if(hsCurrentDigit > 0)then
  3070. hsCurrentDigit = hsCurrentDigit - 1
  3071. end if
  3072. HighScoreDisplayNameNow()
  3073. end if
  3074. end if
  3075. End Sub
  3076.  
  3077. Sub HighScoreDisplayNameNow()
  3078. If debugHighScore Then debug.print "Sub:HighScoreDisplayNameNow"
  3079. HighScoreFlashTimer.Enabled = False
  3080. hsLetterFlash = 0
  3081. HighScoreDisplayName()
  3082. HighScoreFlashTimer.Enabled = True
  3083. End Sub
  3084.  
  3085. Sub HighScoreDisplayName()
  3086. If debugHighScore Then debug.print "Sub:HighScoreDisplayName"
  3087. Dim i
  3088. Dim TempTopStr
  3089. Dim TempBotStr
  3090.  
  3091. TempTopStr = "ENTER YOUR INITIALS"
  3092. dLine(1) = TempTopStr
  3093. DMDUpdate 1
  3094.  
  3095. TempBotStr = " > "
  3096. if(hsCurrentDigit > 0)then TempBotStr = TempBotStr & hsEnteredDigits(0)
  3097. if(hsCurrentDigit > 1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
  3098. if(hsCurrentDigit > 2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
  3099.  
  3100. if(hsCurrentDigit <> 3)then
  3101. if(hsLetterFlash <> 0)then
  3102. TempBotStr = TempBotStr & "_"
  3103. else
  3104. TempBotStr = TempBotStr & mid(hsValidLetters, hsCurrentLetter, 1)
  3105. end if
  3106. end if
  3107.  
  3108. if(hsCurrentDigit < 1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
  3109. if(hsCurrentDigit < 2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
  3110.  
  3111. TempBotStr = TempBotStr & " < "
  3112. dLine(2) = CenterLine(2, TempBotStr)
  3113. DMDUpdate 2
  3114. pupDMDDisplay "default","ENTER YOUR INITALS^"&CenterLine(2, TempBotStr),"",100,0,11
  3115. Pupevent 103
  3116. End Sub
  3117.  
  3118. Sub HighScoreFlashTimer_Timer()
  3119. If debugHighScore Then debug.print "Sub:HighScoreFlashTimer_Timer"
  3120. HighScoreFlashTimer.Enabled = False
  3121. hsLetterFlash = hsLetterFlash + 1
  3122. if(hsLetterFlash = 2)then hsLetterFlash = 0
  3123. HighScoreDisplayName()
  3124. UDMD "NEW HIGH SCORE", "ENTER INITIALS", 5000
  3125.  
  3126. HighScoreFlashTimer.Enabled = True
  3127. End Sub
  3128.  
  3129. Sub HighScoreCommitName()
  3130. If debugHighScore Then debug.print "Sub:HighScoreCommitName"
  3131. HighScoreFlashTimer.Enabled = False
  3132. 'hsbModeActive = False
  3133.  
  3134. DMD "", eNone, "", eNone, "", eNone, "", eNone, 1000, True, ""
  3135. vpmtimer.addtimer 800, "HighscoreDelay '"
  3136.  
  3137. hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
  3138. if(hsEnteredName = " ")then
  3139. hsEnteredName = "YOU"
  3140. end if
  3141.  
  3142. HighScoreName(3) = hsEnteredName
  3143. SortHighscore
  3144. EndOfBallComplete()
  3145. pupDMDDisplay "default","","",1,0,11
  3146. End Sub
  3147.  
  3148. Sub HighscoreDelay
  3149. hsbModeActive = False
  3150. End Sub
  3151.  
  3152. Sub SortHighscore
  3153. If debugHighScore Then debug.print "Sub:SortHighscore"
  3154. Dim tmp, tmp2, i, j
  3155. For i = 0 to 3
  3156. For j = 0 to 2
  3157. If HighScore(j) < HighScore(j + 1)Then
  3158. tmp = HighScore(j + 1)
  3159. tmp2 = HighScoreName(j + 1)
  3160. HighScore(j + 1) = HighScore(j)
  3161. HighScoreName(j + 1) = HighScoreName(j)
  3162. HighScore(j) = tmp
  3163. HighScoreName(j) = tmp2
  3164. End If
  3165. Next
  3166. Next
  3167. End Sub
  3168.  
  3169. ' *****************************************************************************
  3170. ' JP's Reduced Display Driver Functions for Slimer (based on script by Black)
  3171. ' only 5 effects: none, scroll left, scroll right, blink and blinkfast
  3172. ' 4 Lines, treats all 4 lines as text
  3173. ' Example format:
  3174. ' DMD "backgnd", eNone,"text1", eNone,"text2", eNone, "centertext", eNone, 250, True, "sound"
  3175. ' Short names:
  3176. ' dq = display queue
  3177. ' de = display effect
  3178. ' "_" in a line means: do nothing
  3179. ' *****************************************************************************
  3180.  
  3181. Const eNone = 0 ' Instantly displayed
  3182. Const eScrollLeft = 1 ' scroll on from the right
  3183. Const eScrollRight = 2 ' scroll on from the left
  3184. Const eBlink = 3 ' Blink (blinks for 'TimeOn')
  3185. Const eBlinkFast = 4 ' Blink (blinks for 'TimeOn') at user specified intervals (fast speed)
  3186. Const dqSize = 64
  3187.  
  3188. Dim dqHead
  3189. Dim dqTail
  3190. Dim deSpeed
  3191. Dim deBlinkSlowRate
  3192. Dim deBlinkFastRate
  3193.  
  3194. Dim dCharsPerLine(3)
  3195. Dim dLine(3)
  3196. Dim deCount(3)
  3197. Dim deCountEnd(3)
  3198. Dim deBlinkCycle(3)
  3199.  
  3200. Dim dqText(3, 64)
  3201. Dim dqEffect(3, 64)
  3202. Dim dqTimeOn(64)
  3203. Dim dqbFlush(64)
  3204. Dim dqSound(64)
  3205.  
  3206. Sub DMD_Init() 'default/startup values
  3207. Dim i, j
  3208. DMDFlush()
  3209. deSpeed = 20
  3210. deBlinkSlowRate = 5
  3211. deBlinkFastRate = 2
  3212. dCharsPerLine(0) = 3
  3213. dCharsPerLine(1) = 19
  3214. dCharsPerLine(2) = 19
  3215. dCharsPerLine(3) = 13
  3216. For i = 0 to 3
  3217. dLine(i) = Space(dCharsPerLine(i))
  3218. deCount(i) = 0
  3219. deCountEnd(i) = 0
  3220. deBlinkCycle(i) = 0
  3221. dqTimeOn(i) = 0
  3222. dqbFlush(i) = True
  3223. dqSound(i) = ""
  3224. Next
  3225. For i = 0 to 3
  3226. For j = 0 to 64
  3227. dqText(i, j) = ""
  3228. dqEffect(i, j) = eNone
  3229. Next
  3230. Next
  3231. DMD "", eNone, "", eNone, "", eNone, "", eNone, 25, True, ""
  3232. End Sub
  3233.  
  3234. Sub DMDFlush()
  3235. Dim i
  3236. DMDTimer.Enabled = False
  3237. DMDEffectTimer.Enabled = False
  3238. dqHead = 0
  3239. dqTail = 0
  3240. For i = 0 to 3
  3241. deCount(i) = 0
  3242. deCountEnd(i) = 0
  3243. deBlinkCycle(i) = 0
  3244. Next
  3245. If UseUltraDMD > 0 Then UltraDMD.CancelRendering
  3246. End Sub
  3247.  
  3248. Sub DMDScoreNow()
  3249. DMDFlush()
  3250. DMDScore()
  3251. End Sub
  3252.  
  3253. Sub DMDScore()
  3254. Dim tmp0, tmp1, tmp2, tmp3
  3255. Dim CoopScore, i
  3256.  
  3257. If CoopMode = 1 Then 'IF Co-Op mode 1 selected, all players get same score
  3258. CoopScore = Score(CurrentPlayer)
  3259. ' For i = 1 To MaxPlayers
  3260. ' Score(i) = CoopScore
  3261. ' Next
  3262. Score(1) = (Int(CoopScore / 10) * 10) + ReactorScore(1)
  3263. Score(2) = (Int(CoopScore / 10) * 10) + ReactorScore(2)
  3264. Score(3) = (Int(CoopScore / 10) * 10) + ReactorScore(3)
  3265. Score(4) = (Int(CoopScore / 10) * 10) + ReactorScore(4)
  3266.  
  3267. ElseIf CoopMode = 2 Then 'Player 1,3 share score. Player 2,4 share score
  3268. Select Case CurrentPlayer
  3269. Case 1
  3270. Score(3) = (Int(Score(1) / 10) * 10) + ReactorScore(3)
  3271. Case 2
  3272. Score(4) = (Int(Score(2) / 10) * 10) + ReactorScore(4)
  3273. Case 3
  3274. Score(1) = (Int(Score(3) / 10) * 10) + ReactorScore(1)
  3275. Case 4
  3276. Score(2) = (Int(Score(4) / 10) * 10) + ReactorScore(2)
  3277. End Select
  3278. End If
  3279.  
  3280. if(dqHead = dqTail)Then
  3281. tmp0 = ""
  3282. tmp1 = FillLine(1, " PLAYER " & CurrentPlayer, FormatScore(Score(CurrentPlayer)))
  3283. tmp2 = FillLine(2, " RVAL:" & FormatScore(ReactorValue(CurrentPlayer)), "BALL" & Balls)
  3284. tmp3 = ""
  3285. DMD tmp0, eNone, tmp1, eNone, tmp2, eNone, tmp3, eNone, 25, True, ""
  3286. End If
  3287.  
  3288. If B2SOn Then
  3289. If CoopMode = 0 Then
  3290. Controller.B2SSetScorePlayer CurrentPlayer, Score(CurrentPlayer)
  3291. Else
  3292. For i = 1 to PlayersPlayingGame
  3293. Controller.B2SSetScorePlayer i, Score(i)
  3294. Next
  3295. End If
  3296. End If
  3297.  
  3298. uDMDScoreUpdate
  3299.  
  3300. End Sub
  3301.  
  3302.  
  3303. ' DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CRITICAL"), eBlinkfast, 1800, True, "tna_reactorcriticalvoice
  3304. Sub DMD(Text0, Effect0, Text1, Effect1, Text2, Effect2, Text3, Effect3, TimeOn, bFlush, Sound) 'the lines are background. top line, bottom line, and centerline
  3305. if(dqTail < dqSize)Then
  3306. if(Text0 = "_")Then
  3307. dqEffect(0, dqTail) = eNone
  3308. dqText(0, dqTail) = "_"
  3309. Else
  3310. dqEffect(0, dqTail) = Effect0
  3311. dqText(0, dqTail) = ExpandLine(Text0, 0)
  3312. End If
  3313.  
  3314. if(Text1 = "_")Then
  3315. dqEffect(1, dqTail) = eNone
  3316. dqText(1, dqTail) = "_"
  3317. Else
  3318. dqEffect(1, dqTail) = Effect1
  3319. dqText(1, dqTail) = ExpandLine(Text1, 1)
  3320. End If
  3321.  
  3322. if(Text2 = "_")Then
  3323. dqEffect(2, dqTail) = eNone
  3324. dqText(2, dqTail) = "_"
  3325. Else
  3326. dqEffect(2, dqTail) = Effect2
  3327. dqText(2, dqTail) = ExpandLine(Text2, 2)
  3328. End If
  3329.  
  3330. if(Text3 = "_")Then
  3331. dqEffect(3, dqTail) = eNone
  3332. dqText(3, dqTail) = "_"
  3333. Else
  3334. dqEffect(3, dqTail) = Effect3
  3335. dqText(3, dqTail) = ExpandLine(Text3, 3)
  3336. End If
  3337.  
  3338. dqTimeOn(dqTail) = TimeOn
  3339. dqbFlush(dqTail) = bFlush
  3340. dqSound(dqTail) = Sound
  3341. dqTail = dqTail + 1
  3342. if(dqTail = 1)Then
  3343. DMDHead()
  3344. End If
  3345. End If
  3346. End Sub
  3347.  
  3348. Sub DMDHead()
  3349. Dim i
  3350. deCount(0) = 0
  3351. deCount(1) = 0
  3352. deCount(2) = 0
  3353. deCount(3) = 0
  3354. DMDEffectTimer.Interval = deSpeed
  3355.  
  3356. For i = 0 to 3
  3357. Select Case dqEffect(i, dqHead)
  3358. Case eNone:deCountEnd(i) = 1
  3359. Case eScrollLeft:deCountEnd(i) = Len(dqText(i, dqHead))
  3360. Case eScrollRight:deCountEnd(i) = Len(dqText(i, dqHead))
  3361. Case eBlink:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  3362. deBlinkCycle(i) = 0
  3363. Case eBlinkFast:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
  3364. deBlinkCycle(i) = 0
  3365. End Select
  3366. Next
  3367.  
  3368.  
  3369.  
  3370. if(dqSound(dqHead) <> "")Then
  3371. PlaySound(dqSound(dqHead))
  3372. End If
  3373. DMDEffectTimer.Enabled = True
  3374. End Sub
  3375.  
  3376. Sub DMDEffectTimer_Timer()
  3377. DMDEffectTimer.Enabled = False
  3378. DMDProcessEffectOn()
  3379. End Sub
  3380.  
  3381. Sub DMDTimer_Timer()
  3382. Dim Head
  3383. DMDTimer.Enabled = False
  3384. Head = dqHead
  3385. dqHead = dqHead + 1
  3386. if(dqHead = dqTail)Then
  3387. if(dqbFlush(Head) = True)Then
  3388. DMDFlush()
  3389. DMDScore()
  3390. Else
  3391. dqHead = 0
  3392. DMDHead()
  3393. End If
  3394. Else
  3395. DMDHead()
  3396. End If
  3397. End Sub
  3398.  
  3399. Sub DMDProcessEffectOn()
  3400. Dim i
  3401. Dim BlinkEffect
  3402. Dim Temp
  3403.  
  3404. BlinkEffect = False
  3405.  
  3406. For i = 0 to 3
  3407. if(deCount(i) <> deCountEnd(i))Then
  3408. deCount(i) = deCount(i) + 1
  3409.  
  3410. select case(dqEffect(i, dqHead))
  3411. case eNone:
  3412. Temp = dqText(i, dqHead)
  3413. case eScrollLeft:
  3414. Temp = Right(dLine(i), dCharsPerLine(i)- 1)
  3415. Temp = Temp & Mid(dqText(i, dqHead), deCount(i), 1)
  3416. case eScrollRight:
  3417. Temp = Mid(dqText(i, dqHead), (dCharsPerLine(i) + 1)- deCount(i), 1)
  3418. Temp = Temp & Left(dLine(i), dCharsPerLine(i)- 1)
  3419. case eBlink:
  3420. BlinkEffect = True
  3421. if((deCount(i)MOD deBlinkSlowRate) = 0)Then
  3422. deBlinkCycle(i) = deBlinkCycle(i)xor 1
  3423. End If
  3424.  
  3425. if(deBlinkCycle(i) = 0)Then
  3426. Temp = dqText(i, dqHead)
  3427. Else
  3428. Temp = Space(dCharsPerLine(i))
  3429. End If
  3430. case eBlinkFast:
  3431. BlinkEffect = True
  3432. if((deCount(i)MOD deBlinkFastRate) = 0)Then
  3433. deBlinkCycle(i) = deBlinkCycle(i)xor 1
  3434. End If
  3435.  
  3436. if(deBlinkCycle(i) = 0)Then
  3437. Temp = dqText(i, dqHead)
  3438. Else
  3439. Temp = Space(dCharsPerLine(i))
  3440. End If
  3441. End Select
  3442.  
  3443. if(dqText(i, dqHead) <> "_")Then
  3444. dLine(i) = Temp
  3445. DMDUpdate i
  3446. End If
  3447. End If
  3448. Next
  3449.  
  3450. if(deCount(0) = deCountEnd(0))and(deCount(1) = deCountEnd(1))and(deCount(2) = deCountEnd(2))and(deCount(3) = deCountEnd(3))Then
  3451.  
  3452. if(dqTimeOn(dqHead) = 0)Then
  3453. DMDFlush()
  3454. Else
  3455. if(BlinkEffect = True)Then
  3456. DMDTimer.Interval = 10
  3457. Else
  3458. DMDTimer.Interval = dqTimeOn(dqHead)
  3459. End If
  3460.  
  3461. DMDTimer.Enabled = True
  3462. End If
  3463. Else
  3464. DMDEffectTimer.Enabled = True
  3465. End If
  3466. End Sub
  3467.  
  3468. Function ExpandLine(TempStr, id) 'id is the number of the dmd line
  3469. If TempStr = "" Then
  3470. TempStr = Space(dCharsPerLine(id))
  3471. Else
  3472. if(Len(TempStr) > Space(dCharsPerLine(id)))Then
  3473. TempStr = Left(TempStr, Space(dCharsPerLine(id)))
  3474. Else
  3475. if(Len(TempStr) < dCharsPerLine(id))Then
  3476. TempStr = TempStr & Space(dCharsPerLine(id)- Len(TempStr))
  3477. End If
  3478. End If
  3479. End If
  3480. ExpandLine = TempStr
  3481. End Function
  3482.  
  3483. Function FormatScore(ByVal Num) 'it returns a string with commas (as in Black's original font)
  3484. dim i
  3485. dim NumString
  3486.  
  3487. NumString = CStr(abs(Num))
  3488.  
  3489. For i = Len(NumString)-3 to 1 step -3
  3490. if IsNumeric(mid(NumString, i, 1))then
  3491. NumString = left(NumString, i-1) & chr(asc(mid(NumString, i, 1)) + 48) & right(NumString, Len(NumString)- i)
  3492. end if
  3493. Next
  3494. FormatScore = NumString
  3495. End function
  3496.  
  3497. Function UDMDFormatScore(ByVal Num) 'it returns a string with commas (as in Black's original font)
  3498. dim i
  3499. dim NumString
  3500.  
  3501. NumString = CStr(abs(Num))
  3502.  
  3503. For i = Len(NumString)-3 to 1 step -3
  3504. if IsNumeric(mid(NumString, i, 1))then
  3505. NumString = left(NumString, i-1) & "," & right(NumString, Len(NumString)- i)
  3506. end if
  3507. Next
  3508. UDMDFormatScore = NumString
  3509. End function
  3510.  
  3511. Function CenterLine(id, aString)
  3512. Dim tmp, tmpStr
  3513. tmp = (dCharsPerLine(id)- Len(aString)) \ 2
  3514. If(tmp + tmp + Len(aString)) < dCharsPerLine(id)Then
  3515. tmpStr = " " & Space(tmp) & aString & Space(tmp)
  3516. Else
  3517. tmpStr = Space(tmp) & aString & Space(tmp)
  3518. End If
  3519. CenterLine = tmpStr
  3520. End Function
  3521.  
  3522. Function FillLine(id, aString, bString)
  3523. Dim tmp, tmpStr
  3524. tmp = dCharsPerLine(id)- Len(aString)- Len(bString)
  3525. tmpStr = aString & Space(tmp) & bString
  3526. FillLine = tmpStr
  3527. End Function
  3528.  
  3529. Function RightLine(id, aString)
  3530. Dim tmp, tmpStr
  3531. tmp = dCharsPerLine(id)- Len(aString)
  3532. tmpStr = Space(tmp) & aString
  3533. RightLine = tmpStr
  3534. End Function
  3535.  
  3536. '*********************
  3537. ' Section; Update DMD - reels
  3538. '*********************
  3539. Dim DesktopMode:DesktopMode = Table1.ShowDT
  3540.  
  3541. Dim Digits(3)
  3542.  
  3543. DMDReels_Init
  3544.  
  3545. Sub DMDReels_Init
  3546. If DesktopMode Then
  3547. 'Desktop
  3548. Digits(0) = Array(d0, d1, d2) 'backdrop
  3549. Digits(1) = Array(d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19, d20, d21) 'upper line
  3550. Digits(2) = Array(d22, d23, d24, d25, d26, d27, d28, d29, d30, d31, d32, d33, d34, d35, d36, d37, d38, d39, d40) 'lower line
  3551. Digits(3) = Array(d41, d42, d43, d44, d45, d46, d47, d48, d49, d50, d51, d52, d53) ' center line
  3552. d54.Visible = 0:d55.Visible = 0:d56.Visible = 0
  3553. Else
  3554. 'FS
  3555. Digits(0) = Array(d54, d55, d56) 'backdrop
  3556. Digits(1) = Array(d57, d58, d59, d60, d61, d62, d63, d64, d65, d66, d67, d68, d69, d70, d71, d72, d73, d74, d75) 'upper line
  3557. Digits(2) = Array(d76, d77, d78, d79, d80, d81, d82, d83, d84, d85, d86, d87, d88, d89, d90, d91, d92, d93, d94) 'lower line
  3558. Digits(3) = Array(d95, d96, d97, d98, d99, d100, d101, d102, d103, d104, d105, d106, d107)
  3559. d0.Visible = 0:d1.Visible = 0:d2.Visible = 0
  3560. End If
  3561. End Sub
  3562.  
  3563. Sub DMDUpdate(id)
  3564. Dim digit, value
  3565.  
  3566. If UseApronDMD = 1 or DesktopMode or hsbModeActive or ResetHighScore = 1 Then
  3567. For digit = 0 to dCharsPerLine(id)-1
  3568. value = ASC(mid(dLine(id), digit + 1, 1))-32
  3569. Digits(id)(digit).SetValue value
  3570. Next
  3571. End If
  3572.  
  3573. End Sub
  3574.  
  3575. '****************************************
  3576. ' Section; Real Time updatess using the GameTimer
  3577. '****************************************
  3578. 'used for all the real time updates
  3579.  
  3580. Sub GameTimer_Timer
  3581. RollingUpdate
  3582. ' add any other real time update subs, like gates or diverters
  3583. End Sub
  3584.  
  3585. '********************************************************************************************
  3586. ' Only for VPX 10.2 and higher.
  3587. ' Section; FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  3588. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  3589. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  3590. '********************************************************************************************
  3591.  
  3592. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first myVersion
  3593.  
  3594. If TypeName(MyLight) = "Light" Then
  3595.  
  3596. If FinalState = 2 Then
  3597. FinalState = MyLight.State 'Keep the current light state
  3598. End If
  3599. MyLight.BlinkInterval = BlinkPeriod
  3600. MyLight.Duration 2, TotalPeriod, FinalState
  3601. ElseIf TypeName(MyLight) = "Flasher" Then
  3602.  
  3603. Dim steps
  3604.  
  3605. ' Store all blink information
  3606. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  3607. If FinalState = 2 Then 'Keep the current flasher state
  3608. FinalState = ABS(MyLight.Visible)
  3609. End If
  3610. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  3611.  
  3612. ' Start blink timer and create timer subroutine
  3613. MyLight.TimerInterval = BlinkPeriod
  3614. MyLight.TimerEnabled = 0
  3615. MyLight.TimerEnabled = 1
  3616. 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"
  3617. End If
  3618. End Sub
  3619.  
  3620. Sub FlashForMsrgb(MyLight, TotalPeriod, BlinkPeriod, FinalState, Red, Green, Blue) 'thanks gtxjoe for the first myVersion
  3621.  
  3622. If TypeName(MyLight) = "Light" Then
  3623.  
  3624. If FinalState = 2 Then
  3625. FinalState = MyLight.State 'Keep the current light state
  3626. End If
  3627. MyLight.BlinkInterval = BlinkPeriod
  3628. MyLight.Duration 2, TotalPeriod, FinalState
  3629. ElseIf TypeName(MyLight) = "Flasher" Then
  3630.  
  3631. Dim steps
  3632.  
  3633. ' Store all blink information
  3634. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  3635. If FinalState = 2 Then 'Keep the current flasher state
  3636. FinalState = ABS(MyLight.Visible)
  3637. End If
  3638. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  3639.  
  3640. ' Start blink timer and create timer subroutine
  3641. MyLight.TimerInterval = BlinkPeriod
  3642. MyLight.TimerEnabled = 0
  3643. MyLight.TimerEnabled = 1
  3644. 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"
  3645. End If
  3646. End Sub
  3647. '******************************************
  3648. ' Section; Change light color - simulate color leds
  3649. ' changes the light color and state
  3650. ' colors: red, orange, yellow, green, blue, white
  3651. '******************************************
  3652.  
  3653. 'Sub SetLight(n, col, stat)
  3654. Sub SetLight(n, col, stat)
  3655. 'SEt Color
  3656. Select Case col
  3657. Case "red"
  3658. n.color = RGB(128, 0, 0)
  3659. n.colorfull = RGB(255, 0, 0)
  3660. Case "orange"
  3661. n.color = RGB(18, 3, 0)
  3662. n.colorfull = RGB(255, 64, 0)
  3663. Case "yellow"
  3664. n.color = RGB(18, 18, 0)
  3665. n.colorfull = RGB(255, 255, 0)
  3666. Case "green"
  3667. n.color = RGB(0, 32, 0)
  3668. n.colorfull = RGB(0, 200, 0)
  3669. Case "blue"
  3670. n.color = RGB(0, 0, 128)
  3671. n.colorfull = RGB(0, 0, 255)
  3672. Case "white"
  3673. n.color = RGB(255, 252, 224)
  3674. n.colorfull = RGB(193, 91, 0)
  3675. Case "whitegi"
  3676. n.color = RGB(0, 0, 0)
  3677. n.colorfull = RGB(225, 225, 225)
  3678. Case "purple"
  3679. n.color = RGB(128, 0, 128)
  3680. n.colorfull = RGB(255, 0, 255)
  3681. Case "amber"
  3682. n.color = RGB(193, 49, 0)
  3683. n.colorfull = RGB(255, 153, 0)
  3684. Case ""
  3685. End Select
  3686.  
  3687. 'Set State
  3688. If stat <> -1 Then
  3689. n.State = 0
  3690. n.State = stat
  3691. End If
  3692.  
  3693. End Sub
  3694.  
  3695. SetLight l10, "", -1
  3696.  
  3697. ' ********************************
  3698. ' Table info & Attract Mode
  3699. ' ********************************
  3700.  
  3701. Sub ShowTableInfo
  3702.  
  3703. If Score(1)Then
  3704. DMD "", eNone, "", eNone, "", eNone, "", eNone, 1000, True, ""
  3705. UDMD "", "", 1000
  3706. 'info goes in a loop only stopped by the credits and the startkey
  3707. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "GAME OVER"), eBlink, 2000, False, "":'game over
  3708. PuPEvent 91
  3709. UDMD "GAME OVER", "", 2000
  3710. Else
  3711. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, " "), eBlink, 5000, False, "" 'game over
  3712. END IF
  3713.  
  3714. If Score(1)Then
  3715. DMD "", eNone, CenterLine(1, FormatScore(Score(1))), eNone, CenterLine(2, "PLAYER 1"), eNone, "", eNone, 3000, False, ""
  3716. UDMD "PLAYER 1", Score(1), 3000
  3717. End If
  3718. If Score(2)Then
  3719. DMD "", eNone, CenterLine(1, FormatScore(Score(2))), eNone, CenterLine(2, "PLAYER 2"), eNone, "", eNone, 3000, False, ""
  3720. UDMD "PLAYER 2", Score(2), 3000
  3721. End If
  3722. If Score(3)Then
  3723. DMD "", eNone, CenterLine(1, FormatScore(Score(3))), eNone, CenterLine(2, "PLAYER 3"), eNone, "", eNone, 3000, False, ""
  3724. UDMD "PLAYER 3", Score(3), 3000
  3725. End If
  3726. If Score(4)Then
  3727. DMD "", eNone, CenterLine(1, FormatScore(Score(4))), eNone, CenterLine(2, "PLAYER 4"), eNone, "", eNone, 3000, False, ""
  3728. UDMD "PLAYER 4", Score(4), 3000
  3729. End If
  3730.  
  3731. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "GAME OVER"), eBlink, 2000, False, "" 'game over
  3732. UDMD "GAME OVER", "", 2000
  3733.  
  3734. If bFreePlay Then
  3735. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "FREE PLAY"), eNone, 3000, False, ""
  3736. UDMD "FREE PLAY", "", 3000
  3737. Else
  3738. If Credits > 0 Then
  3739. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "PRESS START"), eNone, "", eNone, 2000, False, ""
  3740. UDMD "PRESS START", "", 2000
  3741. Else
  3742. DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eNone, "", eNone, 2000, False, ""
  3743. UDMD "INSERT COIN", "", 2000
  3744. End If
  3745. End If
  3746. DMD "", eNone, " VPX", eNone, " PRESENTS", eNone, "", eNone, 2000, False, ""
  3747. UDMD "VPX", "PRESENTS", 2000
  3748.  
  3749. DMD "", eNone, " TOTAL NUCLEAR", eNone, " ANNIHILATION", eNone, "", eNone, 2000, False, ""
  3750. UDMD "TOTAL NUCLEAR", "ANNIHILATION", 2000
  3751.  
  3752. DMD "", eNone, " TRY CO-OP MODES", eNone, " PRESS MAGNASAVE", eNone, "", eNone, 2000, False, ""
  3753. UDMD "TRY CO-OP MODES", "USE MAGNASAVE", 2000
  3754.  
  3755. ' DMD "", eNone, CenterLine(1, "HIGH SCORES"), eScrollLeft, Space(dCharsPerLine(2)), eScrollLeft, "", eNone, 20, False, ""
  3756. ' UDMD "", "", 20
  3757.  
  3758. DMD "", eNone, CenterLine(1, "HIGH SCORES"), eBlinkFast, "", eNone, "", eNone, 2000, False, ""
  3759. UDMD "HIGH SCORES", "", 2000
  3760.  
  3761. DMD "", eNone, CenterLine(1, "HIGH SCORE"), eNone, " 1 " &HighScoreName(0) & " " &FormatScore(HighScore(0)), eNone, "", eNone, 2000, False, ""
  3762. UDMD "HIGH SCORE 1", HighScoreName(0) & " " & HighScore(0), 2000
  3763.  
  3764. DMD "", eNone, "_", eNone, " 2 " &HighScoreName(1) & " " &FormatScore(HighScore(1)), eNone, "", eNone, 2000, False, ""
  3765. UDMD "HIGH SCORE 2", HighScoreName(1) & " " &HighScore(1), 2000
  3766.  
  3767. DMD "", eNone, "_", eNone, " 3 " &HighScoreName(2) & " " &FormatScore(HighScore(2)), eNone, "", eNone, 2000, False, ""
  3768. UDMD "HIGH SCORE 3", HighScoreName(2) & " " &HighScore(2), 2000
  3769.  
  3770. DMD "", eNone, "_", eNone, " 4 " &HighScoreName(3) & " " &FormatScore(HighScore(3)), eNone, "", eNone, 2000, False, ""
  3771. UDMD "HIGH SCORE 4", HighScoreName(3) & " " &HighScore(3), 2000
  3772.  
  3773. DMD "", eNone, Space(dCharsPerLine(1)), eNone, Space(dCharsPerLine(2)), eNone, "", eNone, 500, False, ""
  3774. UDMD "", "", 500
  3775. End Sub
  3776.  
  3777. Sub StartAttractMode(dummy)
  3778. DOF 149, DOFOn
  3779. StartLightSeq
  3780. DMDFlush
  3781.  
  3782. If ResetHighScore = 0 Then
  3783. ShowTableInfo
  3784. Else
  3785. DMD "", eNone, " HIGH SCORE RESET", eNone, " EXIT GAME", eNone, "", eNone, 100000, False, ""
  3786. UDMD "HIGH SCORE RESET", "EXIT GAME", 100000
  3787. End If
  3788. ''' StartRainbow "arrows"
  3789. End Sub
  3790.  
  3791. Sub StopAttractMode
  3792. DOF 149, DOFOff
  3793. DMDFlush
  3794. DMD "", eNone, "", eNone, "", eNone, "", eNone, 500, True, ""
  3795. UDMD "", "", 500
  3796. LightSeqAttract.StopPlay
  3797. ''' StopRainbow
  3798. 'StopSong
  3799.  
  3800. End Sub
  3801.  
  3802. Sub StartLightSeq()
  3803. 'lights sequences
  3804. LightSeqAttract.UpdateInterval = 15
  3805. LightSeqAttract.Play SeqCircleInOn, 40, 1
  3806.  
  3807. LightSeqAttract.UpdateInterval = 2
  3808. LightSeqAttract.Play SeqRandom, 40, , 4000
  3809. LightSeqAttract.Play SeqAllOff
  3810.  
  3811. LightSeqAttract.UpdateInterval = 5
  3812. LightSeqAttract.Play SeqCircleOutOn, 25, 4
  3813.  
  3814. LightSeqAttract.UpdateInterval = 4
  3815. LightSeqAttract.Play SeqBlinking, , 5, 150
  3816.  
  3817. LightSeqAttract.UpdateInterval = 4
  3818. LightSeqAttract.Play SeqDownOn, 25, 1
  3819. LightSeqAttract.Play SeqUpOn, 25, 1, 500
  3820. LightSeqAttract.UpdateInterval = 4
  3821. LightSeqAttract.Play SeqDownOn, 25, 1
  3822. LightSeqAttract.Play SeqUpOn, 25, 1, 500
  3823.  
  3824. LightSeqAttract.UpdateInterval = 5
  3825. LightSeqAttract.Play SeqCircleOutOn, 25, 4
  3826.  
  3827. LightSeqAttract.UpdateInterval = 8
  3828. LightSeqAttract.Play SeqRightOn, 50, 1
  3829. LightSeqAttract.UpdateInterval = 8
  3830. LightSeqAttract.Play SeqLeftOn, 50, 1
  3831. LightSeqAttract.UpdateInterval = 8
  3832. LightSeqAttract.Play SeqRightOn, 50, 1
  3833. LightSeqAttract.UpdateInterval = 8
  3834. LightSeqAttract.Play SeqLeftOn, 50, 1
  3835.  
  3836. LightSeqAttract.UpdateInterval = 5
  3837. LightSeqAttract.Play SeqStripe2VertOn, 50, 4
  3838.  
  3839. LightSeqAttract.UpdateInterval = 4
  3840. LightSeqAttract.Play SeqDownOn, 25, 1
  3841. LightSeqAttract.Play SeqUpOn, 25, 1, 500
  3842. LightSeqAttract.UpdateInterval = 4
  3843. LightSeqAttract.Play SeqDownOn, 25, 1
  3844. LightSeqAttract.Play SeqUpOn, 25, 1, 500
  3845.  
  3846. LightSeqAttract.UpdateInterval = 2
  3847. LightSeqAttract.Play SeqScrewRightOn, 50, 8
  3848.  
  3849. LightSeqAttract.UpdateInterval = 2
  3850. LightSeqAttract.Play SeqBlinking, , 5, 150
  3851. '
  3852. '
  3853. ' LightSeqAttract.Play SeqRandom, 40, , 4000
  3854. ' LightSeqAttract.Play SeqAllOff
  3855. '' LightSeqAttract.UpdateInterval = 8
  3856. '' LightSeqAttract.Play SeqUpOn, 50, 1
  3857. ' LightSeqAttract.UpdateInterval = 2
  3858. ' LightSeqAttract.Play SeqDownOn, 25, 1
  3859. ' LightSeqAttract.UpdateInterval = 8
  3860. ' LightSeqAttract.Play SeqCircleOutOn, 15, 2
  3861. ' LightSeqAttract.UpdateInterval = 8
  3862. '' LightSeqAttract.Play SeqUpOn, 25, 1
  3863. '' LightSeqAttract.UpdateInterval = 8
  3864. ' LightSeqAttract.Play SeqDownOn, 25, 1
  3865. '' LightSeqAttract.UpdateInterval = 8
  3866. '' LightSeqAttract.Play SeqUpOn, 25, 1
  3867. '' LightSeqAttract.UpdateInterval = 8
  3868. '' LightSeqAttract.Play SeqDownOn, 25, 1
  3869. '' LightSeqAttract.UpdateInterval = 10
  3870. '' LightSeqAttract.Play SeqCircleOutOn, 15, 3
  3871. ' LightSeqAttract.UpdateInterval = 5
  3872. ' LightSeqAttract.Play SeqRightOn, 50, 1
  3873. ' LightSeqAttract.UpdateInterval = 5
  3874. ' LightSeqAttract.Play SeqLeftOn, 50, 1
  3875. ' LightSeqAttract.UpdateInterval = 8
  3876. ' LightSeqAttract.Play SeqRightOn, 50, 1
  3877. ' LightSeqAttract.UpdateInterval = 8
  3878. ' LightSeqAttract.Play SeqLeftOn, 50, 1
  3879. ' LightSeqAttract.UpdateInterval = 8
  3880. ' LightSeqAttract.Play SeqRightOn, 40, 1
  3881. ' LightSeqAttract.UpdateInterval = 8
  3882. ' LightSeqAttract.Play SeqLeftOn, 40, 1
  3883. ' LightSeqAttract.UpdateInterval = 10
  3884. ' LightSeqAttract.Play SeqRightOn, 30, 1
  3885. ' LightSeqAttract.UpdateInterval = 10
  3886. ' LightSeqAttract.Play SeqLeftOn, 30, 1
  3887. ' LightSeqAttract.UpdateInterval = 8
  3888. ' LightSeqAttract.Play SeqRightOn, 25, 1
  3889. ' LightSeqAttract.UpdateInterval = 8
  3890. ' LightSeqAttract.Play SeqLeftOn, 25, 1
  3891. ' LightSeqAttract.UpdateInterval = 8
  3892. ' LightSeqAttract.Play SeqRightOn, 15, 1
  3893. ' LightSeqAttract.UpdateInterval = 8
  3894. ' LightSeqAttract.Play SeqLeftOn, 15, 1
  3895. ' LightSeqAttract.UpdateInterval = 10
  3896. ' LightSeqAttract.Play SeqCircleOutOn, 15, 3
  3897. ' LightSeqAttract.UpdateInterval = 8
  3898. ' LightSeqAttract.Play SeqLeftOn, 25, 1
  3899. ' LightSeqAttract.UpdateInterval = 8
  3900. ' LightSeqAttract.Play SeqRightOn, 25, 1
  3901. ' LightSeqAttract.UpdateInterval = 8
  3902. ' LightSeqAttract.Play SeqLeftOn, 25, 1
  3903. ' LightSeqAttract.UpdateInterval = 8
  3904. ' LightSeqAttract.Play SeqUpOn, 25, 1
  3905. ' LightSeqAttract.UpdateInterval = 8
  3906. ' LightSeqAttract.Play SeqDownOn, 25, 1
  3907. ' LightSeqAttract.UpdateInterval = 8
  3908. ' LightSeqAttract.Play SeqUpOn, 25, 1
  3909. ' LightSeqAttract.UpdateInterval = 8
  3910. ' LightSeqAttract.Play SeqDownOn, 25, 1
  3911. ' LightSeqAttract.UpdateInterval = 5
  3912. ' LightSeqAttract.Play SeqStripe1VertOn, 50, 2
  3913. ' LightSeqAttract.UpdateInterval = 8
  3914. ' LightSeqAttract.Play SeqCircleOutOn, 15, 2
  3915. ' LightSeqAttract.UpdateInterval = 8
  3916. ' LightSeqAttract.Play SeqStripe1VertOn, 50, 3
  3917. ' LightSeqAttract.UpdateInterval = 8
  3918. ' LightSeqAttract.Play SeqLeftOn, 25, 1
  3919. ' LightSeqAttract.UpdateInterval = 8
  3920. ' LightSeqAttract.Play SeqRightOn, 25, 1
  3921. ' LightSeqAttract.UpdateInterval = 8
  3922. ' LightSeqAttract.Play SeqLeftOn, 25, 1
  3923. ' LightSeqAttract.UpdateInterval = 8
  3924. ' LightSeqAttract.Play SeqUpOn, 25, 1
  3925. ' LightSeqAttract.UpdateInterval = 8
  3926. ' LightSeqAttract.Play SeqDownOn, 25, 1
  3927. ' LightSeqAttract.UpdateInterval = 8
  3928. ' LightSeqAttract.Play SeqCircleOutOn, 15, 2
  3929. ' LightSeqAttract.UpdateInterval = 8
  3930. ' LightSeqAttract.Play SeqStripe2VertOn, 50, 3
  3931. ' LightSeqAttract.UpdateInterval = 8
  3932. ' LightSeqAttract.Play SeqLeftOn, 25, 1
  3933. ' LightSeqAttract.UpdateInterval = 8
  3934. ' LightSeqAttract.Play SeqRightOn, 25, 1
  3935. ' LightSeqAttract.UpdateInterval = 8
  3936. ' LightSeqAttract.Play SeqLeftOn, 25, 1
  3937. ' LightSeqAttract.UpdateInterval = 8
  3938. ' LightSeqAttract.Play SeqUpOn, 25, 1
  3939. ' LightSeqAttract.UpdateInterval = 8
  3940. ' LightSeqAttract.Play SeqDownOn, 25, 1
  3941. ' LightSeqAttract.UpdateInterval = 8
  3942. ' LightSeqAttract.Play SeqUpOn, 25, 1
  3943. ' LightSeqAttract.UpdateInterval = 8
  3944. ' LightSeqAttract.Play SeqDownOn, 25, 1
  3945. ' LightSeqAttract.UpdateInterval = 8
  3946. ' LightSeqAttract.Play SeqStripe1VertOn, 25, 3
  3947. ' LightSeqAttract.UpdateInterval = 8
  3948. ' LightSeqAttract.Play SeqStripe2VertOn, 25, 3
  3949. ' LightSeqAttract.UpdateInterval = 8
  3950. ' LightSeqAttract.Play SeqUpOn, 15, 1
  3951. ' LightSeqAttract.UpdateInterval = 8
  3952. ' LightSeqAttract.Play SeqDownOn, 15, 1
  3953. ' LightSeqAttract.UpdateInterval = 8
  3954. ' LightSeqAttract.Play SeqUpOn, 15, 1
  3955. ' LightSeqAttract.UpdateInterval = 8
  3956. ' LightSeqAttract.Play SeqDownOn, 15, 1
  3957. ' LightSeqAttract.UpdateInterval = 8
  3958. ' LightSeqAttract.Play SeqUpOn, 15, 1
  3959. ' LightSeqAttract.UpdateInterval = 8
  3960. ' LightSeqAttract.Play SeqDownOn, 15, 1
  3961. ' LightSeqAttract.UpdateInterval = 8
  3962. ' LightSeqAttract.Play SeqRightOn, 15, 1
  3963. ' LightSeqAttract.UpdateInterval = 8
  3964. ' LightSeqAttract.Play SeqLeftOn, 15, 1
  3965. ' LightSeqAttract.UpdateInterval = 8
  3966. ' LightSeqAttract.Play SeqRightOn, 15, 1
  3967. ' LightSeqAttract.UpdateInterval = 8
  3968. ' LightSeqAttract.Play SeqLeftOn, 15, 1
  3969. End Sub
  3970.  
  3971. Sub LightSeqAttract_PlayDone()
  3972. StartLightSeq()
  3973. End Sub
  3974.  
  3975. Sub LightSeqTilt_PlayDone()
  3976. 'LightSeqTilt.Play SeqAllOff
  3977. End Sub
  3978.  
  3979. Sub LightSeqGame_PlayDone()
  3980. PreviousGI
  3981. LightSeqGame.TimerInterval = 500
  3982. LightSeqGame.TimerEnabled = True
  3983. End Sub
  3984.  
  3985. Sub LightSeqGame_Timer
  3986. GiOn
  3987. LightSeqGame.TimerEnabled = False
  3988. End Sub
  3989.  
  3990. Sub LightSeqMball_PlayDone()
  3991. PreviousGI
  3992. LightSeqMball.TimerInterval = 500
  3993. LightSeqMball.TimerEnabled = True
  3994. End Sub
  3995.  
  3996. Sub LightSeqMball_Timer
  3997. GiOn
  3998. LightSeqMball.TimerEnabled = False
  3999. End Sub
  4000.  
  4001. Sub LightSeqSkillshot_PlayDone()
  4002. LightSeqSkillshot.Play SeqAllOff
  4003. End Sub
  4004.  
  4005. '*************************
  4006. ' Section; Rainbow Changing Lights
  4007. '*************************
  4008.  
  4009. Dim RGBStep, RGBFactor, Red, Green, Blue, RainbowLights
  4010.  
  4011. Sub StartRainbow(n)
  4012. RainbowLights = n
  4013. RGBStep = 0
  4014. RGBFactor = 10
  4015. Red = 255
  4016. Green = 0
  4017. Blue = 0
  4018.  
  4019. RainbowTimer.Interval = 40
  4020. RainbowTimer.Enabled = 1
  4021. End Sub
  4022.  
  4023. Sub StopRainbow()
  4024. Dim obj
  4025. RainbowTimer.Enabled = 0
  4026. If RainbowLights = "all" Then
  4027. For each obj in aRGBLightsMinusSome
  4028. SetLight obj, "white", 0
  4029. Next
  4030. ElseIf RainbowLights = "gi" Then
  4031. For each obj in aGiLights
  4032. SetLight obj, "white", 0
  4033. Next
  4034. End If
  4035. End Sub
  4036.  
  4037. Sub RainbowTimer_Timer 'rainbow led light color changing
  4038. Dim obj
  4039. Select Case RGBStep
  4040. Case 0 'Green
  4041. Green = Green + RGBFactor
  4042. If Green > 255 then
  4043. Green = 255
  4044. RGBStep = 1
  4045. End If
  4046. Case 1 'Red
  4047. Red = Red - RGBFactor
  4048. If Red < 0 then
  4049. Red = 0
  4050. RGBStep = 2
  4051. End If
  4052. Case 2 'Blue
  4053. Blue = Blue + RGBFactor
  4054. If Blue > 255 then
  4055. Blue = 255
  4056. RGBStep = 3
  4057. End If
  4058. Case 3 'Green
  4059. Green = Green - RGBFactor
  4060. If Green < 0 then
  4061. Green = 0
  4062. RGBStep = 4
  4063. End If
  4064. Case 4 'Red
  4065. Red = Red + RGBFactor
  4066. If Red > 255 then
  4067. Red = 255
  4068. RGBStep = 5
  4069. End If
  4070. Case 5 'Blue
  4071. Blue = Blue - RGBFactor
  4072. If Blue < 0 then
  4073. Blue = 0
  4074. RGBStep = 0
  4075. End If
  4076. End Select
  4077. If RainbowLights = "all" Then
  4078. For each obj in aRGBLightsMinusSome
  4079. obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10)
  4080. obj.colorfull = RGB(Red, Green, Blue)
  4081. Next
  4082. ElseIf RainbowLights = "gi" Then
  4083. For each obj in aGiLights
  4084. obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10)
  4085. obj.colorfull = RGB(Red, Green, Blue)
  4086. Next
  4087. End If
  4088. End Sub
  4089.  
  4090. '***********************************************************************
  4091. ' *********************************************************************
  4092. ' Section; Table Specific Script Starts Here
  4093. ' *********************************************************************
  4094. '***********************************************************************
  4095.  
  4096. ' droptargets, animations, etc
  4097. Sub VPObjects_Init
  4098.  
  4099. End Sub
  4100.  
  4101. ' tables variables and modes init
  4102. Dim bSuperJackpot
  4103. Dim bDoubleSuperJackpot
  4104. Dim bTripleSuperJackpot
  4105. Dim bJackpot
  4106. 'Dim bLoopinSupers
  4107. Dim SpinnerValue
  4108. Dim SpinnerReactorValue
  4109. Dim Multiplier2x
  4110. Dim Multiplier3x
  4111. Dim LaneBonus
  4112. Dim BallLockScore
  4113.  
  4114. Dim COREScore
  4115. Dim InlaneScore
  4116. Dim BumperScore
  4117. Dim OutlaneScore
  4118. Dim LowerSlingshotScore
  4119. Dim UpperSlingshotScore
  4120. Dim Jackpot
  4121. Dim DoubleJackpot
  4122. Dim TripleJackpot
  4123. Dim SuperJackpot
  4124. Dim RADSCore
  4125. Dim DESTROYScore
  4126. Dim GridTargetScore
  4127. Dim TargetScore
  4128. Const TargetBonusValue = 1000
  4129. Const LaneSaveBonusValue = 10000
  4130.  
  4131.  
  4132. Sub Game_Init() 'called at the start of a new game
  4133. Dim i
  4134. bExtraBallWonThisBall = False
  4135. TurnOffPlayfieldLights()
  4136.  
  4137. 'Init Variables
  4138. bSkillshotSelect = False
  4139. SkillshotReady = 0
  4140. DropTargetResetLockIsLit 1
  4141.  
  4142. '****************************
  4143. 'SubSection; Scoring Values
  4144. '***************************
  4145. SpinnerValue = 110
  4146. SpinnerReactorValue = 200
  4147.  
  4148. COREScore = 500
  4149. UpperSlingshotScore = 500
  4150. LowerSlingshotScore = 200
  4151. GridTargetScore = 500
  4152. TargetScore = 500
  4153. SkillshotValue = 1000
  4154. BallLockScore = 20000
  4155. Jackpot = 15000
  4156. DoubleJackpot = 30000
  4157. TripleJackpot = 45000
  4158. SuperJackpot = 75000
  4159.  
  4160. 'DropTargetScore
  4161.  
  4162. BumperScore = 500
  4163. InlaneScore = 500
  4164. OutlaneScore = 500
  4165. RADScore = 500
  4166. DESTROYScore = 500
  4167.  
  4168.  
  4169.  
  4170. 'Initialize Player Data
  4171. InitializePlayerData
  4172.  
  4173. ResetCORE
  4174. ResetSAVE
  4175. ResetGrid
  4176. ResetReactor
  4177. ResetReactorBonus
  4178. ResetRAD
  4179. ResetMaxTarget
  4180. ResetMysteryAward
  4181. ResetDESTROY
  4182. ResetGate
  4183. ResetBonusLights
  4184. ResetReactorLoopInserts
  4185. ResetBallSaveDisplay
  4186. ResetSuperSpinner
  4187. ResetInserts
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193. bMultiBallMode = False
  4194. bBonusHeld = False
  4195. Multiplier2x = 1
  4196. Multiplier3x = 1
  4197.  
  4198.  
  4199. 'Init Delays/Timers
  4200. If Quotemode = 1 Then PlayQuote.Enabled = 1
  4201.  
  4202. 'Play some Music
  4203. StartBackgroundMusic
  4204.  
  4205. 'GI color
  4206. ChangeGI GIcolor, 1
  4207. End Sub
  4208.  
  4209. Sub StopEndOfBallModes() 'this sub is called after the last ball is drained
  4210.  
  4211. 'If Modes(0)Then StopMode Modes(0) 'a mode is active so stop it
  4212. End Sub
  4213.  
  4214. Sub ResetNewBallVariables() 'reset variables for a new ball or player
  4215. bSuperJackpot = False
  4216. bDoubleSuperJackpot = False
  4217. bTripleSuperJackpot = False
  4218. bJackpot = False
  4219. LaneBonus = 0
  4220. End Sub
  4221.  
  4222. Sub ResetNewBallLights() 'turn on or off the needed lights before a new ball is released
  4223. End Sub
  4224.  
  4225. Sub TurnOffPlayfieldLights()
  4226. Dim a
  4227. For each a in aLights
  4228. a.State = 0
  4229. Next
  4230. ''' Bumper1Light.Visible = 0
  4231. End Sub
  4232.  
  4233.  
  4234. '**************************
  4235. ' Section; SAVE - Inlanes Outlanes
  4236. '**************************
  4237. Dim LaneSaveCount(4)
  4238. Dim PlayerLa1(4)
  4239. Dim PlayerLa2(4)
  4240. Dim PlayerLa3(4)
  4241. Dim PlayerLa4(4)
  4242. Const LaneSaveCountMax = 6
  4243. Dim bBallSaverSingleUse
  4244.  
  4245. Sub ResetSave() ' ClearSave on end ball or start ball
  4246. LaneSaveCount(CurrentPlayer) = 0
  4247.  
  4248. SetLight la1, "red", 0
  4249. SetLight la2, "red", 0
  4250. SetLight la3, "red", 0
  4251. SetLight la4, "red", 0
  4252.  
  4253.  
  4254. ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
  4255. End Sub
  4256.  
  4257. Sub CheckSAVE()
  4258. dim tmp
  4259. tmp = 0
  4260.  
  4261. if la1.state = 1 then tmp = tmp + 1
  4262. if la2.state = 1 then tmp = tmp + 1
  4263. if la3.state = 1 then tmp = tmp + 1
  4264. if la4.state = 1 then tmp = tmp + 1
  4265.  
  4266. If tmp = 3 then '3 targets lit, earn a SAVE
  4267. AwardSAVE 1
  4268. End If
  4269.  
  4270. End Sub
  4271.  
  4272. Sub AwardSAVE (value)
  4273. Dim SaveInsertAlreadyLit, savecolor
  4274. SaveInsertAlreadyLit = 0
  4275.  
  4276. LaneSaveCount(CurrentPlayer) = LaneSaveCount(CurrentPlayer) + value
  4277. If LaneSaveCount(CurrentPlayer) > LaneSaveCountMax Then
  4278. LaneSaveCount(CurrentPlayer) = LaneSaveCountMax
  4279. Else
  4280. If LaneSaveCount(CurrentPlayer) = 1 Then
  4281. DOF 170, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "LANE SAVE " & LaneSaveCount(CurrentPlayer)), eBlinkfast, 1500, True, "tna_lanesavelevelone"
  4282. UDMD "LANE SAVE", "LEVEL 1", 1500
  4283. Else
  4284. DOF 170, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "LANE SAVE " & LaneSaveCount(CurrentPlayer)), eBlinkfast, 1500, True, "tna_lanesaveincreased"
  4285. UDMD "LANE SAVE", "LEVEL " & LaneSaveCount(CurrentPlayer), 1500
  4286. End If
  4287. GIGame 1, "yellow"
  4288. End If
  4289. Debug.Print "LaneSaveCount(CurrentPlayer) = " & LaneSaveCount(CurrentPlayer)
  4290. ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
  4291.  
  4292.  
  4293. 'Select new Insert color
  4294. SetSaveColor
  4295.  
  4296. 'Check if any Save insert already blinking and change color based on Save count (Red, Orange, Yellow,Green, Blue, Purple)
  4297. if la1.state = 2 then
  4298. SaveInsertAlreadyLit = 1
  4299. elseif la2.state = 2 then
  4300. SaveInsertAlreadyLit = 1
  4301. elseif la3.state = 2 then
  4302. SaveInsertAlreadyLit = 1
  4303. elseif la4.state = 2 then
  4304. SaveInsertAlreadyLit = 1
  4305. end if
  4306.  
  4307. 'If First Save awarded, set Flashing save insert
  4308. if SaveInsertAlreadyLit=0 Then
  4309. if la1.state = 0 then
  4310. la1.state = 2
  4311. elseif la2.state = 0 then
  4312. la2.state = 2
  4313. elseif la3.state = 0 then
  4314. la3.state = 2
  4315. elseif la4.state = 0 then
  4316. la4.state = 2
  4317. end if
  4318. End If
  4319.  
  4320. 'Reset the rest of the SAVE inserts
  4321. if la1.state = 1 then
  4322. la1.state = 0
  4323. end if
  4324. if la2.state = 1 then
  4325. la2.state = 0
  4326. end if
  4327. if la3.state = 1 then
  4328. la3.state = 0
  4329. end if
  4330. if la4.state = 1 then
  4331. la4.state = 0
  4332. end if
  4333.  
  4334. End Sub
  4335.  
  4336.  
  4337. Sub UseSAVE (sw) ' On outlane, check for ballsave condition
  4338. dim savecolor
  4339. dim tmp
  4340. tmp = ""
  4341. if LaneSaveCount(CurrentPlayer) > 0 Then
  4342. 'Check if SAVE insert is matching the drain outlane
  4343. if la1.state = 2 then
  4344. tmp = "swOutlaneL"
  4345. elseif la4.state = 2 then
  4346. tmp = "swOutlaneR"
  4347. end if
  4348.  
  4349. 'debug.print "Entering usesave " & LaneSaveCount(CurrentPlayer) & " : " & sw & " ; " & tmp
  4350.  
  4351. if (StrComp(sw, tmp) = 0)then 'Ball Saved!
  4352.  
  4353. 'debug.print "ballSavesingle!"
  4354. bBallSaverSingleUse = 1
  4355. LaneSaveCount(CurrentPlayer) = LaneSaveCount(CurrentPlayer) - 1
  4356.  
  4357. Playsound "tna_ballsaved"
  4358. DOF 165, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, ""
  4359. UDMD "BALL SAVED", "", 800
  4360. GIGameImmediate 12, "green"
  4361. PuPEvent 94
  4362.  
  4363.  
  4364. if LaneSaveCount(CurrentPlayer) <=0 Then ' Turn off Save insert
  4365. LaneSaveCount(CurrentPlayer) = 0
  4366. if la1.state = 2 then
  4367. la1.state = 0
  4368. elseif la2.state = 2 then
  4369. la2.state = 0
  4370. elseif la3.state = 2 then
  4371. la3.state = 0
  4372. elseif la4.state = 2 then
  4373. la4.state = 0
  4374. end if
  4375. End If
  4376.  
  4377. 'Select new Insert color
  4378. SetSaveColor
  4379.  
  4380. End If
  4381. End If
  4382. ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
  4383.  
  4384. DMDScoreNow
  4385. End Sub
  4386.  
  4387.  
  4388. Sub SetSaveColor
  4389. dim savecolor
  4390.  
  4391. 'Select new Insert color
  4392. Select Case LaneSaveCount(CurrentPlayer)
  4393. Case 0: savecolor = "red"
  4394. Case 1: savecolor = "red"
  4395. Case 2: savecolor = "orange"
  4396. Case 3: savecolor = "yellow"
  4397. Case 4: savecolor = "green"
  4398. Case 5: savecolor = "blue"
  4399. Case else: savecolor = "purple"
  4400. End Select
  4401.  
  4402. 'Set insert color
  4403. SetLight la1, savecolor, -1
  4404. SetLight la2, savecolor, -1
  4405. SetLight la3, savecolor, -1
  4406. SetLight la4, savecolor, -1
  4407. End Sub
  4408.  
  4409. Sub InitLaneSaveData
  4410. Dim i
  4411. For i = 1 To MaxPlayers
  4412. LaneSaveCount(i) = 0
  4413. PlayerLa1(i) = 0
  4414. PlayerLa2(i) = 0
  4415. PlayerLa3(i) = 0
  4416. PlayerLa4(i) = 0
  4417. Next
  4418. End Sub
  4419.  
  4420. Sub SaveLaneSaveData
  4421. 'LaneSaveCount(i) is already saved
  4422. PlayerLa1(CurrentPlayer) = la1.state
  4423. PlayerLa2(CurrentPlayer) = la2.state
  4424. PlayerLa3(CurrentPlayer) = la3.state
  4425. PlayerLa4(CurrentPlayer) = la4.state
  4426. End Sub
  4427.  
  4428. Sub RestoreLaneSaveData
  4429. la1.state = PlayerLa1(CurrentPlayer)
  4430. la2.state = PlayerLa2(CurrentPlayer)
  4431. la3.state = PlayerLa3(CurrentPlayer)
  4432. la4.state = PlayerLa4(CurrentPlayer)
  4433.  
  4434. SetSaveColor
  4435. End Sub
  4436.  
  4437. Sub CopyLaneSaveData (p1, p2)
  4438. LaneSaveCount(p2) = LaneSaveCount(p1)
  4439. PlayerLa1(p2) = PlayerLa1(p1)
  4440. PlayerLa2(p2) = PlayerLa2(p1)
  4441. PlayerLa3(p2) = PlayerLa3(p1)
  4442. PlayerLa4(p2) = PlayerLa4(p1)
  4443. End Sub
  4444.  
  4445. '**************************
  4446. ' Section; Skillshot
  4447. '**************************
  4448. Sub StartSkillShot() 'Updates the DMD & lights with the chosen skillshots
  4449. 'DMDFlush
  4450. bSkillShotSelect = True
  4451. HandsFreeSkillshotInsert = INT(RND * 4) +1
  4452.  
  4453. Select Case HandsFreeSkillshotInsert
  4454. Case 1:
  4455. l1.state = 2
  4456. f1.state = 2
  4457. f2.state = 2
  4458. f3.state = 0
  4459. f4.state = 0
  4460. f5.state = 0
  4461. Case 2:
  4462. l2.state = 2
  4463. f1.state = 0
  4464. f2.state = 2
  4465. f3.state = 2
  4466. f4.state = 0
  4467. f5.state = 0
  4468. Case 3:
  4469. l3.state = 2
  4470. f1.state = 0
  4471. f2.state = 0
  4472. f3.state = 2
  4473. f4.state = 2
  4474. f5.state = 0
  4475. Case 4:
  4476. l4.state = 2
  4477. f1.state = 0
  4478. f2.state = 0
  4479. f3.state = 0
  4480. f4.state = 2
  4481. f5.state = 2
  4482. End Select
  4483.  
  4484. End Sub
  4485.  
  4486. Sub SelectSkillshot(index)
  4487. If index = 1 Then
  4488. Playsound "fx_Previous"
  4489. End If
  4490. If index = 2 Then
  4491. Playsound "fx_Next"
  4492. End If
  4493.  
  4494. if l1.state = 2 then
  4495. HandsFreeSkillshotInsert = 1
  4496. f1.state = 0
  4497. f2.state = 0
  4498. f3.state = 0
  4499. f4.state = 0
  4500. f5.state = 0
  4501. f1.state = 2
  4502. f2.state = 2
  4503. elseif l2.state = 2 then
  4504. HandsFreeSkillshotInsert = 2
  4505. f1.state = 0
  4506. f2.state = 0
  4507. f3.state = 0
  4508. f4.state = 0
  4509. f5.state = 0
  4510. f2.state = 2
  4511. f3.state = 2
  4512. elseif l3.state = 2 then
  4513. HandsFreeSkillshotInsert = 3
  4514. f1.state = 0
  4515. f2.state = 0
  4516. f3.state = 0
  4517. f4.state = 0
  4518. f5.state = 0
  4519. f3.state = 2
  4520. f4.state = 2
  4521. elseif l4.state = 2 then
  4522. HandsFreeSkillshotInsert = 4
  4523. f1.state = 0
  4524. f2.state = 0
  4525. f3.state = 0
  4526. f4.state = 0
  4527. f5.state = 0
  4528. f4.state = 2
  4529. f5.state = 2
  4530. end if
  4531. End Sub
  4532.  
  4533. Sub CheckSkillShot (index) ' reset the skillshot lights & variables
  4534. If (index = HandsFreeSkillshotInsert) AND (ReactorState(CurrentPlayer) = 0) then
  4535. AwardHandsFreeSkillshot
  4536. Else
  4537. Select Case index
  4538. Case 1:
  4539. if l1.state = 2 then AwardSkillshot
  4540. Case 2:
  4541. if l2.state = 2 then AwardSkillshot
  4542. Case 3:
  4543. if l3.state = 2 then AwardSkillshot
  4544. Case 4:
  4545. if l4.state = 2 then AwardSkillshot
  4546. End Select
  4547. End if
  4548.  
  4549. if l1.state = 2 then
  4550. l1.state = 0
  4551. elseif l2.state = 2 then
  4552. l2.state = 0
  4553. elseif l3.state = 2 then
  4554. l3.state = 0
  4555. elseif l4.state = 2 then
  4556. l4.state = 0
  4557. end if
  4558.  
  4559. f1.state = 0
  4560. f2.state = 0
  4561. f3.state = 0
  4562. f4.state = 0
  4563. f5.state = 0
  4564.  
  4565. SkillShotReady = 0
  4566. bSkillShotSelect = False
  4567. HandsFreeSkillshotInsert = -1
  4568.  
  4569. DMDScoreNow
  4570. End Sub
  4571.  
  4572.  
  4573.  
  4574. ' *********************************************************************
  4575. ' Table Object Hit Events
  4576. '
  4577. ' Any target hit Sub will follow this:
  4578. ' - play a sound
  4579. ' - do some physical movement
  4580. ' - add a score, bonus
  4581. ' - check some variables/modes this trigger is a member of
  4582. ' - set the "LastSwicthHit" variable in case it is needed later
  4583. ' *********************************************************************
  4584.  
  4585. ' Slingshots has been hit
  4586.  
  4587. Dim LStep, RStep
  4588.  
  4589. Sub LeftSlingShot_Slingshot
  4590. If Tilted Then Exit Sub
  4591. PlaySound SoundFXDOF("fxz_leftslingshot", 103, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
  4592. PlaySound "tna_reactorslingloud"
  4593. DOF 104, DOFPulse
  4594. LeftSling4.Visible = 1:LeftSling1.Visible = 0
  4595. Lemk.RotX = 26
  4596. LStep = 0
  4597. LeftSlingShot.TimerEnabled = True
  4598. ' add some points
  4599. AddScore LowerSlingshotScore
  4600.  
  4601. ' add some effect to the table?
  4602. GILeftSlingHit
  4603.  
  4604. SwitchReactorLoopInserts
  4605.  
  4606. ' remember last trigger hit by the ball
  4607. SetLastSwitchHit "LeftSlingShot"
  4608. End Sub
  4609.  
  4610. Sub LeftSlingShot_Timer
  4611. Select Case LStep
  4612. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  4613. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  4614. Case 3:LeftSLing2.Visible = 0:LeftSling1.Visible = 1:Lemk.RotX = -10:Gi2.State = 1:LeftSlingShot.TimerEnabled = False
  4615. End Select
  4616. LStep = LStep + 1
  4617. End Sub
  4618.  
  4619. Sub RightSlingShot_Slingshot
  4620. If Tilted Then Exit Sub
  4621. PlaySound SoundFXDOF("fxz_rightslingshot", 105, DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
  4622. PlaySound "tna_reactorslingloud"
  4623. DOF 106, DOFPulse
  4624. RightSling4.Visible = 1:RightSling1.Visible = 0
  4625. Remk.RotX = 26
  4626. RStep = 0
  4627. RightSlingShot.TimerEnabled = True
  4628. ' add some points
  4629. AddScore LowerSlingshotScore
  4630.  
  4631. ' add some effect to the table?
  4632. GIRightSlingHit
  4633.  
  4634. SwitchReactorLoopInserts
  4635.  
  4636. ' remember last trigger hit by the ball
  4637. SetLastSwitchHit "RightSlingShot"
  4638. End Sub
  4639.  
  4640. Sub RightSlingShot_Timer
  4641. Select Case RStep
  4642. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14:
  4643. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2:
  4644. Case 3:RightSLing2.Visible = 0:RightSLing1.Visible = 1:Remk.RotX = -10:Gi1.State = 1:RightSlingShot.TimerEnabled = False
  4645. End Select
  4646. RStep = RStep + 1
  4647. End Sub
  4648.  
  4649.  
  4650.  
  4651.  
  4652. '******************
  4653. ' Section; Spinner
  4654. '******************
  4655. Dim SpinCount, SuperSpinnerValue
  4656. Sub Spinner1_Spin()
  4657. If Tilted Then Exit Sub
  4658. DOF 112, DOFPulse
  4659.  
  4660. If SuperSpinnerValue = 0 Then
  4661. PlaySound "tna_spinner", 0, 1, -0.1
  4662. Else
  4663. PlaySound "tna_superspin", 0, 1, -0.1
  4664. FlashForMs SpinnerFlasher, 100, 50, 0
  4665. End If
  4666.  
  4667.  
  4668. SpinCount = SpinCount + 1
  4669. ttspin.text = SpinCount
  4670. If SpinCount >= 50 Then
  4671. SetSuperSpinner
  4672. End If
  4673.  
  4674. AddScoreSpecial2 SpinnerValue + SuperSpinnerValue, SpinnerReactorValue
  4675. If SkillShotReady <> 0 Then CheckSkillShot 0
  4676.  
  4677. If ReactorState(CurrentPlayer) = 2 Then
  4678. AddReactorPercentForSpinner
  4679. End If
  4680.  
  4681. End Sub
  4682.  
  4683. 'Decide to remove or keep
  4684. Sub Spinner2_Spin()
  4685. if AddRightSpinner = 1 Then
  4686. DOF 113, DOFPulse
  4687. If Tilted Then Exit Sub
  4688.  
  4689. If SuperSpinnerValue = 0 Then
  4690. PlaySound "tna_spinner", 0, 1, -0.1
  4691. Else
  4692. PlaySound "tna_superspin", 0, 1, -0.1
  4693. End If
  4694.  
  4695. ' increase super jackpot if light l66 is blinking
  4696. AddScoreSpecial2 SpinnerValue + SuperSpinnerValue, SpinnerReactorValue
  4697. If SkillShotReady <> 0 Then CheckSkillShot 0
  4698. end if
  4699. End Sub
  4700.  
  4701. Sub Spinner2Enable
  4702. If AddRightSpinner = 0 Then
  4703. Spinner2.visible = False
  4704. Spinner2bracket.visible = False
  4705. End If
  4706. End Sub
  4707.  
  4708.  
  4709. Sub SetSuperSpinner
  4710. If SuperSpinnerValue <> 900 Then
  4711. SuperSpinnerValue = 900
  4712. lSpinner.state = 2
  4713. DOF 171, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SUPER SPINNER"), eBlinkfast, 1800, True, "tna_superspinner"
  4714. UDMD "SUPER", "SPINNER", 1800
  4715. PuPEvent 10
  4716. PuPEvent 12
  4717. End If
  4718. End Sub
  4719.  
  4720. Sub ResetSuperSpinner
  4721. SpinCount = 0
  4722. ttspin.text = SpinCount
  4723. SuperSpinnerValue = 0
  4724. lSpinner.state = 0
  4725. PuPEvent 13
  4726. End Sub
  4727. '*********************
  4728. ' Section; Inlanes - Outlanes
  4729. '*********************
  4730. Sub swOutlaneL_Hit()
  4731. PlaySoundAtVol "fx_sensor", ActiveBall, 1
  4732. If Tilted Then Exit Sub
  4733. AddScore OutlaneScore
  4734.  
  4735. ' change some light
  4736. If la1.State = 0 Then
  4737. la1.State = 1
  4738. PlaySound "tna_toplane"
  4739. End If
  4740. SetLastSwitchHit "swOutlaneL"
  4741.  
  4742. 'Check if Lane Save being used
  4743. If(bBallSaverActive = False) Then
  4744. UseSAVE LastSwitchHit
  4745. Else 'animate lights if ballsave On
  4746. GiGameImmediate 12, "purple"
  4747. End If
  4748.  
  4749. 'Check if Lane Save earned
  4750. CheckSAVE
  4751. End Sub
  4752.  
  4753. Sub swOutlaneR_Hit()
  4754. PlaySoundAtVol "fx_sensor",ActiveBall, 1
  4755. If Tilted Then Exit Sub
  4756. AddScore OutlaneScore
  4757.  
  4758. ' change some light
  4759. If la4.State = 0 Then
  4760. la4.State = 1
  4761. PlaySound "tna_toplane"
  4762. End If
  4763. SetLastSwitchHit "swOutlaneR"
  4764.  
  4765. 'Check if Lane Save being used
  4766. If(bBallSaverActive = False) Then
  4767. UseSAVE LastSwitchHit
  4768. Else 'animate lights if ballsave On
  4769. GiGameImmediate 12, "purple"
  4770. End If
  4771.  
  4772. 'Check if Lane Save earned
  4773. CheckSAVE
  4774. End Sub
  4775.  
  4776. Sub swInlaneL_Hit()
  4777. PlaySoundAtVol "fx_sensor", ActiveBall, 1
  4778. If Tilted Then Exit Sub
  4779. AddScore InlaneScore
  4780.  
  4781. ' change some light
  4782. If la2.State = 0 Then
  4783. la2.State = 1
  4784. PlaySound "tna_toplane"
  4785. End If
  4786.  
  4787. StartReactorRightLoopInserts
  4788.  
  4789. SetLastSwitchHit "swInlaneL"
  4790.  
  4791. ' do some check
  4792. CheckSAVE
  4793. End Sub
  4794.  
  4795. Sub swInlaneR_Hit()
  4796. PlaySoundAtVol "fx_sensor", ActiveBall, 1
  4797. If Tilted Then Exit Sub
  4798. AddScore InlaneScore
  4799.  
  4800. ' change some light
  4801. If la3.State = 0 Then
  4802. la3.State = 1
  4803. PlaySound "tna_toplane"
  4804. End If
  4805.  
  4806. StartReactorLeftLoopInserts
  4807.  
  4808. SetLastSwitchHit "swInlaneR"
  4809.  
  4810. ' do some check
  4811. CheckSAVE
  4812. End Sub
  4813.  
  4814.  
  4815. '*********************
  4816. ' Section; Top Lanes
  4817. '*********************
  4818. Sub sw1_Hit()
  4819. DOF 150, DOFPulse
  4820. ResetGate
  4821. PlaySoundAtVol "fx_sensor", ActiveBall, 1
  4822. If Tilted Then Exit Sub
  4823.  
  4824. ' change some light
  4825. SetLastSwitchHit "sw1"
  4826. If SkillShotReady <> 0 Then CheckSkillShot 1
  4827. If L1.state <> 1 then playsound "tna_toplane"
  4828.  
  4829. L1.state = 1
  4830.  
  4831. AddScoreSpecial COREScore
  4832.  
  4833. If ReactorState(CurrentPlayer) = 2 Then
  4834. AddReactorPercentForSwitch
  4835. End If
  4836.  
  4837. ' do some check
  4838. CheckCORE
  4839. End Sub
  4840.  
  4841. Sub sw2_Hit()
  4842. DOF 151, DOFPulse
  4843. ResetGate
  4844. PlaySoundAtVol "fx_sensor", ActiveBall, 1
  4845. If Tilted Then Exit Sub
  4846.  
  4847. ' change some light
  4848. ' FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0
  4849. SetLastSwitchHit "sw2"
  4850. If SkillShotReady <> 0 Then CheckSkillShot 2
  4851. If l2.state <> 1 then playsound "tna_toplane"
  4852.  
  4853. L2.state = 1
  4854.  
  4855. AddScoreSpecial COREScore
  4856.  
  4857. If ReactorState(CurrentPlayer) = 2 Then
  4858. AddReactorPercentForSwitch
  4859. End If
  4860.  
  4861. ' do some check
  4862. CheckCORE
  4863. End Sub
  4864.  
  4865. Sub sw3_Hit()
  4866. DOF 152, DOFPulse
  4867. ResetGate
  4868. PlaySoundAtVol "fx_sensor", ActiveBall, 1
  4869. If Tilted Then Exit Sub
  4870.  
  4871. ' change some light
  4872. ' FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0
  4873. SetLastSwitchHit "sw3"
  4874. If SkillShotReady <> 0 Then CheckSkillShot 3
  4875. If l3.state <> 1 then playsound "tna_toplane"
  4876.  
  4877. L3.state = 1
  4878.  
  4879. AddScoreSpecial COREScore
  4880.  
  4881. If ReactorState(CurrentPlayer) = 2 Then
  4882. AddReactorPercentForSwitch
  4883. End If
  4884. ' do some check
  4885. CheckCORE
  4886. End Sub
  4887.  
  4888. Sub sw4_Hit()
  4889. DOF 153, DOFPulse
  4890. ResetGate
  4891. PlaySoundAtVol "fx_sensor", ActiveBall, 1
  4892. If Tilted Then Exit Sub
  4893.  
  4894. ' change some light
  4895. ' FlashForms l6f, 1000, 40, 0:FlashForms l6, 1000, 40, 0
  4896. SetLastSwitchHit "sw4"
  4897. If SkillShotReady <> 0 Then CheckSkillShot 4
  4898. If l4.state <> 1 then playsound "tna_toplane"
  4899.  
  4900. L4.state = 1
  4901.  
  4902. AddScoreSpecial COREScore
  4903.  
  4904. If ReactorState(CurrentPlayer) = 2 Then
  4905. AddReactorPercentForSwitch
  4906. End If
  4907.  
  4908. ' do some check
  4909. CheckCORE
  4910. End Sub
  4911.  
  4912.  
  4913. Sub LeftScoop_Hit()
  4914. Dim MysteryAwarded
  4915.  
  4916. PlaySoundAtVol "fx_kicker_enter", ActiveBall, 1
  4917. LeftScoop.Enabled = False
  4918. ' Leftscoop.DestroyBall
  4919.  
  4920. If Tilted Then
  4921. LeftScoopExit
  4922. Exit Sub
  4923. End If
  4924.  
  4925. MysteryAwarded = CollectMysteryAward()
  4926.  
  4927. if MysteryAwarded=0 Then
  4928. vpmtimer.addtimer 200, "LeftScoopExit '"
  4929. End If
  4930.  
  4931. SetLastSwitchHit "LeftScoop"
  4932. End Sub
  4933.  
  4934. Sub LeftScoopExit
  4935. CheckReactorStart
  4936.  
  4937. GiGameImmediate 2, CurrCol
  4938.  
  4939. PlaySoundAtVol SoundFXDOF("fx_kicker", 122, DOFPulse, DOFContactors), LeftScoop, 1
  4940. PlaySound "tna_leftscoopeject"
  4941. DOF 123, DOFPulse
  4942.  
  4943. leftScoop.Kick 165, LeftScoopStrength, 1.56
  4944. LeftScoop.Enabled = True
  4945. End Sub
  4946.  
  4947.  
  4948. Sub LeftScoopAlt_Hit()
  4949. Dim MysteryAwarded
  4950.  
  4951. PlaySoundAtVol "fx_kicker_enter", ActiveBall, 1
  4952. LeftscoopAlt.DestroyBall
  4953.  
  4954. If Tilted Then
  4955. LeftScoopExit
  4956. Exit Sub
  4957. End If
  4958.  
  4959. MysteryAwarded = CollectMysteryAward()
  4960.  
  4961. if MysteryAwarded=0 Then
  4962. vpmtimer.addtimer 500, "LeftScoopAltExit '"
  4963. End If
  4964.  
  4965. LeftScoopAlt.Enabled = False
  4966.  
  4967. SetLastSwitchHit "LeftScoop"
  4968. End Sub
  4969.  
  4970. Sub LeftScoopAltExit
  4971. CheckReactorStart
  4972.  
  4973. GiGameImmediate 2, CurrCol
  4974.  
  4975. PlaySoundAtVol SoundFXDOF("fx_kicker", 122, DOFPulse, DOFContactors), LeftScoopAlt, 1
  4976. PlaySound "tna_leftscoopeject"
  4977. DOF 123, DOFPulse
  4978. LeftScoopAlt.CreateBall
  4979. LeftScoopAlt.Kick 162.7, 34
  4980. LeftScoopAlt.Enabled = True
  4981. End Sub
  4982.  
  4983.  
  4984. Sub RightScoop_Hit()
  4985. Dim tmp
  4986.  
  4987. PlaySoundAtVol "fx_kicker_enter", ActiveBall, 1
  4988. ' Rightscoop.DestroyBall
  4989.  
  4990. If Tilted Then
  4991. vpmtimer.addtimer 150, "RightScoopExit '"
  4992. Exit Sub
  4993. End If
  4994.  
  4995. vpmtimer.addtimer 500, "RightScoopExit '"
  4996. RightScoop.Enabled = False
  4997.  
  4998. If bMultiBallMode = False Then 'Normal Play
  4999. RightScoopEjected.Enabled = True
  5000. lRScoopEjectUpdate 0
  5001. GiGame 2, "green"
  5002. Else 'Multiball Play
  5003. StartDropTargetResetTimer
  5004. AwardSuperJackpot
  5005.  
  5006. 'Multiball add
  5007. AddMultiball 1
  5008. End If
  5009.  
  5010. AddBonusLights
  5011.  
  5012. SetLastSwitchHit "RightScoop"
  5013. End Sub
  5014.  
  5015. Sub RightScoopExit
  5016. 'Error check: If a target is up, need to drop them. Figure this out in future
  5017. ' If (DropTarget1.IsDropped = 0 or DropTarget2.IsDropped = 0 or DropTarget3.IsDropped = 0 or TargetBlocker1.IsDropped = 0 or TargetBlocker2.IsDropped = 0) Then
  5018. ' DropTarget1.IsDropped = 1
  5019. ' DropTarget2.IsDropped = 1
  5020. ' DropTarget3.IsDropped = 1
  5021. ' TargetBlocker1.IsDropped = 1
  5022. ' TargetBlocker2.IsDropped = 1
  5023. ' End If
  5024. If DropTarget1.IsDropped = 0 Then 'Warning: Ball in scoop with targets up, need to temporarily drop Targets to eject ball
  5025. MultiballTargetDrop
  5026. vpmtimer.addtimer 800, "MultiballTargetResetImmediate '"
  5027. End If
  5028.  
  5029. PlaySoundAtVol SoundFXDOF("fx_kicker", 122, DOFPulse, DOFContactors), RightScoop, 1
  5030. DOF 123, DOFPulse
  5031. RightScoop.Kick 190, RightScoopStrength, 1.56
  5032. RightScoop.Enabled = True
  5033. End Sub
  5034.  
  5035. Sub RightScoopEjected_Hit
  5036. DropTargetResetLockIsLit 0
  5037. RightScoopEjected.Enabled = False
  5038. End Sub
  5039.  
  5040.  
  5041. Sub lRScoopEjectUpdate (val)
  5042. if val = 1 Then
  5043. lRScoopEject.state = 2
  5044. Else
  5045. lRScoopEject.state = 0
  5046. End If
  5047. End Sub
  5048.  
  5049. ''*********************
  5050. ' Section; Multiball Drop Targets
  5051. ''*********************
  5052. ' One Target up to start Normal Play. Lock Lit
  5053. ' Multiball when DropTarget 3 hit
  5054. ' When Multiball started, all targets up, jackpot/super jackpot
  5055. ' When Multiball ends, 1 target up and scoop needed to light lock
  5056. Dim bLockIsLit
  5057. Dim MultiballStartScore
  5058. Sub StartMultiball
  5059. If debugMultiball Then debug.print "*****SUB:StartMultiball"
  5060.  
  5061. bMultiBallMode = True
  5062. DOF 115, DOFPulse
  5063. MultiballTargetReset
  5064. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MULTI-BALL!!!"), eBlinkfast, 1800, True, ""
  5065. UDMD "MULTI-BALL!!", "", 1800
  5066. StartMultiballMusic
  5067. MultiballStartScore = Score(CurrentPlayer)
  5068. PuPEvent 93
  5069. End Sub
  5070.  
  5071. Sub EndMultiball 'Multiball ending
  5072. Dim mballtotal
  5073.  
  5074. mballtotal = Score(CurrentPlayer) - MultiballStartScore
  5075. If debugMultiball Then debug.print "*****SUB:EndMultiball"
  5076. ChangeGI GIcolor, 1
  5077.  
  5078. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "M-BALL TOTAL"), eBlinkfast, 1800, True, ""
  5079. DMD "", eNone, Centerline(1, ("MBALL TOTAL")), eNone, "", eNone, CenterLine(3, FormatScore(mballtotal)), eBlinkFast, 1800, True, ""
  5080. UDMD "MULTI-BALL TOTAL", mballtotal, 1800
  5081.  
  5082. 'Restart music or critical music
  5083. If ReactorState(CurrentPlayer) <> 3 Then 'Not Critical
  5084. StopMultiballMusic
  5085. StartBackgroundMusic
  5086. Else
  5087. StopMultiballMusic
  5088. StartReactorCriticalMusic
  5089. End If
  5090.  
  5091.  
  5092. 'If all targets down, reset to lock is lit
  5093. If (DropTarget1.IsDropped = 1 and DropTarget2.IsDropped = 1 and DropTarget3.IsDropped = 1) Then
  5094. DropTargetResetLockIsNotLit
  5095. Else
  5096. DropTargetPartialResetLockIsNotLit
  5097. End If
  5098.  
  5099. End Sub
  5100.  
  5101. Sub DropTargetResetLockIsLit (value) 'Normal Play - Only Target 1 up - Lock is lit
  5102. If debugMultiball Then debug.print "*****SUB:DropTargetResetLockIsLit"
  5103.  
  5104. If bGameInPlay = True then
  5105. bLockIsLit = True
  5106. SetLight lLockIsLit1, "blue", 2
  5107. SetLight lLockIsLit2, "blue", 2
  5108. SetLight lLockIsLit3, "blue", 2
  5109. If value = 0 Then
  5110. DOF 172, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "LOCKS ARE LIT"), eBlinkfast, 1000, True, "tna_lockislit"
  5111. UDMD "LOCKS ARE LIT", "", 1000
  5112. PuPEvent 89
  5113. ElseIf value = 1 Then
  5114. lLockIsLit2.TimerInterval = 500
  5115. lLockIsLit2.TimerEnabled = True
  5116. End If
  5117. End If
  5118. lRScoopEjectUpdate 0
  5119.  
  5120.  
  5121. DropTarget1.UserValue = 1
  5122. DropTarget1.IsDropped = 0
  5123. TargetBlocker1.IsDropped = 0
  5124. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), DropTarget1, 1
  5125.  
  5126. DropTarget2.UserValue = 0
  5127. DropTarget2.IsDropped = 1
  5128. TargetBlocker2.IsDropped = 1
  5129. PlaySoundAtVol SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors), DropTarget2, 1
  5130.  
  5131. DropTarget3.UserValue = 0
  5132. DropTarget3.IsDropped = 1
  5133. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), DropTarget3, 1
  5134. End Sub
  5135.  
  5136. Sub lLockIsLit2_Timer
  5137. lLockIsLit2.TimerEnabled = False
  5138. PlaySound "TNAWelcomeFuture":PuPEvent 1
  5139. pDMDStartGame
  5140. End Sub
  5141.  
  5142. Sub DropTargetResetLockIsNotLit 'Normal Play - Only Target 1 up - Lock is NOT lit
  5143. If debugMultiball Then debug.print "*****SUB:DropTargetResetLockIsNotLit"
  5144.  
  5145. bLockIsLit = False
  5146. lLockIsLit1.state = 0
  5147. lLockIsLit2.state = 0
  5148. lLockIsLit3.state = 0
  5149.  
  5150. DropTarget1.UserValue = 1
  5151. DropTarget1.IsDropped = 0
  5152. TargetBlocker1.IsDropped = 1
  5153. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), ActiveBall, 1
  5154.  
  5155. DropTarget2.UserValue = 0
  5156. DropTarget2.IsDropped = 1
  5157. TargetBlocker2.IsDropped = 1
  5158. PlaySoundAtVol SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors), ActiveBall, 1
  5159.  
  5160. DropTarget3.UserValue = 0
  5161. DropTarget3.IsDropped = 1
  5162. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5163. End Sub
  5164.  
  5165.  
  5166. Sub DropTargetPartialResetLockIsNotLit 'Normal Play - Any targets left up - Lock is NOT lit
  5167. If debugMultiball Then debug.print "*****SUB:DropTargetPartialResetLockIsNotLit"
  5168.  
  5169. bLockIsLit = False
  5170. lLockIsLit1.state = 0
  5171. lLockIsLit2.state = 0
  5172. lLockIsLit3.state = 0
  5173.  
  5174. 'at a minimum, one target up
  5175. DropTarget1.UserValue = 1
  5176. DropTarget1.IsDropped = 0
  5177. TargetBlocker1.IsDropped = 1
  5178. End Sub
  5179.  
  5180. Sub MultiballTargetResetImmediate 'Multiball Play - All targets up
  5181. If debugMultiball Then debug.print "*****SUB:MultiballTargetResetImmediate"
  5182. DropTarget1.TimerInterval = 200
  5183. DropTarget1.TimerEnabled = True
  5184.  
  5185. SetLight lLockIsLit1, "red", 2
  5186. SetLight lLockIsLit2, "red", 2
  5187. SetLight lLockIsLit3, "red", 2
  5188. End Sub
  5189.  
  5190. Sub MultiballTargetReset 'Multiball Play - All targets up
  5191. If debugMultiball Then debug.print "*****SUB:MultiballTargetReset"
  5192. DropTarget1.TimerInterval = 3000
  5193. DropTarget1.TimerEnabled = True
  5194.  
  5195. SetLight lLockIsLit1, "red", 2
  5196. SetLight lLockIsLit2, "red", 2
  5197. SetLight lLockIsLit3, "red", 2
  5198. End Sub
  5199.  
  5200. Sub MultiballTargetDrop
  5201. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), DropTarget1, 1
  5202. DropTarget1.UserValue = 0
  5203. DropTarget1.IsDropped = 1
  5204. TargetBlocker1.IsDropped = 1
  5205. PlaySoundAtVol SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors), DropTarget2, 1
  5206. DropTarget2.UserValue = 0
  5207. DropTarget2.IsDropped = 1
  5208. TargetBlocker2.IsDropped = 1
  5209. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), DropTarget3, 1
  5210. DropTarget3.UserValue = 0
  5211. DropTarget3.IsDropped = 1
  5212. End Sub
  5213.  
  5214. Sub DropTarget1_Timer 'Multiball Play - All targets up
  5215. If debugMultiball Then debug.print "*****SUB:DropTarget1_Timer"
  5216. DropTarget1.TimerEnabled = False
  5217.  
  5218. bLockIsLit = False
  5219.  
  5220. DropTarget1.UserValue = 1
  5221. DropTarget1.IsDropped = 0
  5222. TargetBlocker1.IsDropped = 1
  5223. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), DropTarget1, 1
  5224.  
  5225. DropTarget2.UserValue = 1
  5226. DropTarget2.IsDropped = 0
  5227. TargetBlocker2.IsDropped = 1
  5228. PlaySoundAtVol SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors), DropTarget2, 1
  5229.  
  5230. DropTarget3.UserValue = 1
  5231. DropTarget3.IsDropped = 0
  5232. DropTarget3.HasHitEvent = 1
  5233. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), DropTarget3, 1
  5234. End Sub
  5235.  
  5236. Sub DropTargetOpto2_Hit 'Locks ball 1
  5237. If debugMultiball Then debug.print "*****SUB:DropTargetOpto2_Hit"
  5238.  
  5239. If bLockIsLit = True Then 'Normal Play
  5240. If DropTarget2.UserValue = 0 And DropTarget1.UserValue = 1 Then
  5241. If bTimedSkillShot = False Then
  5242. DOF 173, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL LOCK 1"), eBlinkfast, 1800, True, "tna_balllock1"
  5243. UDMD "BALL 1", "LOCKED", 1800
  5244. Addscore BallLockScore
  5245. PuPEvent 15
  5246.  
  5247. Else
  5248. DOF 173, DOFPulse: DMD "", eNone, "", eNone, CenterLine(2, FormatScore(BallLockScore*2)), eNone, CenterLine(3, "SKILL LOCK"), eBlinkfast, 1800, True, "tna_secretskillshot2"
  5249. UDMD "SKILL LOCK 1", BallLockScore*2, 1800
  5250. Addscore BallLockScore*2
  5251. bTimedSkillShot = False
  5252. PuPEvent 41
  5253. End If
  5254.  
  5255. 'GIMballFlash
  5256. GIGame 3, "red"
  5257.  
  5258. AddBonusLights
  5259. PlaySoundAtVol SoundFXDOF("fx_resetdrop", 137, DOFPulse, DOFContactors), ActiveBall, 1
  5260. DropTarget2.UserValue = 1
  5261. DropTarget2.IsDropped = 0
  5262. TargetBlocker2.IsDropped = 0
  5263.  
  5264. If bGameInPlay Then vpmtimer.addtimer 2500, "CreateNewBallAfterBallLock '"
  5265.  
  5266. End If
  5267. End If
  5268.  
  5269. SetLastSwitchHit "DropTargetOpto2"
  5270. End Sub
  5271.  
  5272.  
  5273. Sub DropTargetOpto3_Hit 'Locks ball 2
  5274. If debugMultiball Then debug.print "*****SUB:DropTargetOpto3_Hit"
  5275.  
  5276. If bLockIsLit = True Then 'Normal Play
  5277.  
  5278. If DropTarget3.UserValue = 0 And DropTarget2.UserValue = 1 Then
  5279.  
  5280.  
  5281. If bTimedSkillShot = False Then
  5282. DOF 173, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL LOCK 2"), eBlinkfast, 1800, True, "tna_balllock2"
  5283. UDMD "BALL 2", "LOCKED", 1800
  5284. Addscore BallLockScore
  5285. PuPEvent 16
  5286. Else
  5287. DOF 173, DOFPulse: DMD "", eNone, "", eNone, CenterLine(2, FormatScore(BallLockScore*2)), eNone, CenterLine(3, "SKILL LOCK"), eBlinkfast, 1800, True, "tna_secretskillshot2"
  5288. UDMD "SKILL LOCK 2", BallLockScore*2, 1800
  5289. Addscore BallLockScore*2
  5290. bTimedSkillShot = False
  5291. PuPEvent 42
  5292. End If
  5293.  
  5294. 'GIMballFlash
  5295. GIGame 3, "red"
  5296.  
  5297. AddBonusLights
  5298. PlaySoundAtVol SoundFXDOF("fx_resetdrop", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5299. DropTarget3.UserValue = 1
  5300. DropTarget3.IsDropped = 0
  5301. If bGameInPlay Then vpmtimer.addtimer 2500, "CreateNewBallAfterBallLock '"
  5302.  
  5303. End If
  5304. End If
  5305. SetLastSwitchHit "DropTargetOpto3"
  5306. End Sub
  5307.  
  5308. Sub DropTarget1_Hit
  5309. If debugMultiball Then debug.print "*****SUB:DropTarget1_Hit"
  5310.  
  5311. AddBonusLights
  5312.  
  5313. If bMultiBallMode = False Then 'Normal Play
  5314. 'Addscore DropTargetScore
  5315. If (DropTarget1.UserValue = 1) Then
  5316. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5317. PlaySound "tna_toptarget"
  5318. lRScoopEjectUpdate 1
  5319. Else 'Game init reset
  5320. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), ActiveBall, 1
  5321. End If
  5322. Else 'Multiball Play
  5323. DropTarget1.UserValue = 0
  5324. AwardTripleJackpot
  5325. StartDropTargetResetTimer
  5326. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5327. End If
  5328. SetLastSwitchHit "DropTarget1"
  5329. End Sub
  5330.  
  5331. Sub DropTarget2_Hit
  5332. If debugMultiball Then debug.print "*****SUB:DropTarget2_Hit"
  5333.  
  5334. AddBonusLights
  5335.  
  5336. If bMultiBallMode = False Then 'Normal Play
  5337. 'Addscore DropTargetScore
  5338. If (DropTarget2.UserValue = 1) Then
  5339. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5340. PlaySound "tna_toptarget"
  5341. Else 'Game init reset
  5342. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), ActiveBall, 1
  5343. End If
  5344. Else 'Multiball Play
  5345. DropTarget2.UserValue = 0
  5346. AwardDoubleJackpot
  5347. StartDropTargetResetTimer
  5348. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5349. End If
  5350. SetLastSwitchHit "DropTarget2"
  5351. End Sub
  5352.  
  5353. Sub DropTarget3_Hit
  5354. If debugMultiball Then debug.print "*****SUB:DropTarget3_Hit"
  5355.  
  5356. AddBonusLights
  5357.  
  5358. If bMultiBallMode = False Then 'If in Normal Play
  5359. 'Addscore DropTargetScore
  5360. If (bLockIsLit = True) Then 'Multiball start
  5361. SetBallsOnPlayfield 3
  5362. Debug.print "BallsonPlayfieldMulti" & " : " & BallsOnPlayfield
  5363. bBallSaverReady = True
  5364. bAutoPlunger = True
  5365. EnableBallSaver BallSaverTime
  5366. ChangeGI "green", 1
  5367. vpmtimer.addtimer 10, "StartMultiball '"
  5368.  
  5369. 'GIMballFlash
  5370. GIGame 4, "green"
  5371.  
  5372. 'Drop targets
  5373. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), ActiveBall, 1
  5374. DropTarget1.UserValue = 0
  5375. DropTarget1.IsDropped = 1
  5376. TargetBlocker1.IsDropped = 1
  5377. PlaySoundAtVol SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors), ActiveBall, 1
  5378. DropTarget2.UserValue = 0
  5379. DropTarget2.IsDropped = 1
  5380. TargetBlocker2.IsDropped = 1
  5381. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5382. DropTarget3.UserValue = 0
  5383. DropTarget3.IsDropped = 1
  5384.  
  5385. Else 'Game init reset
  5386. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), ActiveBall, 1
  5387. PlaySound "tna_toptarget"
  5388. End If
  5389. Else 'Multiball Play
  5390. DropTarget3.UserValue = 0
  5391. AwardJackpot
  5392. StartDropTargetResetTimer
  5393. PlaySoundAtVol SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors), ActiveBall, 1
  5394.  
  5395. End If
  5396. SetLastSwitchHit "DropTarget3"
  5397. End Sub
  5398.  
  5399. Sub MultiballOptoCheck_Hit 'During Multiball, raise a drop target after x sec of no target hits
  5400. If debugMultiball Then debug.print "*****SUB:MultiballOptoCheck_Hit"
  5401.  
  5402. If bMultiBallMode = True Then
  5403. If debugMultiball Then debug.print "Calling StartDropTargetResetTimer"
  5404. StartDropTargetResetTimer
  5405. End If
  5406. If (DropTarget1.TimerEnabled = True) Then
  5407. If debugMultiball Then debug.print "Reseting DropTarget1 3 sec timer"
  5408. DropTarget1.TimerEnabled = True
  5409. DropTarget1.TimerInterval = 3000
  5410. DropTarget1.TimerEnabled = True
  5411. End If
  5412. End Sub
  5413.  
  5414.  
  5415. Sub StartDropTargetResetTimer 'During Multiball, raise a drop target after x sec of no target hits
  5416. If debugMultiball Then debug.print "*****SUB:StartDropTargetResetTimer"
  5417.  
  5418. DropTarget3.TimerEnabled = False
  5419. DropTarget3.TimerInterval = DropTargetResetTime*1000
  5420. DropTarget3.TimerEnabled = True
  5421. End Sub
  5422.  
  5423. Sub DropTarget3_Timer 'During Multiball, raise a drop target after x sec of no target hits
  5424. If debugMultiball Then debug.print "*****SUB:DropTarget3_Timer"
  5425.  
  5426. If bMultiBallMode = False Then 'Multiball over so stop resetting target
  5427. DropTarget3.TimerEnabled = False
  5428. Else
  5429. If DropTarget1.IsDropped = 1 Then
  5430. DropTarget1.IsDropped = 0
  5431. DropTarget1.UserValue = 1
  5432. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), DropTarget1, 1
  5433. ElseIf DropTarget2.IsDropped = 1 Then
  5434. DropTarget2.IsDropped = 0
  5435. DropTarget2.UserValue = 1
  5436. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), DropTarget2, 1
  5437. ElseIf DropTarget3.IsDropped = 1 Then
  5438. DropTarget3.IsDropped = 0
  5439. DropTarget3.UserValue = 1
  5440. PlaySoundAtVol SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors), DropTarget3, 1
  5441. End If
  5442. End If
  5443. End Sub
  5444.  
  5445.  
  5446. '**** MBALL GI ****
  5447. Sub GIMballFlash
  5448.  
  5449. Dim bulb
  5450.  
  5451. GIOff
  5452. For each bulb in aGIMballLIghts
  5453. SetLight bulb, "red", 1
  5454. Next
  5455. For each bulb in aGIRightSling
  5456. SetLight bulb, "red", 1
  5457. Next
  5458. For each bulb in aGILeftSling
  5459. SetLight bulb, "red", 1
  5460. Next
  5461.  
  5462. GI26.TimerInterval = 2000: GI26.TimerEnabled = True
  5463.  
  5464. End Sub
  5465.  
  5466. Sub GI26_Timer 'multiball flash
  5467. Dim Bulb
  5468.  
  5469. For each bulb in aGIMballLights
  5470. SetLight bulb, CurrCol, -1
  5471. Next
  5472. For each bulb in aGIRightSling
  5473. SetLight bulb, CurrCol, -1
  5474. Next
  5475. For each bulb in aGILeftSling
  5476. SetLight bulb, CurrCol, -1
  5477. Next
  5478. GIOn
  5479.  
  5480. GI26.TimerEnabled = False
  5481. 'If bGameInPlay Then CreateNewBallAfterBallLock 'delay cause mball problems
  5482. End Sub
  5483.  
  5484.  
  5485.  
  5486. ''*********************
  5487. '' Section; Section; Grid Targets
  5488. ''*********************
  5489. Dim bGridReady
  5490.  
  5491. Sub GridTargetx_hit()
  5492. PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
  5493. If debugGrid Then debug.print "*****SUB:" & "GridTargetx_hit"
  5494. Select Case ReactorState(CurrentPlayer)
  5495. Case 0: 'Targeted
  5496. If lx1.State = 2 then
  5497. SetLight lx1, "green", 1
  5498. SetLight lx2, "blue", 2
  5499. 'lx1.state = 1
  5500. 'lx2.state = 2
  5501. AddScore GridTargetScore
  5502. AddBonusLights2
  5503. DOF 184, DOFPulse
  5504. ElseIf lx2.State = 2 then
  5505. SetLight lx2, "green", 1
  5506. SetLight lx3, "blue", 2
  5507. 'lx2.state = 1
  5508. 'lx3.state = 2
  5509. AddScore GridTargetScore
  5510. AddBonusLights2
  5511. DOF 184, DOFPulse
  5512. ElseIf lx3.State = 2 then
  5513. SetLight lx3, "green", 1
  5514. 'lx3.state = 1
  5515. AddScore GridTargetScore
  5516. AddBonusLights2
  5517. DOF 184, DOFPulse
  5518. Else
  5519. Playsound "tna_targetreject"
  5520. End If
  5521. CheckGrid
  5522.  
  5523. Case 1: 'Ready
  5524. Playsound "tna_targetreject"
  5525.  
  5526. Case 2: 'Started
  5527. If lx1.State = 2 then
  5528. SetLight lx1, "purple", 1
  5529. SetLight lx2, "blue", 2
  5530. AddScore GridTargetScore
  5531. AddBonusLights2
  5532. DOF 187, DOFPulse
  5533. ElseIf lx2.State = 2 then
  5534. SetLight lx2, "purple", 1
  5535. SetLight lx3, "blue", 2
  5536. AddScore GridTargetScore
  5537. AddBonusLights2
  5538. DOF 187, DOFPulse
  5539. ElseIf lx3.State = 2 then
  5540. SetLight lx3, "purple", 1
  5541. AddScore GridTargetScore
  5542. AddBonusLights2
  5543. DOF 187, DOFPulse
  5544. Else
  5545. Playsound "tna_targetreject"
  5546. End If
  5547. CheckGrid
  5548.  
  5549. Case 3: 'Critical
  5550. If lx1.State = 2 then
  5551. SetLight lx1, "purple", 1
  5552. SetLight lx2, "blue", 2
  5553. AddScore GridTargetScore
  5554. AddBonusLights2
  5555. DOF 187, DOFPulse
  5556. ElseIf lx2.State = 2 then
  5557. SetLight lx2, "purple", 1
  5558. SetLight lx3, "blue", 2
  5559. AddScore GridTargetScore
  5560. AddBonusLights2
  5561. DOF 187, DOFPulse
  5562. ElseIf lx3.State = 2 then
  5563. SetLight lx3, "purple", 1
  5564. AddScore GridTargetScore
  5565. AddBonusLights2
  5566. DOF 187, DOFPulse
  5567. Else
  5568. Playsound "tna_targetreject"
  5569. End If
  5570. CheckGrid
  5571.  
  5572. Case 4: 'Destroyed
  5573. End Select
  5574. SetLastSwitchHit "GridTargetx"
  5575. End Sub
  5576.  
  5577. Sub GridTargety_hit()
  5578. PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
  5579. If debugGrid Then debug.print "*****SUB:" & "GridTargety_hit"
  5580. Select Case ReactorState(CurrentPlayer)
  5581. Case 0: 'Targeted
  5582. If ly1.State = 2 then
  5583. SetLight ly1, "green", 1
  5584. SetLight ly2, "blue", 2
  5585. AddScore GridTargetScore
  5586. AddBonusLights2
  5587. DOF 185, DOFPulse
  5588. ElseIf ly2.State = 2 then
  5589. SetLight ly2, "green", 1
  5590. SetLight ly3, "blue", 2
  5591. AddScore GridTargetScore
  5592. AddBonusLights2
  5593. DOF 185, DOFPulse
  5594. ElseIf ly3.State = 2 then
  5595. SetLight ly3, "green", 1
  5596. AddScore GridTargetScore
  5597. AddBonusLights2
  5598. DOF 185, DOFPulse
  5599. Else
  5600. Playsound "tna_targetreject"
  5601. End If
  5602. CheckGrid
  5603.  
  5604. Case 1: 'Ready
  5605. Playsound "tna_targetreject"
  5606. Case 2: 'Started
  5607. If ly1.State = 2 then
  5608. SetLight ly1, "purple", 1
  5609. SetLight ly2, "blue", 2
  5610. AddScore GridTargetScore
  5611. AddBonusLights2
  5612. DOF 188, DOFPulse
  5613. ElseIf ly2.State = 2 then
  5614. SetLight ly2, "purple", 1
  5615. SetLight ly3, "blue", 2
  5616. AddScore GridTargetScore
  5617. AddBonusLights2
  5618. DOF 188, DOFPulse
  5619. ElseIf ly3.State = 2 then
  5620. SetLight ly3, "purple", 1
  5621. AddScore GridTargetScore
  5622. AddBonusLights2
  5623. DOF 188, DOFPulse
  5624. Else
  5625. Playsound "tna_targetreject"
  5626. End If
  5627. CheckGrid
  5628.  
  5629. Case 3: 'Critical
  5630. If ly1.State = 2 then
  5631. SetLight ly1, "purple", 1
  5632. SetLight ly2, "blue", 2
  5633. AddScore GridTargetScore
  5634. AddBonusLights2
  5635. DOF 188, DOFPulse
  5636. ElseIf ly2.State = 2 then
  5637. SetLight ly2, "purple", 1
  5638. SetLight ly3, "blue", 2
  5639. AddScore GridTargetScore
  5640. AddBonusLights2
  5641. DOF 188, DOFPulse
  5642. ElseIf ly3.State = 2 then
  5643. SetLight ly3, "purple", 1
  5644. AddScore GridTargetScore
  5645. AddBonusLights2
  5646. DOF 188, DOFPulse
  5647. Else
  5648. Playsound "tna_targetreject"
  5649. End If
  5650. CheckGrid
  5651.  
  5652. Case 4: 'Destroyed
  5653.  
  5654. End Select
  5655. SetLastSwitchHit "GridTargety"
  5656. End Sub
  5657.  
  5658. Sub GridTargetz_hit()
  5659. PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
  5660. If debugGrid Then debug.print "*****SUB:" & "GridTargetz_hit"
  5661. Select Case ReactorState(CurrentPlayer)
  5662. Case 0: 'Targeted
  5663. If lz1.State = 2 then
  5664. SetLight lz1, "green", 1
  5665. SetLight lz2, "blue", 2
  5666. AddScore GridTargetScore
  5667. AddBonusLights2
  5668. DOF 186, DOFPulse
  5669. ElseIf lz2.State = 2 then
  5670. SetLight lz2, "green", 1
  5671. SetLight lz3, "blue", 2
  5672. AddScore GridTargetScore
  5673. AddBonusLights2
  5674. DOF 186, DOFPulse
  5675. ElseIf lz3.State = 2 then
  5676. SetLight lz3, "green", 1
  5677. AddScore GridTargetScore
  5678. AddBonusLights2
  5679. DOF 186, DOFPulse
  5680. Else
  5681. Playsound "tna_targetreject"
  5682. End If
  5683. CheckGrid
  5684.  
  5685. Case 1: 'Ready
  5686. Playsound "tna_targetreject"
  5687.  
  5688. Case 2: 'Started
  5689. If lz1.State = 2 then
  5690. SetLight lz1, "purple", 1
  5691. SetLight lz2, "blue", 2
  5692. AddScore GridTargetScore
  5693. AddBonusLights2
  5694. DOF 189, DOFPulse
  5695. ElseIf lz2.State = 2 then
  5696. SetLight lz2, "purple", 1
  5697. SetLight lz3, "blue", 2
  5698. AddScore GridTargetScore
  5699. AddBonusLights2
  5700. DOF 189, DOFPulse
  5701. ElseIf lz3.State = 2 then
  5702. SetLight lz3, "purple", 1
  5703. AddScore GridTargetScore
  5704. AddBonusLights2
  5705. DOF 189, DOFPulse
  5706. Else
  5707. Playsound "tna_targetreject"
  5708. End If
  5709. CheckGrid
  5710.  
  5711. Case 3: 'Critical
  5712. If lz1.State = 2 then
  5713. SetLight lz1, "purple", 1
  5714. SetLight lz2, "blue", 2
  5715. AddScore GridTargetScore
  5716. AddBonusLights2
  5717. DOF 189, DOFPulse
  5718. ElseIf lz2.State = 2 then
  5719. SetLight lz2, "purple", 1
  5720. SetLight lz3, "blue", 2
  5721. AddScore GridTargetScore
  5722. AddBonusLights2
  5723. DOF 189, DOFPulse
  5724. ElseIf lz3.State = 2 then
  5725. SetLight lz3, "purple", 1
  5726. AddScore GridTargetScore
  5727. AddBonusLights2
  5728. DOF 189, DOFPulse
  5729. Else
  5730. Playsound "tna_targetreject"
  5731. End If
  5732. CheckGrid
  5733.  
  5734. Case 4: 'Destroyed
  5735.  
  5736. End Select
  5737. SetLastSwitchHit "GridTargetz"
  5738. End Sub
  5739.  
  5740. Dim GridSetup
  5741. Sub ResetGrid()
  5742. GridSetup = ReactorLevel(CurrentPlayer) + ReactorDifficulty - 1
  5743. If debugGrid Then debug.print "*****SUB:" & "ResetGrid " & GridSetup
  5744. bGridReady = 0
  5745.  
  5746. Select Case GridSetup:
  5747.  
  5748. Case 1: '3 targets
  5749. SetLight lx1, "green", 1
  5750. SetLight lx2, "green", 1
  5751. SetLight lx3, "blue", 2
  5752.  
  5753. SetLight ly1, "green", 1
  5754. SetLight ly2, "green", 1
  5755. SetLight ly3, "blue", 2
  5756.  
  5757. SetLight lz1, "green", 1
  5758. SetLight lz2, "green", 1
  5759. SetLight lz3, "blue", 2
  5760. Case 2: '4 targets
  5761. SetLight lx1, "green", 1
  5762. SetLight lx2, "blue", 2
  5763. SetLight lx3, "green", 0
  5764.  
  5765. SetLight ly1, "green", 1
  5766. SetLight ly2, "green", 1
  5767. SetLight ly3, "blue", 2
  5768.  
  5769. SetLight lz1, "green", 1
  5770. SetLight lz2, "green", 1
  5771. SetLight lz3, "blue", 2
  5772. Case 3: '5 targets
  5773. SetLight lx1, "green", 1
  5774. SetLight lx2, "blue", 2
  5775. SetLight lx3, "green", 0
  5776.  
  5777. SetLight ly1, "green", 1
  5778. SetLight ly2, "blue", 2
  5779. SetLight ly3, "green", 0
  5780.  
  5781. SetLight lz1, "green", 1
  5782. SetLight lz2, "green", 1
  5783. SetLight lz3, "blue", 2
  5784. Case 4: '6 targets
  5785. SetLight lx1, "green", 1
  5786. SetLight lx2, "blue", 2
  5787. SetLight lx3, "green", 0
  5788.  
  5789. SetLight ly1, "green", 1
  5790. SetLight ly2, "blue", 2
  5791. SetLight ly3, "green", 0
  5792.  
  5793. SetLight lz1, "green", 1
  5794. SetLight lz2, "blue", 2
  5795. SetLight lz3, "green", 0
  5796. Case 5: '7 targets
  5797. SetLight lx1, "blue", 2
  5798. SetLight lx2, "green", 0
  5799. SetLight lx3, "green", 0
  5800.  
  5801. SetLight ly1, "green", 1
  5802. SetLight ly2, "blue", 2
  5803. SetLight ly3, "green", 0
  5804.  
  5805. SetLight lz1, "green", 1
  5806. SetLight lz2, "blue", 2
  5807. SetLight lz3, "green", 0
  5808. Case 6: '8 targets
  5809. SetLight lx1, "blue", 2
  5810. SetLight lx2, "green", 0
  5811. SetLight lx3, "green", 0
  5812.  
  5813. SetLight ly1, "blue", 2
  5814. SetLight ly2, "green", 0
  5815. SetLight ly3, "green", 0
  5816.  
  5817. SetLight lz1, "green", 1
  5818. SetLight lz2, "blue", 2
  5819. SetLight lz3, "green", 0
  5820. Case Else:
  5821. SetLight lx1, "blue", 2
  5822. SetLight lx2, "green", 0
  5823. SetLight lx3, "green", 0
  5824.  
  5825. SetLight ly1, "blue", 2
  5826. SetLight ly2, "green", 0
  5827. SetLight ly3, "green", 0
  5828.  
  5829. SetLight lz1, "blue", 2
  5830. SetLight lz2, "green", 0
  5831. SetLight lz3, "green", 0
  5832. End Select
  5833.  
  5834. End Sub
  5835.  
  5836. Sub StartGridJackpot()
  5837. If debugGrid Then debug.print "*****SUB:" & "StartGridJackpot"
  5838.  
  5839. 'Set Grid Color
  5840. SetLight lx1, "blue", 2
  5841. SetLight lx2, "purple", 0
  5842. SetLight lx3, "purple", 0
  5843. SetLight ly1, "blue", 2
  5844. SetLight ly2, "purple", 0
  5845. SetLight ly3, "purple", 0
  5846. SetLight lz1, "blue", 2
  5847. SetLight lz2, "purple", 0
  5848. SetLight lz3, "purple", 0
  5849. '
  5850. ' lx1.State = 2
  5851. ' lx2.State = 0
  5852. ' lx3.State = 0
  5853. '
  5854. ' ly1.State = 2
  5855. ' ly2.State = 0
  5856. ' ly3.State = 0
  5857. '
  5858. ' lz1.State = 2
  5859. ' lz2.State = 0
  5860. ' lz3.State = 0
  5861. End Sub
  5862.  
  5863. Dim Playerx1(4)
  5864. Dim Playerx2(4)
  5865. Dim Playerx3(4)
  5866. Dim Playery1(4)
  5867. Dim Playery2(4)
  5868. Dim Playery3(4)
  5869. Dim Playerz1(4)
  5870. Dim Playerz2(4)
  5871. Dim Playerz3(4)
  5872.  
  5873. Sub InitGridData
  5874. Dim i
  5875. For i = 1 To MaxPlayers
  5876. Playerx1(i) = 0
  5877. Playerx2(i) = 0
  5878. Playerx3(i) = 0
  5879. Playery1(i) = 0
  5880. Playery2(i) = 0
  5881. Playery3(i) = 0
  5882. Playerz1(i) = 0
  5883. Playerz2(i) = 0
  5884. Playerz3(i) = 0
  5885. Next
  5886. End Sub
  5887.  
  5888. Sub SaveGridData
  5889. If debugGrid Then debug.print "*****SUB:" & "SaveGridState"
  5890. Playerx1(CurrentPlayer) = lx1.State
  5891. Playerx2(CurrentPlayer) = lx2.State
  5892. Playerx3(CurrentPlayer) = lx3.State
  5893. Playery1(CurrentPlayer) = ly1.State
  5894. Playery2(CurrentPlayer) = ly2.State
  5895. Playery3(CurrentPlayer) = ly3.State
  5896. Playerz1(CurrentPlayer) = lz1.State
  5897. Playerz2(CurrentPlayer) = lz2.State
  5898. Playerz3(CurrentPlayer) = lz3.State
  5899. End Sub
  5900.  
  5901. Sub RestoreGridData
  5902.  
  5903. If ((BallsRemaining(CurrentPlayer) = BallsPerGame) And (CoopMode = 0)) Then 'If first ball for new player
  5904. ResetGrid
  5905. Elseif ((CurrentPlayer = 2) And (BallsRemaining(CurrentPlayer) = BallsPerGame) And (CoopMode = 2)) Then 'If first ball for 2nd player in co-op mode 2
  5906. ResetGrid
  5907. ElseIf ReactorState(CurrentPlayer) >= 2 Then
  5908. SetLightGrid lx1, "purple", Playerx1(CurrentPlayer)
  5909. SetLightGrid lx2, "purple", Playerx2(CurrentPlayer)
  5910. SetLightGrid lx3, "purple", Playerx3(CurrentPlayer)
  5911. SetLightGrid ly1, "purple", Playery1(CurrentPlayer)
  5912. SetLightGrid ly2, "purple", Playery2(CurrentPlayer)
  5913. SetLightGrid ly3, "purple", Playery3(CurrentPlayer)
  5914. SetLightGrid lz1, "purple", Playerz1(CurrentPlayer)
  5915. SetLightGrid lz2, "purple", Playerz2(CurrentPlayer)
  5916. SetLightGrid lz3, "purple", Playerz3(CurrentPlayer)
  5917. Else
  5918. SetLightGrid lx1, "green", Playerx1(CurrentPlayer)
  5919. SetLightGrid lx2, "green", Playerx2(CurrentPlayer)
  5920. SetLightGrid lx3, "green", Playerx3(CurrentPlayer)
  5921. SetLightGrid ly1, "green", Playery1(CurrentPlayer)
  5922. SetLightGrid ly2, "green", Playery2(CurrentPlayer)
  5923. SetLightGrid ly3, "green", Playery3(CurrentPlayer)
  5924. SetLightGrid lz1, "green", Playerz1(CurrentPlayer)
  5925. SetLightGrid lz2, "green", Playerz2(CurrentPlayer)
  5926. SetLightGrid lz3, "green", Playerz3(CurrentPlayer)
  5927. End If
  5928.  
  5929. End Sub
  5930.  
  5931. Sub CopyGridData (p1, p2)
  5932. If debugGrid Then debug.print "*****SUB:" & "CopyGridData"
  5933. Playerx1(p2) = Playerx1(p1)
  5934. Playerx2(p2) = Playerx2(p1)
  5935. Playerx3(p2) = Playerx3(p1)
  5936. Playery1(p2) = Playery1(p1)
  5937. Playery2(p2) = Playery2(p1)
  5938. Playery3(p2) = Playery3(p1)
  5939. Playerz1(p2) = Playerz1(p1)
  5940. Playerz2(p2) = Playerz2(p1)
  5941. Playerz3(p2) = Playerz3(p1)
  5942. End Sub
  5943.  
  5944. Sub SetLightGrid (obj, col, state)
  5945. If state = 2 then
  5946. SetLight obj, "blue", state
  5947. Else
  5948. SetLight obj, col, state
  5949. End If
  5950. End Sub
  5951.  
  5952. Sub TestHitTarget
  5953. If debugGrid Then debug.print "*****SUB:" & "TestHitTarget"
  5954. GridTargetx_hit
  5955. GridTargetx_hit
  5956. GridTargetx_hit
  5957. GridTargety_hit
  5958. GridTargety_hit
  5959. GridTargety_hit
  5960. GridTargetz_hit
  5961. GridTargetz_hit
  5962. GridTargetz_hit
  5963. ' lx1.State = 1
  5964. ' lx2.State = 1
  5965. ' lx3.State = 1
  5966. '
  5967. ' ly1.State = 1
  5968. ' ly2.State = 1
  5969. ' ly3.State = 1
  5970. '
  5971. ' lz1.State = 1
  5972. ' lz2.State = 1
  5973. ' lz3.State = 1
  5974. CheckGrid
  5975. end Sub
  5976.  
  5977. Sub CheckGrid
  5978.  
  5979. dim tmp
  5980. tmp = 0
  5981.  
  5982.  
  5983. If lx1.State = 1 then tmp = tmp + 1
  5984. If lx2.State = 1 then tmp = tmp + 1
  5985. If lx3.State = 1 then tmp = tmp + 1
  5986.  
  5987. If ly1.State = 1 then tmp = tmp + 1
  5988. If ly2.State = 1 then tmp = tmp + 1
  5989. If ly3.State = 1 then tmp = tmp + 1
  5990.  
  5991. If lz1.State = 1 then tmp = tmp + 1
  5992. If lz2.State = 1 then tmp = tmp + 1
  5993. If lz3.State = 1 then tmp = tmp + 1
  5994.  
  5995. If debugGrid Then debug.print "*****SUB:CheckGrid(), Grid=" & tmp
  5996.  
  5997. If tmp = 9 Then
  5998. If ReactorState(CurrentPlayer) = 0 Then
  5999. SetReactorReady
  6000. ElseIf (ReactorState(CurrentPlayer) = 2) or (ReactorState(CurrentPlayer) = 3) Then
  6001. ReactorJackpot
  6002. End If
  6003.  
  6004. AddBonusLights
  6005. End If
  6006. End Sub
  6007.  
  6008. Sub ByPassGrid
  6009. If debugGrid Then debug.print "*****SUB:ByPassGrid"
  6010. If ReactorState(CurrentPlayer) = 0 Then
  6011. SetReactorReady
  6012. End If
  6013. End Sub
  6014.  
  6015. Sub ReactorJackpot
  6016. If debugGrid Then debug.print "*****SUB:" & "ReactorJackpot"
  6017.  
  6018. DOF 175, DOFPulse: DMD "", eNone, Centerline(1, ("REACTOR JKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(.5*ReactorValue(CurrentPlayer))), eBlinkFast, 1000, True, "tna_reactorjackpot"
  6019. UDMD "REACTOR JACKPOT", .5*ReactorValue(CurrentPlayer), 1000
  6020. AddScore (.5*ReactorValue(CurrentPlayer))
  6021. StartGridJackpot
  6022. PuPEvent 74
  6023. End Sub
  6024.  
  6025. Sub ReadyGrid 'Blinking to Left Scoop
  6026. If debugGrid Then debug.print "*****SUB:" & "ReadyGrid"
  6027. SetLight lx1, "", 0
  6028. SetLight lx2, "", 0
  6029. SetLight lx3, "", 0
  6030.  
  6031. SetLight ly1, "", 0
  6032. SetLight ly2, "", 0
  6033. SetLight ly3, "", 0
  6034.  
  6035. SetLight lz1, "", 0
  6036. SetLight lz2, "", 0
  6037. SetLight lz3, "", 0
  6038.  
  6039. SetLight lx3, "blue", 2
  6040. SetLight ly2, "blue", 2
  6041. SetLight lz1, "blue", 2
  6042.  
  6043. bGridReady = 1
  6044. End Sub
  6045.  
  6046.  
  6047. ''*********************
  6048. '' Section; Bonus Lights
  6049. ''*********************
  6050.  
  6051. 'Bonus light TEST
  6052. lbonus1.timerinterval = 500
  6053. 'lbonus1.timerenabled = 1
  6054. Sub lBonus1_timer
  6055. AddBonusLights
  6056. End Sub
  6057.  
  6058. Sub AddBonusLights2
  6059. playsound "tna_target"
  6060. AddBonusLights
  6061. End Sub
  6062.  
  6063. Sub AddBonusLights
  6064. Dim tmp
  6065. ' Dim xmultiplier
  6066. ' xMultiplier = BallsOnPlayfield
  6067. ' If xMultiplier = 0 then xMultiplier = 1
  6068.  
  6069. BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + 1 '+ (1 * xMultiplier)
  6070.  
  6071. tmp = BonusPoints(CurrentPlayer) mod 10
  6072. Select Case tmp
  6073. Case 1:
  6074. lBonus1.State = 1
  6075. lBonus2.State = 0
  6076. lBonus3.State = 0
  6077. lBonus4.State = 0
  6078. lBonus5.State = 0
  6079. lBonus6.State = 0
  6080. lBonus7.State = 0
  6081. lBonus8.State = 0
  6082. lBonus9.State = 0
  6083. lBonus0.State= 0
  6084. Case 2:
  6085. lBonus1.State = 1
  6086. lBonus2.State = 1
  6087. lBonus3.State = 0
  6088. lBonus4.State = 0
  6089. lBonus5.State = 0
  6090. lBonus6.State = 0
  6091. lBonus7.State = 0
  6092. lBonus8.State = 0
  6093. lBonus9.State = 0
  6094. lBonus0.State= 0
  6095. Case 3:
  6096. lBonus1.State = 1
  6097. lBonus2.State = 1
  6098. lBonus3.State = 1
  6099. lBonus4.State = 0
  6100. lBonus5.State = 0
  6101. lBonus6.State = 0
  6102. lBonus7.State = 0
  6103. lBonus8.State = 0
  6104. lBonus9.State = 0
  6105. lBonus0.State= 0
  6106. Case 4:
  6107. lBonus1.State = 1
  6108. lBonus2.State = 1
  6109. lBonus3.State = 1
  6110. lBonus4.State = 1
  6111. lBonus5.State = 0
  6112. lBonus6.State = 0
  6113. lBonus7.State = 0
  6114. lBonus8.State = 0
  6115. lBonus9.State = 0
  6116. lBonus0.State= 0
  6117. Case 5:
  6118. lBonus1.State = 1
  6119. lBonus2.State = 1
  6120. lBonus3.State = 1
  6121. lBonus4.State = 1
  6122. lBonus5.State = 1
  6123. lBonus6.State = 0
  6124. lBonus7.State = 0
  6125. lBonus8.State = 0
  6126. lBonus9.State = 0
  6127. lBonus0.State= 0
  6128. Case 6:
  6129. lBonus1.State = 1
  6130. lBonus2.State = 1
  6131. lBonus3.State = 1
  6132. lBonus4.State = 1
  6133. lBonus5.State = 1
  6134. lBonus6.State = 1
  6135. lBonus7.State = 0
  6136. lBonus8.State = 0
  6137. lBonus9.State = 0
  6138. lBonus0.State= 0
  6139. Case 7:
  6140. lBonus1.State = 1
  6141. lBonus2.State = 1
  6142. lBonus3.State = 1
  6143. lBonus4.State = 1
  6144. lBonus5.State = 1
  6145. lBonus6.State = 1
  6146. lBonus7.State = 1
  6147. lBonus8.State = 0
  6148. lBonus9.State = 0
  6149. lBonus0.State= 0
  6150. Case 8:
  6151. lBonus1.State = 1
  6152. lBonus2.State = 1
  6153. lBonus3.State = 1
  6154. lBonus4.State = 1
  6155. lBonus5.State = 1
  6156. lBonus6.State = 1
  6157. lBonus7.State = 1
  6158. lBonus8.State = 1
  6159. lBonus9.State = 0
  6160. lBonus0.State= 0
  6161. Case 9:
  6162. lBonus1.State = 1
  6163. lBonus2.State = 1
  6164. lBonus3.State = 1
  6165. lBonus4.State = 1
  6166. lBonus5.State = 1
  6167. lBonus6.State = 1
  6168. lBonus7.State = 1
  6169. lBonus8.State = 1
  6170. lBonus9.State = 1
  6171. lBonus0.State= 0
  6172. Case 0:
  6173. If BonusPoints(CurrentPlayer) > 0 Then
  6174. lBonus1.State = 1
  6175. lBonus2.State = 1
  6176. lBonus3.State = 1
  6177. lBonus4.State = 1
  6178. lBonus5.State = 1
  6179. lBonus6.State = 1
  6180. lBonus7.State = 1
  6181. lBonus8.State = 1
  6182. lBonus9.State = 1
  6183. lBonus0.State= 1
  6184. End If
  6185. End Select
  6186.  
  6187. If BonusPoints(CurrentPlayer) > 150 Then
  6188. lBonus50.State= 1
  6189. lBonus40.State= 1
  6190. lBonus30.State= 1
  6191. lBonus20.State= 1
  6192. lBonus10.State= 1
  6193. ElseIf BonusPoints(CurrentPlayer) > 140 Then
  6194. lBonus50.State= 1
  6195. lBonus40.State= 1
  6196. lBonus30.State= 1
  6197. lBonus20.State= 1
  6198. lBonus10.State= 0
  6199. ElseIf BonusPoints(CurrentPlayer) > 130 Then
  6200. lBonus50.State= 1
  6201. lBonus40.State= 1
  6202. lBonus30.State= 1
  6203. lBonus20.State= 0
  6204. lBonus10.State= 1
  6205. ElseIf BonusPoints(CurrentPlayer) > 120 Then
  6206. lBonus50.State= 1
  6207. lBonus40.State= 1
  6208. lBonus30.State= 1
  6209. lBonus20.State= 0
  6210. lBonus10.State= 0
  6211. ElseIf BonusPoints(CurrentPlayer) > 110 Then
  6212. lBonus50.State= 1
  6213. lBonus40.State= 1
  6214. lBonus30.State= 0
  6215. lBonus20.State= 1
  6216. lBonus10.State= 0
  6217. ElseIf BonusPoints(CurrentPlayer) > 100 Then
  6218. lBonus50.State= 1
  6219. lBonus40.State= 1
  6220. lBonus30.State= 0
  6221. lBonus20.State= 0
  6222. lBonus10.State= 1
  6223. ElseIf BonusPoints(CurrentPlayer) > 90 Then
  6224. lBonus50.State= 1
  6225. lBonus40.State= 1
  6226. lBonus30.State= 0
  6227. lBonus20.State= 0
  6228. lBonus10.State= 0
  6229. ElseIf BonusPoints(CurrentPlayer) > 80 Then
  6230. lBonus50.State= 1
  6231. lBonus40.State= 0
  6232. lBonus30.State= 1
  6233. lBonus20.State= 0
  6234. lBonus10.State= 0
  6235. ElseIf BonusPoints(CurrentPlayer) > 70 Then
  6236. lBonus50.State= 1
  6237. lBonus40.State= 0
  6238. lBonus30.State= 0
  6239. lBonus20.State= 1
  6240. lBonus10.State= 0
  6241. ElseIf BonusPoints(CurrentPlayer) > 60 Then
  6242. lBonus50.State= 1
  6243. lBonus40.State= 0
  6244. lBonus30.State= 0
  6245. lBonus20.State= 0
  6246. lBonus10.State= 1
  6247. ElseIf BonusPoints(CurrentPlayer) > 50 Then
  6248. lBonus50.State= 1
  6249. lBonus40.State= 0
  6250. lBonus30.State= 0
  6251. lBonus20.State= 0
  6252. lBonus10.State= 0
  6253. ElseIf BonusPoints(CurrentPlayer) > 40 Then
  6254. lBonus50.State= 0
  6255. lBonus40.State= 1
  6256. lBonus30.State= 0
  6257. lBonus20.State= 0
  6258. lBonus10.State= 0
  6259. ElseIf BonusPoints(CurrentPlayer) > 30 Then
  6260. lBonus50.State= 0
  6261. lBonus40.State= 0
  6262. lBonus30.State= 1
  6263. lBonus20.State= 0
  6264. lBonus10.State= 0
  6265. ElseIf BonusPoints(CurrentPlayer) > 20 Then
  6266. lBonus50.State= 0
  6267. lBonus40.State= 0
  6268. lBonus30.State= 0
  6269. lBonus20.State= 1
  6270. lBonus10.State= 0
  6271. ElseIf BonusPoints(CurrentPlayer) > 10 Then
  6272. lBonus50.State= 0
  6273. lBonus40.State= 0
  6274. lBonus30.State= 0
  6275. lBonus20.State= 0
  6276. lBonus10.State= 1
  6277. Else
  6278. lBonus50.State= 0
  6279. lBonus40.State= 0
  6280. lBonus30.State= 0
  6281. lBonus20.State= 0
  6282. lBonus10.State= 0
  6283. End If
  6284. End Sub
  6285.  
  6286. Sub ResetBonusLights
  6287. BonusPoints(CurrentPlayer) = 0
  6288. lBonus1.State = 0
  6289. lBonus2.State = 0
  6290. lBonus3.State = 0
  6291. lBonus4.State = 0
  6292. lBonus5.State = 0
  6293. lBonus6.State = 0
  6294. lBonus7.State = 0
  6295. lBonus8.State = 0
  6296. lBonus9.State = 0
  6297. lBonus0.State= 0
  6298. lBonus10.State= 0
  6299. lBonus20.State= 0
  6300. lBonus30.State= 0
  6301. lBonus40.State= 0
  6302. lBonus50.State= 0
  6303. End Sub
  6304.  
  6305. ''*********************
  6306. '' Section; Reactor
  6307. ''*********************
  6308. ' ReactorState overview
  6309. 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
  6310. 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
  6311. 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
  6312. 'Critical 3 - targets not active, no check grid, gates 2-way
  6313. 'Destroyed 4 -
  6314. Dim ReactorState(4)
  6315. Dim ReactorLevel(4)
  6316. Dim ReactorPercent(4)
  6317. Dim ReactorDestroyCount(4)
  6318. Dim ReactorValue(4)
  6319. Dim ReactorValueMax(4)
  6320. Dim LastReactorBeforeDifficultyKicksIn
  6321. Dim ReactorTNAAchieved(4)
  6322. Dim ReactorReactorTotalReward(4)
  6323.  
  6324. Const ReactorSpinnerPercent = 2
  6325. Const ReactorSwitchPercent = 16
  6326. Const ReactorValue1 = 25000
  6327. Const ReactorValue2 = 37500
  6328. Const ReactorValue3 = 50000 'Max = 150,000
  6329. Const ReactorValue4 = 62500
  6330. Const ReactorValue5 = 75000
  6331. Const ReactorValue6 = 87500
  6332. Const ReactorValue7 = 100000
  6333. Const ReactorValue8 = 112500
  6334. Const ReactorValue9 = 125000
  6335. Const ReactorMaxMultiplier = 3
  6336.  
  6337. Sub ResetReactor
  6338. debug.print "*****SUB:" & "ResetReactor [ReactorState(CurrentPlayer)=0]"
  6339. dim tmp
  6340.  
  6341. ReactorState(CurrentPlayer) = 0
  6342. SetReactorPercent -1
  6343. SetReactorDestroyCount 0
  6344. SetReactorInserts 0
  6345. lStart.state = 0
  6346. lScoopEjectUpdate
  6347. RestoreRAD
  6348.  
  6349. If ReactorDifficulty = 1 Then
  6350. LastReactorBeforeDifficultyKicksIn = 6
  6351. Else
  6352. LastReactorBeforeDifficultyKicksIn = 3
  6353. End If
  6354.  
  6355. 'Value of this reactor
  6356. tmp = "ReactorValue" & ReactorLevel(CurrentPlayer) 'ReactorValue1 - 9
  6357. ReactorValue(CurrentPlayer) = eval(tmp)
  6358. ReactorValueMax(CurrentPlayer) = ReactorValue(CurrentPlayer) * ReactorMaxMultiplier
  6359. tReactorValue.text = ReactorValue(CurrentPlayer)
  6360.  
  6361. 'Light Reactor
  6362. Select Case ReactorLevel(CurrentPlayer)
  6363. Case 1:
  6364. SetLight lReactor1, "green", 2
  6365. Case 2:
  6366. SetLight lReactor1, "red", 1
  6367. SetLight lReactor2, "green", 2
  6368. Case 3:
  6369. SetLight lReactor2, "red", 1
  6370. SetLight lReactor3, "green", 2
  6371. Case 4:
  6372. SetLight lReactor3, "red", 1
  6373. SetLight lReactor4, "green", 2
  6374. Case 5:
  6375. SetLight lReactor4, "red", 1
  6376. SetLight lReactor5, "green", 2
  6377. Case 6:
  6378. SetLight lReactor5, "red", 1
  6379. SetLight lReactor6, "green", 2
  6380. Case 7
  6381. SetLight lReactor6, "red", 1
  6382. SetLight lReactor7, "green", 2
  6383. Case 8:
  6384. SetLight lReactor7, "red", 1
  6385. SetLight lReactor8, "green", 2
  6386. Case 9:
  6387. SetLight lReactor8, "red", 1
  6388. SetLight lReactor9, "green", 2
  6389. Case 10:
  6390. SetLight lReactor9, "red", 1
  6391. End Select
  6392. End Sub
  6393.  
  6394. 'Sub DisableReactor
  6395. ' If debugReactor then debug.print "*****SUB:" & "DisableReactor [ReactorState(CurrentPlayer)=0]"
  6396. ' ReactorState(CurrentPlayer) = 0
  6397. ' AddReactorPercent 0
  6398. 'End Sub
  6399.  
  6400. Sub SetReactorReady 'Called when Grid is complete
  6401. If debugReactor then debug.print "*****SUB:" & "SetReactorReady [ReactorState(CurrentPlayer)=1]"
  6402. ReactorState(CurrentPlayer) = 1
  6403. lStart.state = 2
  6404. lScoopEjectUpdate
  6405. ReadyGrid
  6406.  
  6407.  
  6408. DOF 176, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "REACTOR READY"), eBlinkfast, 1800, True, "tna_reactorready":PuPEvent 21
  6409. UDMD "REACTOR", "READY", 1800
  6410. End Sub
  6411.  
  6412.  
  6413. Sub CheckReactorStart 'Checked when left scoop hit
  6414. If ReactorState(CurrentPlayer) = 1 Then
  6415. ReactorState(CurrentPlayer) = 2 'Reactor Started
  6416. lStart.state = 0
  6417. lScoopEjectUpdate
  6418. GIReactorStarted
  6419. Pupevent 19
  6420.  
  6421. StartGridJackpot
  6422. DOF 177, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "REACTOR START"), eBlinkfast, 1800, True, "tna_reactoronline"
  6423. UDMD "REACTOR", "ONLINE", 1800
  6424. SetReactorInserts 2
  6425.  
  6426. ' If MaxTargetFlag = False Then
  6427. AddReactorPercent 0
  6428.  
  6429. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
  6430. fRones.TimerInterval = ReactorPercentLossTime * 1000
  6431. fRones.TimerEnabled = True
  6432. StartReactorLeftLoopInserts
  6433. Else 'ReactorLevel(CurrentPlayer) 1 and 2 and e
  6434. StartReactorLoopInserts
  6435. End If
  6436. ' Else
  6437. ' SetReactorPercent 100
  6438. ' StartMAxTarget
  6439. ' End If
  6440.  
  6441. End If
  6442. If debugReactor then debug.print "*****SUB:" & "CheckReactorStart [ReactorState(CurrentPlayer)=" & ReactorState(CurrentPlayer) & "]"
  6443. End Sub
  6444.  
  6445. Sub fRones_Timer
  6446. AddReactorPercent - 1
  6447. End Sub
  6448.  
  6449. Sub StartReactorLoopInserts
  6450. lLoopL.state = 2
  6451. lLoopR.state = 2
  6452. lTria1.state = 2
  6453. lTria2.state = 2
  6454. lTria3.state = 2
  6455. lTria4.state = 2
  6456. lTria5.state = 2
  6457. lTria6.state = 2
  6458. End Sub
  6459. Sub ResetReactorLoopInserts
  6460. lLoopL.state = 0
  6461. lLoopR.state = 0
  6462. lTria1.state = 0
  6463. lTria2.state = 0
  6464. lTria3.state = 0
  6465. lTria4.state = 0
  6466. lTria5.state = 0
  6467. lTria6.state = 0
  6468. End Sub
  6469.  
  6470. Sub StartReactorLeftLoopInserts
  6471. If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
  6472. lLoopL.state = 2
  6473. lTria1.state = 2
  6474. lTria2.state = 2
  6475. lTria3.state = 2
  6476.  
  6477. lLoopR.state = 0
  6478. lTria4.state = 0
  6479. lTria5.state = 0
  6480. lTria6.state = 0
  6481. End If
  6482. End Sub
  6483.  
  6484. Sub StartReactorRightLoopInserts
  6485. If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
  6486. lLoopR.state = 2
  6487. lTria4.state = 2
  6488. lTria5.state = 2
  6489. lTria6.state = 2
  6490.  
  6491. lLoopL.state = 0
  6492. lTria1.state = 0
  6493. lTria2.state = 0
  6494. lTria3.state = 0
  6495. End If
  6496. End Sub
  6497.  
  6498. Sub SwitchReactorLoopInserts
  6499. If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
  6500. If lLoopL.State = 2 Then
  6501. StartReactorRightLoopInserts
  6502. ElseIf lLoopR.State = 2 Then
  6503. StartReactorLeftLoopInserts
  6504. End If
  6505. End If
  6506. End Sub
  6507.  
  6508. Sub ClearReactorPercent
  6509. fRtens.ImageA = "blank"
  6510. fRones.ImageA = "blank"
  6511. SetReactorInsertsInterval 200
  6512. End Sub
  6513.  
  6514. Dim drtens, drones
  6515. Sub SetReactorPercent (value)
  6516. If debugReactor then debug.print "*****SUB:" & "SetReactorPercent " & value
  6517. ReactorPercent(CurrentPlayer) = value
  6518. If ReactorPercent(CurrentPlayer) > 100 Then ReactorPercent(CurrentPlayer) = 100
  6519.  
  6520. If ReactorPercent(CurrentPlayer) = -1 Then
  6521. ClearReactorPercent
  6522. ReactorPercent(CurrentPlayer) = 0
  6523. fRtens.TimerEnabled = False
  6524. fRones.TimerEnabled = False
  6525. ElseIf ((ReactorPercent(CurrentPlayer) = 0) and (ReactorState(CurrentPlayer) <> 2)) Then
  6526. ClearReactorPercent
  6527. ElseIf ReactorPercent(CurrentPlayer) < 100 Then
  6528. drtens = Int(ReactorPercent(CurrentPlayer)/10)
  6529. drones = Int(ReactorPercent(CurrentPlayer)-drtens*10)
  6530. ' dReactor1.SetValue (drtens + 1)
  6531. ' dReactor2.SetValue (drones + 1)
  6532. fRtens.ImageA = Eval(drtens)
  6533. fRones.ImageA = Eval(drones)
  6534. SetReactorInsertsInterval (200 - (ReactorPercent(CurrentPlayer)*2))
  6535.  
  6536. Else 'ReactorPercent(CurrentPlayer) = 100
  6537. dReactor1.SetValue (0)
  6538. dReactor2.SetValue (0)
  6539. SetReactorInsertsInterval (10)
  6540.  
  6541. startReactorLEDblink
  6542. End If
  6543. CheckReactorCritical
  6544. End Sub
  6545.  
  6546. Sub AddReactorPercent (value)
  6547. Dim obj
  6548. If debugReactor then debug.print "*****SUB:" & "AddReactorPercent " & value
  6549. ReactorPercent(CurrentPlayer) = ReactorPercent(CurrentPlayer) + value
  6550. If ReactorPercent(CurrentPlayer) > 100 Then
  6551. ReactorPercent(CurrentPlayer) = 100
  6552. ElseIf ReactorPercent(CurrentPlayer) < 0 Then
  6553. ReactorPercent(CurrentPlayer) = 0
  6554. End If
  6555.  
  6556. If ReactorPercent(CurrentPlayer) < 100 Then
  6557. drtens = Int(ReactorPercent(CurrentPlayer)/10)
  6558. drones = Int(ReactorPercent(CurrentPlayer)-drtens*10)
  6559. ' dReactor1.SetValue (drtens + 1)
  6560. ' dReactor2.SetValue (drones + 1)
  6561. fRtens.ImageA = Eval(drtens)
  6562. fRones.ImageA = Eval(drones)
  6563. SetReactorInsertsInterval (200 - (ReactorPercent(CurrentPlayer)*2))
  6564.  
  6565. Else
  6566. ' dReactor1.SetValue (0)
  6567. ' dReactor2.SetValue (0)
  6568.  
  6569. SetReactorInsertsInterval (10)
  6570.  
  6571. startReactorLEDblink
  6572. End If
  6573.  
  6574. 'Increase reactor inserts as percentage goes up
  6575. ' For each obj in aInsertsReactor
  6576. ' If ReactorPercent(CurrentPlayer) < 60 Then
  6577. ' obj.intensityscale = ReactorPercent(CurrentPlayer)/200
  6578. ' Else
  6579. ' obj.intensityscale = ReactorPercent(CurrentPlayer)/100
  6580. ' End If
  6581. ' Next
  6582.  
  6583. CheckReactorCritical
  6584. End Sub
  6585.  
  6586. Sub startReactorLEDblink
  6587. fRtens.ImageA = "-"
  6588. fRones.ImageA = "---"
  6589. fRtens.TimerInterval = 250
  6590. fRtens.TimerEnabled = True
  6591. fRones.TimerEnabled = False
  6592. End Sub
  6593.  
  6594. Sub stopReactorLEDblink
  6595. fRtens.TimerEnabled = False
  6596. fRtens.ImageA = "blank"
  6597. fRones.ImageA = "blank"
  6598. End Sub
  6599.  
  6600. Dim fRtenscount
  6601. Sub fRtens_Timer
  6602. fRtenscount = (fRtenscount + 1) Mod 2
  6603. If fRtenscount = 0 Then
  6604. fRtens.ImageA = "---"
  6605. fRones.ImageA = "-"
  6606. Else
  6607. fRtens.ImageA = "-"
  6608. fRones.ImageA = "---"
  6609. End If
  6610. End Sub
  6611.  
  6612. Sub AddReactorPercentForSpinner
  6613. AddReactorPercent ReactorSpinnerPercent
  6614. End Sub
  6615.  
  6616. Sub AddReactorPercentForSwitch
  6617. debug.print
  6618. Dim value
  6619. If ReactorLevel(CurrentPlayer) < 7 Then
  6620. value = ReactorSwitchPercent - ((ReactorLevel(CurrentPlayer) - 1)*2)
  6621. Else
  6622. value = 5
  6623. End IF
  6624. AddReactorPercent value
  6625. End Sub
  6626.  
  6627. Sub CheckReactorCritical 'Called when reactor targets percent increased
  6628. If debugReactor then debug.print "*****SUB:" & "CheckReactorCritical"
  6629. If ReactorState(CurrentPlayer) = 2 Then
  6630. If ReactorPercent(CurrentPlayer) >= 100 Then
  6631. DOF 178, DOFOn: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CRITICAL"), eBlinkfast, 1800, True, "tna_reactorcriticalvoice"
  6632. UDMD "REACTOR", "CRITICAL", 1800
  6633.  
  6634. SetReactorCritical
  6635. GiReactorCritical
  6636. StartReactorCriticalMusic
  6637.  
  6638. End If
  6639. End If
  6640. End Sub
  6641.  
  6642. Sub SetReactorCritical
  6643. If debugReactor then debug.print "*****SUB:" & "SetReactorCritical [ReactorState(CurrentPlayer)=3]"
  6644. Gi9.TimerEnabled = False 'stop reactor online spin timer
  6645. SaveRAD
  6646. ReactorState(CurrentPlayer) = 3:'Reactor Critical
  6647.  
  6648. SetReactorDestroyCount ReactorLevel(CurrentPlayer)
  6649. SetReactorInserts 1
  6650. ResetReactorLoopInserts
  6651. 'Light Reactor
  6652.  
  6653. 'Extra ball Award
  6654. If ReactorLevel(CurrentPlayer) = ExtraBallAward1 Then
  6655. AwardExtraBall
  6656. ElseIf ReactorLevel(CurrentPlayer) = ExtraBallAward2 Then
  6657. AwardExtraBall
  6658. End If
  6659.  
  6660. Select Case ReactorLevel(CurrentPlayer)
  6661. Case 1:
  6662. SetLight lReactor1, "red", 2
  6663. Case 2:
  6664. SetLight lReactor2, "red", 2
  6665. Case 3:
  6666. SetLight lReactor3, "red", 2
  6667. Case 4:
  6668. SetLight lReactor4, "red", 2
  6669. Case 5:
  6670. SetLight lReactor5, "red", 2
  6671. Case 6:
  6672. SetLight lReactor6, "red", 2
  6673. Case 7
  6674. SetLight lReactor7, "red", 2
  6675. Case 8:
  6676. SetLight lReactor8, "red", 2
  6677. Case 9:
  6678. SetLight lReactor9, "red", 2
  6679. End Select
  6680.  
  6681. End Sub
  6682.  
  6683.  
  6684. Sub SetReactorDestroyCount (value) 'Setup the reactor critical inserts 1-9
  6685. If debugReactor then debug.print "*****SUB:" & "SetReactorDestroyCount " & value
  6686. dim tmp, tmp2
  6687. ReactorDestroyCount(CurrentPlayer) = 0
  6688.  
  6689. tmp2 = value
  6690. if tmp2 > 7 then tmp2 = 7 'There are only 7 targets so blink up to 7 inserts
  6691.  
  6692. do while ReactorDestroyCount(CurrentPlayer) < tmp2
  6693. tmp = INT(RND * 7)
  6694. If debugReactor then debug.print "Reactor Target = " & tmp
  6695.  
  6696. if ReactorLevel(CurrentPlayer) < 3 AND tmp < 3 then 'Dont light the RAD targets on first 2 reactor levels
  6697. tmp = tmp + 3
  6698. If debugReactor then debug.print "Reactor Target Changed = " & tmp
  6699. end if
  6700.  
  6701. If debugReactor then debug.print tmp &" : "& tmp2
  6702. if aDTGT(tmp).state = 0 then
  6703. 'aDTGT(tmp).state = 2
  6704. SetLight aDTGT(tmp), "white", 2
  6705.  
  6706. if (tmp < 5) Then
  6707. aDFTGT(tmp).state = 2
  6708. Else
  6709. aDFTGT(5).state = 2
  6710. End If
  6711. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) + 1
  6712. End If
  6713. loop
  6714.  
  6715. ReactorDestroyCount(CurrentPlayer) = value
  6716. If debugReactor then debug.print " " & "ReactorDestroyCount(CurrentPlayer) " & value
  6717. ''ttReactorTgt.text = "Tgts = " &ReactorDestroyCount(CurrentPlayer)
  6718. End Sub
  6719.  
  6720. Sub DecreaseReactorDestroyCount (obj, obj2)
  6721. If ReactorState(CurrentPlayer) = 3 Then
  6722. If ReactorDestroyCount(CurrentPlayer) <=7 Then
  6723.  
  6724. 'Special case since Bumper has 2 inserts. Check both
  6725. If obj.name = "lD3" Then
  6726. If lD3.state = 2 Then
  6727. lD3.state = 0
  6728. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  6729. PlaySound "tna_toptarget"
  6730. ElseIf lD4.state = 2 Then
  6731. lD4.state = 0
  6732. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  6733. PlaySound "tna_toptarget"
  6734. End If
  6735.  
  6736. 'Check if bumper should be turned off
  6737. If (ld3.state = 0) AND (ld4.state = 0) then obj2.state = 0
  6738.  
  6739. ElseIf obj.State = 2 Then
  6740. obj.State = 0
  6741. obj2.State = 0
  6742. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  6743. PlaySound "tna_toptarget"
  6744. Else 'target not lit
  6745. Playsound "tna_targetreject"
  6746. End If
  6747. Else 'Keep all inserts lit, decrease count until below 7
  6748. ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
  6749. PlaySound "tna_toptarget"
  6750. End If
  6751.  
  6752.  
  6753. If debugReactor then debug.print "*****SUB:" & "DecreaseReactorDestroyCount:(), ReactorDestroyCount(CurrentPlayer)=" & ReactorDestroyCount(CurrentPlayer)
  6754.  
  6755. if ReactorDestroyCount(CurrentPlayer) = 0 Then
  6756. If debugReactor then debug.print " Reactor Destroyed!!!"
  6757.  
  6758. AddScore ReactorValue(CurrentPlayer)
  6759. AddScoreForReactor
  6760. AddToTotalReactorReward
  6761. AddReactorBonus ReactorValue(CurrentPlayer)
  6762. AddBonusLights
  6763.  
  6764. ReactorLevel(CurrentPlayer) = ReactorLevel(CurrentPlayer) + 1
  6765.  
  6766. LightSeqCritical.StopPlay
  6767.  
  6768. If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
  6769. DOF 179, DOFPulse:DMD "", eNone, Centerline(1, ("DESTROYED!!!")), eNone, "", eNone, CenterLine(3, FormatScore(ReactorValue(CurrentPlayer))), eBlinkFast, 2500, True, "tna_reactordestroyed":
  6770. PuPEvent 30
  6771. UDMD " REACTOR ", "", 1000
  6772. UDMD "DESTROYED", ReactorValue(CurrentPlayer) & " x " & BallsOnPlayfield, 1500
  6773.  
  6774. EnableBallSaver 10
  6775. Else
  6776. DOF 180, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CONGRATS!!!"), eBlinkfast, 5000, True, "tna_totalannihilation"
  6777. UDMD "CONGRATULATIONS", ReactorValue(CurrentPlayer) & " x " & BallsOnPlayfield, 5000
  6778. PuPEvent 102
  6779. StopBallSaver
  6780. ReactorTNAAchieved(CurrentPlayer) = 1
  6781. End If
  6782.  
  6783. If ReactorTNAAchieved(CurrentPlayer) = 0 Then
  6784. GiReactorStopped 'reator destroyed. play gi ramdom for 2 seconds
  6785. Else 'Congratulations Game Over Man
  6786. StartRainbow "all"
  6787. StartLightSeq
  6788. End If
  6789.  
  6790. ResetReactor
  6791. ResetGrid
  6792. StartMAxTarget
  6793. StopReactorCriticalMusic
  6794. StopMultiballMusic
  6795. StartBackgroundMusic
  6796.  
  6797.  
  6798. End if
  6799. Else
  6800. Playsound "tna_targetreject"
  6801. End If
  6802.  
  6803. End Sub
  6804.  
  6805. Sub SetReactorInserts (newstate)
  6806. If debugReactor then debug.print "*****SUB:" & "SetReactorInserts " & newstate
  6807.  
  6808. l5.state = newstate
  6809. l6.state = newstate
  6810. l7.state = newstate
  6811. l8.state = newstate
  6812. l9.state = newstate
  6813. l10.state = newstate
  6814. l11.state = newstate
  6815. End sub
  6816.  
  6817. Sub SetReactorInsertsInterval (inter)
  6818. If debugReactor then debug.print "*****SUB:" & "SetReactorInsertsInterval " & inter
  6819.  
  6820. l5.blinkinterval = inter
  6821. l6.blinkinterval = inter
  6822. l7.blinkinterval = inter
  6823. l8.blinkinterval = inter
  6824. l9.blinkinterval = inter
  6825. l10.blinkinterval = inter
  6826. l11.blinkinterval = inter
  6827. End sub
  6828.  
  6829. Dim ReactorBonus
  6830. Sub AddReactorBonus (value)
  6831.  
  6832. ReactorBonus = ReactorBonus + value
  6833. debug.print ReactorBonus
  6834. End Sub
  6835.  
  6836. Sub ResetReactorBonus
  6837. ReactorBonus = 0
  6838. End Sub
  6839. '=============================================
  6840.  
  6841.  
  6842.  
  6843.  
  6844. Dim LUStep
  6845. Sub Slingshot1_Slingshot
  6846. If debugReactor then debug.print "*****SUB:Slingshot1_Slingshot"
  6847. PlaySoundAtVol SoundFXDOF("fxz_leftslingshot", 117, DOFPulse, DOFContactors), ActiveBall, 1
  6848. AddscoreSpecial UpperSlingshotScore
  6849.  
  6850. LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
  6851. l8.TimerEnabled = True
  6852.  
  6853. PlaySound "tna_reactorslingloud"
  6854. GiReactorEffect 3
  6855.  
  6856.  
  6857. LeftUpSling4.Visible = 1:LeftUpSling1.Visible = 0
  6858. LUemk.RotX = 26
  6859. LUStep = 0
  6860. Slingshot1.TimerEnabled = True
  6861.  
  6862. If ReactorState(CurrentPlayer) = 2 Then
  6863. AddReactorPercentForSwitch
  6864. End If
  6865. SetLastSwitchHit "Slingshot1"
  6866. End Sub
  6867.  
  6868. Sub SlingShot1_Timer
  6869. Select Case LUStep
  6870. Case 1:LeftUpSLing4.Visible = 0:LeftUpSLing3.Visible = 1:LUemk.RotX = 14:
  6871. Case 2:LeftUpSLing3.Visible = 0:LeftUpSLing2.Visible = 1:LUemk.RotX = 2:
  6872. Case 3:LeftUpSLing2.Visible = 0:LeftUpSLing1.Visible = 1:LUemk.RotX = -10:SlingShot1.TimerEnabled = False
  6873. End Select
  6874. LUStep = LUStep + 1
  6875. End Sub
  6876.  
  6877.  
  6878. Dim RUStep
  6879. Sub Slingshot2_Slingshot
  6880. If debugReactor then debug.print "*****SUB:Slingshot2_Slingshot"
  6881. PlaySoundAtVol SoundFXDOF("fxz_rightslingshot", 118, DOFPulse, DOFContactors), ActiveBall, 1
  6882. AddscoreSpecial UpperSlingshotScore
  6883.  
  6884. LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
  6885. l8.TimerEnabled = True
  6886.  
  6887. PlaySound "tna_reactorslingloud"
  6888. GiReactorEffect 3
  6889.  
  6890. RightUpSling4.Visible = 1:RightUpSling1.Visible = 0
  6891. RUemk.RotX = 26
  6892. RUStep = 0
  6893. Slingshot2.TimerEnabled = True
  6894.  
  6895. If ReactorState(CurrentPlayer) = 2 Then
  6896. AddReactorPercentForSwitch
  6897. End If
  6898. SetLastSwitchHit "Slingshot2"
  6899. End Sub
  6900.  
  6901. Sub SlingShot2_Timer
  6902. Select Case RUStep
  6903. Case 1:RightUpSLing4.Visible = 0:RightUpSLing3.Visible = 1:RUemk.RotX = 14:
  6904. Case 2:RightUpSLing3.Visible = 0:RightUpSLing2.Visible = 1:RUemk.RotX = 2:
  6905. Case 3:RightUpSLing2.Visible = 0:RightUpSLing1.Visible = 1:RUemk.RotX = -10:SlingShot2.TimerEnabled = False
  6906. End Select
  6907. RUStep = RUStep + 1
  6908. End Sub
  6909.  
  6910. Dim LLStep
  6911. Sub ReactorWallSling_Slingshot
  6912. If debugReactor then debug.print "*****SUB:ReactorWall_Hit"
  6913. PlaySoundAtVol SoundFXDOF("fxz_leftslingshot", 117, DOFPulse, DOFContactors), ActiveBall, 1
  6914. AddscoreSpecial UpperSlingshotScore
  6915.  
  6916. LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
  6917. l8.TimerEnabled = True
  6918.  
  6919. PlaySound "tna_reactorslingloud"
  6920. GiReactorEffect 3
  6921.  
  6922. LeftLeftSling4.Visible = 1:LeftLeftSling1.Visible = 0
  6923. LLemk.RotX = 26
  6924. LLStep = 0
  6925. ReactorWall.TimerEnabled = True
  6926.  
  6927.  
  6928. If ReactorState(CurrentPlayer) = 2 Then
  6929. AddReactorPercentForSwitch
  6930. End If
  6931. SetLastSwitchHit "ReactorWall"
  6932. End Sub
  6933.  
  6934. Sub ReactorWall_Timer
  6935. Select Case LLStep
  6936. Case 1:LeftLeftSling4.Visible = 0:LeftLeftSling3.Visible = 1:LLemk.RotX = 14:
  6937. Case 2:LeftLeftSling3.Visible = 0:LeftLeftSling2.Visible = 1:LLemk.RotX = 2:
  6938. Case 3:LeftLeftSling2.Visible = 0:LeftLeftSling1.Visible = 1:LLemk.RotX = -10:ReactorWall.TimerEnabled = False
  6939. End Select
  6940. LLStep = LLStep + 1
  6941. End Sub
  6942.  
  6943. Sub ReactorInsertsFlash
  6944. Dim i
  6945. For i = 0 to 5
  6946. a
  6947. Next
  6948. End Sub
  6949.  
  6950. L8.TimerInterval = 500
  6951. Sub l8_Timer
  6952. LightSeqReactorInserts.StopPlay
  6953. l8.TimerEnabled = False
  6954. End Sub
  6955.  
  6956. ''*********************
  6957. '' Section; Reactor Max Targets
  6958. ''*********************
  6959. Sub Target1_Hit
  6960. PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
  6961. AddScoreSpecial TargetScore
  6962.  
  6963. If ReactorState(CurrentPlayer) = 2 Then
  6964. AddReactorPercentForSwitch
  6965. End If
  6966.  
  6967. Check123MaxTarget lt1, 190
  6968.  
  6969. SetLastSwitchHit "Target1"
  6970. End Sub
  6971.  
  6972. Sub Target2_Hit
  6973. PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
  6974. AddScoreSpecial TargetScore
  6975.  
  6976. If ReactorState(CurrentPlayer) = 2 Then
  6977. AddReactorPercentForSwitch
  6978. End If
  6979.  
  6980. Check123MaxTarget lt2, 191
  6981.  
  6982. SetLastSwitchHit "Target2"
  6983. End Sub
  6984.  
  6985. Sub Target3_Hit
  6986. PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
  6987. AddScoreSpecial TargetScore
  6988.  
  6989. If ReactorState(CurrentPlayer) = 2 Then
  6990. AddReactorPercentForSwitch
  6991. End If
  6992.  
  6993. Check123MaxTarget lt3, 192
  6994.  
  6995. SetLastSwitchHit "Target3"
  6996. End Sub
  6997.  
  6998. 'Dim MaxTargetFlag
  6999. Sub ResetMaxTarget
  7000. If debugReactor Then debug.print "*****SUB:ResetMaxTarget"
  7001. SetLight lt1, "red", 0
  7002. SetLight lt2, "red", 0
  7003. SetLight lt3, "red", 0
  7004. 'MaxTargetFlag = False
  7005.  
  7006. End Sub
  7007.  
  7008. Sub StartMAxTarget
  7009. If debugReactor Then debug.print "*****SUB:StartMaxTarget"
  7010. SetLight lt1, "red", 2
  7011. SetLight lt2, "red", 0
  7012. SetLight lt3, "red", 0
  7013. 'MaxTargetFlag = False
  7014. End Sub
  7015.  
  7016. Sub Check123MaxTarget (obj, val)
  7017. If debugReactor Then debug.print "*****SUB:Check123MaxTarget"
  7018. If Obj.state = 2 Then
  7019. obj.state = 1
  7020. playsound "tna_toptarget"
  7021. GiReactorEffect 3
  7022. DOF val, DOFPulse
  7023. Else
  7024. playsound "tna_targetreject"
  7025. End If
  7026.  
  7027. If (lt1.State = 1 and lt2.State = 1 and lt3.State = 1) Then
  7028.  
  7029. SetReactorMaxed
  7030. AddBonusLights
  7031. StartMAxTarget
  7032.  
  7033. 'to do lightseq
  7034. DMDFlush
  7035. DOF 181, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MAX REACTOR"), eBlinkfast, 1800, True, "tna_reactorvaluemaxed"
  7036. UDMD "REACTOR VALUE", "MAXED", 1800
  7037. PuPEvent 11
  7038.  
  7039. FlashForMs lt1, 2000, 100, 2
  7040. FlashForMs lt2, 2000, 100, 2
  7041. FlashForMs lt3, 2000, 100, 2
  7042. lt1.TimerInterval = 2000
  7043. lt1.TimerEnabled = True
  7044. ElseIf lt2.state = 1 Then
  7045. lt3.state = 2
  7046. ElseIf lt1.state = 1 Then
  7047. lt2.state = 2
  7048. End If
  7049. End Sub
  7050. '
  7051. Sub lt1_timer
  7052. If debugReactor Then debug.print "*****SUB:lt1_timer"
  7053. lt1.TimerEnabled = False
  7054. 'do something
  7055. End Sub
  7056. ''*********************
  7057. '' Section; Gate control
  7058. ''*********************
  7059. ' REactor Targeted mode
  7060. ' Plunge - full loop. Lgate up on plunge. Lgate down after a switch
  7061. ' Right Loop - full loop. Lgate up on RLswitch. Lgate down after a switch
  7062. ' Left Loop - into toplanes.
  7063. 'Reactor Started mode
  7064. 'Both into toplanes
  7065.  
  7066. 'Multiball
  7067. 'both loops do full loop
  7068. 'Reactor Critical
  7069. ' Left Loop - full loop
  7070.  
  7071. Dim loopDirection '1 = CW, -1 = CCW
  7072. Sub swLLoop_Hit
  7073. LoopEnter 1
  7074. SetLastSwitchHit "swLLoop"
  7075. End Sub
  7076.  
  7077. Sub swRLoop_Hit
  7078. LoopEnter -1
  7079. SetLastSwitchHit "swRLoop"
  7080. End Sub
  7081.  
  7082. Dim JustPlunged
  7083. Sub LoopEnter (value)
  7084. LoopDirection = loopDirection + value
  7085.  
  7086. If JustPlunged = True Then
  7087. GateL.open = 1
  7088. GateR.open = 1
  7089. JustPlunged = False
  7090. ' ElseIf bMultiBallMode = True Then
  7091. ' GateL.open = 1
  7092. ' GateR.open = 1
  7093. ElseIf ReactorState(CurrentPlayer) = 2 Then'Reactor Started
  7094. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then
  7095. If lLoopR.state = 2 Then 'CCW goes to reactor
  7096. If loopDirection = -1 Then
  7097. GateL.open = 0
  7098. GateR.open = 0
  7099. Else
  7100. GateL.open = 1
  7101. GateR.open = 1
  7102. End If
  7103. Else 'lLoopL.state = 2
  7104. If loopDirection = -1 Then
  7105. GateL.open = 1
  7106. GateR.open = 1
  7107. Else
  7108. GateL.open = 0
  7109. GateR.open = 0
  7110. End If
  7111. End If
  7112. Else '< 3 both gates open
  7113. GateR.open = 0
  7114. GateL.open = 0
  7115. End If
  7116. ElseIf loopDirection = -1 Then 'ball is going CCW
  7117. GateL.open = 1
  7118. GateR.open = 0
  7119. ElseIf loopDirection = 1 Then
  7120. GateR.open = 0
  7121. ElseIf loopDirection = 0 Then
  7122. GateR.open = 0
  7123. GateL.open = 0
  7124. Else
  7125. LoopDirection = 0
  7126. GateR.open = 0
  7127. GateL.open = 0
  7128. End If
  7129. End Sub
  7130.  
  7131. Sub ResetGate
  7132. loopDirection = 0
  7133. GateL.open = 0
  7134. GateR.open = 0
  7135. End Sub
  7136.  
  7137.  
  7138.  
  7139. ''*********************
  7140. '' Section; RAD target
  7141. ''*********************
  7142. Sub TargetRAD1_HIt
  7143. PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
  7144. If debugDestroyRAD Then debug.print "*****SUB:TargetRAD1_HIt"
  7145. 'Addscore RADScore
  7146. CheckRADMysteryAward lRad1, 195
  7147. DecreaseReactorDestroyCount lRad1, fRad1
  7148. SetLastSwitchHit "TargetRAD1"
  7149. End Sub
  7150.  
  7151. Sub TargetRAD2_HIt
  7152. PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
  7153. If debugDestroyRAD Then debug.print "*****SUB:TargetRAD2_HIt"
  7154. 'Addscore RADScore
  7155. CheckRADMysteryAward lRad2, 194
  7156. DecreaseReactorDestroyCount lRad2, fRad2
  7157. SetLastSwitchHit "TargetRAD2"
  7158. End Sub
  7159.  
  7160. Sub TargetRAD3_HIt
  7161. PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
  7162. If debugDestroyRAD Then debug.print "*****SUB:TargetRAD3_HIt"
  7163. 'Addscore RADScore
  7164. CheckRADMysteryAward lRad3, 193
  7165. DecreaseReactorDestroyCount lRad3, fRad3
  7166. SetLastSwitchHit "TargetRAD3"
  7167. End Sub
  7168.  
  7169. Sub ResetRAD
  7170. If debugDestroyRAD Then debug.print "*****SUB:ResetRAD"
  7171.  
  7172. SetLight lRAD1, "red", 0
  7173. SetLight lRAD2, "red", 0
  7174. SetLight lRAD3, "red", 0
  7175. End Sub
  7176.  
  7177. Sub StartRad
  7178. If debugDestroyRAD Then debug.print "*****SUB:StartRad"
  7179. If ReactorState(CurrentPlayer) <> 3 Then
  7180. SetLight lRAD1, "red", 0
  7181. SetLight lRAD2, "red", 0
  7182. SetLight lRAD3, "red", 2
  7183. End If
  7184. End Sub
  7185.  
  7186. Dim PausedRAD1
  7187. Dim PausedRAD2
  7188. Dim PausedRAD3
  7189. Sub SaveRAD
  7190. PausedRAD1 = lRAD1.State
  7191. PausedRAD2 = lRAD2.State
  7192. PausedRAD3 = lRAD3.State
  7193. lRAD1.State = 0
  7194. lRAD2.State = 0
  7195. lRAD3.State = 0
  7196. End Sub
  7197.  
  7198. Sub RestoreRAD
  7199. SetLight lRAD1, "red", PausedRAD1
  7200. SetLight lRAD2, "red", PausedRAD2
  7201. SetLight lRAD3, "red", PausedRAD3
  7202.  
  7203. If (lRAD3.State = 0) Then
  7204. lRAD1.State = 0
  7205. lRAD2.State = 0
  7206. lRAD3.State = 2
  7207. End If
  7208. End Sub
  7209.  
  7210. ''*********************
  7211. '' Section; Mystery Award
  7212. ''*********************
  7213. Dim MysteryState(4)
  7214.  
  7215. Sub ResetMysteryAward
  7216. If debugMysteryAward Then debug.print "*****SUB:ResetMysteryAward"
  7217. MysteryState(CurrentPlayer) = 0
  7218. lMystery.State = 0
  7219. lScoopEjectUpdate
  7220. End Sub
  7221.  
  7222. Sub DecrementMysteryAward
  7223. If debugMysteryAward Then debug.print "*****SUB:DecrementMysteryAward"
  7224. If MysteryState(CurrentPlayer) > 0 Then
  7225. MysteryState(CurrentPlayer) = MysteryState(CurrentPlayer) - 1
  7226. End If
  7227. If MysteryState(CurrentPlayer) <= 0 then
  7228. ResetMysteryAward
  7229. End If
  7230. End Sub
  7231.  
  7232. Sub SetMysteryAward
  7233. If debugMysteryAward Then debug.print "*****SUB:SetMysteryAward"
  7234. MysteryState(CurrentPlayer) = MysteryState(CurrentPlayer) + 1
  7235. lMystery.State = 2
  7236. lScoopEjectUpdate
  7237. End Sub
  7238.  
  7239. Sub InitMysteryAwardData
  7240. Dim i
  7241. For i = 1 to MaxPlayers
  7242. MysteryState(i) = 0
  7243. Next
  7244. End Sub
  7245.  
  7246. Sub SaveMysteryAwardData
  7247. 'Nothing needed as always stored in MysteryState(4)
  7248. End Sub
  7249.  
  7250. Sub RestoreMysteryAwardData
  7251. If MysteryState(CurrentPlayer) > 0 then
  7252. lMystery.State = 2
  7253. lScoopEjectUpdate
  7254. Else
  7255. lMystery.State = 0
  7256. lScoopEjectUpdate
  7257. End If
  7258. End Sub
  7259.  
  7260. Sub CopyMysteryAwardData (p1, p2)
  7261. MysteryState(p2) = MysteryState(p1)
  7262. End Sub
  7263.  
  7264. 'CheckMysteryAward
  7265. Sub CheckRADMysteryAward (obj, val)
  7266. If debugMysteryAward Then debug.print "*****SUB:CheckMysteryAward"
  7267. If ReactorState(CurrentPlayer) <> 3 Then
  7268. If Obj.state = 2 Then
  7269. obj.state = 1
  7270. playsound "tna_toptarget"
  7271. Addscore RADScore
  7272. GiEffect 2
  7273. DOF val, DOFPulse
  7274. End If
  7275.  
  7276. If (lRAD1.State = 1 and lRAD2.State = 1 and lRAD3.State = 1) Then
  7277. StartRAD
  7278. AddBonusLights
  7279.  
  7280. 'to do lightseq
  7281. DMDFlush
  7282. DOF 182, DOFPulse: DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MYSTERY LIT"), eBlinkfast, 1800, True, "tna_mysteryawardlit"
  7283. UDMD "MYSTERY", "AWARD LIT", 1800
  7284. PuPEvent 90
  7285.  
  7286. FlashForMs lRAD1, 2000, 100, 2
  7287. FlashForMs lRAD2, 2000, 100, 2
  7288. FlashForMs lRAD3, 2000, 100, 2
  7289. lRAD1.TimerInterval = 2000
  7290. lRAD1.TimerEnabled = True
  7291. ElseIf lRAD2.state = 1 Then
  7292. lRAD1.state = 2
  7293. ElseIf lRAD3.state = 1 Then
  7294. lRAD2.state = 2
  7295. End If
  7296. End If
  7297. End Sub
  7298.  
  7299. Sub lRAD1_Timer
  7300. If debugMysteryAward Then debug.print "*****SUB:lRAD1_Timer"
  7301. lRAD1.TimerEnabled = False
  7302. SetMysteryAward
  7303. End Sub
  7304.  
  7305. 'CollectMysterAward (Video: More4k 9:28)
  7306. Dim MysteryStep, MysRandom0, MysRandom1, MysRandom2, MysRandom3
  7307. Const MaxMysteryItems = 13
  7308. Function CollectMysteryAward
  7309. If debugMysteryAward Then debug.print "*****SUB:CollectMysteryAward"
  7310.  
  7311. If MysteryState(CurrentPlayer) > 0 Then
  7312.  
  7313. DOF 183, DOFPulse:
  7314. PlaySound "tna_mysteryselect"
  7315. MysteryStep = 0
  7316.  
  7317. 'Generate 4 random awards. avoid duplicates
  7318. MysRandom0 = INT(RND * MaxMysteryItems)
  7319. MysRandom1 = INT(RND * MaxMysteryItems)
  7320. MysRandom2 = INT(RND * MaxMysteryItems)
  7321. MysRandom3 = INT(RND * MaxMysteryItems)
  7322. If debugMysteryAward Then debug.print MysRandom0 & "-" & MysRandom1 & "-" & MysRandom2 & "-" & MysRandom3
  7323.  
  7324. If MysRandom1 = MysRandom0 Then MysRandom1 = (MysRandom1+1) Mod MaxMysteryItems
  7325.  
  7326. If ((MysRandom2 = MysRandom0) or (MysRandom2 = MysRandom1)) Then MysRandom2 = (MysRandom2+1) Mod MaxMysteryItems
  7327. If ((MysRandom2 = MysRandom0) or (MysRandom2 = MysRandom1)) Then MysRandom2 = (MysRandom2+1) Mod MaxMysteryItems
  7328.  
  7329. If ((MysRandom3 = MysRandom0) or (MysRandom3 = MysRandom1) or (MysRandom3 = MysRandom2)) Then MysRandom3 = (MysRandom3+1) Mod MaxMysteryItems
  7330. If ((MysRandom3 = MysRandom0) or (MysRandom3 = MysRandom1) or (MysRandom3 = MysRandom2)) Then MysRandom3 = (MysRandom3+1) Mod MaxMysteryItems
  7331.  
  7332. If debugMysteryAward Then debug.print MysRandom0 & "-" & MysRandom1 & "-" & MysRandom2 & "-" & MysRandom3
  7333.  
  7334. ListMysteryAward MysRandom0, displayTime, 0
  7335. DecrementMysteryAward
  7336. lMystery.TimerInterval = 750
  7337. lMystery.TimerEnabled = True
  7338.  
  7339. CollectMysteryAward = 1 'Return 1
  7340. Else
  7341. CollectMysteryAward = 0
  7342. End If
  7343. End Function
  7344.  
  7345. Const DisplayTime = 500
  7346. Sub lMystery_Timer
  7347. If debugMysteryAward Then debug.print "*****SUB:lMystery_Timer"
  7348.  
  7349.  
  7350. MysteryStep = MysteryStep + 1
  7351. Select Case MysteryStep
  7352. Case 1
  7353. ListMysteryAward MysRandom1, displayTime, 0
  7354. Case 2
  7355. ListMysteryAward MysRandom2, displayTime, 0
  7356. Case 3
  7357. ListMysteryAward MysRandom3, displayTime * 3, 1
  7358. Case 4
  7359. PlaySound "TNALeftScoopAwardEject"
  7360.  
  7361. lMystery.TimerEnabled = False
  7362. LeftScoop.TimerInterval = 6100
  7363. LeftScoop.TimerEnabled = True
  7364. 'LightSeqAutoLaunch.Play SeqDownOn, 10, 1, 0
  7365. End Select
  7366.  
  7367. End Sub
  7368.  
  7369. Dim DelayedBallSaver
  7370. Sub LeftScoop_Timer
  7371. If DelayedBallSaver = 1 Then
  7372. DelayedBallSaver = 0
  7373. EnableBallSaver BallSaverTime
  7374. End If
  7375. LeftScoop.TimerEnabled = False
  7376. 'eject ball
  7377. LeftScoopExit
  7378.  
  7379. End Sub
  7380.  
  7381. Sub ListMysteryAward (value, duration, giveaward)
  7382.  
  7383.  
  7384.  
  7385. Select Case value
  7386. Case 0,MaxMysteryItems
  7387. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+10,000")), eBlink, duration, True, ""
  7388. UDMD " +10000 ", "", duration
  7389. PuPEvent 43
  7390. Case 1
  7391. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+25,000")), eBlink, duration, True, ""
  7392. UDMD " +25000 ", "", duration
  7393. PuPEvent 45
  7394. Case 2
  7395. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+150,000")), eBlink, duration, True, ""
  7396. UDMD " +150000 ", "", duration
  7397. PuPEvent 46
  7398. Case 3
  7399. If ReactorState(CurrentPlayer) = 0 Then
  7400. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("START REACTOR")), eBlink, duration, True, ""
  7401. UDMD "START REACTOR", "", duration
  7402. PuPEvent 66
  7403. 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
  7404. 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
  7405. 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
  7406. 'Critical 3 - targets not active, no check grid, gates 2-way
  7407. ElseIf giveaward = 0 Then
  7408. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("WARP TO LVL 9")), eBlink, duration, True, ""
  7409. UDMD "WARP TO", "LEVEL 9", duration
  7410. PuPEvent 47
  7411. Else
  7412. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+50,000")), eBlink, duration, True, ""
  7413. UDMD " +50000 ", "", duration
  7414. PuPEvent 48
  7415. End If
  7416. Case 4
  7417. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("BALLSAVER")), eBlink, duration, True, ""
  7418. UDMD "BALL SAVE", "ACTIVATED", duration
  7419. PuPEvent 49
  7420. Case 5
  7421. If bLockIsLit = False Then
  7422. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("LOCKS ARE LIT")), eBlink, duration, True, ""
  7423. UDMD "LOCKS ARE LIT", "", duration
  7424. PuPEvent 50
  7425. ElseIf giveaward = 0 Then
  7426. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("LIONMAN!!!")), eBlink, duration, True, ""
  7427. UDMD "LIONMAN!!!", "", duration
  7428. PuPEvent 51
  7429. Else
  7430. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+40,000")), eBlink, duration, True, ""
  7431. UDMD " +40000 ", "", duration
  7432. PuPEvent 52
  7433. End If
  7434. Case 6
  7435. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+1 LANESAVE")), eBlink, duration, True, ""
  7436. UDMD "AWARD LANE SAVE", "", duration
  7437. PuPEvent 53
  7438. Case 7
  7439. If SuperSpinnerValue = 0 Then
  7440. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("SUPER SPINNER")), eBlink, duration, True, ""
  7441. UDMD "AWARD", "SUPER SPINNER", duration
  7442. PuPEvent 54
  7443. Else
  7444. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+30,000")), eBlink, duration, True, ""
  7445. UDMD " +30000 ", "", duration
  7446. PuPEvent 55
  7447. End If
  7448. Case 8
  7449. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  7450. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+1X BONUS")), eBlink, duration, True, ""
  7451. UDMD "MULTIPLIER", "INCREASED", duration
  7452. PuPEvent 56
  7453. Else
  7454. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+20,000")), eBlink, duration, True, ""
  7455. UDMD " +20000 ", "", duration
  7456. PuPEvent 57
  7457. End If
  7458. Case 9
  7459. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  7460. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("4X MAX BONUS")), eBlink, duration, True, ""
  7461. PuPEvent 58
  7462. Else
  7463. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+35,000")), eBlink, duration, True, ""
  7464. UDMD " +35000 ", "", duration
  7465. PuPEvent 59
  7466. End If
  7467. Case 10
  7468. If CoopMode = 0 Then
  7469. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("EXTRA BALL")), eBlink, duration, True, ""
  7470. UDMD "AWARD", "EXTRA BALL", duration
  7471. PuPEvent 60
  7472. Else
  7473. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+45,000")), eBlink, duration, True, ""
  7474. UDMD " +45000 ", "", duration
  7475. PuPEvent 61
  7476. End If
  7477. Case 11
  7478. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("MAX REACTOR")), eBlink, duration, True, ""
  7479. UDMD "REACTOR VALUE", "MAXED", duration
  7480. PuPEvent 62
  7481. Case 12
  7482. If ReactorState(CurrentPlayer) = 0 Then
  7483. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("KEYPAD UNLOCK")), eBlink, duration, True, ""
  7484. UDMD "KEYPAD", "UNLOCKED", duration
  7485. PuPEvent 63
  7486. 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
  7487. 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
  7488. 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
  7489. 'Critical 3 - targets not active, no check grid, gates 2-way
  7490. ElseIf giveaward = 0 Then
  7491. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("GAME OVER")), eBlink, duration, True, ""
  7492. UDMD "GAME OVER", "", duration
  7493. PuPEvent 64
  7494. Else
  7495. DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+50,000")), eBlink, duration, True, ""
  7496. UDMD " +50000 ", "", duration
  7497. PuPEvent 65
  7498. End If
  7499. End Select
  7500.  
  7501. If giveaward = 1 Then
  7502. Select Case value
  7503. Case 0,MaxMysteryItems
  7504. AddScore 10000
  7505. Case 1
  7506. AddScore 25000
  7507. Case 2
  7508. AddScore 150000
  7509. Case 3
  7510. If ReactorState(CurrentPlayer) = 0 Then
  7511. ByPassGrid
  7512. CheckReactorStart
  7513. Else
  7514. AddScore 50000
  7515. End If
  7516. Case 4
  7517. DelayedBallSaver = 1
  7518. Case 5
  7519. If bLockIsLit = False Then
  7520. DropTargetResetLockIsLit 0
  7521. Else
  7522. AddScore 40000
  7523. End If
  7524. Case 6
  7525. AwardSAVE 1
  7526. Case 7
  7527. If SuperSpinnerValue =0 Then
  7528. SetSuperSpinner
  7529. Else
  7530. AddScore 30000
  7531. End If
  7532. Case 8
  7533. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  7534. AddBonusMultiplier 1
  7535. Else
  7536. AddScore 20000
  7537. End If
  7538. Case 9
  7539. If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
  7540. SetBonusMultiplier(MaxMultiplier)
  7541. Else
  7542. AddScore 35000
  7543. End If
  7544. Case 10
  7545. If CoopMode = 0 Then
  7546. AwardExtraBallNoCallout
  7547. Else
  7548. AddScore 45000
  7549. End If
  7550. Case 11
  7551. SetReactorMaxed
  7552. Case 12
  7553. If ReactorState(CurrentPlayer) = 0 Then
  7554. ByPassGrid
  7555. Else
  7556. AddScore 50000
  7557. End If
  7558. End Select
  7559. End If
  7560.  
  7561. End Sub
  7562.  
  7563.  
  7564. ''*********************
  7565. '' Section; DESTROY target
  7566. ''*********************
  7567. Sub TargetD1_Hit
  7568. PlaySound SoundFXDOF("", 110, DOFPulse, DOFTargets)
  7569. If debugDestroyRAD Then debug.print "*****SUB:TargetD1_Hit"
  7570. Addscore DESTROYScore
  7571. DecreaseReactorDestroyCount lD1, fD1
  7572. SetLastSwitchHit "TargetD1"
  7573. End Sub
  7574.  
  7575. Sub TargetD2_Hit
  7576. PlaySound SoundFXDOF("", 111, DOFPulse, DOFTargets)
  7577. If debugDestroyRAD Then debug.print "*****SUB:TargetD2_Hit"
  7578. Addscore DESTROYScore
  7579. DecreaseReactorDestroyCount lD2, fD2
  7580. SetLastSwitchHit "TargetD2"
  7581.  
  7582. End Sub
  7583.  
  7584. Sub ResetDESTROY
  7585. If debugDestroyRAD Then debug.print "*****SUB:ResetDESTROY"
  7586. lD1.State = 0
  7587. lD2.State = 0
  7588. lD3.State = 0
  7589. lD4.State = 0
  7590. End Sub
  7591.  
  7592. '********
  7593. ' Section; Bumper
  7594. '********
  7595. Sub Bumper1_Hit
  7596. If debugDestroyRAD Then debug.print "*****SUB:Bumper1_Hit"
  7597. If Tilted Then Exit Sub
  7598. PlaySoundAtVol SoundFXDOF("fxz_topbumper_hit", 107, DOFPulse, DOFContactors), ActiveBall, 1
  7599. PlaySound "tna_bumperloud"
  7600. DOF 119, DOFPulse
  7601. ' FlashForMs lBumperFlash, 500, 50, 0:FlashForMs lBumperFlash1, 500, 50, 0
  7602. AddScore BumperScore
  7603. DecreaseReactorDestroyCount lD3, lBumperflash
  7604. LightSeqBumper.StopPlay
  7605. LightSeqBumper.UpdateInterval = 5
  7606. LightSeqBumper.Play SeqCircleOutOn, 5, 1
  7607.  
  7608. SwitchReactorLoopInserts
  7609.  
  7610. SetLastSwitchHit "Bumper1"
  7611. End Sub
  7612.  
  7613.  
  7614.  
  7615. ''*********************
  7616. '' Section; Debug routines
  7617. ''*********************
  7618. 'BlockerWall for debug testing
  7619. Dim BLState
  7620. 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
  7621. Sub BlockerWalls
  7622.  
  7623. BLState = (BLState + 1) Mod 4
  7624. debug.print "BlockerWalls"
  7625. Playsound "fx_next"
  7626. Select Case BLState:
  7627. Case 0
  7628. 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
  7629. Case 1:
  7630. 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
  7631. Case 2:
  7632. 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
  7633. Case 3:
  7634. 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
  7635. End Select
  7636. End Sub
  7637.  
  7638.  
  7639. Sub SetBallsOnPlayfield (value)
  7640. If value < 0 Then
  7641. value = 0
  7642. End If
  7643.  
  7644. BallsOnPlayfield = value
  7645. Select Case BallsOnPlayfield
  7646. Case 1: 'Not multiball so resume based current X multiplier
  7647. Select Case BonusMultiplier(CurrentPlayer):
  7648. Case 1:
  7649. SetLight l2x, "white", 0
  7650. SetLight l3x, "white", 0
  7651. SetLight l4x, "white", 0
  7652.  
  7653. Case 2:
  7654. SetLight l2x, "white", 1
  7655. SetLight l3x, "white", 0
  7656. SetLight l4x, "white", 0
  7657.  
  7658. Case 3:
  7659. SetLight l2x, "white", 1
  7660. SetLight l3x, "white", 1
  7661. SetLight l4x, "white", 0
  7662.  
  7663. Case 4:
  7664. SetLight l2x, "white", 1
  7665. SetLight l3x, "white", 1
  7666. SetLight l4x, "white", 1
  7667.  
  7668. Case Else:
  7669. SetLight l2x, "white", 1
  7670. SetLight l3x, "white", 1
  7671. SetLight l4x, "white", 1
  7672. End Select
  7673.  
  7674.  
  7675. Case 2:
  7676. SetLight l2x, "red", 2
  7677. SetLight l3x, "red", 0
  7678. SetLight l4x, "red", 0
  7679. Case 3:
  7680. SetLight l2x, "red", 0
  7681. SetLight l3x, "red", 2
  7682. SetLight l4x, "red", 0
  7683. Case 4:
  7684. SetLight l2x, "red", 0
  7685. SetLight l3x, "red", 0
  7686. SetLight l4x, "red", 2
  7687. End Select
  7688.  
  7689. End Sub
  7690.  
  7691. Sub AddBallsOnPlayfield (value)
  7692. Dim tmp
  7693. tmp = BallsOnPlayfield + value
  7694.  
  7695. SetBallsOnPlayfield tmp
  7696. End Sub
  7697.  
  7698.  
  7699. 'Section; Save Player Data
  7700. '1. Create player array
  7701. '2. Create Save routine
  7702. '3. Create Restore routine
  7703. '4. Add to Master Save routine
  7704. '5. Add to Master Restore routine
  7705.  
  7706. Sub InitializePlayerData
  7707. InitLaneSaveData
  7708. InitMysteryAwardData
  7709. InitGridData
  7710. InitReactorData
  7711. InitiReactorDestroyData
  7712. End Sub
  7713.  
  7714. Sub SavePlayerData
  7715. SaveLaneSaveData
  7716. SaveMysteryAwardData
  7717. SaveGridData
  7718. 'SaveReactorData - already saved
  7719. SaveReactorDestroyData
  7720. End Sub
  7721.  
  7722. Sub RestorePlayerData
  7723. RestoreLaneSaveData
  7724. RestoreMysteryAwardData
  7725. RestoreGridData
  7726. RestoreReactorData
  7727. RestoreReactorDestroyData
  7728. End Sub
  7729.  
  7730. Sub CopyPlayerData (p1, p2)
  7731. CopyLaneSaveData p1, p2
  7732. CopyMysteryAwardData p1, p2
  7733. CopyGridData p1, p2
  7734. CopyReactorData p1, p2
  7735. CopyReactorDestroyData p1, p2
  7736. End Sub
  7737.  
  7738.  
  7739. Sub InitReactorData
  7740. Dim i
  7741. For i = 1 To MaxPlayers
  7742. ReactorState(i) = 0
  7743. ReactorLevel(i) = 1
  7744. ReactorTNAAchieved(i) = 0
  7745. ReactorReactorTotalReward(i) = 0
  7746. ReactorPercent(i) = -1
  7747. ReactorDestroyCount(i) = 0
  7748. ReactorValue(i) = ReactorValue1
  7749. ReactorValueMax(i) = ReactorValue1 * ReactorMaxMultiplier
  7750. ResetReactorLoopInserts
  7751. Next
  7752. End Sub
  7753.  
  7754. 'Sub SaveReactorData
  7755. ' Line 5071: Dim ReactorState(4)
  7756. ' Line 5072: Dim ReactorLevel(4)
  7757. ' Dim ReactorTNAAchieved(4)
  7758. ' Dim ReactorReactorTotalReward(4)
  7759. ' Line 5073: Dim ReactorPercent(4)
  7760. ' Line 5074: Dim ReactorDestroyCount(4)
  7761. ' Line 5075: Dim ReactorValue(4)
  7762. ' Line 5076: Dim ReactorValueMax(4)
  7763. 'End Sub
  7764.  
  7765. Sub CopyReactorData (p1, p2)
  7766. ReactorState(p2) = ReactorState(p1)
  7767. ReactorLevel(p2) = ReactorLevel(p1)
  7768. ReactorTNAAchieved(p2) = ReactorTNAAchieved(p1)
  7769. ReactorReactorTotalReward(p2) = ReactorReactorTotalReward(p1)
  7770. ReactorPercent(p2) = ReactorPercent(p1)
  7771. ReactorDestroyCount(p2) = ReactorDestroyCount(p1)
  7772. ReactorValue(p2) = ReactorValue(p1)
  7773. ReactorValueMax(p2) = ReactorValueMax(p1)
  7774. End Sub
  7775.  
  7776. Sub RestoreReactorData
  7777. Dim tmpcolor
  7778. Dim i
  7779.  
  7780. 'Set all inserts off, light destroyed reactor green, then current reactor blinking red or green
  7781. If ReactorState(CurrentPlayer) = 3 Then 'Critical
  7782. tmpcolor = "red"
  7783. Else
  7784. tmpcolor = "green"
  7785. End If
  7786. For i = 0 to 8
  7787. SetLight aReactorLevelInserts(i), "red", 0
  7788. Next
  7789. For i = 0 to (ReactorLevel(CurrentPlayer) - 2)
  7790. If i >=0 Then SetLight aReactorLevelInserts(i), "red", 1
  7791. Next
  7792. i = ReactorLevel(CurrentPlayer) - 1
  7793. If i >=0 AND i < 9 Then
  7794. SetLight aReactorLevelInserts(i), tmpcolor, 2
  7795. End If
  7796.  
  7797. 'Set table to default state
  7798. ResetReactorLoopInserts
  7799. lStart.State = 0
  7800. lScoopEjectUpdate
  7801. SetReactorInserts 0
  7802. SetReactorPercent ReactorPercent(CurrentPlayer)
  7803. fRones.TimerEnabled = False
  7804. GIReactorStoppedImmediate
  7805. StopReactorCriticalMusic
  7806.  
  7807. 'Set up active items
  7808. Select Case ReactorState(CurrentPlayer)
  7809. Case 0: 'Targeted
  7810.  
  7811. Case 1: 'Ready
  7812. SetReactorReady
  7813.  
  7814. Case 2: 'Started
  7815. SetReactorInserts 2
  7816. GIReactorStarted
  7817.  
  7818. If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
  7819. fRones.TimerInterval = ReactorPercentLossTime * 1000
  7820. fRones.TimerEnabled = True
  7821. StartReactorRightLoopInserts
  7822. Else 'ReactorLevel(CurrentPlayer) 1 and 2 and 3
  7823. StartReactorLoopInserts
  7824. End If
  7825.  
  7826. Case 3: 'Critical
  7827. SetReactorInserts 1
  7828. GiReactorCritical
  7829. ' ChangeGiImmediate "red", 1
  7830. ' GIGameImmediate 5, "red"
  7831. StartReactorCriticalMusic
  7832.  
  7833. 'Need to restore Destroy targets count and inserts
  7834.  
  7835. End Select
  7836. End Sub
  7837.  
  7838.  
  7839. Dim PlayeraDTGT1(4)
  7840. Dim PlayeraDTGT2(4)
  7841. Dim PlayeraDTGT3(4)
  7842. Dim PlayeraDTGT4(4)
  7843. Dim PlayeraDTGT5(4)
  7844. Dim PlayeraDTGT6(4)
  7845. Dim PlayeraDTGT7(4)
  7846.  
  7847. Sub InitiReactorDestroyData
  7848. Dim i
  7849. For i = 1 To MaxPlayers
  7850. PlayeraDTGT1(i) = 0
  7851. PlayeraDTGT2(i) = 0
  7852. PlayeraDTGT3(i) = 0
  7853. PlayeraDTGT4(i) = 0
  7854. PlayeraDTGT5(i) = 0
  7855. PlayeraDTGT6(i) = 0
  7856. PlayeraDTGT7(i) = 0
  7857. Next
  7858. End Sub
  7859.  
  7860. Sub SaveReactorDestroyData
  7861. If ReactorState(CurrentPlayer) = 3 Then
  7862. PlayeraDTGT1(CurrentPlayer) = lRAD1.State
  7863. PlayeraDTGT2(CurrentPlayer) = lRAD2.State
  7864. PlayeraDTGT3(CurrentPlayer) = lRAD3.State
  7865. PlayeraDTGT4(CurrentPlayer) = lD1.State
  7866. PlayeraDTGT5(CurrentPlayer) = lD2.State
  7867. PlayeraDTGT6(CurrentPlayer) = lD3.State
  7868. PlayeraDTGT7(CurrentPlayer) = lD4.State
  7869. Else
  7870. PlayeraDTGT1(CurrentPlayer) = 0
  7871. PlayeraDTGT2(CurrentPlayer) = 0
  7872. PlayeraDTGT3(CurrentPlayer) = 0
  7873. PlayeraDTGT4(CurrentPlayer) = 0
  7874. PlayeraDTGT5(CurrentPlayer) = 0
  7875. PlayeraDTGT6(CurrentPlayer) = 0
  7876. PlayeraDTGT7(CurrentPlayer) = 0
  7877. End If
  7878. End Sub
  7879.  
  7880. Sub RestoreReactorDestroyData
  7881.  
  7882. SetLight aDTGT(0), "white", PlayeraDTGT1(CurrentPlayer)
  7883. SetLight aDTGT(1), "white", PlayeraDTGT2(CurrentPlayer)
  7884. SetLight aDTGT(2), "white", PlayeraDTGT3(CurrentPlayer)
  7885. SetLight aDTGT(3), "white", PlayeraDTGT4(CurrentPlayer)
  7886. SetLight aDTGT(4), "white", PlayeraDTGT5(CurrentPlayer)
  7887. SetLight aDTGT(5), "white", PlayeraDTGT6(CurrentPlayer)
  7888. SetLight aDTGT(6), "white", PlayeraDTGT7(CurrentPlayer)
  7889.  
  7890.  
  7891. SetLight aDFTGT(0), "white", PlayeraDTGT1(CurrentPlayer)
  7892. SetLight aDFTGT(1), "white", PlayeraDTGT2(CurrentPlayer)
  7893. SetLight aDFTGT(2), "white", PlayeraDTGT3(CurrentPlayer)
  7894. SetLight aDFTGT(3), "white", PlayeraDTGT4(CurrentPlayer)
  7895. SetLight aDFTGT(4), "white", PlayeraDTGT5(CurrentPlayer)
  7896. If PlayeraDTGT6(CurrentPlayer) = 2 Then
  7897. SetLight aDFTGT(5), "white", PlayeraDTGT6(CurrentPlayer) 'bumper shared with dtgt6 and 7
  7898. Else
  7899. SetLight aDFTGT(5), "white", PlayeraDTGT7(CurrentPlayer) 'bumper shared with dtgt6 and 7
  7900. End If
  7901. End Sub
  7902.  
  7903. Sub CopyReactorDestroyData (p1, p2)
  7904. PlayeraDTGT1(p2) = PlayeraDTGT1(p1)
  7905. PlayeraDTGT2(p2) = PlayeraDTGT2(p1)
  7906. PlayeraDTGT3(p2) = PlayeraDTGT3(p1)
  7907. PlayeraDTGT4(p2) = PlayeraDTGT4(p1)
  7908. PlayeraDTGT5(p2) = PlayeraDTGT5(p1)
  7909. PlayeraDTGT6(p2) = PlayeraDTGT6(p1)
  7910. PlayeraDTGT7(p2) = PlayeraDTGT7(p1)
  7911.  
  7912. End Sub
  7913.  
  7914.  
  7915. '==================================
  7916. '******************************************************
  7917. ' FLIPPER CORRECTION SUPPORTING FUNCTIONS
  7918. '******************************************************
  7919.  
  7920. Sub AddPt(aStr, idx, aX, aY) 'debugger wrapper for adjusting flipper script in-game
  7921. dim a : a = Array(LF, RF)
  7922. dim x : for each x in a
  7923. x.addpoint aStr, idx, aX, aY
  7924. Next
  7925. End Sub
  7926.  
  7927. 'Methods:
  7928. '.TimeDelay - Delay before trigger shuts off automatically. Default = 80 (ms)
  7929. '.AddPoint - "Polarity", "Velocity", "Ycoef" coordinate points. Use one of these 3 strings, keep coordinates sequential. x = %position on the flipper, y = output
  7930. '.Object - set to flipper reference. Optional.
  7931. '.StartPoint - set start point coord. Unnecessary, if .object is used.
  7932.  
  7933. 'Called with flipper -
  7934. 'ProcessBalls - catches ball data.
  7935. ' - OR -
  7936. '.Fire - fires flipper.rotatetoend automatically + processballs. Requires .Object to be set to the flipper.
  7937.  
  7938. Class FlipperPolarity
  7939. Public DebugOn, Enabled
  7940. Private FlipAt 'Timer variable (IE 'flip at 723,530ms...)
  7941. Public TimeDelay 'delay before trigger turns off and polarity is disabled TODO set time!
  7942. private Flipper, FlipperStart, FlipperEnd, LR, PartialFlipCoef
  7943. Private Balls(20), balldata(20)
  7944.  
  7945. dim PolarityIn, PolarityOut
  7946. dim VelocityIn, VelocityOut
  7947. dim YcoefIn, YcoefOut
  7948. Public Sub Class_Initialize
  7949. redim PolarityIn(0) : redim PolarityOut(0) : redim VelocityIn(0) : redim VelocityOut(0) : redim YcoefIn(0) : redim YcoefOut(0)
  7950. Enabled = True : TimeDelay = 50 : LR = 1: dim x : for x = 0 to uBound(balls) : balls(x) = Empty : set Balldata(x) = new SpoofBall : next
  7951. End Sub
  7952.  
  7953. Public Property let Object(aInput) : Set Flipper = aInput : StartPoint = Flipper.x : End Property
  7954. Public Property Let StartPoint(aInput) : if IsObject(aInput) then FlipperStart = aInput.x else FlipperStart = aInput : end if : End Property
  7955. Public Property Get StartPoint : StartPoint = FlipperStart : End Property
  7956. Public Property Let EndPoint(aInput) : if IsObject(aInput) then FlipperEnd = aInput.x else FlipperEnd = aInput : end if : End Property
  7957. Public Property Get EndPoint : EndPoint = FlipperEnd : End Property
  7958.  
  7959. Public Sub AddPoint(aChooseArray, aIDX, aX, aY) 'Index #, X position, (in) y Position (out)
  7960. Select Case aChooseArray
  7961. case "Polarity" : ShuffleArrays PolarityIn, PolarityOut, 1 : PolarityIn(aIDX) = aX : PolarityOut(aIDX) = aY : ShuffleArrays PolarityIn, PolarityOut, 0
  7962. Case "Velocity" : ShuffleArrays VelocityIn, VelocityOut, 1 :VelocityIn(aIDX) = aX : VelocityOut(aIDX) = aY : ShuffleArrays VelocityIn, VelocityOut, 0
  7963. Case "Ycoef" : ShuffleArrays YcoefIn, YcoefOut, 1 :YcoefIn(aIDX) = aX : YcoefOut(aIDX) = aY : ShuffleArrays YcoefIn, YcoefOut, 0
  7964. End Select
  7965. if gametime > 100 then Report aChooseArray
  7966. End Sub
  7967.  
  7968. Public Sub Report(aChooseArray) 'debug, reports all coords in tbPL.text
  7969. if not DebugOn then exit sub
  7970. dim a1, a2 : Select Case aChooseArray
  7971. case "Polarity" : a1 = PolarityIn : a2 = PolarityOut
  7972. Case "Velocity" : a1 = VelocityIn : a2 = VelocityOut
  7973. Case "Ycoef" : a1 = YcoefIn : a2 = YcoefOut
  7974. case else :tbpl.text = "wrong string" : exit sub
  7975. End Select
  7976. dim str, x : for x = 0 to uBound(a1) : str = str & aChooseArray & " x: " & round(a1(x),4) & ", " & round(a2(x),4) & vbnewline : next
  7977. tbpl.text = str
  7978. End Sub
  7979.  
  7980. Public Sub AddBall(aBall) : dim x : for x = 0 to uBound(balls) : if IsEmpty(balls(x)) then set balls(x) = aBall : exit sub :end if : Next : End Sub
  7981.  
  7982. Private Sub RemoveBall(aBall)
  7983. dim x : for x = 0 to uBound(balls)
  7984. if TypeName(balls(x) ) = "IBall" then
  7985. if aBall.ID = Balls(x).ID Then
  7986. balls(x) = Empty
  7987. Balldata(x).Reset
  7988. End If
  7989. End If
  7990. Next
  7991. End Sub
  7992.  
  7993. Public Sub Fire()
  7994. Flipper.RotateToEnd
  7995. processballs
  7996. End Sub
  7997.  
  7998. Public Property Get Pos 'returns % position a ball. For debug stuff.
  7999. dim x : for x = 0 to uBound(balls)
  8000. if not IsEmpty(balls(x) ) then
  8001. pos = pSlope(Balls(x).x, FlipperStart, 0, FlipperEnd, 1)
  8002. End If
  8003. Next
  8004. End Property
  8005.  
  8006. Public Sub ProcessBalls() 'save data of balls in flipper range
  8007. FlipAt = GameTime
  8008. dim x : for x = 0 to uBound(balls)
  8009. if not IsEmpty(balls(x) ) then
  8010. balldata(x).Data = balls(x)
  8011. if DebugOn then StickL.visible = True : StickL.x = balldata(x).x 'debug TODO
  8012. End If
  8013. Next
  8014. PartialFlipCoef = ((Flipper.StartAngle - Flipper.CurrentAngle) / (Flipper.StartAngle - Flipper.EndAngle))
  8015. PartialFlipCoef = abs(PartialFlipCoef-1)
  8016. if abs(Flipper.currentAngle - Flipper.EndAngle) < 30 Then
  8017. PartialFlipCoef = 0
  8018. End If
  8019. End Sub
  8020. Private Function FlipperOn() : if gameTime < FlipAt+TimeDelay then FlipperOn = True : End If : End Function 'Timer shutoff for polaritycorrect
  8021.  
  8022. Public Sub PolarityCorrect(aBall)
  8023. if FlipperOn() then
  8024. dim tmp, BallPos, x, IDX, Ycoef : Ycoef = 1
  8025. dim teststr : teststr = "Cutoff"
  8026. tmp = PSlope(aBall.x, FlipperStart, 0, FlipperEnd, 1)
  8027. if tmp < 0.1 then 'if real ball position is behind flipper, exit Sub to prevent stucks 'Disabled 1.03, I think it's the Mesh that's causing stucks, not this
  8028. if DebugOn then TestStr = "real pos < 0.1 ( " & round(tmp,2) & ")" : tbpl.text = Teststr
  8029. 'RemoveBall aBall
  8030. 'Exit Sub
  8031. end if
  8032.  
  8033. 'y safety Exit
  8034. if aBall.VelY > -8 then 'ball going down
  8035. if DebugOn then teststr = "y velocity: " & round(aBall.vely, 3) & "exit sub" : tbpl.text = teststr
  8036. RemoveBall aBall
  8037. exit Sub
  8038. end if
  8039. 'Find balldata. BallPos = % on Flipper
  8040. for x = 0 to uBound(Balls)
  8041. if aBall.id = BallData(x).id AND not isempty(BallData(x).id) then
  8042. idx = x
  8043. BallPos = PSlope(BallData(x).x, FlipperStart, 0, FlipperEnd, 1)
  8044. 'TB.TEXT = balldata(x).id & " " & BALLDATA(X).X & VBNEWLINE & FLIPPERSTART & " " & FLIPPEREND
  8045. if ballpos > 0.65 then Ycoef = LinearEnvelope(BallData(x).Y, YcoefIn, YcoefOut) 'find safety coefficient 'ycoef' data
  8046. end if
  8047. Next
  8048.  
  8049. 'Velocity correction
  8050. if not IsEmpty(VelocityIn(0) ) then
  8051. Dim VelCoef
  8052. if DebugOn then set tmp = new spoofball : tmp.data = aBall : End If
  8053. if IsEmpty(BallData(idx).id) and aBall.VelY < -12 then 'if tip hit with no collected data, do vel correction anyway
  8054. if PSlope(aBall.x, FlipperStart, 0, FlipperEnd, 1) > 1.1 then 'adjust plz
  8055. VelCoef = LinearEnvelope(5, VelocityIn, VelocityOut)
  8056. if partialflipcoef < 1 then VelCoef = PSlope(partialflipcoef, 0, 1, 1, VelCoef)
  8057. if Enabled then aBall.Velx = aBall.Velx*VelCoef'VelCoef
  8058. if Enabled then aBall.Vely = aBall.Vely*VelCoef'VelCoef
  8059. if DebugOn then teststr = "tip protection" & vbnewline & "velcoef: " & round(velcoef,3) & vbnewline & round(PSlope(aBall.x, FlipperStart, 0, FlipperEnd, 1),3) & vbnewline
  8060. 'debug.print teststr
  8061. end if
  8062. Else
  8063. : VelCoef = LinearEnvelope(BallPos, VelocityIn, VelocityOut)
  8064. if Enabled then aBall.Velx = aBall.Velx*VelCoef
  8065. if Enabled then aBall.Vely = aBall.Vely*VelCoef
  8066. end if
  8067. End If
  8068.  
  8069. 'Polarity Correction (optional now)
  8070. if not IsEmpty(PolarityIn(0) ) then
  8071. If StartPoint > EndPoint then LR = -1 'Reverse polarity if left flipper
  8072. dim AddX : AddX = LinearEnvelope(BallPos, PolarityIn, PolarityOut) * LR
  8073. if Enabled then aBall.VelX = aBall.VelX + 1 * (AddX*ycoef*PartialFlipcoef)
  8074. End If
  8075. 'debug
  8076. if DebugOn then
  8077. TestStr = teststr & "%pos:" & round(BallPos,2)
  8078. if IsEmpty(PolarityOut(0) ) then
  8079. teststr = teststr & vbnewline & "(Polarity Disabled)" & vbnewline
  8080. else
  8081. teststr = teststr & "+" & round(1 *(AddX*ycoef*PartialFlipcoef),3)
  8082. if BallPos >= PolarityOut(uBound(PolarityOut) ) then teststr = teststr & "(MAX)" & vbnewline else teststr = teststr & vbnewline end if
  8083. if Ycoef < 1 then teststr = teststr & "ycoef: " & ycoef & vbnewline
  8084. if PartialFlipcoef < 1 then teststr = teststr & "PartialFlipcoef: " & round(PartialFlipcoef,4) & vbnewline
  8085. end if
  8086.  
  8087. teststr = teststr & vbnewline & "Vel: " & round(BallSpeed(tmp),2) & " -> " & round(ballspeed(aBall),2) & vbnewline
  8088. teststr = teststr & "%" & round(ballspeed(aBall) / BallSpeed(tmp),2)
  8089. tbpl.text = TestSTR
  8090. end if
  8091. Else
  8092. 'if DebugOn then tbpl.text = "td" & timedelay
  8093. End If
  8094. RemoveBall aBall
  8095. End Sub
  8096. End Class
  8097.  
  8098. '================================
  8099. 'Helper Functions
  8100.  
  8101.  
  8102. Sub ShuffleArray(ByRef aArray, byVal offset) 'shuffle 1d array
  8103. dim x, aCount : aCount = 0
  8104. redim a(uBound(aArray) )
  8105. for x = 0 to uBound(aArray) 'Shuffle objects in a temp array
  8106. if not IsEmpty(aArray(x) ) Then
  8107. if IsObject(aArray(x)) then
  8108. Set a(aCount) = aArray(x)
  8109. Else
  8110. a(aCount) = aArray(x)
  8111. End If
  8112. aCount = aCount + 1
  8113. End If
  8114. Next
  8115. if offset < 0 then offset = 0
  8116. redim aArray(aCount-1+offset) 'Resize original array
  8117. for x = 0 to aCount-1 'set objects back into original array
  8118. if IsObject(a(x)) then
  8119. Set aArray(x) = a(x)
  8120. Else
  8121. aArray(x) = a(x)
  8122. End If
  8123. Next
  8124. End Sub
  8125.  
  8126. Sub ShuffleArrays(aArray1, aArray2, offset)
  8127. ShuffleArray aArray1, offset
  8128. ShuffleArray aArray2, offset
  8129. End Sub
  8130.  
  8131.  
  8132. Function BallSpeed(ball) 'Calculates the ball speed
  8133. BallSpeed = SQR(ball.VelX^2 + ball.VelY^2 + ball.VelZ^2)
  8134. End Function
  8135.  
  8136. Function PSlope(Input, X1, Y1, X2, Y2) 'Set up line via two points, no clamping. Input X, output Y
  8137. dim x, y, b, m : x = input : m = (Y2 - Y1) / (X2 - X1) : b = Y2 - m*X2
  8138. Y = M*x+b
  8139. PSlope = Y
  8140. End Function
  8141.  
  8142. Function NullFunctionZ(aEnabled):End Function '1 argument null function placeholder TODO move me or replac eme
  8143.  
  8144. Class spoofball
  8145. Public X, Y, Z, VelX, VelY, VelZ, ID, Mass, Radius
  8146. Public Property Let Data(aBall)
  8147. With aBall
  8148. x = .x : y = .y : z = .z : velx = .velx : vely = .vely : velz = .velz
  8149. id = .ID : mass = .mass : radius = .radius
  8150. end with
  8151. End Property
  8152. Public Sub Reset()
  8153. x = Empty : y = Empty : z = Empty : velx = Empty : vely = Empty : velz = Empty
  8154. id = Empty : mass = Empty : radius = Empty
  8155. End Sub
  8156. End Class
  8157.  
  8158.  
  8159. Function LinearEnvelope(xInput, xKeyFrame, yLvl)
  8160. dim y 'Y output
  8161. dim L 'Line
  8162. dim ii : for ii = 1 to uBound(xKeyFrame) 'find active line
  8163. if xInput <= xKeyFrame(ii) then L = ii : exit for : end if
  8164. Next
  8165. if xInput > xKeyFrame(uBound(xKeyFrame) ) then L = uBound(xKeyFrame) 'catch line overrun
  8166. Y = pSlope(xInput, xKeyFrame(L-1), yLvl(L-1), xKeyFrame(L), yLvl(L) )
  8167.  
  8168. 'Clamp if on the boundry lines
  8169. 'if L=1 and Y < yLvl(LBound(yLvl) ) then Y = yLvl(lBound(yLvl) )
  8170. 'if L=uBound(xKeyFrame) and Y > yLvl(uBound(yLvl) ) then Y = yLvl(uBound(yLvl) )
  8171. 'clamp 2.0
  8172. if xInput <= xKeyFrame(lBound(xKeyFrame) ) then Y = yLvl(lBound(xKeyFrame) ) 'Clamp lower
  8173. if xInput >= xKeyFrame(uBound(xKeyFrame) ) then Y = yLvl(uBound(xKeyFrame) ) 'Clamp upper
  8174.  
  8175. LinearEnvelope = Y
  8176. End Function
  8177.  
  8178.  
  8179.  
  8180. dim LF : Set LF = New FlipperPolarity
  8181. dim RF : Set RF = New FlipperPolarity
  8182.  
  8183. InitPolarity
  8184.  
  8185. Sub InitPolarity()
  8186. dim x, a : a = Array(LF, RF)
  8187. for each x in a
  8188. 'safety coefficient (diminishes polarity correction only)
  8189. x.AddPoint "Ycoef", 0, RightFlipper.Y-65, 1 'disabled
  8190. x.AddPoint "Ycoef", 1, RightFlipper.Y-11, 1
  8191.  
  8192. x.enabled = True
  8193. x.TimeDelay = 44
  8194. Next
  8195.  
  8196. '"Polarity" Profile
  8197. AddPt "Polarity", 0, 0, 0
  8198. AddPt "Polarity", 1, 0.368, -4
  8199. AddPt "Polarity", 2, 0.451, -3.7
  8200. AddPt "Polarity", 3, 0.493, -3.88
  8201. AddPt "Polarity", 4, 0.65, -2.3
  8202. AddPt "Polarity", 5, 0.71, -2
  8203. AddPt "Polarity", 6, 0.785,-1.8
  8204. AddPt "Polarity", 7, 1.18, -1
  8205. AddPt "Polarity", 8, 1.2, 0
  8206.  
  8207.  
  8208. '"Velocity" Profile
  8209. addpt "Velocity", 0, 0, 1
  8210. addpt "Velocity", 1, 0.16, 1.06
  8211. addpt "Velocity", 2, 0.41, 1.05
  8212. addpt "Velocity", 3, 0.53, 1'0.982
  8213. addpt "Velocity", 4, 0.702, 0.968
  8214. addpt "Velocity", 5, 0.95, 0.968
  8215. addpt "Velocity", 6, 1.03, 0.945
  8216.  
  8217. LF.Object = LeftFlipper
  8218. LF.EndPoint = EndPointLp 'you can use just a coordinate, or an object with a .x property. Using a couple of simple primitive objects
  8219. RF.Object = RightFlipper
  8220. RF.EndPoint = EndPointRp
  8221. End Sub
  8222.  
  8223. 'Trigger Hit - .AddBall activeball
  8224. 'Trigger UnHit - .PolarityCorrect activeball
  8225.  
  8226. Sub TriggerLF_Hit() : If FlipperPhysicsMode = 2 Then LF.Addball activeball End If: End Sub
  8227. Sub TriggerLF_UnHit() : If FlipperPhysicsMode = 2 Then LF.PolarityCorrect activeball End If: End Sub
  8228. Sub TriggerRF_Hit() : If FlipperPhysicsMode = 2 Then RF.Addball activeball End If: End Sub
  8229. Sub TriggerRF_UnHit() : If FlipperPhysicsMode = 2 Then RF.PolarityCorrect activeball End If: End Sub
  8230.  
  8231.  
  8232. Sub lScoopEjectUpdate
  8233. if ((lmystery.state = 2) Or (lStart.state = 2)) Then
  8234. lScoopEject.state = 2
  8235. Else
  8236. lScoopEject.state = 0
  8237. End If
  8238. End Sub
  8239.  
  8240.  
  8241. Dim ChooseBats
  8242.  
  8243. ' *** 0=default flipper, 1=primitive flipper, 2=glow green, 3=glow blue, 4=glow orange ****
  8244. ChooseBats = 1
  8245.  
  8246. '*********** Glowball
  8247. Dim GlowBall, CustomBulbIntensity(10)
  8248. Dim GBred(10)
  8249. Dim GBgreen(10), GBblue(10)
  8250. Dim CustomBallImage(10), CustomBallLogoMode(10), CustomBallDecal(10), CustomBallGlow(10)
  8251.  
  8252.  
  8253.  
  8254.  
  8255. ' default Ball
  8256. CustomBallGlow(0) = False
  8257. CustomBallImage(0) = "TTMMball"
  8258. CustomBallLogoMode(0) = False
  8259. CustomBallDecal(0) = "scratches"
  8260. CustomBulbIntensity(0) = 0.01
  8261. GBred(0) = 0 : GBgreen(0) = 0 : GBblue(0) = 0
  8262.  
  8263. ' white GlowBall
  8264. CustomBallGlow(1) = True
  8265. CustomBallImage(1) = "white"
  8266. CustomBallLogoMode(1) = True
  8267. CustomBallDecal(1) = ""
  8268. CustomBulbIntensity(1) = 0
  8269. GBred(1) = 255 : GBgreen(1) = 255 : GBblue(1) = 255
  8270.  
  8271. ' Magma GlowBall
  8272. CustomBallGlow(2) = True
  8273. CustomBallImage(2) = "ballblack"
  8274. CustomBallLogoMode(2) = True
  8275. CustomBallDecal(2) = "magma6"
  8276. CustomBulbIntensity(2) = 0
  8277. GBred(2) = 255 : GBgreen(2) = 20 : GBblue(2) = 20
  8278.  
  8279. ' Blue ball
  8280. CustomBallGlow(3) = True
  8281. CustomBallImage(3) = "blueball2"
  8282. CustomBallLogoMode(3) = False
  8283. CustomBallDecal(3) = ""
  8284. CustomBulbIntensity(3) = 0
  8285. GBred(3) = 30 : GBgreen(3) = 40 : GBblue(3) = 200
  8286.  
  8287. ' HDR ball
  8288. CustomBallGlow(4) = False
  8289. CustomBallImage(4) = "ball_HDR"
  8290. CustomBallLogoMode(4) = False
  8291. CustomBallDecal(4) = "JPBall-Scratches"
  8292. CustomBulbIntensity(4) = 0.01
  8293. GBred(4) = 0 : GBgreen(4) = 0 : GBblue(4) = 0
  8294.  
  8295. ' Earth
  8296. CustomBallGlow(5) = True
  8297. CustomBallImage(5) = "ballblack"
  8298. CustomBallLogoMode(5) = True
  8299. CustomBallDecal(5) = "earth"
  8300. CustomBulbIntensity(5) = 0
  8301. GBred(5) = 100 : GBgreen(5) = 100 : GBblue(5) = 100
  8302.  
  8303. ' green GlowBall
  8304. CustomBallGlow(6) = True
  8305. CustomBallImage(6) = "glowball green"
  8306. CustomBallLogoMode(6) = True
  8307. CustomBallDecal(6) = ""
  8308. CustomBulbIntensity(6) = 0
  8309. GBred(6) = 100 : GBgreen(6) = 255 : GBblue(6) = 100
  8310.  
  8311. ' blue GlowBall
  8312. CustomBallGlow(7) = True
  8313. CustomBallImage(7) = "glowball blue"
  8314. CustomBallLogoMode(7) = True
  8315. CustomBallDecal(7) = ""
  8316. CustomBulbIntensity(7) = 0
  8317. GBred(7) = 50 : GBgreen(7) = 50 : GBblue(7) = 255
  8318. 'GBred(7) = 100 : GBgreen(7) = 100 : GBblue(7) = 255
  8319.  
  8320. ' red GlowBall
  8321. CustomBallGlow(8) = True
  8322. CustomBallImage(8) = "glowball orange"
  8323. CustomBallLogoMode(8) = True
  8324. CustomBallDecal(8) = ""
  8325. CustomBulbIntensity(8) = 0
  8326. GBred(8) = 255 : GBgreen(8) = 0 : GBblue(8) = 000
  8327. 'GBred(8) = 255 : GBgreen(8) = 255 : GBblue(8) = 100 'orange
  8328.  
  8329. ' shiny Ball
  8330. CustomBallGlow(9) = False
  8331. CustomBallImage(9) = "pinball3"
  8332. CustomBallLogoMode(9) = False
  8333. CustomBallDecal(9) = "JPBall-Scratches"
  8334. CustomBulbIntensity(9) = 0.01
  8335. GBred(9) = 0 : GBgreen(9) = 0 : GBblue(9) = 0
  8336.  
  8337. ' *** prepare the variable with references to three lights for glow ball ***
  8338. Dim Glowing(10)
  8339. Set Glowing(0) = Glowball1 : Set Glowing(1) = Glowball2 : Set Glowing(2) = Glowball3 : Set Glowing(3) = Glowball4
  8340.  
  8341.  
  8342. '*** change ball appearance ***
  8343.  
  8344. Sub ChangeBall(ballnr)
  8345. Dim BOT, ii, col
  8346. table1.BallDecalMode = CustomBallLogoMode(ballnr)
  8347. table1.BallFrontDecal = CustomBallDecal(ballnr)
  8348. table1.DefaultBulbIntensityScale = CustomBulbIntensity(ballnr)
  8349. table1.BallImage = CustomBallImage(ballnr)
  8350. GlowBall = CustomBallGlow(ballnr)
  8351. For ii = 0 to 3
  8352. col = RGB(GBred(ballnr), GBgreen(ballnr), GBblue(ballnr))
  8353. Glowing(ii).color = col : Glowing(ii).colorfull = col
  8354. Next
  8355. End Sub
  8356.  
  8357.  
  8358.  
  8359. ' *** Ball Shadow code / Glow Ball code / Primitive Flipper Update ***
  8360.  
  8361. Dim BallShadowArray
  8362. BallShadowArray = Array (BallShadow1, BallShadow2, BallShadow3)
  8363. Const anglecompensate = 15
  8364.  
  8365. Sub GraphicsTimer_Timer()
  8366. Dim BOT, b
  8367. BOT = GetBalls
  8368.  
  8369. ' switch off glowlight for removed Balls
  8370. IF GlowBall Then
  8371. For b = UBound(BOT) + 1 to 3
  8372. If GlowBall and Glowing(b).state = 1 Then Glowing(b).state = 0 End If
  8373. Next
  8374. End If
  8375.  
  8376. For b = 0 to UBound(BOT)
  8377. ' *** move ball shadow for max 3 balls ***
  8378. ' If BallShadow and b < 3 Then
  8379. ' If BOT(b).X < table1.Width/2 Then
  8380. ' BallShadowArray(b).X = ((BOT(b).X) - (50/6) + ((BOT(b).X - (table1.Width/2))/7)) + 10
  8381. ' Else
  8382. ' BallShadowArray(b).X = ((BOT(b).X) + (50/6) + ((BOT(b).X - (table1.Width/2))/7)) - 10
  8383. ' End If
  8384. ' BallShadowArray(b).Y = BOT(b).Y + 20 : BallShadowArray(b).Z = 1
  8385. ' If BOT(b).Z > 20 Then BallShadowArray(b).visible = 1 Else BallShadowArray(b).visible = 0 End If
  8386. ' End If
  8387. ' *** move glowball light for max 3 balls ***
  8388. If GlowBall and b < 4 Then
  8389. If Glowing(b).state = 0 Then Glowing(b).state = 1 end if
  8390. Glowing(b).BulbHaloHeight = BOT(b).z + 51
  8391. Glowing(b).x = BOT(b).x : Glowing(b).y = BOT(b).y + anglecompensate
  8392. End If
  8393. Next
  8394. ' If ChooseBats = 1 Then
  8395. ' ' *** move primitive bats ***
  8396. ' batleft.objrotz = LeftFlipper.CurrentAngle + 1
  8397. ' batleftshadow.objrotz = batleft.objrotz
  8398. ' batright.objrotz = RightFlipper.CurrentAngle - 1
  8399. ' batrightshadow.objrotz = batright.objrotz
  8400. ' Else
  8401. ' If ChooseBats > 1 Then
  8402. ' ' *** move glowbats ***
  8403. ' GlowBatLightLeft.y = 1720 - 121 + LeftFlipper.CurrentAngle
  8404. ' glowbatleft.objrotz = LeftFlipper.CurrentAngle
  8405. ' GlowBatLightRight.y =1720 - 121 - RightFlipper.CurrentAngle
  8406. ' glowbatright.objrotz = RightFlipper.CurrentAngle
  8407. ' End If
  8408. ' End If
  8409. End Sub
  8410.  
  8411. Sub UDMD (toptext, bottomtext, utime)
  8412. If UseUltraDMD > 0 Then UltraDMD.DisplayScene00Ex "", toptext, 8, 14, bottomtext, 8,14, 14, utime, 14
  8413. End Sub
  8414.  
  8415.  
  8416. '************ future update maybe
  8417. 'ball trapped in RightScoop
  8418. '5 second delay when Reactor Starting (scoop shot)
  8419. 'Match not implemented
  8420. 'drain on scoop eject will do a ballsave
  8421. 'co-op mode
  8422. 'bugs
  8423. 'qqq'should revert to old software before all the gieffects and then add in one at a Time
  8424. 'DONT START game until all locked balls drained. call setballsonplayfield when endofgame, DropTargetResetLockIsLit 0 is called 'ballsonplayfield check in keydown
  8425. 'add match event
  8426. 'DONE 'qqq'critical music played during Bonus
  8427. 'DONE 'qqq'gi is white on new ball with reactor critcal
  8428. '09-10-fixing6.vpx gi became purple after a bunch of jackpot mball testing
  8429. ' detect ball trapped in danesi lock
  8430. 'animations
  8431. 'mystery Award three circle out, three down
  8432. 'lock - down,circle out, up
  8433. ' super spinner three circle Out
  8434. 'handsfree Skillshot
  8435. 'Skillshot
  8436. 'combo ccw
  8437. 'dof events
  8438. 'DONE 'total anil Bonus
  8439. 'DONE 'Tilt - dmd "Danger and Tilt. Need sound clip
  8440. 'DONE 'super spinner sound
  8441. 'launch ball early if lane save light or ballsaveractive
  8442. 'Reactor unlocked call out for reator ready, not started. about 5 sec later "shoot the left scoop
  8443. 'DONE 'Need Reactor Online callout for started
  8444. 'spinner strobes insert
  8445. 'msytery award, light locks if not lit
  8446. 'Based on TNABeta10_03 (11/16/19)
  8447. 'Shoot again during critical, GI is wrong/purple
  8448. 'improve skill LOCK check
  8449. ' If ((StrComp(value, "DropTargetOpto2") = 0) OR (StrComp(value, "DropTargetOpto3") = 0)) AND (StrComp(LastSwitchHit, "swLLoop") = 0) OR Then
  8450. ' bTimedSkillShot
  8451.  
  8452.  
  8453.  
  8454.  
  8455. '================================================================
  8456. ' PUP STUFF
  8457. '================================================================
  8458. '******************** DO NOT MODIFY STUFF BELOW THIS LINE!!!! ***************
  8459. '******************************************************************************
  8460. '***** Create a PUPPack within PUPPackEditor for layout config!!! **********
  8461. '******************************************************************************
  8462. '
  8463. '
  8464. ' Quick Steps:
  8465. ' 1> create a folder in PUPVideos with Starter_PuPPack.zip and call the folder "yourgame"
  8466. ' 2> above set global variable pGameName="yourgame"
  8467. ' 3> copy paste the settings section above to top of table script for user changes.
  8468. ' 4> on Table you need to create ONE timer only called pupDMDUpdate and set it to 250 ms enabled on startup.
  8469. ' 5> go to your table1_init or table first startup function and call PUPINIT function
  8470. ' 6> Go to bottom on framework here and setup game to call the appropriate events like pStartGame (call that in your game code where needed)...etc
  8471. ' 7> attractmodenext at bottom is setup for you already, just go to each case and add/remove as many as you want and setup the messages to show.
  8472. ' 8> Have fun and use pDMDDisplay(xxxx) sub all over where needed. remember its best to make a bunch of mp4 with text animations... looks the best for sure!
  8473. '
  8474. '
  8475. 'Note: for *Future Pinball* "pupDMDupdate_Timer()" timer needs to be renamed to "pupDMDupdate_expired()" and then all is good.
  8476. ' and for future pinball you need to add the follow lines near top
  8477. 'Need to use BAM and have com idll enabled.
  8478. ' Dim icom : Set icom = xBAM.Get("icom") ' "icom" is name of "icom.dll" in BAM\Plugins dir
  8479. ' if icom is Nothing then MSGBOX "Error cannot run without icom.dll plugin"
  8480. ' Function CreateObject(className)
  8481. ' Set CreateObject = icom.CreateObject(className)
  8482. ' End Function
  8483.  
  8484.  
  8485. Const HasPuP = True 'dont set to false as it will break pup
  8486.  
  8487. Const pTopper=0
  8488. Const pDMD=1
  8489. Const pBackglass=2
  8490. Const pPlayfield=3
  8491. Const pMusic=4
  8492. Const pMusic2=5
  8493. Const pCallouts=6
  8494. Const pBackglass2=7
  8495. Const pTopper2=8
  8496. Const pPopUP=9
  8497. Const pPopUP2=10
  8498.  
  8499.  
  8500. 'pages
  8501. Const pDMDBlank=0
  8502. Const pScores=1
  8503. Const pBigLine=2
  8504. Const pThreeLines=3
  8505. Const pTwoLines=4
  8506. Const pTargerLetters=5
  8507.  
  8508. 'dmdType
  8509. Const pDMDTypeLCD=0
  8510. Const pDMDTypeReal=1
  8511. Const pDMDTypeFULL=2
  8512.  
  8513.  
  8514.  
  8515.  
  8516.  
  8517.  
  8518. Dim PuPlayer
  8519. dim PUPDMDObject 'for realtime mirroring.
  8520. Dim pDMDlastchk: pDMDLastchk= -1 'performance of updates
  8521. Dim pDMDCurPage: pDMDCurPage= 0 'default page is empty.
  8522. Dim pInAttract : pInAttract=false 'pAttract mode
  8523.  
  8524.  
  8525.  
  8526.  
  8527. '************* starts PUP system, must be called AFTER b2s/controller running so put in last line of table1_init
  8528. Sub PuPInit
  8529.  
  8530. Set PuPlayer = CreateObject("PinUpPlayer.PinDisplay")
  8531. PuPlayer.B2SInit "", pGameName
  8532.  
  8533. if (PuPDMDDriverType=pDMDTypeReal) and (useRealDMDScale=1) Then
  8534. PuPlayer.setScreenEx pDMD,0,0,128,32,0 'if hardware set the dmd to 128,32
  8535. End if
  8536.  
  8537. PuPlayer.LabelInit pDMD
  8538.  
  8539.  
  8540. if PuPDMDDriverType=pDMDTypeReal then
  8541. Set PUPDMDObject = CreateObject("PUPDMDControl.DMD")
  8542. PUPDMDObject.DMDOpen
  8543. PUPDMDObject.DMDPuPMirror
  8544. PUPDMDObject.DMDPuPTextMirror
  8545. PuPlayer.SendMSG "{ ""mt"":301, ""SN"": 1, ""FN"":33 }" 'set pupdmd for mirror and hide behind other pups
  8546. PuPlayer.SendMSG "{ ""mt"":301, ""SN"": 1, ""FN"":32, ""FQ"":3 }" 'set no antialias on font render if real
  8547. END IF
  8548.  
  8549.  
  8550. pSetPageLayouts
  8551.  
  8552. pDMDSetPage(pDMDBlank) 'set blank text overlay page.
  8553. pDMDStartUP ' firsttime running for like an startup video..
  8554.  
  8555.  
  8556. End Sub 'end PUPINIT
  8557.  
  8558.  
  8559.  
  8560. 'PinUP Player DMD Helper Functions
  8561.  
  8562. Sub pDMDLabelHide(labName)
  8563. PuPlayer.LabelSet pDMD,labName,"",0,""
  8564. end sub
  8565.  
  8566.  
  8567.  
  8568.  
  8569. Sub pDMDScrollBig(msgText,timeSec,mColor)
  8570. PuPlayer.LabelShowPage pDMD,2,timeSec,""
  8571. PuPlayer.LabelSet pDMD,"Splash",msgText,0,"{'mt':1,'at':2,'xps':1,'xpe':-1,'len':" & (timeSec*1000000) & ",'mlen':" & (timeSec*1000) & ",'tt':0,'fc':" & mColor & "}"
  8572. end sub
  8573.  
  8574. Sub pDMDScrollBigV(msgText,timeSec,mColor)
  8575. PuPlayer.LabelShowPage pDMD,2,timeSec,""
  8576. PuPlayer.LabelSet pDMD,"Splash",msgText,0,"{'mt':1,'at':2,'yps':1,'ype':-1,'len':" & (timeSec*1000000) & ",'mlen':" & (timeSec*1000) & ",'tt':0,'fc':" & mColor & "}"
  8577. end sub
  8578.  
  8579.  
  8580. Sub pDMDSplashScore(msgText,timeSec,mColor)
  8581. PuPlayer.LabelSet pDMD,"MsgScore",msgText,0,"{'mt':1,'at':1,'fq':250,'len':"& (timeSec*1000) &",'fc':" & mColor & "}"
  8582. end Sub
  8583.  
  8584. Sub pDMDSplashScoreScroll(msgText,timeSec,mColor)
  8585. PuPlayer.LabelSet pDMD,"MsgScore",msgText,0,"{'mt':1,'at':2,'xps':1,'xpe':-1,'len':"& (timeSec*1000) &", 'mlen':"& (timeSec*1000) &",'tt':0, 'fc':" & mColor & "}"
  8586. end Sub
  8587.  
  8588. Sub pDMDZoomBig(msgText,timeSec,mColor) 'new Zoom
  8589. PuPlayer.LabelShowPage pDMD,2,timeSec,""
  8590. PuPlayer.LabelSet pDMD,"Splash",msgText,0,"{'mt':1,'at':3,'hstart':5,'hend':80,'len':" & (timeSec*1000) & ",'mlen':" & (timeSec*500) & ",'tt':5,'fc':" & mColor & "}"
  8591. end sub
  8592.  
  8593. Sub pDMDTargetLettersInfo(msgText,msgInfo, timeSec) 'msgInfo = '0211' 0= layer 1, 1=layer 2, 2=top layer3.
  8594. 'this function is when you want to hilite spelled words. Like B O N U S but have O S hilited as already hit markers... see example.
  8595. PuPlayer.LabelShowPage pDMD,5,timeSec,"" 'show page 5
  8596. Dim backText
  8597. Dim middleText
  8598. Dim flashText
  8599. Dim curChar
  8600. Dim i
  8601. Dim offchars:offchars=0
  8602. Dim spaces:spaces=" " 'set this to 1 or more depends on font space width. only works with certain fonts
  8603. 'if using a fixed font width then set spaces to just one space.
  8604.  
  8605. For i=1 To Len(msgInfo)
  8606. curChar="" & Mid(msgInfo,i,1)
  8607. if curChar="0" Then
  8608. backText=backText & Mid(msgText,i,1)
  8609. middleText=middleText & spaces
  8610. flashText=flashText & spaces
  8611. offchars=offchars+1
  8612. End If
  8613. if curChar="1" Then
  8614. backText=backText & spaces
  8615. middleText=middleText & Mid(msgText,i,1)
  8616. flashText=flashText & spaces
  8617. End If
  8618. if curChar="2" Then
  8619. backText=backText & spaces
  8620. middleText=middleText & spaces
  8621. flashText=flashText & Mid(msgText,i,1)
  8622. End If
  8623. Next
  8624.  
  8625. if offchars=0 Then 'all litup!... flash entire string
  8626. backText=""
  8627. middleText=""
  8628. FlashText=msgText
  8629. end if
  8630.  
  8631. PuPlayer.LabelSet pDMD,"Back5" ,backText ,1,""
  8632. PuPlayer.LabelSet pDMD,"Middle5",middleText,1,""
  8633. PuPlayer.LabelSet pDMD,"Flash5" ,flashText ,0,"{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}"
  8634. end Sub
  8635.  
  8636.  
  8637. Sub pDMDSetPage(pagenum)
  8638. PuPlayer.LabelShowPage pDMD,pagenum,0,"" 'set page to blank 0 page if want off
  8639. PDMDCurPage=pagenum
  8640. end Sub
  8641.  
  8642. Sub pHideOverlayText(pDisp)
  8643. PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "& pDisp &", ""FN"": 34 }" 'hideoverlay text during next videoplay on DMD auto return
  8644. end Sub
  8645.  
  8646.  
  8647.  
  8648. Sub pDMDShowLines3(msgText,msgText2,msgText3,timeSec)
  8649. Dim vis:vis=1
  8650. if pLine1Ani<>"" Then vis=0
  8651. PuPlayer.LabelShowPage pDMD,3,timeSec,""
  8652. PuPlayer.LabelSet pDMD,"Splash3a",msgText,vis,pLine1Ani
  8653. PuPlayer.LabelSet pDMD,"Splash3b",msgText2,vis,pLine2Ani
  8654. PuPlayer.LabelSet pDMD,"Splash3c",msgText3,vis,pLine3Ani
  8655. end Sub
  8656.  
  8657.  
  8658. Sub pDMDShowLines2(msgText,msgText2,timeSec)
  8659. Dim vis:vis=1
  8660. if pLine1Ani<>"" Then vis=0
  8661. PuPlayer.LabelShowPage pDMD,4,timeSec,""
  8662. PuPlayer.LabelSet pDMD,"Splash4a",msgText,vis,pLine1Ani
  8663. PuPlayer.LabelSet pDMD,"Splash4b",msgText2,vis,pLine2Ani
  8664. end Sub
  8665.  
  8666. Sub pDMDShowCounter(msgText,msgText2,msgText3,timeSec)
  8667. Dim vis:vis=1
  8668. if pLine1Ani<>"" Then vis=0
  8669. PuPlayer.LabelShowPage pDMD,6,timeSec,""
  8670. PuPlayer.LabelSet pDMD,"Splash6a",msgText,vis, pLine1Ani
  8671. PuPlayer.LabelSet pDMD,"Splash6b",msgText2,vis,pLine2Ani
  8672. PuPlayer.LabelSet pDMD,"Splash6c",msgText3,vis,pLine3Ani
  8673. end Sub
  8674.  
  8675.  
  8676. Sub pDMDShowBig(msgText,timeSec, mColor)
  8677. Dim vis:vis=1
  8678. if pLine1Ani<>"" Then vis=0
  8679. PuPlayer.LabelShowPage pDMD,2,timeSec,""
  8680. PuPlayer.LabelSet pDMD,"Splash",msgText,vis,pLine1Ani
  8681. end sub
  8682.  
  8683.  
  8684. Sub pDMDShowHS(msgText,msgText2,msgText3,timeSec) 'High Score
  8685. Dim vis:vis=1
  8686. if pLine1Ani<>"" Then vis=0
  8687. PuPlayer.LabelShowPage pDMD,7,timeSec,""
  8688. PuPlayer.LabelSet pDMD,"Splash7a",msgText,vis,pLine1Ani
  8689. PuPlayer.LabelSet pDMD,"Splash7b",msgText2,vis,pLine2Ani
  8690. PuPlayer.LabelSet pDMD,"Splash7c",msgText3,vis,pLine3Ani
  8691. end Sub
  8692.  
  8693.  
  8694. Sub pDMDSetBackFrame(fname)
  8695. PuPlayer.playlistplayex pDMD,"PUPFrames",fname,0,1
  8696. end Sub
  8697.  
  8698. Sub pDMDStartBackLoop(fPlayList,fname)
  8699. PuPlayer.playlistplayex pDMD,fPlayList,fname,0,1
  8700. PuPlayer.SetBackGround pDMD,1
  8701. end Sub
  8702.  
  8703. Sub pDMDStopBackLoop
  8704. PuPlayer.SetBackGround pDMD,0
  8705. PuPlayer.playstop pDMD
  8706. end Sub
  8707.  
  8708.  
  8709. Dim pNumLines
  8710.  
  8711. 'Theme Colors for Text (not used currenlty, use the |<colornum> in text labels for colouring.
  8712. Dim SpecialInfo
  8713. Dim pLine1Color : pLine1Color=8454143
  8714. Dim pLine2Color : pLine2Color=8454143
  8715. Dim pLine3Color : pLine3Color=8454143
  8716. Dim curLine1Color: curLine1Color=pLine1Color 'can change later
  8717. Dim curLine2Color: curLine2Color=pLine2Color 'can change later
  8718. Dim curLine3Color: curLine3Color=pLine3Color 'can change later
  8719.  
  8720.  
  8721. Dim pDMDCurPriority: pDMDCurPriority =-1
  8722. Dim pDMDDefVolume: pDMDDefVolume = 0 'default no audio on pDMD
  8723.  
  8724. Dim pLine1
  8725. Dim pLine2
  8726. Dim pLine3
  8727. Dim pLine1Ani
  8728. Dim pLine2Ani
  8729. Dim pLine3Ani
  8730.  
  8731. Dim PriorityReset:PriorityReset=-1
  8732. DIM pAttractReset:pAttractReset=-1
  8733. DIM pAttractBetween: pAttractBetween=2000 '1 second between calls to next attract page
  8734. DIM pDMDVideoPlaying: pDMDVideoPlaying=false
  8735.  
  8736.  
  8737. '************************ where all the MAGIC goes, pretty much call this everywhere ****************************************
  8738. '************************* see docs for examples ************************************************
  8739. '**************************************** DONT TOUCH THIS CODE ************************************************************
  8740.  
  8741. Sub pupDMDDisplay(pEventID, pText, VideoName,TimeSec, pAni,pPriority)
  8742. ' pEventID = reference if application,
  8743. ' pText = "text to show" separate lines by ^ in same string
  8744. ' VideoName "gameover.mp4" will play in background "@gameover.mp4" will play and disable text during gameplay.
  8745. ' also global variable useDMDVideos=true/false if user wishes only TEXT
  8746. ' TimeSec how long to display msg in Seconds
  8747. ' animation if any 0=none 1=Flasher
  8748. ' also, now can specify color of each line (when no animation). "sometext|12345" will set label to "sometext" and set color to 12345
  8749.  
  8750. DIM curPos
  8751. if pDMDCurPriority>pPriority then Exit Sub 'if something is being displayed that we don't want interrupted. same level will interrupt.
  8752. pDMDCurPriority=pPriority
  8753. if timeSec=0 then timeSec=1 'don't allow page default page by accident
  8754.  
  8755.  
  8756. pLine1=""
  8757. pLine2=""
  8758. pLine3=""
  8759. pLine1Ani=""
  8760. pLine2Ani=""
  8761. pLine3Ani=""
  8762.  
  8763.  
  8764. if pAni=1 Then 'we flashy now aren't we
  8765. pLine1Ani="{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}"
  8766. pLine2Ani="{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}"
  8767. pLine3Ani="{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}"
  8768. end If
  8769.  
  8770. curPos=InStr(pText,"^") 'Lets break apart the string if needed
  8771. if curPos>0 Then
  8772. pLine1=Left(pText,curPos-1)
  8773. pText=Right(pText,Len(pText) - curPos)
  8774.  
  8775. curPos=InStr(pText,"^") 'Lets break apart the string
  8776. if curPOS>0 Then
  8777. pLine2=Left(pText,curPos-1)
  8778. pText=Right(pText,Len(pText) - curPos)
  8779.  
  8780. curPos=InStr("^",pText) 'Lets break apart the string
  8781. if curPos>0 Then
  8782. pline3=Left(pText,curPos-1)
  8783. Else
  8784. if pText<>"" Then pline3=pText
  8785. End if
  8786. Else
  8787. if pText<>"" Then pLine2=pText
  8788. End if
  8789. Else
  8790. pLine1=pText 'just one line with no break
  8791. End if
  8792.  
  8793.  
  8794. 'lets see how many lines to Show
  8795. pNumLines=0
  8796. if pLine1<>"" then pNumLines=pNumlines+1
  8797. if pLine2<>"" then pNumLines=pNumlines+1
  8798. if pLine3<>"" then pNumLines=pNumlines+1
  8799.  
  8800. if pDMDVideoPlaying and (VideoName="") Then
  8801. PuPlayer.playstop pDMD
  8802. pDMDVideoPlaying=False
  8803. End if
  8804.  
  8805.  
  8806. if (VideoName<>"") and (useDMDVideos) Then 'we are showing a splash video instead of the text.
  8807.  
  8808. PuPlayer.playlistplayex pDMD,"DMDSplash",VideoName,pDMDDefVolume,pPriority 'should be an attract background (no text is displayed)
  8809. pDMDVideoPlaying=true
  8810. end if 'if showing a splash video with no text
  8811.  
  8812.  
  8813.  
  8814.  
  8815. if StrComp(pEventID,"shownum",1)=0 Then 'check eventIDs
  8816. pDMDShowCounter pLine1,pLine2,pLine3,timeSec
  8817. Elseif StrComp(pEventID,"target",1)=0 Then 'check eventIDs
  8818. pDMDTargetLettersInfo pLine1,pLine2,timeSec
  8819. Elseif StrComp(pEventID,"highscore",1)=0 Then 'check eventIDs
  8820. pDMDShowHS pLine1,pLine2,pline3,timeSec
  8821. Elseif (pNumLines=3) Then 'depends on # of lines which one to use. pAni=1 will flash.
  8822. pDMDShowLines3 pLine1,pLine2,pLine3,TimeSec
  8823. Elseif (pNumLines=2) Then
  8824. pDMDShowLines2 pLine1,pLine2,TimeSec
  8825. Elseif (pNumLines=1) Then
  8826. pDMDShowBig pLine1,timeSec, curLine1Color
  8827. Else
  8828. pDMDShowBig pLine1,timeSec, curLine1Color
  8829. End if
  8830.  
  8831. PriorityReset=TimeSec*1000
  8832. End Sub 'pupDMDDisplay message
  8833.  
  8834. Sub pupDMDupdate_Timer()
  8835. pUpdateScores
  8836.  
  8837. if PriorityReset>0 Then 'for splashes we need to reset current prioirty on timer
  8838. PriorityReset=PriorityReset-pupDMDUpdate.interval
  8839. if PriorityReset<=0 Then
  8840. pDMDCurPriority=-1
  8841. if pInAttract then pAttractReset=pAttractBetween ' pAttractNext call attract next after 1 second
  8842. pDMDVideoPlaying=false
  8843. End if
  8844. End if
  8845.  
  8846. if pAttractReset>0 Then 'for splashes we need to reset current prioirty on timer
  8847. pAttractReset=pAttractReset-pupDMDUpdate.interval
  8848. if pAttractReset<=0 Then
  8849. pAttractReset=-1
  8850. if pInAttract then pAttractNext
  8851. End if
  8852. end if
  8853. End Sub
  8854.  
  8855. Sub PuPEvent(EventNum)
  8856.  
  8857. If UsePinup = 1 Then
  8858. if hasPUP=false then Exit Sub
  8859. PuPlayer.B2SData "E"&EventNum,1 'send event to puppack driver
  8860. End If
  8861. End Sub
  8862.  
  8863.  
  8864. '********************* END OF PUPDMD FRAMEWORK v1.0 *************************
  8865. '******************** DO NOT MODIFY STUFF ABOVE THIS LINE!!!! ***************
  8866. '****************************************************************************
  8867.  
  8868. '*****************************************************************
  8869. ' ********** PUPDMD MODIFY THIS SECTION!!! ***************
  8870. 'PUPDMD Layout for each Table1
  8871. 'Setup Pages. Note if you use fonts they must be in FONTS folder of the pupVideos\tablename\FONTS "case sensitive exact naming fonts!"
  8872. '*****************************************************************
  8873.  
  8874. Sub pSetPageLayouts
  8875.  
  8876. DIM dmddef
  8877. DIM dmdalt
  8878. DIM dmdscr
  8879. DIM dmdfixed
  8880.  
  8881. 'labelNew <screen#>, <Labelname>, <fontName>,<size%>,<colour>,<rotation>,<xalign>,<yalign>,<xpos>,<ypos>,<PageNum>,<visible>
  8882. '***********************************************************************'
  8883. '<screen#>, in standard we’d set this to pDMD ( or 1)
  8884. '<Labelname>, your name of the label. keep it short no spaces (like 8 chars) although you can call it anything really. When setting the label you will use this labelname to access the label.
  8885. '<fontName> Windows font name, this must be exact match of OS front name. if you are using custom TTF fonts then double check the name of font names.
  8886. '<size%>, Height as a percent of display height. 20=20% of screen height.
  8887. '<colour>, integer value of windows color.
  8888. '<rotation>, degrees in tenths (900=90 degrees)
  8889. '<xAlign>, 0= horizontal left align, 1 = center horizontal, 2= right horizontal
  8890. '<yAlign>, 0 = top, 1 = center, 2=bottom vertical alignment
  8891. '<xpos>, this should be 0, but if you want to ‘force’ a position you can set this. it is a % of horizontal width. 20=20% of screen width.
  8892. '<ypos> same as xpos.
  8893. '<PageNum> IMPORTANT… this will assign this label to this ‘page’ or group.
  8894. '<visible> initial state of label. visible=1 show, 0 = off.
  8895.  
  8896.  
  8897.  
  8898. if PuPDMDDriverType=pDMDTypeReal Then 'using RealDMD Mirroring. ********** 128x32 Real Color DMD
  8899. dmdalt="dmddef"
  8900. dmdfixed="Instruction"
  8901. dmdscr="SpaceQuestItalic-g8jY" 'main scorefont
  8902. dmddef="Zig"
  8903.  
  8904. 'Page 1 (default score display)
  8905. PuPlayer.LabelNew pDMD,"Credits" ,dmddef,20,33023 ,0,2,2,85,0,4,0
  8906. PuPlayer.LabelNew pDMD,"Play1" ,dmdalt,21,33023 ,1,0,0,15,0,1,0
  8907. PuPlayer.LabelNew pDMD,"Ball" ,dmdalt,50,33023 ,1,2,0,85,0,1,0
  8908. PuPlayer.LabelNew pDMD,"MsgScore",dmddef,45,33023 ,0,1,0, 0,40,1,0
  8909. PuPlayer.LabelNew pDMD,"CurScore",dmdscr,10,8454143 ,0,0,0, 0,0,1,0
  8910.  
  8911.  
  8912. 'Page 2 (default Text Splash 1 Big Line)
  8913. PuPlayer.LabelNew pDMD,"Splash" ,dmdalt,40,33023,0,1,1,0,0,2,0
  8914.  
  8915. 'Page 3 (default Text Splash 2 and 3 Lines)
  8916. PuPlayer.LabelNew pDMD,"Splash3a",dmddef,30,8454143,0,1,0,0,2,3,0
  8917. PuPlayer.LabelNew pDMD,"Splash3b",dmdalt,30,33023,0,1,0,0,30,3,0
  8918. PuPlayer.LabelNew pDMD,"Splash3c",dmdalt,25,33023,0,1,0,0,55,3,0
  8919.  
  8920.  
  8921. 'Page 4 (2 Line Gameplay DMD)
  8922. PuPlayer.LabelNew pDMD,"Splash4a",dmddef,40,8454143,0,1,0,0,0,4,0
  8923. PuPlayer.LabelNew pDMD,"Splash4b",dmddef,30,33023,0,1,2,0,75,4,0
  8924.  
  8925. 'Page 5 (3 layer large text for overlay targets function, must you fixed width font!
  8926. PuPlayer.LabelNew pDMD,"Back5" ,dmdfixed,80,8421504,0,1,1,0,0,5,0
  8927. PuPlayer.LabelNew pDMD,"Middle5" ,dmdfixed,80,65535 ,0,1,1,0,0,5,0
  8928. PuPlayer.LabelNew pDMD,"Flash5" ,dmdfixed,80,65535 ,0,1,1,0,0,5,0
  8929.  
  8930. 'Page 6 (3 Lines for big # with two lines, "19^Orbits^Count")
  8931. PuPlayer.LabelNew pDMD,"Splash6a",dmddef,90,65280,0,0,0,15,1,6,0
  8932. PuPlayer.LabelNew pDMD,"Splash6b",dmddef,50,33023,0,1,0,60,0,6,0
  8933. PuPlayer.LabelNew pDMD,"Splash6c",dmddef,40,33023,0,1,0,60,50,6,0
  8934.  
  8935. 'Page 7 (Show High Scores Fixed Fonts)
  8936. PuPlayer.LabelNew pDMD,"Splash7a",dmddef,20,8454143,0,1,0,0,2,7,0
  8937. PuPlayer.LabelNew pDMD,"Splash7b",dmdfixed,40,33023,0,1,0,0,20,7,0
  8938. PuPlayer.LabelNew pDMD,"Splash7c",dmdfixed,40,33023,0,1,0,0,50,7,0
  8939.  
  8940.  
  8941. END IF ' use PuPDMDDriver
  8942.  
  8943. if PuPDMDDriverType=pDMDTypeLCD THEN 'Using 4:1 Standard ratio LCD PuPDMD ************ lcd **************
  8944.  
  8945. 'dmddef="Space Quest"
  8946. dmdalt="Space Quest"
  8947. dmdfixed="Instruction"
  8948. dmdscr="Impact" 'main score font
  8949. dmddef="Space Quest"
  8950.  
  8951. 'Page 1 (default score display)
  8952. PuPlayer.LabelNew pDMD,"Credits" ,dmddef,9, 2292994,1,2,0,87,4,1,0
  8953. PuPlayer.LabelNew pDMD,"Play1" ,dmdalt,9,2292994 ,1,1,2,13,0,1,0
  8954. PuPlayer.LabelNew pDMD,"Ball" ,dmdalt,9,2292994 ,0,2,2,63,0,1,0
  8955. PuPlayer.LabelNew pDMD,"MsgScore",dmddef,45,33023 ,0,1,0, 0,40,1,0
  8956. PuPlayer.LabelNew pDMD,"CurScore",dmdscr,8,8454143 ,0,2,2,46,0,1,0
  8957. PuPlayer.LabelNew pDMD,"Free",dmdalt,9,2292994 ,0,2,2,98,0,1,0
  8958. PuPlayer.LabelNew pDMD,"Status",dmddef,9, 2292994 ,1,2,0,90,13,1,0
  8959. PuPlayer.LabelNew pDMD,"RV" ,dmddef,9, 2292994 ,1,2,0,44,4,1,0
  8960. PuPlayer.LabelNew pDMD,"RS" ,dmddef,9, 2292994 ,1,2,0,44,13,1,0
  8961. PuPlayer.LabelNew pDMD,"Ball Saved" ,dmddef,9, 2292994 ,1,1,0,0,0,1,0
  8962. PuPlayer.LabelNew pDMD,"lane" ,dmddef,6,65021 ,1,2,0,30,84,1,0
  8963.  
  8964.  
  8965. 'Page 2 (default Text Splash 1 Big Line)
  8966. PuPlayer.LabelNew pDMD,"Splash" ,dmdalt,15,2292994,0,1,1,0,0,2,0
  8967.  
  8968. 'Page 3 (default Text 3 Lines)
  8969. PuPlayer.LabelNew pDMD,"Splash3a" ,dmdalt,15,2292994,0,1,1,0,0,2,0
  8970. PuPlayer.LabelNew pDMD,"Splash3b",dmdalt,30,33023,0,1,0,0,30,3,0
  8971. PuPlayer.LabelNew pDMD,"Splash3c",dmdalt,25,33023,0,1,0,0,57,3,0
  8972.  
  8973.  
  8974. 'Page 4 (default Text 2 Line)
  8975. PuPlayer.LabelNew pDMD,"Splash4a",dmddef,40,8454143,0,1,0,0,0,4,0
  8976. PuPlayer.LabelNew pDMD,"Splash4b",dmddef,30,33023,0,1,2,0,75,4,0
  8977.  
  8978. 'Page 5 (3 layer large text for overlay targets function, must you fixed width font!
  8979. PuPlayer.LabelNew pDMD,"Back5" ,dmdfixed,80,8421504,0,1,1,0,0,5,0
  8980. PuPlayer.LabelNew pDMD,"Middle5" ,dmdfixed,80,65535 ,0,1,1,0,0,5,0
  8981. PuPlayer.LabelNew pDMD,"Flash5" ,dmdfixed,80,65535 ,0,1,1,0,0,5,0
  8982.  
  8983. 'Page 6 (3 Lines for big # with two lines, "19^Orbits^Count")
  8984. PuPlayer.LabelNew pDMD,"Splash6a",dmddef,90,65280,0,0,0,15,1,6,0
  8985. PuPlayer.LabelNew pDMD,"Splash6b",dmddef,50,33023,0,1,0,60,0,6,0
  8986. PuPlayer.LabelNew pDMD,"Splash6c",dmddef,40,33023,0,1,0,60,50,6,0
  8987.  
  8988. 'Page 7 (Show High Scores Fixed Fonts)
  8989. PuPlayer.LabelNew pDMD,"Splash7a",dmddef,20,8454143,0,1,0,0,2,7,0
  8990. PuPlayer.LabelNew pDMD,"Splash7b",dmdfixed,40,33023,0,1,0,0,20,7,0
  8991. PuPlayer.LabelNew pDMD,"Splash7c",dmdfixed,40,33023,0,1,0,0,50,7,0
  8992.  
  8993.  
  8994. END IF ' use PuPDMDDriver
  8995.  
  8996. if PuPDMDDriverType=pDMDTypeFULL THEN 'Using FULL BIG LCD PuPDMD ************ lcd **************
  8997.  
  8998. dmdalt="Space Quest"
  8999. dmdfixed="Instruction"
  9000. dmdscr="Impact" 'main score font
  9001. dmddef="Space Quest"
  9002.  
  9003. 'Page 1 (default score display)
  9004. PuPlayer.LabelNew pDMD,"Credits" ,dmddef,9, 2292994,1,2,0,87,4,1,0
  9005. PuPlayer.LabelNew pDMD,"Play1" ,dmdalt,9,2292994 ,1,1,2,13,0,1,0
  9006. PuPlayer.LabelNew pDMD,"Ball" ,dmdalt,9,2292994 ,0,2,2,63,0,1,0
  9007. PuPlayer.LabelNew pDMD,"MsgScore",dmddef,45,33023 ,0,1,0, 0,40,1,0
  9008. PuPlayer.LabelNew pDMD,"CurScore",dmdscr,8,8454143 ,0,2,2,46,0,1,0
  9009. PuPlayer.LabelNew pDMD,"Free",dmdalt,9,2292994 ,0,2,2,98,0,1,0
  9010. PuPlayer.LabelNew pDMD,"Status",dmddef,9, 2292994 ,1,2,0,90,13,1,0
  9011. PuPlayer.LabelNew pDMD,"RV" ,dmddef,9, 2292994 ,1,2,0,44,4,1,0
  9012. PuPlayer.LabelNew pDMD,"RS" ,dmddef,9, 2292994 ,1,2,0,44,13,1,0
  9013. PuPlayer.LabelNew pDMD,"Ball Saved" ,dmddef,9, 2292994 ,1,1,0,0,0,1,0
  9014. PuPlayer.LabelNew pDMD,"lane" ,dmddef,6,65021 ,1,2,0,30,84,1,0
  9015.  
  9016. 'Page 2 (default Text Splash 1 Big Line)
  9017. PuPlayer.LabelNew pDMD,"Splash" ,dmdalt,15,2292994,0,1,1,0,0,2,0
  9018.  
  9019. 'Page 3 (default Text 3 Lines)
  9020. PuPlayer.LabelNew pDMD,"Splash3a",dmddef,25,2292994,0,1,0,0,20,3,0
  9021. PuPlayer.LabelNew pDMD,"Splash3b",dmddef,20,2292994,0,1,0,0,40,3,0
  9022. PuPlayer.LabelNew pDMD,"Splash3c",dmddef,30,2292994,0,1,0,0,60,3,0
  9023.  
  9024.  
  9025. 'Page 4 (default Text 2 Line)
  9026. PuPlayer.LabelNew pDMD,"Splash4a",dmddef,20,2292994,0,1,0,0,0,4,0
  9027. PuPlayer.LabelNew pDMD,"Splash4b",dmddef,20,2292994,0,1,2,0,75,4,0
  9028.  
  9029. 'Page 5 (3 layer large text for overlay targets function, must you fixed width font!
  9030. PuPlayer.LabelNew pDMD,"Back5" ,dmdfixed,80,8421504,0,1,1,0,0,5,0
  9031. PuPlayer.LabelNew pDMD,"Middle5" ,dmdfixed,80,65535 ,0,1,1,0,0,5,0
  9032. PuPlayer.LabelNew pDMD,"Flash5" ,dmdfixed,80,65535 ,0,1,1,0,0,5,0
  9033.  
  9034. 'Page 6 (3 Lines for big # with two lines, "19^Orbits^Count")
  9035. PuPlayer.LabelNew pDMD,"Splash6a",dmddef,90,65280,0,0,0,15,1,6,0
  9036. PuPlayer.LabelNew pDMD,"Splash6b",dmddef,50,33023,0,1,0,60,0,6,0
  9037. PuPlayer.LabelNew pDMD,"Splash6c",dmddef,40,33023,0,1,0,60,50,6,0
  9038.  
  9039. 'Page 7 (Show High Scores Fixed Fonts)
  9040. PuPlayer.LabelNew pDMD,"Splash7a",dmddef,20,8454143,0,1,0,0,2,7,0
  9041. PuPlayer.LabelNew pDMD,"Splash7b",dmdfixed,40,33023,0,1,0,0,20,7,0
  9042. PuPlayer.LabelNew pDMD,"Splash7c",dmdfixed,40,33023,0,1,0,0,50,7,0
  9043.  
  9044.  
  9045. END IF ' use PuPDMDDriver
  9046.  
  9047.  
  9048.  
  9049.  
  9050. end Sub 'page Layouts
  9051.  
  9052.  
  9053. '*****************************************************************
  9054. ' PUPDMD Custom SUBS/Events for each Table1
  9055. ' ********** MODIFY THIS SECTION!!! ***************
  9056. '*****************************************************************
  9057. '
  9058. '
  9059. ' we need to somewhere in code if applicable
  9060. '
  9061. ' call pDMDStartGame,pDMDStartBall,pGameOver,pAttractStart
  9062. '
  9063. '
  9064. '
  9065. '
  9066. '
  9067.  
  9068.  
  9069. Sub pDMDStartGame
  9070. pInAttract=false
  9071. pDMDSetPage(pScores) 'set blank text overlay page.
  9072.  
  9073. end Sub
  9074.  
  9075.  
  9076. Sub pDMDStartBall
  9077. end Sub
  9078.  
  9079. Sub pDMDGameOver
  9080. pAttractStart
  9081. end Sub
  9082.  
  9083. Sub pAttractStart
  9084. pDMDSetPage(pDMDBlank) 'set blank text overlay page.
  9085. pCurAttractPos=0
  9086. pInAttract=true 'Startup in AttractMode
  9087. pAttractNext
  9088. end Sub
  9089.  
  9090. Sub pDMDStartUP
  9091. pupDMDDisplay "attract","","",5,0,20
  9092. pInAttract=true
  9093. end Sub
  9094.  
  9095. DIM pCurAttractPos: pCurAttractPos=0
  9096.  
  9097.  
  9098. '********************** gets called auto each page next and timed already in DMD_Timer. make sure you use pupDMDDisplay or it wont advance auto.
  9099. Sub pAttractNext
  9100. pCurAttractPos=pCurAttractPos+1
  9101.  
  9102. Select Case pCurAttractPos
  9103.  
  9104. Case 1 pupDMDDisplay "attract","","",5,1,10
  9105. Case 2 pupDMDDisplay "attract","","",3,0,10
  9106. Case 3 pupDMDDisplay "attract","","",2,0,10
  9107. Case 4 pupDMDDisplay "attract","","",3,1,10
  9108. Case 5 pupDMDDisplay "attract","","",1,0,10
  9109. Case 6 pupDMDDisplay "attract","","",3,1,10
  9110. Case 7 pupDMDDisplay "attract","","",2,0,10
  9111. Case 8 pupDMDDisplay "attract","","",1,0,10
  9112. Case 9 pupDMDDisplay "attract","","",1,1,10
  9113. Case 10 pupDMDDisplay "attract","","",3,1,10
  9114. Case Else
  9115. pCurAttractPos=0
  9116. pAttractNext 'reset to beginning
  9117. end Select
  9118.  
  9119. end Sub
  9120.  
  9121.  
  9122.  
  9123. '********************** Sequences (for Attract, Mode Intros, Timed Prompts, etc): called by pDMD_Sequence Timer ************************
  9124. 'added by TerryRed
  9125. Dim pDMD_CurSequencePos:pDMD_CurSequencePos=0
  9126. Dim pDMDmode: pDMDmode="default"
  9127.  
  9128. Sub pDMD_Sequence_Timer
  9129. pDMD_CurSequencePos=pDMD_CurSequencePos+1
  9130. if pDMDmode="endofballbonus" then
  9131. Select Case pDMD_CurSequencePos
  9132. Case 1 pupDMDDisplay "default","PLAYER BONUS^UNUSED BALLSAVE^"& FormatScore(AwardPoints1),"",3,0,10
  9133. Case 2 pupDMDDisplay "default","PLAYER BONUS^TARGET BONUS^"& FormatScore(AwardPoints2),"",3,0,10
  9134. Case 3 pupDMDDisplay "default","PLAYER BONUS^REACTOR BONUS^"& FormatScore(AwardPoints3),"",3,0,10
  9135. Case 4 pupDMDDisplay "default","PLAYER BONUS^TOTAL BONUS^"& FormatScore(TotalBonus),"",3,0,10
  9136. Case Else
  9137. pDMD_CurSequencePos=0
  9138. pDMD_Sequence.Enabled=false
  9139. end Select
  9140. end if
  9141. End Sub
  9142.  
  9143. 'pDMDmode="endofballbonus":pDMD_Sequence.enabled=true
  9144.  
  9145. ' DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "UNUSED BALLSAVE"), eNone, CenterLine(3, FormatScore(AwardPoints1)), eBlinkFast, 2000, True, "tna_3xbonuswithend"
  9146. ' UDMD "UNUSED BALLSAVE", AwardPoints1, 2000
  9147. '
  9148. ' DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TARGET BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints2)), eBlinkFast, 2000, True, ""
  9149. ' UDMD "TARGET BONUS", AwardPoints2,2000
  9150. '
  9151. ' DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "REACTOR BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints3)), eBlinkFast, 2000, True, ""
  9152. 'UDMD "REACTOR BONUS", AwardPoints3, 2000
  9153.  
  9154. 'DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TOTAL BONUS"), eNone, CenterLine(3, FormatScore(TotalBonus)), eBlinkFast, 2000, True, ""
  9155. 'UDMD "TOTAL BONUS", TotalBonus, 2000
  9156.  
  9157.  
  9158.  
  9159.  
  9160.  
  9161. '************************ called during gameplay to update Scores ***************************
  9162.  
  9163. Sub pUpdateScores 'call this ONLY on timer 300ms is good enough
  9164. Dim ReactorStatus
  9165.  
  9166. if pDMDCurPage <> pScores then Exit Sub
  9167.  
  9168. 'puPlayer.LabelSet pDMD,"Credits","CREDITS " & ""& Credits ,1,""
  9169. 'puPlayer.LabelSet pDMD,"Play1","Player 1",1,""
  9170. 'puPlayer.LabelSet pDMD,"Ball"," "&pDMDCurPriority ,1,""
  9171. 'puPlayer.LabelSet pDMD,"Free Play","" & ""& Credits ,1,""
  9172. 'puPlayer.LabelSet pDMD,"Free","CREDITS" & ""& Credits ,1,""
  9173. 'PuPlayer.LabelSet pDMD,"Status","CREDITS " & ""& Credits ,1,""
  9174. 'puPlayer.LabelSet pDMD,"Reactor Value","Reactor Value",1,""
  9175.  
  9176. puPlayer.LabelSet pDMD,"CurScore","" & FormatNumber(Score(CurrentPlayer),0),1,""
  9177. puPlayer.LabelSet pDMD,"Play1","Player: " & CurrentPlayer,1,""
  9178. puPlayer.LabelSet pDMD,"Ball","Ball: " & BallinPlay ,1,""
  9179. puPlayer.LabelSet pDMD,"Credits","" & ReactorValue(CurrentPlayer),1,""
  9180. puPlayer.LabelSet pDMD,"Free","Credits: " & ""& Credits ,1,""
  9181. puPlayer.LabelSet pDMD,"RV","REACTOR VALUE: ",1,""
  9182. puPlayer.LabelSet pDMD,"RS","REACTOR STATUS: ",1,""
  9183. puPlayer.LabelSet pDMD,"lane","LANE SAVE LEVEL: " & LaneSaveCount(CurrentPlayer),1,""
  9184.  
  9185. Select Case ReactorState(CurrentPlayer)
  9186. Case 0: ReactorStatus = "Targeted"
  9187. Case 1: ReactorStatus = "Ready"
  9188. Case 2: ReactorStatus = "Started"
  9189. Case 3: ReactorStatus = "Critical"
  9190. End Select
  9191. puPlayer.LabelSet pDMD,"Status","" & ReactorStatus,1,""
  9192.  
  9193. end Sub
  9194. '**************************
  9195. 'PinUPPlayer
  9196. '**************************
  9197. Sub PinUPInit
  9198. Set PuPlayer = CreateObject("PinUpPlayer.PinDisplay")
  9199. PuPlayer.B2SInit "",CGameName
  9200. end Sub
  9201.  
  9202. Sub PuPEvent(EventNum)
  9203. If UsePinup = 1 Then
  9204. if hasPUP=false then Exit Sub
  9205.  
  9206. PuPlayer.B2SData "D"&EventNum,1 'send event to puppack driver
  9207. End If
  9208. End Sub
  9209. 'this should be called in table1_init at bottom after all else b2s/controller running.
  9210. '******************** pretty much only use pupDMDDisplay all over ************************
  9211. ' Sub pupDMDDisplay(pEventID, pText, VideoName,TimeSec, pAni,pPriority)
  9212. ' pEventID = reference if application,
  9213. ' pText = "text to show" separate lines by ^ in same string
  9214. ' VideoName "gameover.mp4" will play in background "@gameover.mp4" will play and disable text during gameplay.
  9215. ' also global variable useDMDVideos=true/false if user wishes only TEXT
  9216. ' TimeSec how long to display msg in Seconds
  9217. ' animation if any 0=none 1=Flasher
  9218. ' also, now can specify color of each line (when no animation). "sometext|12345" will set label to "sometext" and set color to 12345
  9219. 'Samples
  9220. '
  9221. 'pupDMDDisplay "default", "DATA GADGET LIT", "@DataGadgetLit.mp4", 3, 1, 10
  9222. 'pupDMDDisplay "shoot", "SHOOT AGAIN!", "@shootagain.mp4", 3, 1, 10
  9223. 'pupDMDDisplay "balllock", "Ball^Locked|16744448", "", 5, 1, 10 ' 5 seconds, 1=flash, 10=priority, ball is first line, locked on second and locked has custom color |
  9224. 'pupDMDDisplay "balllock","Ball 2^is^Locked", "balllocked2.mp4",3, 1,10 ' 3 seconds, 1=flash, play balllocked2.mp4 from dmdsplash folder,
  9225. 'pupDMDDisplay "balllock","Ball^is^Locked", "@balllocked.mp4",3, 1,10 ' 3 seconds, 1=flash, play @balllocked.mp4 from dmdsplash folder, because @ text by default is hidden unless useDmDvideos is disabled.
  9226.  
  9227.  
  9228. 'pupDMDDisplay "shownum", "3^More To|616744448^GOOOO", "", 5, 1, 10 ' "shownum" is special. layout is line1=BIG NUMBER and line2,line3 are side two lines. "4^Ramps^Left"
  9229.  
  9230. 'pupDMDDisplay "target", "POTTER^110120", "blank.mp4", 10, 0, 10 ' 'target'... first string is line, second is 0=off,1=already on, 2=flash on for each character in line (count must match)
  9231.  
  9232. 'pupDMDDisplay "highscore", "High Score^AAA 2451654^BBB 2342342", "", 5, 0, 10 ' highscore is special line1=text title like highscore, line2, line3 are fixed fonts to show AAA 123,123,123
  9233. 'pupDMDDisplay "highscore", "High Score^AAA 2451654|616744448^BBB 2342342", "", 5, 0, 10 ' sames as above but notice how we use a custom color for text |
  9234. '================================================================
  9235. ' PUP STUFF
  9236. '================================================================
  9237.  
  9238. '*****************************
  9239. ' AUTO TESTING
  9240. ' by:NailBuster
  9241. ' Global variable "AutoQA" below will switch all this on/off during testing.
  9242. '
  9243. '*****************************
  9244. ' NailBusters AutoQA Code and triggers..
  9245. ' this to do for ROM based: timeout on keydown. if 30 seconds, then assume game is over and you add coins/start game key.
  9246. ' add a timer called AutoQAStartGame. you can run every 10000 interval.
  9247.  
  9248. Dim AutoQA:
  9249. AutoQa = 0 '0 = off, 1, 2,3,4 = 1 or 2 or 3 or 4 player test. Main QA Testing FLAG setting to false will disable all this stuff.
  9250. AutoQAStartGame.Enabled = AutoQa
  9251. Dim QACoinStartSec:QACoinStartSec=60 'timeout seconds for AutoCoinStartSec
  9252. Dim QANumberOfCoins:QANumberOfCoins=3 + AutoQa 'number of coins to add for each start
  9253. Dim QASecondsDiff
  9254.  
  9255. Dim QALastFlipperTime:QALastFlipperTime=Now()
  9256. Dim AutoFlipperLeft:AutoFlipperLeft=false
  9257. Dim AutoFlipperRight:AutoFlipperRight=false
  9258.  
  9259.  
  9260.  
  9261. Sub AutoQAStartGame_Timer() 'this is a timeout when sitting in attract with no flipper presses for 60 seconds, then add coins and start game.
  9262. if AutoQA=0 Then Exit Sub
  9263.  
  9264. QASecondsDiff = DateDiff("s",QALastFlipperTime,NOW())
  9265.  
  9266. if QASecondsDiff>QACoinStartSec Then
  9267.  
  9268. 'simulate quarters and start game keys
  9269. Dim fx : fx=0
  9270. Dim keydelay : keydelay=100
  9271. Do While fx<QANumberOfCoins
  9272. vpmtimer.addtimer keydelay,"Table1_KeyDown(keyInsertCoin1) '"
  9273. vpmtimer.addtimer keydelay+200,"Table1_KeyUp(keyInsertCoin1) '"
  9274. keydelay=keydelay+500
  9275. fx=fx+1
  9276. Loop
  9277.  
  9278. fx=0
  9279. Do While fx<AutoQa
  9280. vpmtimer.addtimer keydelay,"Table1_KeyDown(StartGameKey) '"
  9281. vpmtimer.addtimer keydelay+200,"Table1_KeyUp(StartGameKey) '"
  9282. keydelay=keydelay+500
  9283. fx=fx+1
  9284. Loop
  9285.  
  9286.  
  9287. QALastFlipperTime=Now()
  9288. AutoFlipperLeft=false
  9289. AutoFlipperRight=false
  9290. End if
  9291.  
  9292. if QASecondsDiff>30 Then 'safety of stuck up flipers.
  9293. AutoFlipperLeft=false
  9294. AutoFlipperRight=false
  9295. End if
  9296. End Sub
  9297.  
  9298.  
  9299. Sub TriggerAutoPlunger_Hit() 'add a trigger in front of plunger. adjust the delay timings if needed.
  9300. if AutoQA=0 Then Exit Sub
  9301. vpmtimer.addtimer 10,"Table1_KeyDown(PlungerKey) '"
  9302. vpmtimer.addtimer 900+RND(400),"Table1_KeyUp(PlungerKey) '"
  9303. End Sub
  9304.  
  9305.  
  9306.  
  9307. Sub FlipperUP(which) 'which=1 left 2 right
  9308. QALastFlipperTime=Now()
  9309. if which=1 Then
  9310. Table1_KeyDown(LeftFlipperKey)
  9311. vpmtimer.addtimer 200+Rnd(200),"Table1_KeyUP(LeftFlipperKey):AutoFlipperLeft=false '"
  9312. Else
  9313. Table1_KeyDown(RightFlipperKey)
  9314. vpmtimer.addtimer 200+Rnd(200),"Table1_KeyUP(RightFlipperKey):AutoFlipperRight=false '"
  9315. end If
  9316.  
  9317. End Sub
  9318.  
  9319.  
  9320.  
  9321. Sub TriggerLeftAuto_Hit()
  9322. if AutoQA>0 And AutoFlipperLeft=false then vpmtimer.addtimer 20+Rnd(20),"FlipperUP(1) '"
  9323. AutoFlipperLeft=true
  9324. End Sub
  9325.  
  9326. Sub TriggerRightAuto_Hit()
  9327. if AutoQA>0 and AutoFlipperRight=false then vpmtimer.addtimer 20+Rnd(20),"FlipperUP(2) '"
  9328. AutoFlipperRight=true
  9329. End Sub
  9330.  
  9331. Sub TriggerLeftAuto2_Hit()
  9332. TriggerLeftAuto_Hit()
  9333. End Sub
  9334.  
  9335. Sub TriggerRightAuto2_Hit()
  9336. TriggerRightAuto_Hit()
  9337. End Sub
  9338.  
  9339.  
  9340.  
  9341.  
  9342. '*****************************************************
  9343.  
  9344.  
  9345.  
  9346. '================================================================
  9347. 'DOF Events - "-- Means DOF event is used
  9348. '================================================================
  9349. '101 - Left Flipper
  9350. '102 - Right Flipper
  9351. '103 - Left SlingShot Solenoid
  9352. '104 - Left SlingShot Flasher
  9353. '105 - Right SlingShot Solenoid
  9354. '106 - Right SlingShot Flasher
  9355. '107 - Bumper Solenoid
  9356. '108 - RAD Left Standup Target bank
  9357. '109 - Grid Targetx,y,z standup target
  9358. '110 - Destroy Left standup
  9359. '111 - Destroy Right Standup
  9360. '112 - Left Spinner Flasher
  9361. '113 - Right Spinner Flasher
  9362. '114 - Reactor Stand Up targets
  9363. '115 -- Multiball - Consider Dof On and Off when MB ends
  9364. '116 - Drain
  9365. '117 - Reactor Left Slings
  9366. '118 - Reactor Right Sling
  9367. '119 - Bumper Flasher
  9368. '121 - Ball Trough
  9369. '122 - Left Scoop Solenoid and Right Scoop Solenoid - Consider separating
  9370. '123 - Strobe used for Autoplunge , Extra Game, Left Scoop, Right Scoop, Single Jackpot, Double Jackpot
  9371. '125 - Autoplunge 'Solenoid
  9372. '129 - Knocker
  9373. '132 - Triple Jackpot Strobe
  9374. '133 - Super Jackpot Strobe
  9375. '136 - Drop Target Upper Solenoid
  9376. '137 - Drop Target MIddle Solenoid
  9377. '138 - Drop Target Lower Solenoid
  9378. '140 - Credits/Free Play 'Start Button
  9379. 'Undercab E145 White/E146 Blue/E147 Red/E148 Green/E149 Purple
  9380. '--Const DOFuyellow = 144
  9381. '--Const DOFuwhite = 145
  9382. '--Const DOFublue = 146
  9383. '--Const DOFured = 147
  9384. '--Const DOFugreen = 148
  9385. '--Const DOFupurple= 149
  9386. '150 -- Top Lane 1
  9387. '151 -- Top Lane 2
  9388. '152 -- Top Lane 3
  9389. '153 -- Top Lane 4
  9390. '160 - Combo Loop
  9391. '161 - Tilt warning
  9392. '162 - Tilted
  9393. '163 - Shoot again
  9394. '164 - Player Bonus Count (8 seconds)
  9395. '165 - Ball Saved
  9396. '166 -- Bonus Multiplier Awarded (1.5 seconds)
  9397. '167 - Extra Ball Earned
  9398. '168 - Skill Shot
  9399. '169 - Handsfree Skill Shot
  9400. '170 - Lane Save Earned
  9401. '171 - Super Spinner Awarded
  9402. '172 - Locks are Lit
  9403. '173 -- Ball Lock 1
  9404. '173 -- Ball Lock 2 (using 173 for same Effect)
  9405. '175 - Reactor Grid Jackpot
  9406. '176 - Reactor Ready
  9407. '177 - Reactor Started
  9408. '178 -- Reactor Critical
  9409. '179 -- Reactor Destroyed
  9410. '180 -- Total Annihilation Achieved
  9411. '181 - Reactor Value Maxed
  9412. '182 - Mystery is Lit
  9413. '183 - Mystery Awarded (4 seconds)
  9414. '184 -- Grid insert Left Green
  9415. '185 -- Grid insert Middle Green
  9416. '186 -- Grid insert Right Green
  9417. '187 -- Grid insert Left Purple
  9418. '188 -- Grid insert Middle Purple
  9419. '189 -- Grid insert Right Purple
  9420. '190 -- Reactor Max 1 target inserts
  9421. '191 -- Reactor Max 2 target insert
  9422. '192 -- Reactor Max 3 target insert
  9423. '193 -- Mystery award 1 target inserts
  9424. '194 -- Mystery award 2 target insert
  9425. '195 -- Mystery award 3 target insert
  9426.  
  9427. '================================================================
  9428. 'DOF Events
  9429. '================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement