Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '
- ' ****************************************************************
- ' VISUAL PINBALL X
- ' ****************************************************************
- Option Explicit
- Randomize
- Const bFreePlay = True 'True = FreePlay. False = Coins
- Const BallsPerGame = 3
- Const ReactorDifficulty = 2 'Default: 2 (1-Easy, 2-Med, 3-Hard)
- Const ReactorLevelMax = 9 'Default: 9 (1-9 Reactors)
- Const SongVolume = 0.5
- Const BallSaverTime = 12 'Default: 12 seconds
- Const DropTargetResetTime = 5 'Default: 5 seconds during Multiball Jackpot
- Const ReactorPercentLossTime= 3 'Default: After Reactor 3, Reactor Percent drops back down by 1 every 3 seconds
- Const ExtraBallAward1 = 3 'Default: Extra Ball at Reactor 3 Critical stage
- Const ExtraBallAward2 = 6 'Default: Extra Ball at Reactor 6 Critical stage
- Const KeepLaneSaves = 1 'Default: 1 (Yes. 0=No)
- Const AutoPlungeDelay = 1.0 'Default: 1.0 seconds
- Const Testmode = 0 'Testing only
- Const debugGeneral = 0 'For debug only
- Const debugReactor = 0 'For debug only
- Const debugMultiball = 0 'For debug only
- Const debugGrid = 0 'For debug only
- Const debugDestroyRAD = 0 'For debug only
- Const debugMysteryAward = 0 'For debug only
- Const debugHighScore = 0 'For debug only
- On Error Resume Next
- ExecuteGlobal GetTextFile("controller.vbs")
- If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
- On Error Goto 0
- Dim UltraDMD
- Const uwhite = 145
- Const ublue = 146
- Const ured = 147
- Dim UndercabColor : UndercabColor = ublue
- 'Sub LoadUltraDMD
- ' Set UltraDMD = CreateObject("UltraDMD.DMDObject")
- ' UltraDMD.Init
- ' uDMDScoreTimer.Enabled = 1
- 'End Sub
- Sub uDMDScoreTimer_Timer
- UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "Ball " & Balls, "Credits " & Credits
- End Sub
- Const cGameName = "tna"
- Const BallSize = 50 ' 50 is the normal size
- ' Load the core.vbs for supporting Subs and functions
- LoadCoreVBS
- Sub LoadCoreVBS
- On Error Resume Next
- ExecuteGlobal GetTextFile("core.vbs")
- If Err Then MsgBox "Can't open core.vbs"
- On Error Goto 0
- End Sub
- Sub startB2S(aB2S)
- If B2SOn Then
- Controller.B2SSetData 1, 0
- Controller.B2SSetData 2, 0
- Controller.B2SSetData 3, 0
- Controller.B2SSetData 4, 0
- Controller.B2SSetData 5, 0
- Controller.B2SSetData 6, 0
- Controller.B2SSetData 7, 0
- Controller.B2SSetData 8, 0
- Controller.B2SSetData aB2S, 1
- End If
- End Sub
- ' Define any Constants
- Const TableName = "TNA"
- Const myVersion = "1.0.0"
- Const MaxPlayers = 4
- Const MaxMultiplier = 4 'limit to 4x in this game
- Const MaxMultiballs = 4 ' max number of balls during multiballs
- ' Define Global Variables
- Dim PlayersPlayingGame
- Dim CurrentPlayer
- Dim Credits
- Dim BonusPoints(4)
- Dim BonusHeldPoints(4)
- Dim BonusMultiplier(4)
- Dim bBonusHeld
- Dim BallsRemaining(4)
- Dim ExtraBallsAwards(4)
- Dim Score(4)
- Dim HighScore(4)
- Dim HighScoreName(4)
- Dim Tilt
- Dim TiltSensitivity
- Dim Tilted
- Dim TotalGamesPlayed
- Dim mBalls2Eject
- Dim SkillshotValue
- Dim HandsFreeSkillshotInsert
- Dim bAutoPlunger
- Dim bInstantInfo
- Const Quotemode = 0
- ' Define Game Control Variables
- Dim LastSwitchHit
- Dim BallsOnPlayfield
- Dim BallsInLock
- Dim BallsInHole
- ' Define Game Flags
- Dim bGameInPlay
- Dim bOnTheFirstBall
- Dim bBallInPlungerLane
- Dim bBallSaverActive
- Dim bBallSaverReady
- Dim bMultiBallMode
- Dim bMusicOn
- 'Skillshot
- Dim SkillshotReady '0 = Off, 1 = Start, 2 = Plunged
- Dim bSkillshotSelect 'used to select the skillshot you want
- Dim bExtraBallWonThisBall
- Dim bJustStarted
- Dim plungerIM 'used mostly as an autofire plunger
- 'Dim ttable, cbleft, cbright
- ' *********************************************************************
- ' Visual Pinball Defined Script Events
- ' *********************************************************************
- Sub Table1_Init()
- LoadEM
- Dim i
- Randomize
- 'Impulse Plunger as autoplunger
- Const IMPowerSetting = 40 ' Plunger Power
- Const IMTime = 1.1 ' Time in seconds for Full Plunge
- Set plungerIM = New cvpmImpulseP
- With plungerIM
- .InitImpulseP swplunger, IMPowerSetting, IMTime
- .Random 1.5
- .InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_solenoid", DOFContactors)
- .CreateEvents "plungerIM"
- End With
- 'load saved values, highscore, names, jackpot
- Loadhs
- 'Init main variables
- ' initalise the DMD display
- DMD_Init
- if bFreePlay = True Then
- DOF 140, DOFOn
- end if
- ' initialse any other flags
- bOnTheFirstBall = False
- bBallInPlungerLane = False
- bBallSaverActive = False
- bBallSaverReady = False
- bMultiBallMode = False
- bGameInPlay = False
- bAutoPlunger = False
- bMusicOn = True
- SetBallsOnPlayfield 0
- BallsInLock = 0
- BallsInHole = 0
- LastSwitchHit = ""
- Tilt = 0
- TiltSensitivity = 6
- Tilted = False
- bBonusHeld = False
- bJustStarted = True
- bInstantInfo = False
- 'EndOfGame()
- StartRainbow "all"
- PlaySong "bgout_tna10.mp3", 2
- ShowTableInfo
- LightSeqAttract.Play SeqRandom, 40, 1000, 0
- ' Misc. VP table objects Initialisation, droptargets, animations...
- VPObjects_Init
- ' Remove the cabinet rails if in FS mode
- If Table1.ShowDT = False then
- lrail.Visible = False
- rrail.Visible = False
- ' start the UltraDMD
- 'LoadUltraDMD
- End If
- End Sub
- Dim ComboLoopFlag
- Sub SetLastSwitchHit (value)
- Dim comboscore
- 'check for combo first
- If (StrComp(value, "swRLoop") = 0) Then
- If ComboLoopFlag > 0 Then 'check if value is right loop switch
- comboscore = 5000 * (2 ^ ComboLoopFlag)
- If comboscore > 160000 then comboscore = 160000
- AddScore (comboscore)
- 'MSGBOX "COMBO " & ComboLoopFlag & "!"
- DMD "", eNone, Centerline(1, ("COMBO")), eNone, "", eNone, CenterLine(3, FormatScore(comboscore)), eBlinkFast, 800, True, "tna_combo"
- end if
- elseif (StrComp(value, "swLLoop") = 0) AND (StrComp(LastSwitchHit, "swRLoop") = 0) then 'Loop detected
- ComboLoopFlag = ComboLoopFlag + 1
- else
- ComboLoopFlag = 0
- End If
- LastSwitchHit = value
- End Sub
- '******
- ' Section; Keys
- '******
- Dim kickertest
- kickertest = 8
- Sub Table1_KeyDown(ByVal Keycode)
- If Keycode = AddCreditKey Then
- Credits = Credits + 1
- DOF 140, DOFOn
- If(Tilted = False)Then
- DMDFlush
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CREDITS: " & Credits), eNone, 500, True, "fx_coin"
- If NOT bGameInPlay Then ShowTableInfo
- End If
- End If
- If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
- If keycode = PlungerKey Then
- Plunger.Pullback
- PlaySound "fx_plungerpull"
- End If
- End If
- ' ************ DEBUG KEYS Sect *******
- ' ************ DEBUG KEYS Sect *******
- If Keycode = 3 Then
- BlockerWalls
- End If
- If TestMode = 1 Then
- If keycode = 17 Then 'W key
- ByPassGrid
- debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR READY: GridTargets set"
- End If
- If keycode = 18 Then 'E key
- CheckReactorStart
- debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR STARTED: CheckReactorStart"
- End If
- If keycode = 19 Then 'R key
- SetReactorPercent 100
- debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR CRITICAL: SetReactorPercent 100"
- End If
- If keycode = 20 Then 'T key
- DecreaseReactorDestroyCount lD3, lBumperFlash
- DecreaseReactorDestroyCount lD3, lBumperFlash
- DecreaseReactorDestroyCount lRad1, fRad1
- DecreaseReactorDestroyCount lRad2, fRad2
- DecreaseReactorDestroyCount lRad3, fRad3
- DecreaseReactorDestroyCount lD1, fD1
- DecreaseReactorDestroyCount lD2, fD2
- debug.print "*****SUB:" & "Table1_KeyDown, Testmode:REACTOR DESTROYED: DecreaseReactorDestroyCount"
- End If
- If keycode = 21 Then kickerdebug.enabled = true 'Y key
- If keycode = 22 Then kickerdebug.enabled = true 'U key
- If keycode = 23 Then kickerdebug.enabled = true 'I key
- If keycode = 25 Then kickerdebug.enabled = true 'P key
- If keycode = 30 Then 'A key
- RotateLaneLightsRight
- Sw1_hit
- End If
- If keycode = 31 Then 'S key
- TargetRAD3_Hit
- TargetRAD2_Hit
- TargetRAD1_Hit
- End If
- If keycode = 33 Then 'F key
- AddBonusMultiplier 1
- debug.print "*****SUB:" & "Table1_KeyDown, Testmode:AddBonusMultiplier 1"
- End If
- If keycode = 34 Then 'G key
- AwardSave 1
- debug.print "*****SUB:" & "Table1_KeyDown, Testmode:AwardSave 1"
- End If
- If keycode = 35 Then 'H key
- TestHitTarget
- debug.print "*****SUB:" & "Table1_KeyDown, Testmode:TestHitTarget"
- End If
- End If
- ' ************ DEBUG KEYS Sect *******
- ' ************ DEBUG KEYS Sect *******
- If hsbModeActive Then
- EnterHighScoreKey(keycode)
- Exit Sub
- End If
- ' Table specific
- ' Normal flipper action
- If bGameInPlay AND NOT Tilted Then
- If keycode = LeftTiltKey Then Nudge 90, 6:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt
- If keycode = RightTiltKey Then Nudge 270, 6:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt
- If keycode = CenterTiltKey Then Nudge 0, 7:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt
- If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
- If keycode = LeftFlipperKey Then SolLFlipper 1:InstantInfoTimer.Enabled = False
- If keycode = RightFlipperKey Then SolRFlipper 1:InstantInfoTimer.Enabled = False
- If keycode = StartGameKey Then
- If((PlayersPlayingGame < MaxPlayers)AND(bOnTheFirstBall = True))Then
- If(bFreePlay = True)Then
- PlayersPlayingGame = PlayersPlayingGame + 1
- TotalGamesPlayed = TotalGamesPlayed + 1
- PlaySound "gb_fanfare1"
- DMD "", eNone, "_", eNone, CenterLine(2, PlayersPlayingGame & " PLAYERS"), eBlink, "", eNone, 500, True, ""
- Else
- If(Credits > 0)then
- PlayersPlayingGame = PlayersPlayingGame + 1
- TotalGamesPlayed = TotalGamesPlayed + 1
- Credits = Credits - 1
- PlaySound "gb_fanfare1"
- DMD "", eNone, "_", eNone, CenterLine(2, PlayersPlayingGame & " PLAYERS"), eBlink, "", eNone, 500, True, ""
- Else
- ' Not Enough Credits to start a game.
- DOF 140, DOFOff
- DMDFlush
- DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eNone, "", eNone, 500, True, ""
- End If
- End If
- End If
- End If
- End If
- Else ' If (GameInPlay)
- If keycode = StartGameKey Then
- If(bFreePlay = True)Then
- If(BallsOnPlayfield = 0)Then
- ResetForNewGame()
- End If
- Else
- If(Credits > 0)Then
- If(BallsOnPlayfield = 0)Then
- Credits = Credits - 1
- ResetForNewGame()
- End If
- Else
- ' Not Enough Credits to start a game.
- DOF 140, DOFOff
- DMDFlush
- DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eBlink, "", eNone, 500, True, ""
- PlaySound "gb_electricity1", 0, 1, -0.05, 0.05
- ShowTableInfo
- End If
- End If
- End If
- End If ' If (GameInPlay)
- End Sub
- Sub Table1_KeyUp(ByVal keycode)
- If keycode = PlungerKey Then
- Plunger.Fire
- PlaySound "fx_plunger"
- End If
- 'Testkeys
- If keycode = 21 Then 'Y key
- kickerdebug.enabled = false
- If kickertest = -18 then
- kickertest = 19
- Else
- kickertest = -18
- End If
- kickerdebug.kick kickertest, 40
- End If
- If keycode = 22 Then 'U key
- kickerdebug.enabled = false
- kickertest = -8
- kickerdebug.kick kickertest, 40
- End If
- If keycode = 23 Then 'I key
- kickerdebug.enabled = false
- If kickertest = -2 then
- kickertest = 0
- ElseIf kickertest = 0 then
- kickertest = 4
- Else
- kickertest = -2
- End If
- kickerdebug.kick kickertest, 40
- End If
- If keycode = 25 Then 'P key
- kickerdebug.enabled = false
- kickertest = 8
- kickerdebug.kick kickertest, 40
- End If
- If hsbModeActive Then
- Exit Sub
- End If
- ' Table specific
- If bGameInPLay AND NOT Tilted Then
- If keycode = LeftFlipperKey Then
- SolLFlipper 0
- InstantInfoTimer.Enabled = False
- If bInstantInfo Then
- bInstantInfo = False
- DMDScoreNow
- End If
- End If
- If keycode = RightFlipperKey Then
- SolRFlipper 0
- InstantInfoTimer.Enabled = False
- If bInstantInfo Then
- bInstantInfo = False
- DMDScoreNow
- End If
- End If
- End If
- End Sub
- Sub InstantInfoTimer_Timer
- InstantInfoTimer.Enabled = False
- bInstantInfo = True
- Jackpot = 1000000 + Round(Score(CurrentPlayer) / 10, 0)
- DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "JACKPOT"), eScrollLeft, CenterLine(3, FormatScore(Jackpot)), eScrollLeft, 800, False, ""
- DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "SUPERJACKPOT"), eScrollLeft, CenterLine(3, FormatScore(SuperJackpot)), eScrollLeft, 800, False, ""
- ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "PKE LEVEL"), eScrollLeft, CenterLine(3, FormatScore(1)), eScrollLeft, 800, False, ""
- ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "PKE MULTIPLIER"), eScrollLeft, CenterLine(3, 1), eScrollLeft, 800, False, ""
- ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "GHOSTS CAUGHT"), eScrollLeft, CenterLine(3, Ghosts(CurrentPlayer) + GhostsHundreds(CurrentPlayer) * 100), eScrollLeft, 800, False, ""
- DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "BONUS MULTIPLIER"), eScrollLeft, CenterLine(3, BonusMultiplier(CurrentPlayer)), eScrollLeft, 800, False, ""
- ' DMD "", eNone, CenterLine(1, "INSTANT INFO"), eNone, CenterLine(2, "FIRESTATION HIT"), eScrollLeft, CenterLine(3, FormatScore(SpinnerValue * SpinnerLevel)), eScrollLeft, 800, False, ""
- End Sub
- Sub EndFlipperStatus
- If bInstantInfo Then
- bInstantInfo = False
- DMDScoreNow
- End If
- End Sub
- '*************
- ' Section; Pause Table
- '*************
- Sub table1_Paused
- End Sub
- Sub table1_unPaused
- End Sub
- Sub table1_Exit
- Savehs
- End Sub
- '********************
- ' Section; Flippers
- '********************
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, 1, -0.05, 0.15
- LeftFlipper.RotateToEnd
- LeftFlipper2.RotateToEnd
- RotateLaneLightsLeft
- Else
- PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, -0.05, 0.15
- LeftFlipper.RotateToStart
- LeftFlipper2.RotateToStart
- End If
- End Sub
- Sub SolLFlipper2(Enabled)
- If Enabled Then
- LeftFlipper.RotateToEnd
- Else
- LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, 1, 0.05, 0.15
- RightFlipper.RotateToEnd
- RotateLaneLightsRight
- Else
- PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, 0.05, 0.15
- RightFlipper.RotateToStart
- End If
- End Sub
- ' flippers hit Sound
- Sub LeftFlipper_Collide(parm)
- PlaySound "flip_hit_1", 0, parm / 10, -0.05, 0.25
- End Sub
- Sub RightFlipper_Collide(parm)
- PlaySound "flip_hit_1", 0, parm / 10, 0.05, 0.25
- End Sub
- Sub LeftFlipper2_Collide(parm)
- PlaySound "flip_hit_1", 0, parm / 10, -0.05, 0.25
- End Sub
- Sub RightFlipper2_Collide(parm)
- PlaySound "flip_hit_1", 0, parm / 10, 0.05, 0.25
- End Sub
- '*****************************
- ' Section; CORE Targets - Bonus Multiplier
- '*****************************
- Sub ResetCORE()
- L1.State = 0
- L2.State = 0
- L3.State = 0
- L4.State = 0
- End Sub
- Sub CheckCORE
- If (L1.State = 1 and L2.State = 1 and L3.State = 1 and L4.State = 1) Then
- ResetCORE
- ' 'to do lightseq
- ' FlashForMs l1, 2000, 100, 0
- ' FlashForMs l2, 2000, 100, 0
- ' FlashForMs l3, 2000, 100, 0
- ' FlashForMs l4, 2000, 100, 0
- '
- AddBonusMultiplier 1
- End If
- End Sub
- Sub RotateLaneLightsLeft()
- Dim tmp
- tmp = l1.State
- l1.state = l2.State
- l2.State = l3.State
- l3.State = l4.State
- l4.State = tmp
- tmp = la1.State
- la1.state = la2.State
- la2.State = la3.State
- la3.State = la4.State
- la4.State = tmp
- If bSkillshotSelect Then
- SelectSkillshot(1)
- End If
- End Sub
- Sub RotateLaneLightsRight()
- Dim tmp
- tmp = la4.State
- la4.state = la3.State
- la3.State = la2.State
- la2.State = la1.State
- la1.State = tmp
- tmp = l4.State
- l4.state = l3.State
- l3.State = l2.State
- l2.State = l1.State
- l1.State = tmp
- If bSkillshotSelect Then
- SelectSkillshot(2)
- End If
- End Sub
- '*********
- ' Section; TILT
- '*********
- 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
- Sub CheckTilt 'Called when table is nudged
- Tilt = Tilt + TiltSensitivity 'Add to tilt count
- TiltDecreaseTimer.Enabled = True
- If(Tilt > TiltSensitivity)AND(Tilt < 15)Then 'show a warning
- DMD "", eNone, "_", eNone, CenterLine(2, "CAREFUL!"), eBlinkFast, "", eNone, 500, True, ""
- End if
- If Tilt > 15 Then 'If more that 15 then TILT the table
- Tilted = True
- 'display Tilt
- DMDFlush
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "TILT!"), eBlinkFast, 200, False, ""
- DisableTable True
- TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
- End If
- End Sub
- Sub TiltDecreaseTimer_Timer
- ' DecreaseTilt
- If Tilt > 0 Then
- Tilt = Tilt - 0.1
- Else
- TiltDecreaseTimer.Enabled = False
- End If
- End Sub
- Sub DisableTable(Enabled)
- If Enabled Then
- 'turn off GI and turn off all the lights
- GiOff
- 'LightSeqTilt.Play SeqAllOff
- 'Disable slings, bumpers etc
- LeftFlipper.RotateToStart
- RightFlipper.RotateToStart
- LeftSlingshot.Disabled = 1
- RightSlingshot.Disabled = 1
- Else
- 'turn back on GI and the lights
- 'GiOn
- ' 'LightSeqTilt.StopPlay
- LeftSlingshot.Disabled = 0
- RightSlingshot.Disabled = 0
- 'clean up the buffer display
- DMDFlush
- End If
- End Sub
- Sub TiltRecoveryTimer_Timer()
- ' if all the balls have been drained then..
- If(BallsOnPlayfield = 0)Then
- ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
- EndOfBall()
- TiltRecoveryTimer.Enabled = False
- End If
- ' else retry (checks again in another second or so)
- End Sub
- '********************
- ' Section; Music
- '********************
- Dim Song
- Song = ""
- Dim m_main
- Sub StartBackgroundMusic
- Dim tmp
- tmp = ((ReactorLevel(CurrentPlayer) + RandomSongStart) Mod 8) + 2
- If debugGeneral Then debug.print "StartBackgroundMusic, ReactorState(CurrentPlayer)=" & ReactorState(CurrentPlayer)
- If ReactorState(CurrentPlayer) <> 3 Then 'Critical
- If ReactorLevel(CurrentPlayer) = 1 Then
- m_main = "bgout_TNA" & ReactorLevel(CurrentPlayer) & ".mp3"
- Else
- m_main = "bgout_TNA" & tmp & ".mp3"
- End If
- PlaySong m_main, 2
- End If
- End Sub
- Sub StopBackgroundMusic
- If debugGeneral Then debug.print "StopBackgroundMusic"
- EndMusic
- Song = ""
- End Sub
- Sub StartReactorCriticalMusic
- If debugGeneral Then debug.print "StartReactorCriticalMusic"
- EndMusic
- playsound "tna_reactorcritical", -1
- End Sub
- Sub PlaySong(name, ttype)
- If debugGeneral Then debug.print "PlaySong " & "name"
- If bMusicOn Then
- If Song <> name Then
- StopSound Song
- EndMusic
- Song = name
- If ttype = 1 Then
- If Song = "m_end" Then
- PlaySound Song, 0, 0.1 'this last number is the volume, from 0 to 1
- Else
- PlaySound Song, -1, 1 'this last number is the volume, from 0 to 1
- End If
- Else
- PlayMusic Song, SongVolume
- End If
- End If
- End If
- End Sub
- '**********************
- ' Section; GI effects
- ' independent routine
- ' it turns on the gi
- ' when there is a ball
- ' in play
- '**********************
- Dim OldGiState, CurrCol
- OldGiState = -1 'start witht the Gi off
- Sub ChangeGi(col) 'changes the gi color
- If debugGeneral Then debug.print "*****SUB:ChangeGi " & col
- CurrCol = col
- ChangeGiTimer.Interval = 500
- ChangeGITimer.Enabled = True
- GIOff
- End Sub
- Sub ChangeGiTimer_Timer
- If debugGeneral Then debug.print "*****SUB:ChangeGiTimer_Timer " & CurrCol
- Dim bulb
- ChangeGITimer.Enabled = False
- For each bulb in aGILights
- SetLight bulb, CurrCol, -1
- Next
- GiOn
- End Sub
- Sub ChangeGiImmediate (col)
- DOF UndercabColor, DOFOff
- If col = "white" Then
- UndercabColor = uwhite
- ElseIf col = "blue" Then
- UndercabColor = ublue
- ElseIf col = "red" Then
- UndercabColor = ured
- End If
- DOF UndercabColor, DOFOn
- Dim bulb
- CurrCol = col
- For each bulb in aGILights
- SetLight bulb, col, -1
- Next
- End Sub
- 'Sub GIUpdateTimer_Timer
- ' Dim tmp, obj
- ' tmp = Getballs
- ' If UBound(tmp) <> OldGiState Then
- ' OldGiState = Ubound(tmp)
- ' If UBound(tmp) = 3 Then 'we have 4 captive balls on the table (-1 means no balls, 0 is the first ball, 1 is the second..)
- ' GiOff ' turn off the gi if no active balls on the table, we could also have used the variable ballsonplayfield.
- ' Else
- ' Gion
- ' End If
- ' End If
- 'End Sub
- Sub GiOn
- 'If debugGeneral Then debug.print "*****SUB:GiOn"
- DOF UndercabColor, DOFOn
- Dim bulb
- For each bulb in aGiLights
- bulb.State = 1
- Next
- End Sub
- Sub GiOff
- 'If debugGeneral Then debug.print "*****SUB:GiOff"
- DOF UndercabColor, DOFOff
- Dim bulb
- For each bulb in aGiLights
- bulb.State = 0
- Next
- End Sub
- Sub GIReactor (col)
- Dim Bulb
- For each bulb in aGIReactorLights
- SetLight bulb, col, -1
- Next
- End Sub
- Sub GIReactorStarted
- gi9.TimerInterval = 30
- gi9.TimerEnabled = True
- End Sub
- Sub GIReactorStopped
- gi9.TimerEnabled = False
- gi10.TimerInterval = 2000
- gi10.TimerEnabled = True
- ChangeGIImmediate("white")
- LightSeqAttract.Play SeqRandom, 40, , 0
- End Sub
- Sub GIReactorStoppedImmediate
- gi9.TimerEnabled = False
- ChangeGIImmediate("blue")
- End Sub
- Sub Gi10_Timer
- gi10.TimerEnabled = False
- LightSeqAttract.StopPlay
- ChangeGI("blue")
- End Sub
- Dim GISpinNum
- GISpinNum=0
- Sub GI9_Timer
- If ReactorState(CurrentPlayer) = 2 Then 'Reactor Started 'Circle animation
- SetLight aGiReactorLights((GISpinNum)mod 16), "blue", -1
- SetLight aGiReactorLights((GISpinNum+1)mod 16), "blue", -1
- SetLight aGiReactorLights((GISpinNum+2)mod 16), "blue", -1
- SetLight aGiReactorLights((GISpinNum+3)mod 16), "blue", -1
- SetLight aGiReactorLights((GISpinNum+4)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+5)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+6)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+7)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+8)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+9)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+10)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+11)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+12)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+13)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+14)mod 16), "red", -1
- SetLight aGiReactorLights((GISpinNum+15)mod 16), "red", -1
- ElseIf ReactorState(CurrentPlayer) = 3 Then 'Reactor Critical 'blinking Red GI
- ChangeGiImmediate("red")
- GiON
- ' Select Case GISpinNum
- ' Case 1,2,8,9
- ' GIOff 'GiReactorOff
- ' Case Else
- ' GiOn 'GIReactorOn
- ' End Select
- End If
- GISpinNum = (GISpinNum+1) Mod 16
- End Sub
- 'Sub GiReactorOn
- ' If debugGeneral Then debug.print "*****SUB:GiReactorOn"
- ' Dim bulb
- ' For each bulb in aGIReactorLights
- ' bulb.State = 1
- ' Next
- 'End Sub
- '
- 'Sub GiReactorOff
- ' If debugGeneral Then debug.print "*****SUB:GiReactorOff"
- ' Dim bulb
- ' For each bulb in aGIReactorLights
- ' bulb.State = 0
- ' Next
- 'End Sub
- '**** Blink Left GI Sling
- Dim GILeftSlingPrevCol, GIRightSlingPrevCol
- Sub GILeftSlingHit
- Dim Bulb
- GILeftSlingPrevCol = CurrCol
- For each bulb in aGILeftSling
- SetLight bulb, "red", -1
- Next
- GI3.TimerInterval = 250: GI3.TimerEnabled = True
- End Sub
- Sub GI3_Timer
- Dim Bulb
- For each bulb in aGILeftSling
- SetLight bulb, CurrCol, -1
- Next
- GI3.TimerEnabled = False
- End Sub
- '**** Blink Right GI Sling
- Sub GIRightSlingHit
- Dim Bulb
- GIRightSlingPrevCol = CurrCol
- For each bulb in aGIRightSling
- SetLight bulb, "red", -1
- Next
- GI1.TimerInterval = 250: GI1.TimerEnabled = True
- End Sub
- Sub GI1_Timer
- Dim Bulb
- For each bulb in aGIRightSling
- SetLight bulb, CurrCol, -1
- Next
- GI1.TimerEnabled = False
- End Sub
- ' GI & light sequence effects
- Sub GiEffect(n)
- End Sub
- Sub LightEffect(n)
- End Sub
- ' Flasher Effects
- Dim FEStep, FEffect
- FEStep = 0
- FEffect = 0
- Sub FlashEffect(n)
- Select case n
- Case 1:FEStep = 0:FEffect = 1:FlashEffectTimer.Enabled = 1 'all blink
- Case 2:FEStep = 0:FEffect = 2:FlashEffectTimer.Enabled = 1 'random
- Case 3:FEStep = 0:FEffect = 3:FlashEffectTimer.Enabled = 1 'upon
- Case 4:FEStep = 0:FEffect = 4:FlashEffectTimer.Enabled = 1 'ordered random :)
- End Select
- End Sub
- Sub FlashEffectTimer_Timer()
- FEStep = FEStep + 1
- End Sub
- Sub ResetInserts
- Dim Obj
- 'Reactor Inserts
- For each obj in aInsertsReactor
- SetLight obj, "blue", 0
- Next
- 'Bonus Inserts
- For each obj in aInsertsBonus
- SetLight obj, "white", 0
- Next
- SetLight lSpinner, "blue", -1
- SetLight F1, "white", 0
- SetLight F2, "white", 0
- SetLight F3, "white", 0
- SetLight F4, "white", 0
- SetLight F5, "white", 0
- SetLight FD1, "white", 0
- SetLight FD2, "white", 0
- SetLight FRAD1, "white", 0
- SetLight FRAD2, "white", 0
- SetLight FRAD3, "white", 0
- End Sub
- ' *********************************************************************
- ' Section; Supporting Ball & Sound Functions
- ' *********************************************************************
- Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
- Vol = Csng(BallVel(ball) ^2 / 2000)
- End Function
- Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
- Dim tmp
- tmp = ball.x * 2 / table1.width-1
- If tmp > 0 Then
- Pan = Csng(tmp ^10)
- Else
- Pan = Csng(-((- tmp) ^10))
- End If
- End Function
- Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
- Pitch = BallVel(ball) * 20
- End Function
- Function BallVel(ball) 'Calculates the ball speed
- BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2)))
- End Function
- '*****************************************
- ' Section; JP's VP10 Rolling Sounds
- '*****************************************
- Const tnob = 20 ' total number of balls
- Const lob = 4 'number of locked balls
- ReDim rolling(tnob)
- InitRolling
- Sub InitRolling
- Dim i
- For i = 0 to tnob
- rolling(i) = False
- Next
- End Sub
- Sub RollingUpdate()
- Dim BOT, b, ballpitch
- BOT = GetBalls
- ' stop the sound of deleted balls
- For b = UBound(BOT) + 1 to tnob
- rolling(b) = False
- StopSound("fx_ballrolling" & b)
- Next
- ' exit the sub if no balls on the table
- If UBound(BOT) = 3 Then Exit Sub 'there are always 4 balls on this table
- ' play the rolling sound for each ball
- For b = lob to UBound(BOT)
- If BallVel(BOT(b)) > 1 Then
- If BOT(b).z < 30 Then
- ballpitch = Pitch(BOT(b))
- Else
- ballpitch = Pitch(BOT(b)) * 100
- End If
- rolling(b) = True
- PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), Pan(BOT(b)), 0, ballpitch, 1, 0
- Else
- If rolling(b) = True Then
- StopSound("fx_ballrolling" & b)
- rolling(b) = False
- End If
- End If
- Next
- End Sub
- '**********************
- ' Section; Ball Collision Sound
- '**********************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
- End Sub
- '******************************
- ' Section; Diverse Collection Hit Sounds
- '******************************
- Sub aTargets_Hit(idx):PlaySound "fx_Target_soft", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aBigTargets_Hit(idx):PlaySound "fx_Target", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aYellowPins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub aCaptiveWalls_Hit(idx):PlaySound "fx_collide", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub PlayQuote_timer() 'one quote each 2 minutes
- Dim Quote
- Quote = "gb_quote" & INT(RND * 56) + 1
- PlaySound Quote
- End Sub
- ' Ramp Soundss
- Sub RHelp1_Hit()
- StopSound "fx_metalrolling"
- PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall)
- End Sub
- Sub RHelp2_Hit()
- StopSound "fx_metalrolling"
- PlaySound "fx_ballrampdrop", 0, 1, pan(ActiveBall)
- End Sub
- ' *********************************************************************
- ' User Defined Script Events
- ' *********************************************************************
- ' Initialise the Table for a new Game
- Dim RandomSongStart
- Sub ResetForNewGame()
- If debugGeneral Then Debug.print "*****SUB:ResetForNewGame()"
- Dim i
- RandomSongStart = INT(RND * 8)
- bGameInPLay = True
- 'resets the score display, and turn off attrack mode
- StopAttractMode
- StopRainbow
- GiOn
- TotalGamesPlayed = TotalGamesPlayed + 1
- CurrentPlayer = 1
- PlayersPlayingGame = 1
- bOnTheFirstBall = True
- For i = 1 To MaxPlayers
- Score(i) = 0
- BonusPoints(i) = 0
- BonusHeldPoints(i) = 0
- BonusMultiplier(i) = 1
- BallsRemaining(i) = BallsPerGame
- ExtraBallsAwards(i) = 0
- Next
- ' initialise any other flags
- Tilt = 0
- ' initialise Game variables
- Game_Init()
- ' you may wish to start some music, play a sound, do whatever at this point
- ' set up the start delay to handle any Start of Game Attract Sequence
- vpmtimer.addtimer 1500, "FirstBall '"
- End Sub
- ' This is used to delay the start of a game to allow any attract sequence to
- ' complete. When it expires it creates a ball for the player to start playing with
- Sub FirstBall
- If debugGeneral Then Debug.print "*****SUB:FirstBall()"
- ' reset the table for a new ball
- ResetForNewPlayerBall()
- ' create a new ball in the shooters lane
- CreateNewBall()
- End Sub
- ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
- ' lost one or we have moved onto the next player (if multiple are playing))
- Sub ResetForNewPlayerBall()
- If debugGeneral Then Debug.print "*****SUB:ResetForNewPlayerBall()"
- ' make sure the correct display is upto date
- AddScore 0
- ' set the current players bonus multiplier back down to 1X
- SetBonusMultiplier 1
- ' reset any drop targets, lights, game modes etc..
- BonusPoints(CurrentPlayer) = 0
- bBonusHeld = False
- bExtraBallWonThisBall = False
- ResetNewBallLights()
- 'Reset any table specific
- ResetNewBallVariables
- 'This is a new ball, so activate the ballsaver
- bBallSaverReady = True
- 'and the skillshot
- SkillShotReady = 1
- 'ResetModes : drain
- If KeepLaneSaves = 0 Then ResetSAVE
- ResetCORE
- ResetGate
- ResetBonusLights
- ResetSuperSpinner
- StartRAD
- StartMaxTarget
- ResetReactorBonus
- 'Change the music ?
- End Sub
- ' Create a new ball on the Playfield
- Sub CreateNewBall()
- ' create a ball in the plunger lane kicker.
- BallRelease.CreateSizedball BallSize / 2
- ' There is a (or another) ball on the playfield
- AddBallsOnPlayfield 1
- If debugGeneral Then Debug.print "*****SUB:CreateNewBall, BallCnt = " & " : " & BallsOnPlayfield
- 'ChangeGI "blue"
- ' kick it out..
- PlaySound SoundFXDOF("fx_Ballrel", 121, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1
- BallRelease.Kick 90, 4
- StartBackgroundMusic
- If bBallSaverSingleUse = 1 then bBallSaverSingleUse = 0 'SAVE mode: Clear single ball save
- End Sub
- Sub CreateNewBallAfterBallLock()
- ' create a ball in the plunger lane kicker.
- BallRelease.CreateSizedball BallSize / 2
- ' There is a (or another) ball on the playfield
- 'BallsOnPlayfield = BallsOnPlayfield
- If debugGeneral Then Debug.print "*****SUB:CreateNewBallAfterBallLock, BallCnt = " & " : " & BallsOnPlayfield
- ' kick it out..
- PlaySound SoundFXDOF("fx_Ballrel", 121, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1
- BallRelease.Kick 90, 4
- bAutoPlunger = True
- End Sub
- ' Add extra balls to the table with autoplunger
- ' Use it as AddMultiball 4 to add 4 extra balls to the table
- Sub AddMultiball(nballs)
- If debugGeneral Then Debug.print "*****SUB:AddMultiball()"
- mBalls2Eject = mBalls2Eject + nballs
- CreateMultiballTimer.Interval = 1000
- CreateMultiballTimer.Enabled = True
- End Sub
- ' Eject the ball after the delay, AddMultiballDelay
- Sub CreateMultiballTimer_Timer()
- If debugGeneral Then Debug.print "*****SUB:CreateMultiballTimer_Timer()"
- ' wait if there is a ball in the plunger lane
- If bBallInPlungerLane Then
- debug.print "AAA"
- Exit Sub
- Else
- If BallsOnPlayfield < MaxMultiballs Then
- CreateNewBall()
- mBalls2Eject = mBalls2Eject -1
- If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
- Me.Enabled = False
- End If
- Else 'the max number of multiballs is reached, so stop the timer
- mBalls2Eject = 0
- Me.Enabled = False
- End If
- End If
- End Sub
- ' The Player has lost his ball (there are no more balls on the playfield).
- ' Handle any bonus points awarded
- Sub EndOfBall()
- Dim AwardPoints1, AwardPoints2, AwardPoints3, TotalBonus
- Dim tmp
- If debugGeneral Then Debug.print "*****SUB:EndOfBall()"
- ' TNA bonus
- ' Target bonus - 1000 * targets * bonus level
- ' Unused BallSave bonus - ? 5000 each?
- ' Reactor bonus
- 'Total bonus
- AwardPoints1 = 0
- AwardPoints2 = 0
- AwardPoints3 = 0
- TotalBonus = 0
- ' the first ball has been lost. From this point on no new players can join in
- bOnTheFirstBall = False
- 'Stop music
- StopBackgroundMusic
- If((BallsRemaining(CurrentPlayer) <= 1) AND (ExtraBallsAwards(CurrentPlayer) = 0)) Then 'If game ends with reactor critical
- StopSound "tna_reactorcritical"
- GIReactorStoppedImmediate
- End If
- ' only process any of this if the table is not tilted. (the tilt recovery
- ' mechanism will handle any extra balls or end of game)
- If(Tilted = False)Then
- ' Count the bonus. This table uses several bonus
- 'dmdflush
- Playsound "tna_3xbonuswithend"
- AwardPoints1 = LaneSaveBonusValue * LaneSaveCount(CurrentPlayer)
- AwardPoints2 = TargetBonusValue * BonusPoints(CurrentPlayer) * BonusMultiplier(CurrentPlayer)
- AwardPoints3 = ReactorBonus
- TotalBonus = (LaneSaveBonusValue * LaneSaveCount(CurrentPlayer)) + (TargetBonusValue * BonusPoints(CurrentPlayer)) + ReactorBonus
- AddScore TotalBonus
- DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "UNUSED BALLSAVE"), eNone, CenterLine(3, FormatScore(AwardPoints1)), eBlinkFast, 900, True, ""
- DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TARGET BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints2)), eBlinkFast, 1500, True, ""
- DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "REACTOR BONUS"), eNone, CenterLine(3, FormatScore(AwardPoints3)), eBlinkFast, 1500, True, ""
- DMD "", eNone, CenterLine(1, "PLAYER BONUS"), eNone, CenterLine(2, "TOTAL BONUS"), eNone, CenterLine(3, FormatScore(TotalBonus)), eBlinkFast, 1500, True, ""
- ' add a bit of a delay to allow for the bonus points to be shown & added up
- vpmtimer.addtimer 9000, "EndOfBall2 '"
- Else
- vpmtimer.addtimer 100, "EndOfBall2 '"
- End If
- End Sub
- ' The Timer which delays the machine to allow any bonus points to be added up
- ' has expired. Check to see if there are any extra balls for this player.
- ' if not, then check to see if this was the last ball (of the CurrentPlayer)
- '
- Sub EndOfBall2()
- If debugGeneral Then Debug.print "*****SUB:EndOfBall2()"
- ChangeGi "blue"
- ' if were tilted, reset the internal tilted flag (this will also
- ' set TiltWarnings back to zero) which is useful if we are changing player LOL
- Tilted = False
- Tilt = 0
- DisableTable False 'enable again bumpers and slingshots
- ' has the player won an extra-ball ? (might be multiple outstanding)
- If(ExtraBallsAwards(CurrentPlayer) <> 0)Then
- debug.print "Extra Ball"
- ' yep got to give it to them
- ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer)- 1
- ' if no more EB's then turn off any shoot again light
- If(ExtraBallsAwards(CurrentPlayer) = 0)Then
- 'lLightShootAgain.State = 0
- ResetBallSaveDisplay
- End If
- ' You may wish to do a bit of a song AND dance at this point
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("EXTRA BALL")), eBlink, 1000, True, "tna_extraball"
- ' Create a new ball in the shooters lane
- ResetForNewPlayerBall
- CreateNewBall()
- If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
- fRones.TimerInterval = ReactorPercentLossTime * 1000
- fRones.TimerEnabled = True
- StartReactorRightLoopInserts
- Else 'ReactorLevel(CurrentPlayer) 1 and 2 and e
- StartReactorLoopInserts
- End If
- Else ' no extra balls
- BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer)- 1
- ' was that the last ball ?
- If(BallsRemaining(CurrentPlayer) <= 0)Then
- debug.print "No More Balls, High Score Entry"
- ' Submit the CurrentPlayers score to the High Score system
- CheckHighScore()
- ' you may wish to play some music at this point
- Else
- ' not the last ball (for that player)
- ' if multiple players are playing then move onto the next one
- EndOfBallComplete()
- End If
- End If
- End Sub
- ' This function is called when the end of bonus display
- ' (or high score entry finished) AND it either end the game or
- ' move onto the next player (or the next ball of the same player)
- '
- Sub EndOfBallComplete()
- Dim NextPlayer
- If debugGeneral Then debug.print "*****SUB: EndOfBallComplete()"
- ' are there multiple players playing this game ?
- If(PlayersPlayingGame > 1)Then
- ' then move to the next player
- NextPlayer = CurrentPlayer + 1
- ' are we going from the last player back to the first
- ' (ie say from player 4 back to player 1)
- If(NextPlayer > PlayersPlayingGame)Then
- NextPlayer = 1
- End If
- Else
- NextPlayer = CurrentPlayer
- End If
- ' is it the end of the game ? (all balls been lost for all players)
- If((BallsRemaining(CurrentPlayer) <= 0)AND(BallsRemaining(NextPlayer) <= 0))Then
- ' you may wish to do some sort of Point Match free game award here
- ' generally only done when not in free play mode
- ' set the machine into game over mode
- EndOfGame()
- ' you may wish to put a Game Over message on the desktop/backglass
- Else
- ' Save any additional Player data
- SavePlayerData
- ' set the next player
- CurrentPlayer = NextPlayer
- ' Restore next player data or load default setting for ball 1
- RestorePlayerData
- ' make sure the correct display is up to date
- AddScore 0
- ' reset the playfield for the new player (or new ball)
- ResetForNewPlayerBall()
- ' AND create a new ball
- CreateNewBall()
- ' play a sound if more than 1 player
- If PlayersPlayingGame > 1 Then
- 'PlaySound "vo_player" &CurrentPlayer
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "PLAYER " &CurrentPlayer), eNone, 800, True, ""
- End If
- End If
- If debugGeneral Then debug.print "Next Player = " & NextPlayer
- End Sub
- ' This function is called at the End of the Game, it should reset all
- ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
- Sub EndOfGame()
- If debugGeneral Then debug.print "*****SUB:EndOfGame()"
- bGameInPLay = False
- ' just ended your game then play the end of game tune
- If NOT bJustStarted Then
- 'PlaySong "m_end", 1
- End If
- bJustStarted = False
- ' ensure that the flippers are down
- SolLFlipper 0
- SolRFlipper 0
- ' terminate all modes - eject locked balls
- ' most of the modes/timers terminate at the end of the ball
- PlayQuote.Enabled = 0
- ' set any lights for the attract mode
- GiOff
- StartAttractMode 1
- ' you may wish to light any Game Over Light you may have
- DropTargetResetLockIsLit 0
- End Sub
- Function Balls
- Dim tmp
- tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
- If tmp > BallsPerGame Then
- Balls = BallsPerGame
- Else
- Balls = tmp
- End If
- End Function
- ' *********************************************************************
- ' Section; Drain / Plunger Functions
- ' *********************************************************************
- ' lost a ball ;-( check to see how many balls are on the playfield.
- ' if only one then decrement the remaining count AND test for End of game
- ' if more than 1 ball (multi-ball) then kill of the ball but don't create
- ' a new one
- '
- Sub Drain_Hit()
- DOF 116, DOFPulse
- startB2S(7)
- ' Destroy the ball
- Drain.DestroyBall
- ' Exit Sub ' only for debugging
- AddBallsOnPlayfield -1
- If debugGeneral Then Debug.print "Drain_Hit(), ballcnt=" & BallsOnPlayfield
- ' pretend to knock the ball into the ball storage mech
- PlaySound "fx_drain"
- 'if Tilted the end Ball modes
- If Tilted Then
- StopEndOfBallModes
- End If
- ' if there is a game in progress AND it is not Tilted
- If(bGameInPLay = True)AND(Tilted = False)Then
- ' is the ball saver active,
- If(bBallSaverActive = True) Then
- ' yep, create a new ball in the shooters lane
- ' we use the Addmultiball in case the multiballs are being ejected
- AddMultiball 1
- ' we kick the ball with the autoplunger
- bAutoPlunger = True
- ' you may wish to put something on a display or play a sound at this point
- if (bMultiBallMode = False) Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, "tna_ballsaved"
- End If
- Else
- 'Check if player used a SAVE to save ball
- 'UseSAVE LastSwitchHit
- If bBallSaverSingleUse = 1 Then
- ' yep, create a new ball in the shooters lane
- ' we use the Addmultiball in case the multiballs are being ejected
- AddMultiball 1
- ' we kick the ball with the autoplunger
- bAutoPlunger = True
- ' you may wish to put something on a display or play a sound at this point
- 'DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, "tna_ballsaved"
- Exit Sub
- End If
- ' cancel any multiball if on last ball (ie. lost all other balls)
- If(BallsOnPlayfield = 1)Then
- ' AND in a multi-ball??
- If(bMultiBallMode = True)then
- ' not in multiball mode any more
- bMultiBallMode = False
- ResetGate
- EndMultiball
- ChangeGi "blue"
- ' you may wish to change any music over at this point and
- ' turn off any multiball specific lights
- 'DropTargetReset
- End If
- End If
- ' was that the last ball on the playfield
- If(BallsOnPlayfield = 0)Then
- ' End Modes and timers
- 'PlaySong "m_wait", 1
- StopEndOfBallModes
- fRones.TimerEnabled = False 'stop reactor decrement timer if running
- ResetReactorLoopInserts
- ChangeGi "red"
- ' handle the end of ball (count bonus, change player, high score entry etc..)
- vpmtimer.addtimer 1500, "EndOfBall '"
- End If
- End If
- End If
- End Sub
- ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane
- ' Check to see if a ball saver mechanism is needed and if so fire it up.
- Sub swPlungerRest_Hit()
- If debugGeneral Then debug.print "*****SUB:swPlungerRest_Hit, Resting"
- Wall348.TimerInterval = AutoPlungeDelay*1000
- ' some sound according to the ball position
- PlaySound "fx_sensor", 0, 1, 0.15, 0.25
- bBallInPlungerLane = True
- If SkillshotReady = 2 Then 'Soft plunge failed. Cancel Skillshot and Autolaunch
- bAutoPlunger = True
- CheckSkillShot 0
- PlaySound "gb_electricity1", 0, 1, -0.05, 0.05
- Wall348.TimerInterval = 250
- End If
- ' turn on Launch light is there is one
- 'LaunchLight.State = 2
- ' kick the ball in play if the bAutoPlunger flag is on
- If bAutoPlunger Then
- If debugGeneral Then debug.print "*****SUB:swPlungerRest_Hit, AutoPlunge"
- Wall348.TimerEnabled = True
- If mBalls2Eject = 0 Then bAutoPlunger = False
- LightSeqAutoLaunch.StopPlay
- LightSeqAutoLaunch.UpdateInterval = 1
- LightSeqAutoLaunch.Play SeqUpOn, 20, 1
- End If
- 'Start the Selection of the skillshot if ready
- If SkillShotReady = 1 Then
- StartSkillshot()
- End If
- ' remember last trigger hit by the ball.
- SetLastSwitchHit "swPlungerRest"
- End Sub
- Sub Wall348_Timer
- PlungerIM.AutoFire
- PlaySound SoundFXDOF("fx_plunger",125,DOFPulse,DOFContactors)
- DOF 123, DOFPulse
- Wall348.TimerEnabled = False
- End Sub
- ' The ball is released from the plunger turn off some flags and check for skillshot
- Dim bTimedSkillShot
- Sub swPlungerRest_UnHit()
- bBallInPlungerLane = False
- If SkillShotReady = 1 Then
- SkillShotReady = 2 'Ball plunged
- bSkillShotSelect = False 'Skillshot frozen
- swPlungerRest.TimerInterval = 5000
- swPlungerRest.TimerEnabled = True
- bTimedSkillShot = True
- End If
- If debugGeneral Then debug.print "*****SUB:swPlungerRest_UnHit, Ballcnt: " & BallsOnPlayfield
- 'Debug.print "BallsonPlayfieldCheck" & " : " & BallsOnPlayfield
- ' if there is a need for a ball saver, then start off a timer
- ' only start if it is ready, and it is currently not running, else it will reset the time period
- 'msgbox bBallSaverReady & ":" & BallSaverTime & ":" & bBallSaverActive
- If(bBallSaverReady = True)AND(BallSaverTime <> 0)And(bBallSaverActive = False)Then
- EnableBallSaver BallSaverTime
- End If
- JustPlunged = True
- Gate1.TimerEnabled = False
- Gate1.TimerInterval = 2000
- Gate1.TimerEnabled = True
- End Sub
- Sub swPlungerRest_Timer 'Timed skillshot support
- bTimedSkillShot = False
- swPlungerRest.TimerEnabled = False
- End Sub
- Sub Gate1_Timer
- JustPlunged = False
- Gate1.TimerEnabled = False
- End Sub
- 'Version of Ballsaver using led display
- Dim dbs1, dbs2, dbsdelta, dbstime, dbstens, dbsones, dbsdecimals
- Sub EnableBallSaver(seconds)
- seconds = seconds + .3 'padding
- 'If debugGeneral Then debug.print "*****SUB:EnableBallSaver, seconds=" & seconds
- ' set our game flag
- bBallSaverActive = True
- bBallSaverReady = False
- ' start the timer
- BallSaverTimerExpired.Interval = 1000 * seconds
- BallSaverTimerExpired.Enabled = True
- 'Set display to x seconds
- dbstime = seconds
- dbsdelta = .1
- BallSaverUpdateTimer.Interval = 100
- dbstens = Int(dbstime/10)
- dbsones = Int(dbstime-dbstens*10)
- dbsdecimals = Int((dbstime-dbstens*10-dbsones)*10)
- debug.print dbsones
- debug.print dbsdecimals
- if dbstime > 10 then
- fBStens.ImageA = Eval(dbstens)
- fBSones.ImageA = Eval(dbsones)
- else
- fBStens.ImageA = Eval (dbsones + 10)
- fBSones.ImageA = Eval(dbsdecimals)
- end if
- ' if dbstime > 10 then
- ' dBallSave1.SetValue (dbstens + 1)
- ' dBallSave2.SetValue (dbsones + 1)
- ' else
- ' dBallSave1.SetValue (dbsones + 1+10)
- ' dBallSave2.SetValue (dbsdecimals + 1)
- ' end if
- dbstime = dbstime - dbsdelta
- BallSaverUpdateTimer.Enabled = True
- End Sub
- ' The ball saver timer has expired. Turn it off AND reset the game flag
- '
- Sub BallSaverTimerExpired_Timer()
- If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimerExpired_Timer"
- BallSaverTimerExpired.Enabled = False
- BallSaverUpdateTimer.Enabled = False
- ' clear the LED display, give extra 1 second
- If ExtraBallsAwards(CurrentPlayer) = 0 Then
- ResetBallSaveDisplay
- Else
- SetExtraBallDisplay
- End If
- BallSaverTimer2Expired.Interval = 1000
- BallSaverTimer2Expired.Enabled = True
- End Sub
- Sub ResetBallSaveDisplay
- ' dBallSave1.SetValue 0
- ' dBallSave2.SetValue 0
- fBStens.ImageA = "blank"
- fBSones.ImageA = "blank"
- End Sub
- Sub BallSaverTimer2Expired_Timer()
- If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimer2Expired_Timer"
- BallSaverTimer2Expired.Enabled = False
- ' clear the flag
- bBallSaverActive = False
- End Sub
- Sub BallSaverUpdateTimer_Timer()
- Dim tmp
- 'If debugGeneral Then debug.print "*****SUB:" & "BallSaverUpdateTimer_Timer " & dbstime
- dbstens = Int(dbstime/10)
- dbsones = Int(dbstime-dbstens*10)
- dbsdecimals = Int((dbstime-dbstens*10-dbsones)*10)
- if dbstime > 10 then
- fBStens.ImageA = Eval(dbstens)
- fBSones.ImageA = Eval(dbsones)
- else
- fBStens.ImageA = Eval (dbsones + 10)
- fBSones.ImageA = Eval(dbsdecimals)
- end if
- ' if dbstime > 10 then
- ' 'DEBUG.PRINT dbstime & " : " & dbstens & " : " & dbsones & " : " & dbsdecimals
- ' dBallSave1.SetValue (dbstens + 1)
- ' dBallSave2.SetValue (dbsones + 1)
- ' else
- ' 'DEBUG.PRINT dbstime & " : " & dbstens & " : " & dbsones & " : " & dbsdecimals
- ' dBallSave1.SetValue (dbsones + 1+10)
- ' dBallSave2.SetValue (dbsdecimals + 1)
- ' end if
- dbstime = dbstime - dbsdelta
- End Sub
- 'Version of Ballsaver using light insert
- 'Sub EnableBallSaver(seconds)
- ' If debugGeneral Then debug.print "*****SUB:EnableBallSaver, seconds=" & seconds
- ' ' set our game flag
- ' bBallSaverActive = True
- ' bBallSaverReady = False
- ' ' start the timer
- ' BallSaverTimerExpired.Interval = 1000 * seconds
- ' BallSaverTimerExpired.Enabled = True
- ' BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
- ' BallSaverSpeedUpTimer.Enabled = True
- ' ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
- ' lLightShootAgain.BlinkInterval = 160
- ' lLightShootAgain.State = 2
- 'End Sub
- '
- '' The ball saver timer has expired. Turn it off AND reset the game flag
- ''
- 'Sub BallSaverTimerExpired_Timer()
- ' If debugGeneral Then debug.print "*****SUB:" & "BallSaverTimerExpired_Timer"
- ' BallSaverTimerExpired.Enabled = False
- ' ' clear the flag
- ' bBallSaverActive = False
- ' ' if you have a ball saver light then turn it off at this point
- ' lLightShootAgain.State = 0
- 'End Sub
- '
- 'Sub BallSaverSpeedUpTimer_Timer()
- ' If debugGeneral Then debug.print "*****SUB:" & "BallSaverSpeedUpTimer_Timer"
- ' BallSaverSpeedUpTimer.Enabled = False
- ' ' Speed up the blinking
- ' lLightShootAgain.BlinkInterval = 80
- ' lLightShootAgain.State = 2
- 'End Sub
- ' *********************************************************************
- ' Supporting Score Functions
- ' *********************************************************************
- Dim checkones
- Sub AddScore(points)
- Dim xmultiplier
- xMultiplier = BallsOnPlayfield
- If xMultiplier = 0 then xMultiplier = 1
- If(Tilted = False)Then
- ' add the points to the current players score variable
- Score(CurrentPlayer) = Score(CurrentPlayer) + (points * xMultiplier)
- 'If (Score(CurrentPlayer) mod 10) > checkones Then
- ' msgbox "Score changed by one"
- ' checkones = (Score(CurrentPlayer) mod 10)
- 'End if
- ' update the score displays
- DMDScore
- End if
- If debugGeneral Then debug.print "*****SUB:" & "AddScore(" & points * xMultiplier & "), Total=" & Score(CurrentPlayer)
- ' you may wish to check to see if the player has gotten a replay
- End Sub
- Sub AddScoreForReactor()
- If(Tilted = False)Then
- ' add the points to the current players score variable
- Score(CurrentPlayer) = Score(CurrentPlayer) + (1)
- ' update the score displays
- DMDScore
- End if
- If debugGeneral Then debug.print "*****SUB:" & "AddScore(1), Total=" & Score(CurrentPlayer)
- End Sub
- Sub AddScoreSpecial2(points, points2) 'Increase Score and Reactor value
- If debugGeneral Then debug.print "*****SUB:" & "AddScoreSpecial(" & points & ")"
- If(Tilted = False)Then
- ' add the points to the current players score variable
- 'Score(CurrentPlayer) = Score(CurrentPlayer) + points
- If ReactorValue(CurrentPlayer) < ReactorValueMax(CurrentPlayer) Then
- ReactorValue(CurrentPlayer) = ReactorValue(CurrentPlayer) + points2
- If ReactorValue(CurrentPlayer) >= ReactorValueMax(CurrentPlayer) Then
- ReactorValue(CurrentPlayer) = ReactorValueMax(CurrentPlayer)
- End If
- AddReactorBonus points2
- tReactorValue.text = ReactorValue(CurrentPlayer)
- End If
- AddScore(points)
- End if
- ' you may wish to check to see if the player has gotten a replay
- End Sub
- Sub AddScoreSpecial(points) 'Increase Score and Reactor value
- If debugGeneral Then debug.print "*****SUB:" & "AddScoreSpecial(" & points & ")"
- AddScoreSpecial2 points, points
- End Sub
- Sub SetReactorMaxed
- Dim delta
- 'Update Reactor value to max
- delta = ReactorValueMax(CurrentPlayer) - ReactorValue(CurrentPlayer)
- ReactorValue(CurrentPlayer) = ReactorValueMax(CurrentPlayer)
- 'Update Reactor Bonus Award
- If delta > 0 Then
- AddReactorBonus delta
- End If
- End Sub
- ' Add bonus to the bonuspoints AND update the score board
- 'Sub AddBonus(points)
- ' If debugGeneral Then debug.print "*****SUB:" & "AddBonus(" & points & ")"
- '
- ' If(Tilted = False)Then
- ' ' add the bonus to the current players bonus variable
- ' BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points
- ' ' update the score displays
- ' DMDScore
- ' End if
- '
- '' you may wish to check to see if the player has gotten a replay
- 'End Sub
- '
- '' Add some points to the current Jackpot.
- ''
- 'Sub AddJackpot(points) 'not used in this table
- 'End Sub
- Sub AddBonusMultiplier(n)
- If debugGeneral Then debug.print "*****SUB:" & "AddBonusMultiplier(" & n & ")"
- Dim NewBonusLevel
- ' if not at the maximum bonus level
- if(BonusMultiplier(CurrentPlayer) + n <= MaxMultiplier)then
- ' then add and set the lights
- NewBonusLevel = BonusMultiplier(CurrentPlayer) + n
- SetBonusMultiplier(NewBonusLevel)
- End if
- End Sub
- ' Set the Bonus Multiplier to the specified level AND set any lights accordingly
- ' There is no bonus multiplier lights in this table
- Sub SetBonusMultiplier(Level)
- Dim obj
- If debugGeneral Then debug.print "*****SUB:" & "SetBonusMultiplier(" & Level & ")"
- ' Set the multiplier to the specified level
- BonusMultiplier(CurrentPlayer) = Level
- ' Update the lights
- Select Case Level:
- Case 1:
- l2X.State = 0
- l3X.State = 0
- l4X.State = 0
- Case 2:
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 2X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
- l2X.State = 1
- l3X.State = 0
- l4X.State = 0
- GI37.TimerEnabled = True
- GICoreCount = 0
- For each obj in aGICore
- obj.state = 0
- Next
- Case 3:
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 3X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
- l2X.State = 1
- l3X.State = 1
- l4X.State = 0
- GI37.TimerEnabled = True
- GICoreCount = 0
- For each obj in aGICore
- obj.state = 0
- Next
- Case 4:
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BONUS 4X"), eBlinkfast, 1800, True, "tna_bonusmultiplier"
- l2X.State = 1
- l3X.State = 1
- l4X.State = 1
- GI37.TimerEnabled = True
- For each obj in aGICore
- obj.state = 0
- Next
- Case Else:
- l2X.State = 1
- l3X.State = 1
- l4X.State = 1
- End Select
- End Sub
- Dim GICoreCount,GICoredirection, GICoreSweep
- GICoredirection = 1
- GI37.TimerInterval=25
- Sub GI37_Timer
- Dim obj
- For Each obj in aGICore
- SetLight obj, "orange", 0
- Next
- aGICore((GICoreCount+0) Mod 13).state = 1
- aGICore((GICoreCount+1) Mod 13).state = 1
- aGICore((GICoreCount+2) Mod 13).state = 1
- aGICore((GICoreCount+3) Mod 13).state = 0
- aGICore((GICoreCount+4) Mod 13).state = 0
- aGICore((GICoreCount+5) Mod 13).state = 0
- aGICore((GICoreCount+6) Mod 13).state = 0
- aGICore((GICoreCount+7) Mod 13).state = 0
- aGICore((GICoreCount+8) Mod 13).state = 0
- aGICore((GICoreCount+9) Mod 13).state = 0
- aGICore((GICoreCount+10) Mod 13).state = 0
- aGICore((GICoreCount+11) Mod 13).state = 0
- aGICore((GICoreCount+12) Mod 13).state = 0
- GICoreCount = GICoreCount + GICoredirection
- If GICoreCount = 10 Then
- GICoredirection = -1
- GICoreSweep = GICoreSweep + 1
- ElseIf GICoreCount = 0 Then
- GICoreSweep = GICoreSweep + 1
- GICoredirection = 1
- End If
- If GICoreSweep = 6 Then 'Sweep done, return lights to normal
- GI37.TimerEnabled = False
- GICoreDirection = 1
- GICoreCount = 0
- GICoreSweep = 0
- For each obj in aGICore
- obj.state = 1
- SetLight obj, "blue", 1
- Next
- SetLight l1, "white", 0
- SetLight l2, "white", 0
- SetLight l3, "white", 0
- SetLight l4, "white", 0
- ' l1.state = 0
- ' l2.state = 0
- ' l3.state = 0
- ' l4.state = 0
- End If
- End Sub
- Sub AwardExtraBall()
- ' If NOT bExtraBallWonThisBall Then 'Use if you want to limit to 1 extraball
- DMDFlush
- DMD "", eNone, "_", eNone, Centerline(2, "EXTRA BALL WON"), eBlink, "", eNone, 1000, True, "tna_extraball"
- ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
- debug.print "ExtraBall count " & ExtraBallsAwards(CurrentPlayer)
- bExtraBallWonThisBall = True
- GiEffect 1
- LightEffect 2
- 'Set Insert or Display
- SetExtraBallDisplay
- ' END If
- End Sub
- Sub AwardExtraBallNoCallout()
- ' If NOT bExtraBallWonThisBall Then 'Use if you want to limit to 1 extraball
- ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
- debug.print "ExtraBall count " & ExtraBallsAwards(CurrentPlayer)
- bExtraBallWonThisBall = True
- GiEffect 1
- LightEffect 2
- 'Set Insert or Display
- SetExtraBallDisplay
- ' END If
- End Sub
- Sub SetExtraBallDisplay
- ' dBallSave1.SetValue 21 'e
- ' dBallSave2.SetValue 22 'b
- fBStens.ImageA = "e"
- fBSones.ImageA = "b"
- End Sub
- Sub AwardSpecial()
- DMDFlush
- DMD "", eNone, "_", eNone, Centerline(2, "EXTRA GAME WON"), eBlink, "", eNone, 1000, True, SoundFXDOF("fx_Knocker", 129, DOFPulse, DOFKnocker)
- DOF 123, DOFPulse
- Credits = Credits + 1
- DOF 140, DOFOn
- GiEffect 1
- LightEffect 1
- End Sub
- Sub AwardJackpot() 'award a normal jackpot, double or triple jackpot
- DMDFlush
- DMD "", eNone, Centerline(1, ("JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(Jackpot)), eBlinkFast, 1000, True, "tna_jackpot"
- AddScore Jackpot
- GiEffect 1
- LightEffect 2
- FlashEffect 1
- End Sub
- Sub AwardDoubleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
- DMDFlush
- DMD "", eNone, Centerline(1, ("DOUBLE JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(DoubleJackpot)), eBlinkFast, 1000, True, "tna_doublejackpot"
- AddScore DoubleJackpot
- GiEffect 1
- LightEffect 2
- FlashEffect 1
- End Sub
- Sub AwardTripleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
- DOF 132, DOFPulse
- DMDFlush
- DMD "", eNone, Centerline(1, ("TRIPLE JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(TripleJackpot)), eBlinkFast, 1000, True, "tna_triplejackpot"
- AddScore TripleJackpot
- GiEffect 1
- LightEffect 2
- FlashEffect 1
- End Sub
- Sub AwardSuperJackpot()
- DOF 133, DOFPulse
- DMDFlush
- DMD "", eNone, Centerline(1, ("SUPER JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(SuperJackpot)), eBlinkFast, 1000, True, "tna_superjackpot"
- AddScore SuperJackpot
- GiEffect 1
- LightEffect 2
- FlashEffect 2
- End Sub
- 'Sub AwardDoubleSuperJackpot()
- ' DOF 134, DOFPulse
- ' DMDFlush
- ' DMD "", eNone, Centerline(1, ("2X SUPER JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(SuperJackpot * 2)), eBlinkFast, 1000, True, "vo_doublesuperjackpot"
- ' AddScore SuperJackpot * 2
- ' GiEffect 1
- ' LightEffect 2
- ' FlashEffect 2
- 'End Sub
- '
- 'Sub AwardTripleSuperJackpot()
- ' DOF 135, DOFPulse
- ' DMDFlush
- ' DMD "", eNone, Centerline(1, ("3X SUPER JACKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(SuperJackpot * 3)), eBlinkFast, 1000, True, "vo_triplesuperjackpot"
- ' AddScore SuperJackpot * 3
- ' GiEffect 1
- ' LightEffect 2
- ' FlashEffect 2
- 'End Sub
- Sub AwardSkillshot()
- DMDFlush
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SKILLSHOT"), eBlinkfast, 1000, True, "tna_lanesave"
- debug.print "Skillshot"
- AddScore SkillshotValue
- GiEffect 1
- LightEffect 2
- AwardSAVE 1
- End Sub
- Sub AwardHandsFreeSkillshot()
- DMDFlush
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SKILLSHOT"), eBlinkfast, 1000, True, "tna_superskillshot"
- debug.print "Super Skillshot"
- AddScore SkillshotValue
- GiEffect 1
- LightEffect 2
- AwardSAVE 1
- SetReactorReady
- End Sub
- 'Sub Congratulation()
- ' Dim tmp
- ' tmp = "vo_congrat" & INT(RND * 21 + 1)
- ' PlaySound tmp
- 'End Sub
- '*****************************
- ' Section; Load / Save / Highscore
- '*****************************
- Sub Loadhs
- If debugHighScore Then debug.print "Sub:Loadhs"
- Dim x
- x = LoadValue(TableName, "HighScore1")
- If(x <> "")Then HighScore(0) = CDbl(x)Else HighScore(0) = 100000 End If
- x = LoadValue(TableName, "HighScore1Name")
- If(x <> "")Then HighScoreName(0) = x Else HighScoreName(0) = "TNA" End If
- x = LoadValue(TableName, "HighScore2")
- If(x <> "")then HighScore(1) = CDbl(x)Else HighScore(1) = 100000 End If
- x = LoadValue(TableName, "HighScore2Name")
- If(x <> "")then HighScoreName(1) = x Else HighScoreName(1) = "TNA" End If
- x = LoadValue(TableName, "HighScore3")
- If(x <> "")then HighScore(2) = CDbl(x)Else HighScore(2) = 100000 End If
- x = LoadValue(TableName, "HighScore3Name")
- If(x <> "")then HighScoreName(2) = x Else HighScoreName(2) = "TNA" End If
- x = LoadValue(TableName, "HighScore4")
- If(x <> "")then HighScore(3) = CDbl(x)Else HighScore(3) = 100000 End If
- x = LoadValue(TableName, "HighScore4Name")
- If(x <> "")then HighScoreName(3) = x Else HighScoreName(3) = "TNA" End If
- x = LoadValue(TableName, "Credits")
- If(x <> "")then Credits = CInt(x)Else Credits = 0 End If
- x = LoadValue(TableName, "TotalGamesPlayed")
- If(x <> "")then TotalGamesPlayed = CInt(x)Else TotalGamesPlayed = 0 End If
- End Sub
- Sub Savehs
- If debugHighScore Then debug.print "Sub:Savehs"
- SaveValue TableName, "HighScore1", HighScore(0)
- SaveValue TableName, "HighScore1Name", HighScoreName(0)
- SaveValue TableName, "HighScore2", HighScore(1)
- SaveValue TableName, "HighScore2Name", HighScoreName(1)
- SaveValue TableName, "HighScore3", HighScore(2)
- SaveValue TableName, "HighScore3Name", HighScoreName(2)
- SaveValue TableName, "HighScore4", HighScore(3)
- SaveValue TableName, "HighScore4Name", HighScoreName(3)
- SaveValue TableName, "Credits", Credits
- SaveValue TableName, "TotalGamesPlayed", TotalGamesPlayed
- End Sub
- ' ***********************************************************
- ' High Score Initals Entry Functions - based on Black's code
- ' ***********************************************************
- Dim hsbModeActive
- Dim hsEnteredName
- Dim hsEnteredDigits(3)
- Dim hsCurrentDigit
- Dim hsValidLetters
- Dim hsCurrentLetter
- Dim hsLetterFlash
- Sub CheckHighscore()
- If debugHighScore Then debug.print "Sub:CheckHighscore"
- Dim tmp
- tmp = Score(1)
- If Score(2) > tmp Then tmp = Score(2)
- If Score(3) > tmp Then tmp = Score(3)
- If Score(4) > tmp Then tmp = Score(4)
- If tmp > HighScore(1)Then 'add 1 credit for beating the highscore
- AwardSpecial
- End If
- If tmp > HighScore(3)Then
- HighScore(3) = tmp
- 'enter player's name
- HighScoreEntryInit()
- Else
- EndOfBallComplete()
- End If
- End Sub
- Sub HighScoreEntryInit()
- If debugHighScore Then debug.print "Sub:HighScoreEntryInit"
- hsbModeActive = True
- 'PlaySound "vo_enteryourinitials"
- hsLetterFlash = 0
- hsEnteredDigits(0) = " "
- hsEnteredDigits(1) = " "
- hsEnteredDigits(2) = " "
- hsCurrentDigit = 0
- hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ'<>*+-/=\^0123456789`" ' ` is back arrow
- hsCurrentLetter = 1
- DMDFlush()
- HighScoreDisplayNameNow()
- HighScoreFlashTimer.Interval = 250
- HighScoreFlashTimer.Enabled = True
- End Sub
- Sub EnterHighScoreKey(keycode)
- If debugHighScore Then debug.print "Sub:EnterHighScoreKey"
- If keycode = LeftFlipperKey Then
- Playsound "fx_Previous"
- hsCurrentLetter = hsCurrentLetter - 1
- if(hsCurrentLetter = 0)then
- hsCurrentLetter = len(hsValidLetters)
- end if
- HighScoreDisplayNameNow()
- End If
- If keycode = RightFlipperKey Then
- Playsound "fx_Next"
- hsCurrentLetter = hsCurrentLetter + 1
- if(hsCurrentLetter > len(hsValidLetters))then
- hsCurrentLetter = 1
- end if
- HighScoreDisplayNameNow()
- End If
- If keycode = PlungerKey Then
- if(mid(hsValidLetters, hsCurrentLetter, 1) <> "`")then
- playsound "fx_Enter"
- hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
- hsCurrentDigit = hsCurrentDigit + 1
- if(hsCurrentDigit = 3)then
- HighScoreCommitName()
- else
- HighScoreDisplayNameNow()
- end if
- else
- playsound "fx_Esc"
- hsEnteredDigits(hsCurrentDigit) = " "
- if(hsCurrentDigit > 0)then
- hsCurrentDigit = hsCurrentDigit - 1
- end if
- HighScoreDisplayNameNow()
- end if
- end if
- End Sub
- Sub HighScoreDisplayNameNow()
- If debugHighScore Then debug.print "Sub:HighScoreDisplayNameNow"
- HighScoreFlashTimer.Enabled = False
- hsLetterFlash = 0
- HighScoreDisplayName()
- HighScoreFlashTimer.Enabled = True
- End Sub
- Sub HighScoreDisplayName()
- If debugHighScore Then debug.print "Sub:HighScoreDisplayName"
- Dim i
- Dim TempTopStr
- Dim TempBotStr
- TempTopStr = "ENTER YOUR INITIALS"
- dLine(1) = TempTopStr
- DMDUpdate 1
- TempBotStr = " > "
- if(hsCurrentDigit > 0)then TempBotStr = TempBotStr & hsEnteredDigits(0)
- if(hsCurrentDigit > 1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
- if(hsCurrentDigit > 2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
- if(hsCurrentDigit <> 3)then
- if(hsLetterFlash <> 0)then
- TempBotStr = TempBotStr & "_"
- else
- TempBotStr = TempBotStr & mid(hsValidLetters, hsCurrentLetter, 1)
- end if
- end if
- if(hsCurrentDigit < 1)then TempBotStr = TempBotStr & hsEnteredDigits(1)
- if(hsCurrentDigit < 2)then TempBotStr = TempBotStr & hsEnteredDigits(2)
- TempBotStr = TempBotStr & " < "
- dLine(2) = CenterLine(2, TempBotStr)
- DMDUpdate 2
- End Sub
- Sub HighScoreFlashTimer_Timer()
- If debugHighScore Then debug.print "Sub:HighScoreFlashTimer_Timer"
- HighScoreFlashTimer.Enabled = False
- hsLetterFlash = hsLetterFlash + 1
- if(hsLetterFlash = 2)then hsLetterFlash = 0
- HighScoreDisplayName()
- HighScoreFlashTimer.Enabled = True
- End Sub
- Sub HighScoreCommitName()
- If debugHighScore Then debug.print "Sub:HighScoreCommitName"
- HighScoreFlashTimer.Enabled = False
- hsbModeActive = False
- hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
- if(hsEnteredName = " ")then
- hsEnteredName = "YOU"
- end if
- HighScoreName(3) = hsEnteredName
- SortHighscore
- EndOfBallComplete()
- End Sub
- Sub SortHighscore
- If debugHighScore Then debug.print "Sub:SortHighscore"
- Dim tmp, tmp2, i, j
- For i = 0 to 3
- For j = 0 to 2
- If HighScore(j) < HighScore(j + 1)Then
- tmp = HighScore(j + 1)
- tmp2 = HighScoreName(j + 1)
- HighScore(j + 1) = HighScore(j)
- HighScoreName(j + 1) = HighScoreName(j)
- HighScore(j) = tmp
- HighScoreName(j) = tmp2
- End If
- Next
- Next
- End Sub
- ' *****************************************************************************
- ' JP's Reduced Display Driver Functions for Slimer (based on script by Black)
- ' only 5 effects: none, scroll left, scroll right, blink and blinkfast
- ' 4 Lines, treats all 4 lines as text
- ' Example format:
- ' DMD "backgnd", eNone,"text1", eNone,"text2", eNone, "centertext", eNone, 250, True, "sound"
- ' Short names:
- ' dq = display queue
- ' de = display effect
- ' "_" in a line means: do nothing
- ' *****************************************************************************
- Const eNone = 0 ' Instantly displayed
- Const eScrollLeft = 1 ' scroll on from the right
- Const eScrollRight = 2 ' scroll on from the left
- Const eBlink = 3 ' Blink (blinks for 'TimeOn')
- Const eBlinkFast = 4 ' Blink (blinks for 'TimeOn') at user specified intervals (fast speed)
- Const dqSize = 64
- Dim dqHead
- Dim dqTail
- Dim deSpeed
- Dim deBlinkSlowRate
- Dim deBlinkFastRate
- Dim dCharsPerLine(3)
- Dim dLine(3)
- Dim deCount(3)
- Dim deCountEnd(3)
- Dim deBlinkCycle(3)
- Dim dqText(3, 64)
- Dim dqEffect(3, 64)
- Dim dqTimeOn(64)
- Dim dqbFlush(64)
- Dim dqSound(64)
- Sub DMD_Init() 'default/startup values
- Dim i, j
- DMDFlush()
- deSpeed = 20
- deBlinkSlowRate = 5
- deBlinkFastRate = 2
- dCharsPerLine(0) = 3
- dCharsPerLine(1) = 19
- dCharsPerLine(2) = 19
- dCharsPerLine(3) = 13
- For i = 0 to 3
- dLine(i) = Space(dCharsPerLine(i))
- deCount(i) = 0
- deCountEnd(i) = 0
- deBlinkCycle(i) = 0
- dqTimeOn(i) = 0
- dqbFlush(i) = True
- dqSound(i) = ""
- Next
- For i = 0 to 3
- For j = 0 to 64
- dqText(i, j) = ""
- dqEffect(i, j) = eNone
- Next
- Next
- DMD "", eNone, "", eNone, "", eNone, "", eNone, 25, True, ""
- End Sub
- Sub DMDFlush()
- Dim i
- DMDTimer.Enabled = False
- DMDEffectTimer.Enabled = False
- dqHead = 0
- dqTail = 0
- For i = 0 to 3
- deCount(i) = 0
- deCountEnd(i) = 0
- deBlinkCycle(i) = 0
- Next
- End Sub
- Sub DMDScoreNow()
- DMDFlush()
- DMDScore()
- End Sub
- Sub DMDScore()
- Dim tmp0, tmp1, tmp2, tmp3
- if(dqHead = dqTail)Then
- tmp0 = ""
- tmp1 = FillLine(1, " PLAYER " & CurrentPlayer, FormatScore(Score(CurrentPlayer)))
- 'tmp2 = FillLine(2, " ", " BALL " & Balls)
- tmp2 = FillLine(2, " RVAL:" & FormatScore(ReactorValue(CurrentPlayer)), "BALL" & Balls)
- tmp3 = ""
- DMD tmp0, eNone, tmp1, eNone, tmp2, eNone, tmp3, eNone, 25, True, ""
- End If
- End Sub
- Sub DMD(Text0, Effect0, Text1, Effect1, Text2, Effect2, Text3, Effect3, TimeOn, bFlush, Sound) 'the lines are background. top line, bottom line, and centerline
- if(dqTail < dqSize)Then
- if(Text0 = "_")Then
- dqEffect(0, dqTail) = eNone
- dqText(0, dqTail) = "_"
- Else
- dqEffect(0, dqTail) = Effect0
- dqText(0, dqTail) = ExpandLine(Text0, 0)
- End If
- if(Text1 = "_")Then
- dqEffect(1, dqTail) = eNone
- dqText(1, dqTail) = "_"
- Else
- dqEffect(1, dqTail) = Effect1
- dqText(1, dqTail) = ExpandLine(Text1, 1)
- End If
- if(Text2 = "_")Then
- dqEffect(2, dqTail) = eNone
- dqText(2, dqTail) = "_"
- Else
- dqEffect(2, dqTail) = Effect2
- dqText(2, dqTail) = ExpandLine(Text2, 2)
- End If
- if(Text3 = "_")Then
- dqEffect(3, dqTail) = eNone
- dqText(3, dqTail) = "_"
- Else
- dqEffect(3, dqTail) = Effect3
- dqText(3, dqTail) = ExpandLine(Text3, 3)
- End If
- dqTimeOn(dqTail) = TimeOn
- dqbFlush(dqTail) = bFlush
- dqSound(dqTail) = Sound
- dqTail = dqTail + 1
- if(dqTail = 1)Then
- DMDHead()
- End If
- End If
- End Sub
- Sub DMDHead()
- Dim i
- deCount(0) = 0
- deCount(1) = 0
- deCount(2) = 0
- deCount(3) = 0
- DMDEffectTimer.Interval = deSpeed
- For i = 0 to 3
- Select Case dqEffect(i, dqHead)
- Case eNone:deCountEnd(i) = 1
- Case eScrollLeft:deCountEnd(i) = Len(dqText(i, dqHead))
- Case eScrollRight:deCountEnd(i) = Len(dqText(i, dqHead))
- Case eBlink:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
- deBlinkCycle(i) = 0
- Case eBlinkFast:deCountEnd(i) = int(dqTimeOn(dqHead) / deSpeed)
- deBlinkCycle(i) = 0
- End Select
- Next
- if(dqSound(dqHead) <> "")Then
- PlaySound(dqSound(dqHead))
- End If
- DMDEffectTimer.Enabled = True
- End Sub
- Sub DMDEffectTimer_Timer()
- DMDEffectTimer.Enabled = False
- DMDProcessEffectOn()
- End Sub
- Sub DMDTimer_Timer()
- Dim Head
- DMDTimer.Enabled = False
- Head = dqHead
- dqHead = dqHead + 1
- if(dqHead = dqTail)Then
- if(dqbFlush(Head) = True)Then
- DMDFlush()
- DMDScore()
- Else
- dqHead = 0
- DMDHead()
- End If
- Else
- DMDHead()
- End If
- End Sub
- Sub DMDProcessEffectOn()
- Dim i
- Dim BlinkEffect
- Dim Temp
- BlinkEffect = False
- For i = 0 to 3
- if(deCount(i) <> deCountEnd(i))Then
- deCount(i) = deCount(i) + 1
- select case(dqEffect(i, dqHead))
- case eNone:
- Temp = dqText(i, dqHead)
- case eScrollLeft:
- Temp = Right(dLine(i), dCharsPerLine(i)- 1)
- Temp = Temp & Mid(dqText(i, dqHead), deCount(i), 1)
- case eScrollRight:
- Temp = Mid(dqText(i, dqHead), (dCharsPerLine(i) + 1)- deCount(i), 1)
- Temp = Temp & Left(dLine(i), dCharsPerLine(i)- 1)
- case eBlink:
- BlinkEffect = True
- if((deCount(i)MOD deBlinkSlowRate) = 0)Then
- deBlinkCycle(i) = deBlinkCycle(i)xor 1
- End If
- if(deBlinkCycle(i) = 0)Then
- Temp = dqText(i, dqHead)
- Else
- Temp = Space(dCharsPerLine(i))
- End If
- case eBlinkFast:
- BlinkEffect = True
- if((deCount(i)MOD deBlinkFastRate) = 0)Then
- deBlinkCycle(i) = deBlinkCycle(i)xor 1
- End If
- if(deBlinkCycle(i) = 0)Then
- Temp = dqText(i, dqHead)
- Else
- Temp = Space(dCharsPerLine(i))
- End If
- End Select
- if(dqText(i, dqHead) <> "_")Then
- dLine(i) = Temp
- DMDUpdate i
- End If
- End If
- Next
- if(deCount(0) = deCountEnd(0))and(deCount(1) = deCountEnd(1))and(deCount(2) = deCountEnd(2))and(deCount(3) = deCountEnd(3))Then
- if(dqTimeOn(dqHead) = 0)Then
- DMDFlush()
- Else
- if(BlinkEffect = True)Then
- DMDTimer.Interval = 10
- Else
- DMDTimer.Interval = dqTimeOn(dqHead)
- End If
- DMDTimer.Enabled = True
- End If
- Else
- DMDEffectTimer.Enabled = True
- End If
- End Sub
- Function ExpandLine(TempStr, id) 'id is the number of the dmd line
- If TempStr = "" Then
- TempStr = Space(dCharsPerLine(id))
- Else
- if(Len(TempStr) > Space(dCharsPerLine(id)))Then
- TempStr = Left(TempStr, Space(dCharsPerLine(id)))
- Else
- if(Len(TempStr) < dCharsPerLine(id))Then
- TempStr = TempStr & Space(dCharsPerLine(id)- Len(TempStr))
- End If
- End If
- End If
- ExpandLine = TempStr
- End Function
- Function FormatScore(ByVal Num) 'it returns a string with commas (as in Black's original font)
- dim i
- dim NumString
- NumString = CStr(abs(Num))
- For i = Len(NumString)-3 to 1 step -3
- if IsNumeric(mid(NumString, i, 1))then
- NumString = left(NumString, i-1) & chr(asc(mid(NumString, i, 1)) + 48) & right(NumString, Len(NumString)- i)
- end if
- Next
- FormatScore = NumString
- End function
- Function CenterLine(id, aString)
- Dim tmp, tmpStr
- tmp = (dCharsPerLine(id)- Len(aString)) \ 2
- If(tmp + tmp + Len(aString)) < dCharsPerLine(id)Then
- tmpStr = " " & Space(tmp) & aString & Space(tmp)
- Else
- tmpStr = Space(tmp) & aString & Space(tmp)
- End If
- CenterLine = tmpStr
- End Function
- Function FillLine(id, aString, bString)
- Dim tmp, tmpStr
- tmp = dCharsPerLine(id)- Len(aString)- Len(bString)
- tmpStr = aString & Space(tmp) & bString
- FillLine = tmpStr
- End Function
- Function RightLine(id, aString)
- Dim tmp, tmpStr
- tmp = dCharsPerLine(id)- Len(aString)
- tmpStr = Space(tmp) & aString
- RightLine = tmpStr
- End Function
- '*********************
- ' Section; Update DMD - reels
- '*********************
- Dim DesktopMode:DesktopMode = Table1.ShowDT
- Dim Digits(3)
- DMDReels_Init
- Sub DMDReels_Init
- If DesktopMode Then
- 'Desktop
- Digits(0) = Array(d0, d1, d2) 'backdrop
- Digits(1) = Array(d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19, d20, d21) 'upper line
- Digits(2) = Array(d22, d23, d24, d25, d26, d27, d28, d29, d30, d31, d32, d33, d34, d35, d36, d37, d38, d39, d40) 'lower line
- Digits(3) = Array(d41, d42, d43, d44, d45, d46, d47, d48, d49, d50, d51, d52, d53) ' center line
- d54.Visible = 0:d55.Visible = 0:d56.Visible = 0
- Else
- 'FS
- Digits(0) = Array(d54, d55, d56) 'backdrop
- Digits(1) = Array(d57, d58, d59, d60, d61, d62, d63, d64, d65, d66, d67, d68, d69, d70, d71, d72, d73, d74, d75) 'upper line
- Digits(2) = Array(d76, d77, d78, d79, d80, d81, d82, d83, d84, d85, d86, d87, d88, d89, d90, d91, d92, d93, d94) 'lower line
- Digits(3) = Array(d95, d96, d97, d98, d99, d100, d101, d102, d103, d104, d105, d106, d107)
- d0.Visible = 0:d1.Visible = 0:d2.Visible = 0
- End If
- End Sub
- Sub DMDUpdate(id)
- Dim digit, value
- For digit = 0 to dCharsPerLine(id)-1
- value = ASC(mid(dLine(id), digit + 1, 1))-32
- Digits(id)(digit).SetValue value
- Next
- End Sub
- '****************************************
- ' Section; Real Time updatess using the GameTimer
- '****************************************
- 'used for all the real time updates
- Sub GameTimer_Timer
- RollingUpdate
- ' add any other real time update subs, like gates or diverters
- End Sub
- '********************************************************************************************
- ' Only for VPX 10.2 and higher.
- ' Section; FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
- ' When TotalPeriod done, light or flasher will be set to FinalState value where
- ' Final State values are: 0=Off, 1=On, 2=Return to previous State
- '********************************************************************************************
- Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first myVersion
- If TypeName(MyLight) = "Light" Then
- If FinalState = 2 Then
- FinalState = MyLight.State 'Keep the current light state
- End If
- MyLight.BlinkInterval = BlinkPeriod
- MyLight.Duration 2, TotalPeriod, FinalState
- ElseIf TypeName(MyLight) = "Flasher" Then
- Dim steps
- ' Store all blink information
- steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
- If FinalState = 2 Then 'Keep the current flasher state
- FinalState = ABS(MyLight.Visible)
- End If
- MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
- ' Start blink timer and create timer subroutine
- MyLight.TimerInterval = BlinkPeriod
- MyLight.TimerEnabled = 0
- MyLight.TimerEnabled = 1
- 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"
- End If
- End Sub
- Sub FlashForMsrgb(MyLight, TotalPeriod, BlinkPeriod, FinalState, Red, Green, Blue) 'thanks gtxjoe for the first myVersion
- If TypeName(MyLight) = "Light" Then
- If FinalState = 2 Then
- FinalState = MyLight.State 'Keep the current light state
- End If
- MyLight.BlinkInterval = BlinkPeriod
- MyLight.Duration 2, TotalPeriod, FinalState
- ElseIf TypeName(MyLight) = "Flasher" Then
- Dim steps
- ' Store all blink information
- steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
- If FinalState = 2 Then 'Keep the current flasher state
- FinalState = ABS(MyLight.Visible)
- End If
- MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
- ' Start blink timer and create timer subroutine
- MyLight.TimerInterval = BlinkPeriod
- MyLight.TimerEnabled = 0
- MyLight.TimerEnabled = 1
- 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"
- End If
- End Sub
- '******************************************
- ' Section; Change light color - simulate color leds
- ' changes the light color and state
- ' colors: red, orange, yellow, green, blue, white
- '******************************************
- 'Sub SetLight(n, col, stat)
- Sub SetLight(n, col, stat)
- 'SEt Color
- Select Case col
- Case "red"
- n.color = RGB(128, 0, 0)
- n.colorfull = RGB(255, 0, 0)
- Case "orange"
- n.color = RGB(18, 3, 0)
- n.colorfull = RGB(255, 64, 0)
- Case "yellow"
- n.color = RGB(18, 18, 0)
- n.colorfull = RGB(255, 255, 0)
- Case "green"
- n.color = RGB(0, 32, 0)
- n.colorfull = RGB(0, 200, 0)
- Case "blue"
- n.color = RGB(0, 0, 128)
- n.colorfull = RGB(0, 0, 255)
- Case "white"
- n.color = RGB(255, 252, 224)
- n.colorfull = RGB(193, 91, 0)
- Case "purple"
- n.color = RGB(128, 0, 128)
- n.colorfull = RGB(255, 0, 255)
- Case "amber"
- n.color = RGB(193, 49, 0)
- n.colorfull = RGB(255, 153, 0)
- Case ""
- End Select
- 'Set State
- If stat <> -1 Then
- n.State = 0
- n.State = stat
- End If
- End Sub
- SetLight l10, "", -1
- ' ********************************
- ' Table info & Attract Mode
- ' ********************************
- Sub ShowTableInfo
- 'info goes in a loop only stopped by the credits and the startkey
- If Score(1)Then
- DMD "", eNone, CenterLine(1, FormatScore(Score(1))), eNone, CenterLine(2, "PLAYER 1"), eNone, "", eNone, 3000, False, ""
- End If
- If Score(2)Then
- DMD "", eNone, CenterLine(1, FormatScore(Score(2))), eNone, CenterLine(2, "PLAYER 2"), eNone, "", eNone, 3000, False, ""
- End If
- If Score(3)Then
- DMD "", eNone, CenterLine(1, FormatScore(Score(3))), eNone, CenterLine(2, "PLAYER 3"), eNone, "", eNone, 3000, False, ""
- End If
- If Score(4)Then
- DMD "", eNone, CenterLine(1, FormatScore(Score(4))), eNone, CenterLine(2, "PLAYER 4"), eNone, "", eNone, 3000, False, ""
- End If
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "GAME OVER"), eBlink, 2000, False, "" 'game over
- If bFreePlay Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "FREE PLAY"), eNone, 3000, False, ""
- Else
- If Credits > 0 Then
- DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "PRESS START"), eNone, "", eNone, 2000, False, ""
- Else
- DMD "", eNone, CenterLine(1, "CREDITS " & Credits), eNone, CenterLine(2, "INSERT COIN"), eNone, "", eNone, 2000, False, ""
- End If
- End If
- DMD "", eNone, " VPX", eNone, " PRESENTS", eNone, "", eNone, 2000, False, ""
- DMD "", eNone, " TOTAL NUCLEAR", eNone, " ANNIHILATION", eNone, "", eNone, 2000, False, ""
- ' DMD "T N A", eScrollRight, "", eNone, "", eNone, "", eNone, 4000, False, ""
- ' DMD """#$", eScrollRight, "", eNone, "", eNone, "", eNone, 4000, False, ""
- DMD " ", eScrollLeft, "", eNone, "", eNone, "", eNone, 500, False, ""
- DMD "", eNone, CenterLine(1, "HIGH SCORES"), eScrollLeft, Space(dCharsPerLine(2)), eScrollLeft, "", eNone, 20, False, ""
- DMD "", eNone, CenterLine(1, "HIGH SCORES"), eBlinkFast, "", eNone, "", eNone, 1000, False, ""
- DMD "", eNone, CenterLine(1, "HIGH SCORES"), eNone, " 1 " &HighScoreName(0) & " " &FormatScore(HighScore(0)), eScrollLeft, "", eNone, 2000, False, ""
- DMD "", eNone, "_", eNone, " 2 " &HighScoreName(1) & " " &FormatScore(HighScore(1)), eScrollLeft, "", eNone, 2000, False, ""
- DMD "", eNone, "_", eNone, " 3 " &HighScoreName(2) & " " &FormatScore(HighScore(2)), eScrollLeft, "", eNone, 2000, False, ""
- DMD "", eNone, "_", eNone, " 4 " &HighScoreName(3) & " " &FormatScore(HighScore(3)), eScrollLeft, "", eNone, 2000, False, ""
- DMD "", eNone, Space(dCharsPerLine(1)), eScrollLeft, Space(dCharsPerLine(2)), eScrollLeft, "", eNone, 500, False, ""
- End Sub
- Sub StartAttractMode(dummy)
- StartLightSeq
- DMDFlush
- ShowTableInfo
- ''' StartRainbow "arrows"
- End Sub
- Sub StopAttractMode
- DMDFlush:DMD "", eNone, "", eNone, "", eNone, "", eNone, 500, True, ""
- LightSeqAttract.StopPlay
- ''' StopRainbow
- 'StopSong
- End Sub
- Sub StartLightSeq()
- 'lights sequences
- LightSeqAttract.UpdateInterval = 2
- LightSeqAttract.Play SeqBlinking, , 5, 150
- LightSeqAttract.Play SeqRandom, 40, , 4000
- LightSeqAttract.Play SeqAllOff
- ' LightSeqAttract.UpdateInterval = 8
- ' LightSeqAttract.Play SeqUpOn, 50, 1
- LightSeqAttract.UpdateInterval = 2
- LightSeqAttract.Play SeqDownOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqCircleOutOn, 15, 2
- LightSeqAttract.UpdateInterval = 8
- ' LightSeqAttract.Play SeqUpOn, 25, 1
- ' LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 25, 1
- ' LightSeqAttract.UpdateInterval = 8
- ' LightSeqAttract.Play SeqUpOn, 25, 1
- ' LightSeqAttract.UpdateInterval = 8
- ' LightSeqAttract.Play SeqDownOn, 25, 1
- ' LightSeqAttract.UpdateInterval = 10
- ' LightSeqAttract.Play SeqCircleOutOn, 15, 3
- LightSeqAttract.UpdateInterval = 5
- LightSeqAttract.Play SeqRightOn, 50, 1
- LightSeqAttract.UpdateInterval = 5
- LightSeqAttract.Play SeqLeftOn, 50, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 50, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 50, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 40, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 40, 1
- LightSeqAttract.UpdateInterval = 10
- LightSeqAttract.Play SeqRightOn, 30, 1
- LightSeqAttract.UpdateInterval = 10
- LightSeqAttract.Play SeqLeftOn, 30, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 15, 1
- LightSeqAttract.UpdateInterval = 10
- LightSeqAttract.Play SeqCircleOutOn, 15, 3
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 25, 1
- LightSeqAttract.UpdateInterval = 5
- LightSeqAttract.Play SeqStripe1VertOn, 50, 2
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqCircleOutOn, 15, 2
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqStripe1VertOn, 50, 3
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqCircleOutOn, 15, 2
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqStripe2VertOn, 50, 3
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 25, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqStripe1VertOn, 25, 3
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqStripe2VertOn, 25, 3
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqUpOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqDownOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqRightOn, 15, 1
- LightSeqAttract.UpdateInterval = 8
- LightSeqAttract.Play SeqLeftOn, 15, 1
- End Sub
- Sub LightSeqAttract_PlayDone()
- StartLightSeq()
- End Sub
- Sub LightSeqTilt_PlayDone()
- 'LightSeqTilt.Play SeqAllOff
- End Sub
- Sub LightSeqSkillshot_PlayDone()
- LightSeqSkillshot.Play SeqAllOff
- End Sub
- '*************************
- ' Section; Rainbow Changing Lights
- '*************************
- Dim RGBStep, RGBFactor, Red, Green, Blue, RainbowLights
- Sub StartRainbow(n)
- RainbowLights = n
- RGBStep = 0
- RGBFactor = 10
- Red = 255
- Green = 0
- Blue = 0
- RainbowTimer.Enabled = 1
- End Sub
- Sub StopRainbow()
- Dim obj
- RainbowTimer.Enabled = 0
- If RainbowLights = "all" Then
- For each obj in aRGBLights
- SetLight obj, "white", 0
- Next
- ElseIf RainbowLights = "gi" Then
- For each obj in aGiLights
- SetLight obj, "white", 0
- Next
- End If
- End Sub
- Sub RainbowTimer_Timer 'rainbow led light color changing
- Dim obj
- Select Case RGBStep
- Case 0 'Green
- Green = Green + RGBFactor
- If Green > 255 then
- Green = 255
- RGBStep = 1
- End If
- Case 1 'Red
- Red = Red - RGBFactor
- If Red < 0 then
- Red = 0
- RGBStep = 2
- End If
- Case 2 'Blue
- Blue = Blue + RGBFactor
- If Blue > 255 then
- Blue = 255
- RGBStep = 3
- End If
- Case 3 'Green
- Green = Green - RGBFactor
- If Green < 0 then
- Green = 0
- RGBStep = 4
- End If
- Case 4 'Red
- Red = Red + RGBFactor
- If Red > 255 then
- Red = 255
- RGBStep = 5
- End If
- Case 5 'Blue
- Blue = Blue - RGBFactor
- If Blue < 0 then
- Blue = 0
- RGBStep = 0
- End If
- End Select
- If RainbowLights = "all" Then
- For each obj in aRGBLights
- obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10)
- obj.colorfull = RGB(Red, Green, Blue)
- Next
- ElseIf RainbowLights = "gi" Then
- For each obj in aGiLights
- obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10)
- obj.colorfull = RGB(Red, Green, Blue)
- Next
- End If
- End Sub
- '***********************************************************************
- ' *********************************************************************
- ' Section; Table Specific Script Starts Here
- ' *********************************************************************
- '***********************************************************************
- ' droptargets, animations, etc
- Sub VPObjects_Init
- End Sub
- ' tables variables and modes init
- Dim bSuperJackpot
- Dim bDoubleSuperJackpot
- Dim bTripleSuperJackpot
- Dim bJackpot
- 'Dim bLoopinSupers
- Dim SpinnerValue
- Dim SpinnerReactorValue
- Dim Multiplier2x
- Dim Multiplier3x
- Dim LaneBonus
- Dim BallLockScore
- Dim COREScore
- Dim InlaneScore
- Dim BumperScore
- Dim OutlaneScore
- Dim LowerSlingshotScore
- Dim UpperSlingshotScore
- Dim Jackpot
- Dim DoubleJackpot
- Dim TripleJackpot
- Dim SuperJackpot
- Dim RADSCore
- Dim DESTROYScore
- Dim GridTargetScore
- Dim TargetScore
- Const TargetBonusValue = 1000
- Const LaneSaveBonusValue = 10000
- Sub Game_Init() 'called at the start of a new game
- Dim i
- bExtraBallWonThisBall = False
- TurnOffPlayfieldLights()
- 'Init Variables
- bSkillshotSelect = False
- SkillshotReady = 0
- DropTargetResetLockIsLit 1
- '****************************
- 'SubSection; Scoring Values
- '***************************
- SpinnerValue = 110
- SpinnerReactorValue = 200
- COREScore = 500
- UpperSlingshotScore = 500
- LowerSlingshotScore = 200
- GridTargetScore = 500
- TargetScore = 500
- SkillshotValue = 1000
- BallLockScore = 20000
- Jackpot = 15000
- DoubleJackpot = 30000
- TripleJackpot = 45000
- SuperJackpot = 75000
- 'DropTargetScore
- BumperScore = 500
- InlaneScore = 500
- OutlaneScore = 500
- RADScore = 500
- DESTROYScore = 500
- 'Initialize Player Data
- InitializePlayerData
- ResetCORE
- ResetSAVE
- ResetGrid
- ResetReactor
- ResetReactorBonus
- ResetRAD
- ResetMaxTarget
- ResetMysteryAward
- ResetDESTROY
- ResetGate
- ResetBonusLights
- ResetReactorLoopInserts
- ResetBallSaveDisplay
- ResetSuperSpinner
- ResetInserts
- bMultiBallMode = False
- bBonusHeld = False
- Multiplier2x = 1
- Multiplier3x = 1
- 'Init Delays/Timers
- If Quotemode = 1 Then PlayQuote.Enabled = 1
- 'Play some Music
- StartBackgroundMusic
- 'GI color
- ChangeGI "blue"
- End Sub
- Sub StopEndOfBallModes() 'this sub is called after the last ball is drained
- 'If Modes(0)Then StopMode Modes(0) 'a mode is active so stop it
- End Sub
- Sub ResetNewBallVariables() 'reset variables for a new ball or player
- bSuperJackpot = False
- bDoubleSuperJackpot = False
- bTripleSuperJackpot = False
- bJackpot = False
- LaneBonus = 0
- End Sub
- Sub ResetNewBallLights() 'turn on or off the needed lights before a new ball is released
- End Sub
- Sub TurnOffPlayfieldLights()
- Dim a
- For each a in aLights
- a.State = 0
- Next
- ''' Bumper1Light.Visible = 0
- End Sub
- '**************************
- ' Section; SAVE - Inlanes Outlanes
- '**************************
- Dim LaneSaveCount(4)
- Dim PlayerLa1(4)
- Dim PlayerLa2(4)
- Dim PlayerLa3(4)
- Dim PlayerLa4(4)
- Const LaneSaveCountMax = 6
- Dim bBallSaverSingleUse
- Sub ResetSave() ' ClearSave on end ball or start ball
- LaneSaveCount(CurrentPlayer) = 0
- SetLight la1, "red", 0
- SetLight la2, "red", 0
- SetLight la3, "red", 0
- SetLight la4, "red", 0
- ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
- End Sub
- Sub CheckSAVE()
- dim tmp
- tmp = 0
- if la1.state = 1 then tmp = tmp + 1
- if la2.state = 1 then tmp = tmp + 1
- if la3.state = 1 then tmp = tmp + 1
- if la4.state = 1 then tmp = tmp + 1
- If tmp = 3 then '3 targets lit, earn a SAVE
- AwardSAVE 1
- End If
- End Sub
- Sub AwardSAVE (value)
- Dim SaveInsertAlreadyLit, savecolor
- SaveInsertAlreadyLit = 0
- LaneSaveCount(CurrentPlayer) = LaneSaveCount(CurrentPlayer) + value
- If LaneSaveCount(CurrentPlayer) > LaneSaveCountMax Then
- LaneSaveCount(CurrentPlayer) = LaneSaveCountMax
- Else
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "LANE SAVE"), eBlinkfast, 800, True, "tna_lanesave"
- End If
- Debug.Print "LaneSaveCount(CurrentPlayer) = " & LaneSaveCount(CurrentPlayer)
- ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
- 'Select new Insert color
- SetSaveColor
- 'Check if any Save insert already blinking and change color based on Save count (Red, Orange, Yellow,Green, Blue, Purple)
- if la1.state = 2 then
- SaveInsertAlreadyLit = 1
- elseif la2.state = 2 then
- SaveInsertAlreadyLit = 1
- elseif la3.state = 2 then
- SaveInsertAlreadyLit = 1
- elseif la4.state = 2 then
- SaveInsertAlreadyLit = 1
- end if
- 'If First Save awarded, set Flashing save insert
- if SaveInsertAlreadyLit=0 Then
- if la1.state = 0 then
- la1.state = 2
- elseif la2.state = 0 then
- la2.state = 2
- elseif la3.state = 0 then
- la3.state = 2
- elseif la4.state = 0 then
- la4.state = 2
- end if
- End If
- 'Reset the rest of the SAVE inserts
- if la1.state = 1 then
- la1.state = 0
- end if
- if la2.state = 1 then
- la2.state = 0
- end if
- if la3.state = 1 then
- la3.state = 0
- end if
- if la4.state = 1 then
- la4.state = 0
- end if
- End Sub
- Sub UseSAVE (sw) ' On outlane, check for ballsave condition
- dim savecolor
- dim tmp
- tmp = ""
- if LaneSaveCount(CurrentPlayer) > 0 Then
- 'Check if SAVE insert is matching the drain outlane
- if la1.state = 2 then
- tmp = "swOutlaneL"
- elseif la4.state = 2 then
- tmp = "swOutlaneR"
- end if
- 'debug.print "Entering usesave " & LaneSaveCount(CurrentPlayer) & " : " & sw & " ; " & tmp
- if (StrComp(sw, tmp) = 0)then 'Ball Saved!
- 'debug.print "ballSavesingle!"
- bBallSaverSingleUse = 1
- LaneSaveCount(CurrentPlayer) = LaneSaveCount(CurrentPlayer) - 1
- Playsound "tna_ballsaved"
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL SAVED"), eBlinkfast, 800, True, ""
- if LaneSaveCount(CurrentPlayer) <=0 Then ' Turn off Save insert
- LaneSaveCount(CurrentPlayer) = 0
- if la1.state = 2 then
- la1.state = 0
- elseif la2.state = 2 then
- la2.state = 0
- elseif la3.state = 2 then
- la3.state = 0
- elseif la4.state = 2 then
- la4.state = 0
- end if
- End If
- 'Select new Insert color
- SetSaveColor
- End If
- End If
- ttSaves.text = "S:" & LaneSaveCount(CurrentPlayer)
- DMDScoreNow
- End Sub
- Sub SetSaveColor
- dim savecolor
- 'Select new Insert color
- Select Case LaneSaveCount(CurrentPlayer)
- Case 0: savecolor = "red"
- Case 1: savecolor = "red"
- Case 2: savecolor = "orange"
- Case 3: savecolor = "yellow"
- Case 4: savecolor = "green"
- Case 5: savecolor = "blue"
- Case else: savecolor = "purple"
- End Select
- 'Set insert color
- SetLight la1, savecolor, -1
- SetLight la2, savecolor, -1
- SetLight la3, savecolor, -1
- SetLight la4, savecolor, -1
- End Sub
- Sub InitLaneSaveData
- Dim i
- For i = 1 To MaxPlayers
- LaneSaveCount(i) = 0
- PlayerLa1(i) = 0
- PlayerLa2(i) = 0
- PlayerLa3(i) = 0
- PlayerLa4(i) = 0
- Next
- End Sub
- Sub SaveLaneSaveData
- PlayerLa1(CurrentPlayer) = la1.state
- PlayerLa2(CurrentPlayer) = la2.state
- PlayerLa3(CurrentPlayer) = la3.state
- PlayerLa4(CurrentPlayer) = la4.state
- End Sub
- Sub RestoreLaneSaveData
- la1.state = PlayerLa1(CurrentPlayer)
- la2.state = PlayerLa2(CurrentPlayer)
- la3.state = PlayerLa3(CurrentPlayer)
- la4.state = PlayerLa4(CurrentPlayer)
- SetSaveColor
- End Sub
- '**************************
- ' Section; Skillshot
- '**************************
- Sub StartSkillShot() 'Updates the DMD & lights with the chosen skillshots
- DMDFlush
- bSkillShotSelect = True
- HandsFreeSkillshotInsert = INT(RND * 4) +1
- Select Case HandsFreeSkillshotInsert
- Case 1:
- l1.state = 2
- f1.state = 2
- f2.state = 2
- f3.state = 0
- f4.state = 0
- f5.state = 0
- Case 2:
- l2.state = 2
- f1.state = 0
- f2.state = 2
- f3.state = 2
- f4.state = 0
- f5.state = 0
- Case 3:
- l3.state = 2
- f1.state = 0
- f2.state = 0
- f3.state = 2
- f4.state = 2
- f5.state = 0
- Case 4:
- l4.state = 2
- f1.state = 0
- f2.state = 0
- f3.state = 0
- f4.state = 2
- f5.state = 2
- End Select
- End Sub
- Sub SelectSkillshot(index)
- If index = 1 Then
- Playsound "fx_Previous"
- End If
- If index = 2 Then
- Playsound "fx_Next"
- End If
- if l1.state = 2 then
- HandsFreeSkillshotInsert = 1
- f1.state = 0
- f2.state = 0
- f3.state = 0
- f4.state = 0
- f5.state = 0
- f1.state = 2
- f2.state = 2
- elseif l2.state = 2 then
- HandsFreeSkillshotInsert = 2
- f1.state = 0
- f2.state = 0
- f3.state = 0
- f4.state = 0
- f5.state = 0
- f2.state = 2
- f3.state = 2
- elseif l3.state = 2 then
- HandsFreeSkillshotInsert = 3
- f1.state = 0
- f2.state = 0
- f3.state = 0
- f4.state = 0
- f5.state = 0
- f3.state = 2
- f4.state = 2
- elseif l4.state = 2 then
- HandsFreeSkillshotInsert = 4
- f1.state = 0
- f2.state = 0
- f3.state = 0
- f4.state = 0
- f5.state = 0
- f4.state = 2
- f5.state = 2
- end if
- End Sub
- Sub CheckSkillShot (index) ' reset the skillshot lights & variables
- If index = HandsFreeSkillshotInsert then
- AwardHandsFreeSkillshot
- Else
- Select Case index
- Case 1:
- if l1.state = 2 then AwardSkillshot
- Case 2:
- if l2.state = 2 then AwardSkillshot
- Case 3:
- if l3.state = 2 then AwardSkillshot
- Case 4:
- if l4.state = 2 then AwardSkillshot
- End Select
- End if
- if l1.state = 2 then
- l1.state = 0
- elseif l2.state = 2 then
- l2.state = 0
- elseif l3.state = 2 then
- l3.state = 0
- elseif l4.state = 2 then
- l4.state = 0
- end if
- f1.state = 0
- f2.state = 0
- f3.state = 0
- f4.state = 0
- f5.state = 0
- SkillShotReady = 0
- bSkillShotSelect = False
- HandsFreeSkillshotInsert = 0
- DMDScoreNow
- End Sub
- ' *********************************************************************
- ' Table Object Hit Events
- '
- ' Any target hit Sub will follow this:
- ' - play a sound
- ' - do some physical movement
- ' - add a score, bonus
- ' - check some variables/modes this trigger is a member of
- ' - set the "LastSwicthHit" variable in case it is needed later
- ' *********************************************************************
- ' Slingshots has been hit
- Dim LStep, RStep
- Sub LeftSlingShot_Slingshot
- If Tilted Then Exit Sub
- PlaySound SoundFXDOF("fx_slingshot", 103, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
- PlaySound "tna_reactorslingloud"
- DOF 104, DOFPulse
- LeftSling4.Visible = 1:LeftSling1.Visible = 0
- Lemk.RotX = 26
- LStep = 0
- LeftSlingShot.TimerEnabled = True
- ' add some points
- AddScore LowerSlingshotScore
- ' add some effect to the table?
- GILeftSlingHit
- SwitchReactorLoopInserts
- ' remember last trigger hit by the ball
- SetLastSwitchHit "LeftSlingShot"
- End Sub
- Sub LeftSlingShot_Timer
- Select Case LStep
- Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
- Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
- Case 3:LeftSLing2.Visible = 0:LeftSling1.Visible = 1:Lemk.RotX = -10:Gi2.State = 1:LeftSlingShot.TimerEnabled = False
- End Select
- LStep = LStep + 1
- End Sub
- Sub RightSlingShot_Slingshot
- If Tilted Then Exit Sub
- PlaySound SoundFXDOF("fx_slingshot", 105, DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
- PlaySound "tna_reactorslingloud"
- DOF 106, DOFPulse
- RightSling4.Visible = 1:RightSling1.Visible = 0
- Remk.RotX = 26
- RStep = 0
- RightSlingShot.TimerEnabled = True
- ' add some points
- AddScore LowerSlingshotScore
- ' add some effect to the table?
- GIRightSlingHit
- SwitchReactorLoopInserts
- ' remember last trigger hit by the ball
- SetLastSwitchHit "RightSlingShot"
- End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14:
- Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2:
- Case 3:RightSLing2.Visible = 0:RightSLing1.Visible = 1:Remk.RotX = -10:Gi1.State = 1:RightSlingShot.TimerEnabled = False
- End Select
- RStep = RStep + 1
- End Sub
- '******************
- ' Section; Spinner
- '******************
- Dim SpinCount, SuperSpinnerValue
- Sub Spinner1_Spin()
- If Tilted Then Exit Sub
- DOF 112, DOFPulse
- PlaySound "tna_spinner", 0, 1, -0.1
- SpinCount = SpinCount + 1
- ttspin.text = SpinCount
- If SpinCount >= 50 Then
- SetSuperSpinner
- End If
- AddScoreSpecial2 SpinnerValue*SuperSpinnerValue, SpinnerReactorValue
- If SkillShotReady <> 0 Then CheckSkillShot 0
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSpinner
- End If
- End Sub
- 'Decide to remove or keep
- Sub Spinner2_Spin()
- DOF 113, DOFPulse
- If Tilted Then Exit Sub
- PlaySound "tna_spinner", 0, 1, -0.1
- ' increase super jackpot if light l66 is blinking
- AddScoreSpecial2 SpinnerValue, SpinnerReactorValue
- If SkillShotReady <> 0 Then CheckSkillShot 0
- End Sub
- Sub SetSuperSpinner
- If SuperSpinnerValue <> 2 Then
- SuperSpinnerValue = 2
- lSpinner.state = 2
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "SUPER SPINNER"), eBlinkfast, 1800, True, "tna_superspinner"
- End If
- End Sub
- Sub ResetSuperSpinner
- SpinCount = 0
- ttspin.text = SpinCount
- SuperSpinnerValue = 1
- lSpinner.state = 0
- End Sub
- '*********************
- ' Section; Inlanes - Outlanes
- '*********************
- Sub swOutlaneL_Hit()
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- AddScore OutlaneScore
- ' change some light
- If la1.State = 0 Then
- la1.State = 1
- PlaySound "tna_toplane"
- End If
- SetLastSwitchHit "swOutlaneL"
- 'Check if Lane Save being used
- UseSAVE LastSwitchHit
- 'Check if Lane Save earned
- CheckSAVE
- End Sub
- Sub swOutlaneR_Hit()
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- AddScore OutlaneScore
- ' change some light
- If la4.State = 0 Then
- la4.State = 1
- PlaySound "tna_toplane"
- End If
- SetLastSwitchHit "swOutlaneR"
- 'Check if Lane Save being used
- UseSAVE LastSwitchHit
- 'Check if Lane Save earned
- CheckSAVE
- End Sub
- Sub swInlaneL_Hit()
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- AddScore InlaneScore
- ' change some light
- If la2.State = 0 Then
- la2.State = 1
- PlaySound "tna_toplane"
- End If
- StartReactorRightLoopInserts
- SetLastSwitchHit "swInlaneL"
- ' do some check
- CheckSAVE
- End Sub
- Sub swInlaneR_Hit()
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- AddScore InlaneScore
- ' change some light
- If la3.State = 0 Then
- la3.State = 1
- PlaySound "tna_toplane"
- End If
- StartReactorLeftLoopInserts
- SetLastSwitchHit "swInlaneR"
- ' do some check
- CheckSAVE
- End Sub
- '*********************
- ' Section; Top Lanes
- '*********************
- Sub sw1_Hit()
- DOF 150, DOFPulse
- ResetGate
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- ' change some light
- SetLastSwitchHit "sw1"
- If SkillShotReady <> 0 Then CheckSkillShot 1
- If L1.state <> 1 then playsound "tna_toplane"
- L1.state = 1
- AddScoreSpecial COREScore
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- ' do some check
- CheckCORE
- End Sub
- Sub sw2_Hit()
- DOF 151, DOFPulse
- ResetGate
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- ' change some light
- ' FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0
- SetLastSwitchHit "sw2"
- If SkillShotReady <> 0 Then CheckSkillShot 2
- If l2.state <> 1 then playsound "tna_toplane"
- L2.state = 1
- AddScoreSpecial COREScore
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- ' do some check
- CheckCORE
- End Sub
- Sub sw3_Hit()
- DOF 152, DOFPulse
- ResetGate
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- ' change some light
- ' FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0
- SetLastSwitchHit "sw3"
- If SkillShotReady <> 0 Then CheckSkillShot 3
- If l3.state <> 1 then playsound "tna_toplane"
- L3.state = 1
- AddScoreSpecial COREScore
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- ' do some check
- CheckCORE
- End Sub
- Sub sw4_Hit()
- DOF 153, DOFPulse
- ResetGate
- PlaySound "fx_sensor", 0, 1, pan(ActiveBall)
- If Tilted Then Exit Sub
- ' change some light
- ' FlashForms l6f, 1000, 40, 0:FlashForms l6, 1000, 40, 0
- SetLastSwitchHit "sw4"
- If SkillShotReady <> 0 Then CheckSkillShot 4
- If l4.state <> 1 then playsound "tna_toplane"
- L4.state = 1
- AddScoreSpecial COREScore
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- ' do some check
- CheckCORE
- End Sub
- Sub LeftScoop_Hit()
- Dim MysteryAwarded
- PlaySound "fx_kicker_enter", 0, 1, -0.07, 0.15
- 'Activeball.x = 296: Activeball.y = 692 'Center ball in scoop
- If Tilted Then
- LeftScoopExit
- Exit Sub
- End If
- MysteryAwarded = CollectMysteryAward()
- if MysteryAwarded=0 Then
- vpmtimer.addtimer 500, "LeftScoopExit '"
- End If
- LeftScoop.Enabled = False
- SetLastSwitchHit "LeftScoop"
- End Sub
- '
- 'Sub FlashLeftScoop
- ' FlashForms l5f, 1000, 40, 0
- ' FlashForms LibraryFlasher, 1000, 40, 0
- ' DOF 206, DOFPulse
- 'End Sub
- '
- Sub LeftScoopExit
- CheckReactorStart
- LightSeqLeftScoop.StopPlay
- LightSeqLeftScoop.UpdateInterval = 1
- 'LightSeqLeftScoop.Play SeqCircleOutOn, 20, 1
- PlaySound SoundFXDOF("fx_kicker", 122, DOFPulse, DOFContactors), 0, 1, -0.07, 0.15
- PlaySound "tna_leftscoopeject"
- DOF 123, DOFPulse
- leftScoop.Kick 162.7, 34
- LeftScoop.Enabled = True
- 'Enable BallSave
- 'EnableBallSaver 3
- End Sub
- Sub RightScoop_Hit()
- Dim tmp
- PlaySound "fx_kicker_enter", 0, 1, -0.07, 0.15
- If Tilted Then
- vpmtimer.addtimer 150, "RightScoopExit '"
- Exit Sub
- End If
- vpmtimer.addtimer 500, "RightScoopExit '"
- RightScoop.Enabled = False
- If bMultiBallMode = False Then 'Normal Play
- RightScoopEjected.Enabled = True
- Else 'Multiball Play
- StartDropTargetResetTimer
- AwardSuperJackpot
- 'Multiball add
- AddMultiball 1
- End If
- AddBonusLights
- SetLastSwitchHit "RightScoop"
- End Sub
- Sub RightScoopExit
- PlaySound SoundFXDOF("fx_kicker", 124, DOFPulse, DOFContactors), 0, 1, -0.07, 0.15
- DOF 123, DOFPulse
- RightScoop.Kick 190, 40
- RightScoop.Enabled = True
- End Sub
- Sub RightScoopEjected_Hit
- DropTargetResetLockIsLit 0
- RightScoopEjected.Enabled = False
- End Sub
- ''*********************
- ' Section; Multiball Drop Targets
- ''*********************
- ' One Target up to start Normal Play. Lock Lit
- ' Multiball when DropTarget 3 hit
- ' When Multiball started, all targets up, jackpot/super jackpot
- ' When Multiball ends, 1 target up and scoop needed to light lock
- Dim bLockIsLit
- Sub StartMultiball
- If debugMultiball Then debug.print "*****SUB:StartMultiball"
- bMultiBallMode = True
- DOF 115, DOFPulse
- MultiballTargetReset
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MULTI-BALL!!!"), eBlinkfast, 1800, True, "tna_multiball"
- End Sub
- Sub EndMultiball 'Multiball ending
- If debugMultiball Then debug.print "*****SUB:EndMultiball"
- ChangeGI "blue"
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MBALL TOTAL"), eBlinkfast, 1800, True, ""
- 'If all targets down, reset to lock is lit
- If (DropTarget1.IsDropped = 1 and DropTarget2.IsDropped = 1 and DropTarget3.IsDropped = 1) Then
- DropTargetResetLockIsNotLit
- Else
- DropTargetPartialResetLockIsNotLit
- End If
- End Sub
- Sub DropTargetResetLockIsLit (value) 'Normal Play - Only Target 1 up - Lock is lit
- If debugMultiball Then debug.print "*****SUB:DropTargetResetLockIsLit"
- If bGameInPlay = True then
- bLockIsLit = True
- SetLight lLockIsLit1, "blue", 2
- SetLight lLockIsLit2, "blue", 2
- SetLight lLockIsLit3, "blue", 2
- If value = 0 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "LOCKS ARE LIT"), eBlinkfast, 1000, True, "tna_lockislit"
- Else
- lLockIsLit2.TimerInterval = 500
- lLockIsLit2.TimerEnabled = True
- End If
- End If
- DropTarget1.UserValue = 1
- DropTarget1.IsDropped = 0
- TargetBlocker1.IsDropped = 0
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- DropTarget2.UserValue = 0
- DropTarget2.IsDropped = 1
- TargetBlocker2.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
- DropTarget3.UserValue = 0
- DropTarget3.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- End Sub
- Sub lLockIsLit2_Timer
- lLockIsLit2.TimerEnabled = False
- PlaySound "TNAWelcomeFuture"
- End Sub
- Sub DropTargetResetLockIsNotLit 'Normal Play - Only Target 1 up - Lock is NOT lit
- If debugMultiball Then debug.print "*****SUB:DropTargetResetLockIsNotLit"
- bLockIsLit = False
- lLockIsLit1.state = 0
- lLockIsLit2.state = 0
- lLockIsLit3.state = 0
- DropTarget1.UserValue = 1
- DropTarget1.IsDropped = 0
- TargetBlocker1.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- DropTarget2.UserValue = 0
- DropTarget2.IsDropped = 1
- TargetBlocker2.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
- DropTarget3.UserValue = 0
- DropTarget3.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- End Sub
- Sub DropTargetPartialResetLockIsNotLit 'Normal Play - Any targets left up - Lock is NOT lit
- If debugMultiball Then debug.print "*****SUB:DropTargetPartialResetLockIsNotLit"
- bLockIsLit = False
- lLockIsLit1.state = 0
- lLockIsLit2.state = 0
- lLockIsLit3.state = 0
- DropTarget1.UserValue = 1
- DropTarget1.IsDropped = 0
- TargetBlocker1.IsDropped = 1
- End Sub
- Sub MultiballTargetReset 'Multiball Play - All targets up
- If debugMultiball Then debug.print "*****SUB:MultiballTargetReset"
- DropTarget1.TimerInterval = 3000
- DropTarget1.TimerEnabled = True
- SetLight lLockIsLit1, "red", 2
- SetLight lLockIsLit2, "red", 2
- SetLight lLockIsLit3, "red", 2
- End Sub
- Sub DropTarget1_Timer 'Multiball Play - All targets up
- If debugMultiball Then debug.print "*****SUB:DropTarget1_Timer"
- DropTarget1.TimerEnabled = False
- bLockIsLit = False
- DropTarget1.UserValue = 1
- DropTarget1.IsDropped = 0
- TargetBlocker1.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- DropTarget2.UserValue = 1
- DropTarget2.IsDropped = 0
- TargetBlocker2.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
- DropTarget3.UserValue = 1
- DropTarget3.IsDropped = 0
- DropTarget3.HasHitEvent = 1
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- End Sub
- Sub DropTargetOpto2_Hit 'Locks ball 1
- If debugMultiball Then debug.print "*****SUB:DropTargetOpto2_Hit"
- If bLockIsLit = True Then 'Normal Play
- If DropTarget2.UserValue = 0 And DropTarget1.UserValue = 1 Then
- If bTimedSkillShot = False Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL LOCK 1"), eBlinkfast, 1800, True, "tna_balllock1"
- Addscore BallLockScore
- Else
- DMD "", eNone, "", eNone, CenterLine(2, FormatScore(BallLockScore*2)), eNone, CenterLine(3, "SKILL LOCK"), eBlinkfast, 1800, True, "tna_secretskillshot2"
- Addscore BallLockScore*2
- bTimedSkillShot = False
- End If
- AddBonusLights
- PlaySound SoundFXDOF("fx_resetdrop", 137, DOFPulse, DOFContactors)
- DropTarget2.UserValue = 1
- DropTarget2.IsDropped = 0
- TargetBlocker2.IsDropped = 0
- If bGameInPlay Then CreateNewBallAfterBallLock
- End If
- End If
- SetLastSwitchHit "DropTargetOpto2"
- End Sub
- Sub DropTargetOpto3_Hit 'Locks ball 2
- If debugMultiball Then debug.print "*****SUB:DropTargetOpto3_Hit"
- If bLockIsLit = True Then 'Normal Play
- If DropTarget3.UserValue = 0 And DropTarget2.UserValue = 1 Then
- If bTimedSkillShot = False Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "BALL LOCK 2"), eBlinkfast, 1800, True, "tna_balllock2"
- Addscore BallLockScore
- Else
- DMD "", eNone, "", eNone, CenterLine(2, FormatScore(BallLockScore*2)), eNone, CenterLine(3, "SKILL LOCK"), eBlinkfast, 1800, True, "tna_secretskillshot2"
- Addscore BallLockScore*2
- bTimedSkillShot = False
- End If
- AddBonusLights
- PlaySound SoundFXDOF("fx_resetdrop", 138, DOFPulse, DOFContactors)
- DropTarget3.UserValue = 1
- DropTarget3.IsDropped = 0
- If bGameInPlay Then CreateNewBallAfterBallLock
- End If
- End If
- SetLastSwitchHit "DropTargetOpto3"
- End Sub
- Sub DropTarget1_Hit
- If debugMultiball Then debug.print "*****SUB:DropTarget1_Hit"
- AddBonusLights
- If bMultiBallMode = False Then 'Normal Play
- 'Addscore DropTargetScore
- If (DropTarget1.UserValue = 1) Then
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- PlaySound "tna_toptarget"
- Else 'Game init reset
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- End If
- Else 'Multiball Play
- DropTarget1.UserValue = 0
- AwardTripleJackpot
- StartDropTargetResetTimer
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- End If
- SetLastSwitchHit "DropTarget1"
- End Sub
- Sub DropTarget2_Hit
- If debugMultiball Then debug.print "*****SUB:DropTarget2_Hit"
- AddBonusLights
- If bMultiBallMode = False Then 'Normal Play
- 'Addscore DropTargetScore
- If (DropTarget2.UserValue = 1) Then
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- PlaySound "tna_toptarget"
- Else 'Game init reset
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- End If
- Else 'Multiball Play
- DropTarget2.UserValue = 0
- AwardDoubleJackpot
- StartDropTargetResetTimer
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- End If
- SetLastSwitchHit "DropTarget2"
- End Sub
- Sub DropTarget3_Hit
- If debugMultiball Then debug.print "*****SUB:DropTarget3_Hit"
- AddBonusLights
- If bMultiBallMode = False Then 'If in Normal Play
- 'Addscore DropTargetScore
- If (bLockIsLit = True) Then 'Multiball start
- SetBallsOnPlayfield 3
- Debug.print "BallsonPlayfieldMulti" & " : " & BallsOnPlayfield
- bBallSaverReady = True
- bAutoPlunger = True
- EnableBallSaver BallSaverTime
- ChangeGI "green"
- vpmtimer.addtimer 1000, "StartMultiball '"
- DMD "", eNone, Centerline(1, ("MULTIBALL")), eNone, "", eNone, CenterLine(3, FormatScore(Jackpot)), eBlinkFast, 1000, True, "tna_multiball"
- 'if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations)
- 'set the bAutoPlunger flag to kick the ball in play automatically
- DOF 129, DOFPulse
- 'PlaySong "m_multiball", 1
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- DropTarget1.UserValue = 0
- DropTarget1.IsDropped = 1
- TargetBlocker1.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 137, DOFPulse, DOFContactors)
- DropTarget2.UserValue = 0
- DropTarget2.IsDropped = 1
- TargetBlocker2.IsDropped = 1
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- DropTarget3.UserValue = 0
- DropTarget3.IsDropped = 1
- Else 'Game init reset
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- PlaySound "tna_toptarget"
- End If
- Else 'Multiball Play
- DropTarget3.UserValue = 0
- AwardJackpot
- StartDropTargetResetTimer
- PlaySound SoundFXDOF("fx_droptarget", 138, DOFPulse, DOFContactors)
- End If
- SetLastSwitchHit "DropTarget3"
- End Sub
- Sub MultiballOptoCheck_Hit 'During Multiball, raise a drop target after x sec of no target hits
- If debugMultiball Then debug.print "*****SUB:MultiballOptoCheck_Hit"
- If bMultiBallMode = True Then
- If debugMultiball Then debug.print "Calling StartDropTargetResetTimer"
- StartDropTargetResetTimer
- End If
- If (DropTarget1.TimerEnabled = True) Then
- If debugMultiball Then debug.print "Reseting DropTarget1 3 sec timer"
- DropTarget1.TimerEnabled = True
- DropTarget1.TimerInterval = 3000
- DropTarget1.TimerEnabled = True
- End If
- End Sub
- Sub StartDropTargetResetTimer 'During Multiball, raise a drop target after x sec of no target hits
- If debugMultiball Then debug.print "*****SUB:StartDropTargetResetTimer"
- DropTarget3.TimerEnabled = False
- DropTarget3.TimerInterval = DropTargetResetTime*1000
- DropTarget3.TimerEnabled = True
- End Sub
- Sub DropTarget3_Timer 'During Multiball, raise a drop target after x sec of no target hits
- If debugMultiball Then debug.print "*****SUB:DropTarget3_Timer"
- If bMultiBallMode = False Then 'Multiball over so stop resetting target
- DropTarget3.TimerEnabled = False
- Else
- If DropTarget1.IsDropped = 1 Then
- DropTarget1.IsDropped = 0
- DropTarget1.UserValue = 1
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- ElseIf DropTarget2.IsDropped = 1 Then
- DropTarget2.IsDropped = 0
- DropTarget2.UserValue = 1
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- ElseIf DropTarget3.IsDropped = 1 Then
- DropTarget3.IsDropped = 0
- DropTarget3.UserValue = 1
- PlaySound SoundFXDOF("fx_droptarget", 136, DOFPulse, DOFContactors)
- End If
- End If
- End Sub
- ''*********************
- '' Section; Section; Grid Targets
- ''*********************
- Dim bGridReady
- Sub GridTargetx_hit()
- PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
- If debugGrid Then debug.print "*****SUB:" & "GridTargetx_hit"
- Select Case ReactorState(CurrentPlayer)
- Case 0: 'Targeted
- If lx1.State = 2 then
- SetLight lx1, "green", 1
- SetLight lx2, "blue", 2
- 'lx1.state = 1
- 'lx2.state = 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lx2.State = 2 then
- SetLight lx2, "green", 1
- SetLight lx3, "blue", 2
- 'lx2.state = 1
- 'lx3.state = 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lx3.State = 2 then
- SetLight lx3, "green", 1
- 'lx3.state = 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 1: 'Ready
- Playsound "tna_targetreject"
- Case 2: 'Started
- If lx1.State = 2 then
- SetLight lx1, "purple", 1
- SetLight lx2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lx2.State = 2 then
- SetLight lx2, "purple", 1
- SetLight lx3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lx3.State = 2 then
- SetLight lx3, "purple", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 3: 'Critical
- If lx1.State = 2 then
- SetLight lx1, "purple", 1
- SetLight lx2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lx2.State = 2 then
- SetLight lx2, "purple", 1
- SetLight lx3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lx3.State = 2 then
- SetLight lx3, "purple", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 4: 'Destroyed
- End Select
- SetLastSwitchHit "GridTargetx"
- End Sub
- Sub GridTargety_hit()
- PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
- If debugGrid Then debug.print "*****SUB:" & "GridTargety_hit"
- Select Case ReactorState(CurrentPlayer)
- Case 0: 'Targeted
- If ly1.State = 2 then
- SetLight ly1, "green", 1
- SetLight ly2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf ly2.State = 2 then
- SetLight ly2, "green", 1
- SetLight ly3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf ly3.State = 2 then
- SetLight ly3, "green", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 1: 'Ready
- Playsound "tna_targetreject"
- Case 2: 'Started
- If ly1.State = 2 then
- SetLight ly1, "purple", 1
- SetLight ly2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf ly2.State = 2 then
- SetLight ly2, "purple", 1
- SetLight ly3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf ly3.State = 2 then
- SetLight ly3, "purple", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 3: 'Critical
- If ly1.State = 2 then
- SetLight ly1, "purple", 1
- SetLight ly2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf ly2.State = 2 then
- SetLight ly2, "purple", 1
- SetLight ly3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf ly3.State = 2 then
- SetLight ly3, "purple", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 4: 'Destroyed
- End Select
- SetLastSwitchHit "GridTargety"
- End Sub
- Sub GridTargetz_hit()
- PlaySound SoundFXDOF("", 109, DOFPulse, DOFTargets)
- If debugGrid Then debug.print "*****SUB:" & "GridTargetz_hit"
- Select Case ReactorState(CurrentPlayer)
- Case 0: 'Targeted
- If lz1.State = 2 then
- SetLight lz1, "green", 1
- SetLight lz2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lz2.State = 2 then
- SetLight lz2, "green", 1
- SetLight lz3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lz3.State = 2 then
- SetLight lz3, "green", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 1: 'Ready
- Playsound "tna_targetreject"
- Case 2: 'Started
- If lz1.State = 2 then
- SetLight lz1, "purple", 1
- SetLight lz2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lz2.State = 2 then
- SetLight lz2, "purple", 1
- SetLight lz3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lz3.State = 2 then
- SetLight lz3, "purple", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 3: 'Critical
- If lz1.State = 2 then
- SetLight lz1, "purple", 1
- SetLight lz2, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lz2.State = 2 then
- SetLight lz2, "purple", 1
- SetLight lz3, "blue", 2
- AddScore GridTargetScore
- AddBonusLights2
- ElseIf lz3.State = 2 then
- SetLight lz3, "purple", 1
- AddScore GridTargetScore
- AddBonusLights2
- Else
- Playsound "tna_targetreject"
- End If
- CheckGrid
- Case 4: 'Destroyed
- End Select
- SetLastSwitchHit "GridTargetz"
- End Sub
- Dim GridSetup
- Sub ResetGrid()
- GridSetup = ReactorLevel(CurrentPlayer) + ReactorDifficulty - 1
- If debugGrid Then debug.print "*****SUB:" & "ResetGrid " & GridSetup
- bGridReady = 0
- Select Case GridSetup:
- Case 1: '3 targets
- SetLight lx1, "green", 1
- SetLight lx2, "green", 1
- SetLight lx3, "blue", 2
- SetLight ly1, "green", 1
- SetLight ly2, "green", 1
- SetLight ly3, "blue", 2
- SetLight lz1, "green", 1
- SetLight lz2, "green", 1
- SetLight lz3, "blue", 2
- Case 2: '4 targets
- SetLight lx1, "green", 1
- SetLight lx2, "blue", 2
- SetLight lx3, "green", 0
- SetLight ly1, "green", 1
- SetLight ly2, "green", 1
- SetLight ly3, "blue", 2
- SetLight lz1, "green", 1
- SetLight lz2, "green", 1
- SetLight lz3, "blue", 2
- Case 3: '5 targets
- SetLight lx1, "green", 1
- SetLight lx2, "blue", 2
- SetLight lx3, "green", 0
- SetLight ly1, "green", 1
- SetLight ly2, "blue", 2
- SetLight ly3, "green", 0
- SetLight lz1, "green", 1
- SetLight lz2, "green", 1
- SetLight lz3, "blue", 2
- Case 4: '6 targets
- SetLight lx1, "green", 1
- SetLight lx2, "blue", 2
- SetLight lx3, "green", 0
- SetLight ly1, "green", 1
- SetLight ly2, "blue", 2
- SetLight ly3, "green", 0
- SetLight lz1, "green", 1
- SetLight lz2, "blue", 2
- SetLight lz3, "green", 0
- Case 5: '7 targets
- SetLight lx1, "blue", 2
- SetLight lx2, "green", 0
- SetLight lx3, "green", 0
- SetLight ly1, "green", 1
- SetLight ly2, "blue", 2
- SetLight ly3, "green", 0
- SetLight lz1, "green", 1
- SetLight lz2, "blue", 2
- SetLight lz3, "green", 0
- Case 6: '8 targets
- SetLight lx1, "blue", 2
- SetLight lx2, "green", 0
- SetLight lx3, "green", 0
- SetLight ly1, "blue", 2
- SetLight ly2, "green", 0
- SetLight ly3, "green", 0
- SetLight lz1, "green", 1
- SetLight lz2, "blue", 2
- SetLight lz3, "green", 0
- Case Else:
- SetLight lx1, "blue", 2
- SetLight lx2, "green", 0
- SetLight lx3, "green", 0
- SetLight ly1, "blue", 2
- SetLight ly2, "green", 0
- SetLight ly3, "green", 0
- SetLight lz1, "blue", 2
- SetLight lz2, "green", 0
- SetLight lz3, "green", 0
- End Select
- End Sub
- Sub StartGridJackpot()
- If debugGrid Then debug.print "*****SUB:" & "StartGridJackpot"
- 'Set Grid Color
- SetLight lx1, "blue", 2
- SetLight lx2, "purple", 0
- SetLight lx3, "purple", 0
- SetLight ly1, "blue", 2
- SetLight ly2, "purple", 0
- SetLight ly3, "purple", 0
- SetLight lz1, "blue", 2
- SetLight lz2, "purple", 0
- SetLight lz3, "purple", 0
- '
- ' lx1.State = 2
- ' lx2.State = 0
- ' lx3.State = 0
- '
- ' ly1.State = 2
- ' ly2.State = 0
- ' ly3.State = 0
- '
- ' lz1.State = 2
- ' lz2.State = 0
- ' lz3.State = 0
- End Sub
- Dim Playerx1(4)
- Dim Playerx2(4)
- Dim Playerx3(4)
- Dim Playery1(4)
- Dim Playery2(4)
- Dim Playery3(4)
- Dim Playerz1(4)
- Dim Playerz2(4)
- Dim Playerz3(4)
- Sub InitGridPlayerData
- Dim i
- For i = 1 To MaxPlayers
- Playerx1(i) = 0
- Playerx2(i) = 0
- Playerx3(i) = 0
- Playery1(i) = 0
- Playery2(i) = 0
- Playery3(i) = 0
- Playerz1(i) = 0
- Playerz2(i) = 0
- Playerz3(i) = 0
- Next
- End Sub
- Sub SaveGridData
- If debugGrid Then debug.print "*****SUB:" & "SaveGridState"
- Playerx1(CurrentPlayer) = lx1.State
- Playerx2(CurrentPlayer) = lx2.State
- Playerx3(CurrentPlayer) = lx3.State
- Playery1(CurrentPlayer) = ly1.State
- Playery2(CurrentPlayer) = ly2.State
- Playery3(CurrentPlayer) = ly3.State
- Playerz1(CurrentPlayer) = lz1.State
- Playerz2(CurrentPlayer) = lz2.State
- Playerz3(CurrentPlayer) = lz3.State
- End Sub
- Sub RestoreGridData
- If (BallsRemaining(CurrentPlayer) = BallsPerGame) Then 'If first ball for new player
- ResetGrid
- ElseIf ReactorState(CurrentPlayer) >= 2 Then
- SetLightGrid lx1, "purple", Playerx1(CurrentPlayer)
- SetLightGrid lx2, "purple", Playerx2(CurrentPlayer)
- SetLightGrid lx3, "purple", Playerx3(CurrentPlayer)
- SetLightGrid ly1, "purple", Playery1(CurrentPlayer)
- SetLightGrid ly2, "purple", Playery2(CurrentPlayer)
- SetLightGrid ly3, "purple", Playery3(CurrentPlayer)
- SetLightGrid lz1, "purple", Playerz1(CurrentPlayer)
- SetLightGrid lz2, "purple", Playerz2(CurrentPlayer)
- SetLightGrid lz3, "purple", Playerz3(CurrentPlayer)
- Else
- SetLightGrid lx1, "green", Playerx1(CurrentPlayer)
- SetLightGrid lx2, "green", Playerx2(CurrentPlayer)
- SetLightGrid lx3, "green", Playerx3(CurrentPlayer)
- SetLightGrid ly1, "green", Playery1(CurrentPlayer)
- SetLightGrid ly2, "green", Playery2(CurrentPlayer)
- SetLightGrid ly3, "green", Playery3(CurrentPlayer)
- SetLightGrid lz1, "green", Playerz1(CurrentPlayer)
- SetLightGrid lz2, "green", Playerz2(CurrentPlayer)
- SetLightGrid lz3, "green", Playerz3(CurrentPlayer)
- End If
- End Sub
- Sub SetLightGrid (obj, col, state)
- If state = 2 then
- SetLight obj, "blue", state
- Else
- SetLight obj, col, state
- End If
- End Sub
- Sub TestHitTarget
- If debugGrid Then debug.print "*****SUB:" & "TestHitTarget"
- GridTargetx_hit
- GridTargetx_hit
- GridTargetx_hit
- GridTargety_hit
- GridTargety_hit
- GridTargety_hit
- GridTargetz_hit
- GridTargetz_hit
- GridTargetz_hit
- ' lx1.State = 1
- ' lx2.State = 1
- ' lx3.State = 1
- '
- ' ly1.State = 1
- ' ly2.State = 1
- ' ly3.State = 1
- '
- ' lz1.State = 1
- ' lz2.State = 1
- ' lz3.State = 1
- CheckGrid
- end Sub
- Sub CheckGrid
- dim tmp
- tmp = 0
- If lx1.State = 1 then tmp = tmp + 1
- If lx2.State = 1 then tmp = tmp + 1
- If lx3.State = 1 then tmp = tmp + 1
- If ly1.State = 1 then tmp = tmp + 1
- If ly2.State = 1 then tmp = tmp + 1
- If ly3.State = 1 then tmp = tmp + 1
- If lz1.State = 1 then tmp = tmp + 1
- If lz2.State = 1 then tmp = tmp + 1
- If lz3.State = 1 then tmp = tmp + 1
- If debugGrid Then debug.print "*****SUB:CheckGrid(), Grid=" & tmp
- If tmp = 9 Then
- If ReactorState(CurrentPlayer) = 0 Then
- SetReactorReady
- ElseIf (ReactorState(CurrentPlayer) = 2) or (ReactorState(CurrentPlayer) = 3) Then
- ReactorJackpot
- End If
- AddBonusLights
- End If
- End Sub
- Sub ByPassGrid
- If debugGrid Then debug.print "*****SUB:ByPassGrid"
- If ReactorState(CurrentPlayer) = 0 Then
- SetReactorReady
- End If
- End Sub
- Sub ReactorJackpot
- If debugGrid Then debug.print "*****SUB:" & "ReactorJackpot"
- DMD "", eNone, Centerline(1, ("REACTOR JKPOT")), eNone, "", eNone, CenterLine(3, FormatScore(.5*ReactorValue(CurrentPlayer))), eBlinkFast, 1000, True, "tna_reactorjackpot"
- AddScore (.5*ReactorValue(CurrentPlayer))
- StartGridJackpot
- End Sub
- Sub ReadyGrid 'Blinking to Left Scoop
- If debugGrid Then debug.print "*****SUB:" & "ReadyGrid"
- SetLight lx1, "", 0
- SetLight lx2, "", 0
- SetLight lx3, "", 0
- SetLight ly1, "", 0
- SetLight ly2, "", 0
- SetLight ly3, "", 0
- SetLight lz1, "", 0
- SetLight lz2, "", 0
- SetLight lz3, "", 0
- SetLight lx3, "blue", 2
- SetLight ly2, "blue", 2
- SetLight lz1, "blue", 2
- bGridReady = 1
- End Sub
- ''*********************
- '' Section; Bonus Lights
- ''*********************
- 'Bonus light TEST
- lbonus1.timerinterval = 500
- 'lbonus1.timerenabled = 1
- Sub lBonus1_timer
- AddBonusLights
- End Sub
- Sub AddBonusLights2
- playsound "tna_target"
- AddBonusLights
- End Sub
- Sub AddBonusLights
- Dim tmp
- ' Dim xmultiplier
- ' xMultiplier = BallsOnPlayfield
- ' If xMultiplier = 0 then xMultiplier = 1
- BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + 1 '+ (1 * xMultiplier)
- tmp = BonusPoints(CurrentPlayer) mod 10
- Select Case tmp
- Case 1:
- lBonus1.State = 1
- lBonus2.State = 0
- lBonus3.State = 0
- lBonus4.State = 0
- lBonus5.State = 0
- lBonus6.State = 0
- lBonus7.State = 0
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- Case 2:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 0
- lBonus4.State = 0
- lBonus5.State = 0
- lBonus6.State = 0
- lBonus7.State = 0
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- Case 3:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 0
- lBonus5.State = 0
- lBonus6.State = 0
- lBonus7.State = 0
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- Case 4:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 1
- lBonus5.State = 0
- lBonus6.State = 0
- lBonus7.State = 0
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- Case 5:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 1
- lBonus5.State = 1
- lBonus6.State = 0
- lBonus7.State = 0
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- Case 6:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 1
- lBonus5.State = 1
- lBonus6.State = 1
- lBonus7.State = 0
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- Case 7:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 1
- lBonus5.State = 1
- lBonus6.State = 1
- lBonus7.State = 1
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- Case 8:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 1
- lBonus5.State = 1
- lBonus6.State = 1
- lBonus7.State = 1
- lBonus8.State = 1
- lBonus9.State = 0
- lBonus0.State= 0
- Case 9:
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 1
- lBonus5.State = 1
- lBonus6.State = 1
- lBonus7.State = 1
- lBonus8.State = 1
- lBonus9.State = 1
- lBonus0.State= 0
- Case 0:
- If BonusPoints(CurrentPlayer) > 0 Then
- lBonus1.State = 1
- lBonus2.State = 1
- lBonus3.State = 1
- lBonus4.State = 1
- lBonus5.State = 1
- lBonus6.State = 1
- lBonus7.State = 1
- lBonus8.State = 1
- lBonus9.State = 1
- lBonus0.State= 1
- End If
- End Select
- If BonusPoints(CurrentPlayer) > 150 Then
- lBonus50.State= 1
- lBonus40.State= 1
- lBonus30.State= 1
- lBonus20.State= 1
- lBonus10.State= 1
- ElseIf BonusPoints(CurrentPlayer) > 140 Then
- lBonus50.State= 1
- lBonus40.State= 1
- lBonus30.State= 1
- lBonus20.State= 1
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 130 Then
- lBonus50.State= 1
- lBonus40.State= 1
- lBonus30.State= 1
- lBonus20.State= 0
- lBonus10.State= 1
- ElseIf BonusPoints(CurrentPlayer) > 120 Then
- lBonus50.State= 1
- lBonus40.State= 1
- lBonus30.State= 1
- lBonus20.State= 0
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 110 Then
- lBonus50.State= 1
- lBonus40.State= 1
- lBonus30.State= 0
- lBonus20.State= 1
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 100 Then
- lBonus50.State= 1
- lBonus40.State= 1
- lBonus30.State= 0
- lBonus20.State= 0
- lBonus10.State= 1
- ElseIf BonusPoints(CurrentPlayer) > 90 Then
- lBonus50.State= 1
- lBonus40.State= 1
- lBonus30.State= 0
- lBonus20.State= 0
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 80 Then
- lBonus50.State= 1
- lBonus40.State= 0
- lBonus30.State= 1
- lBonus20.State= 0
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 70 Then
- lBonus50.State= 1
- lBonus40.State= 0
- lBonus30.State= 0
- lBonus20.State= 1
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 60 Then
- lBonus50.State= 1
- lBonus40.State= 0
- lBonus30.State= 0
- lBonus20.State= 0
- lBonus10.State= 1
- ElseIf BonusPoints(CurrentPlayer) > 50 Then
- lBonus50.State= 1
- lBonus40.State= 0
- lBonus30.State= 0
- lBonus20.State= 0
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 40 Then
- lBonus50.State= 0
- lBonus40.State= 1
- lBonus30.State= 0
- lBonus20.State= 0
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 30 Then
- lBonus50.State= 0
- lBonus40.State= 0
- lBonus30.State= 1
- lBonus20.State= 0
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 20 Then
- lBonus50.State= 0
- lBonus40.State= 0
- lBonus30.State= 0
- lBonus20.State= 1
- lBonus10.State= 0
- ElseIf BonusPoints(CurrentPlayer) > 10 Then
- lBonus50.State= 0
- lBonus40.State= 0
- lBonus30.State= 0
- lBonus20.State= 0
- lBonus10.State= 1
- Else
- lBonus50.State= 0
- lBonus40.State= 0
- lBonus30.State= 0
- lBonus20.State= 0
- lBonus10.State= 0
- End If
- End Sub
- Sub ResetBonusLights
- BonusPoints(CurrentPlayer) = 0
- lBonus1.State = 0
- lBonus2.State = 0
- lBonus3.State = 0
- lBonus4.State = 0
- lBonus5.State = 0
- lBonus6.State = 0
- lBonus7.State = 0
- lBonus8.State = 0
- lBonus9.State = 0
- lBonus0.State= 0
- lBonus10.State= 0
- lBonus20.State= 0
- lBonus30.State= 0
- lBonus40.State= 0
- lBonus50.State= 0
- End Sub
- ''*********************
- '' Section; Reactor
- ''*********************
- ' ReactorState overview
- 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
- 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
- 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
- 'Critical 3 - targets not active, no check grid, gates 2-way
- 'Destroyed 4 -
- Dim ReactorState(4)
- Dim ReactorLevel(4)
- Dim ReactorPercent(4)
- Dim ReactorDestroyCount(4)
- Dim ReactorValue(4)
- Dim ReactorValueMax(4)
- Dim LastReactorBeforeDifficultyKicksIn
- Const ReactorSpinnerPercent = 2
- Const ReactorSwitchPercent = 16
- Const ReactorValue1 = 25000
- Const ReactorValue2 = 37500
- Const ReactorValue3 = 50000 'Max = 150,000
- Const ReactorValue4 = 62500
- Const ReactorValue5 = 75000
- Const ReactorValue6 = 87500
- Const ReactorValue7 = 100000
- Const ReactorValue8 = 112500
- Const ReactorValue9 = 125000
- Const ReactorMaxMultiplier = 3
- Sub ResetReactor
- debug.print "*****SUB:" & "ResetReactor [ReactorState(CurrentPlayer)=0]"
- dim tmp
- ReactorState(CurrentPlayer) = 0
- SetReactorPercent -1
- SetReactorDestroyCount 0
- SetReactorInserts 0
- RestoreRAD
- If ReactorDifficulty = 1 Then
- LastReactorBeforeDifficultyKicksIn = 6
- Else
- LastReactorBeforeDifficultyKicksIn = 3
- End If
- 'Value of this reactor
- tmp = "ReactorValue" & ReactorLevel(CurrentPlayer) 'ReactorValue1 - 9
- ReactorValue(CurrentPlayer) = eval(tmp)
- ReactorValueMax(CurrentPlayer) = ReactorValue(CurrentPlayer) * ReactorMaxMultiplier
- tReactorValue.text = ReactorValue(CurrentPlayer)
- 'Light Reactor
- Select Case ReactorLevel(CurrentPlayer)
- Case 1:
- SetLight lReactor1, "green", 2
- Case 2:
- SetLight lReactor1, "red", 1
- SetLight lReactor2, "green", 2
- Case 3:
- SetLight lReactor2, "red", 1
- SetLight lReactor3, "green", 2
- Case 4:
- SetLight lReactor3, "red", 1
- SetLight lReactor4, "green", 2
- Case 5:
- SetLight lReactor4, "red", 1
- SetLight lReactor5, "green", 2
- Case 6:
- SetLight lReactor5, "red", 1
- SetLight lReactor6, "green", 2
- Case 7
- SetLight lReactor6, "red", 1
- SetLight lReactor7, "green", 2
- Case 8:
- SetLight lReactor7, "red", 1
- SetLight lReactor8, "green", 2
- Case 9:
- SetLight lReactor8, "red", 1
- SetLight lReactor9, "green", 2
- Case 10:
- SetLight lReactor9, "red", 1
- End Select
- End Sub
- 'Sub DisableReactor
- ' If debugReactor then debug.print "*****SUB:" & "DisableReactor [ReactorState(CurrentPlayer)=0]"
- ' ReactorState(CurrentPlayer) = 0
- ' AddReactorPercent 0
- 'End Sub
- Sub SetReactorReady 'Called when Grid is complete
- If debugReactor then debug.print "*****SUB:" & "SetReactorReady [ReactorState(CurrentPlayer)=1]"
- ReactorState(CurrentPlayer) = 1
- lStart.state = 2
- ReadyGrid
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "REACTOR READY"), eBlinkfast, 1800, True, "tna_reactorready"
- End Sub
- Sub CheckReactorStart 'Checked when left scoop hit
- If ReactorState(CurrentPlayer) = 1 Then
- ReactorState(CurrentPlayer) = 2 'Reactor Started
- lStart.state = 0
- GIReactorStarted
- StartGridJackpot
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "REACTOR START"), eBlinkfast, 1800, True, "tna_reactorunlockedmod"
- SetReactorInserts 2
- ' If MaxTargetFlag = False Then
- AddReactorPercent 0
- If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
- fRones.TimerInterval = ReactorPercentLossTime * 1000
- fRones.TimerEnabled = True
- StartReactorLeftLoopInserts
- Else 'ReactorLevel(CurrentPlayer) 1 and 2 and e
- StartReactorLoopInserts
- End If
- ' Else
- ' SetReactorPercent 100
- ' StartMAxTarget
- ' End If
- End If
- If debugReactor then debug.print "*****SUB:" & "CheckReactorStart [ReactorState(CurrentPlayer)=" & ReactorState(CurrentPlayer) & "]"
- End Sub
- Sub fRones_Timer
- AddReactorPercent - 1
- End Sub
- Sub StartReactorLoopInserts
- lLoopL.state = 2
- lLoopR.state = 2
- lTria1.state = 2
- lTria2.state = 2
- lTria3.state = 2
- lTria4.state = 2
- lTria5.state = 2
- lTria6.state = 2
- End Sub
- Sub ResetReactorLoopInserts
- lLoopL.state = 0
- lLoopR.state = 0
- lTria1.state = 0
- lTria2.state = 0
- lTria3.state = 0
- lTria4.state = 0
- lTria5.state = 0
- lTria6.state = 0
- End Sub
- Sub StartReactorLeftLoopInserts
- If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
- lLoopL.state = 2
- lTria1.state = 2
- lTria2.state = 2
- lTria3.state = 2
- lLoopR.state = 0
- lTria4.state = 0
- lTria5.state = 0
- lTria6.state = 0
- End If
- End Sub
- Sub StartReactorRightLoopInserts
- If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
- lLoopR.state = 2
- lTria4.state = 2
- lTria5.state = 2
- lTria6.state = 2
- lLoopL.state = 0
- lTria1.state = 0
- lTria2.state = 0
- lTria3.state = 0
- End If
- End Sub
- Sub SwitchReactorLoopInserts
- If ((ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn) AND (ReactorState(CurrentPlayer) = 2)) Then
- If lLoopL.State = 2 Then
- StartReactorRightLoopInserts
- ElseIf lLoopR.State = 2 Then
- StartReactorLeftLoopInserts
- End If
- End If
- End Sub
- Sub ClearReactorPercent
- fRtens.ImageA = "blank"
- fRones.ImageA = "blank"
- End Sub
- Dim drtens, drones
- Sub SetReactorPercent (value)
- If debugReactor then debug.print "*****SUB:" & "SetReactorPercent " & value
- ReactorPercent(CurrentPlayer) = value
- If ReactorPercent(CurrentPlayer) > 100 Then ReactorPercent(CurrentPlayer) = 100
- If ReactorPercent(CurrentPlayer) = -1 Then
- ClearReactorPercent
- ReactorPercent(CurrentPlayer) = 0
- fRtens.TimerEnabled = False
- fRones.TimerEnabled = False
- ElseIf ((ReactorPercent(CurrentPlayer) = 0) and (ReactorState(CurrentPlayer) <> 2)) Then
- ClearReactorPercent
- ElseIf ReactorPercent(CurrentPlayer) < 100 Then
- drtens = Int(ReactorPercent(CurrentPlayer)/10)
- drones = Int(ReactorPercent(CurrentPlayer)-drtens*10)
- ' dReactor1.SetValue (drtens + 1)
- ' dReactor2.SetValue (drones + 1)
- fRtens.ImageA = Eval(drtens)
- fRones.ImageA = Eval(drones)
- Else 'ReactorPercent(CurrentPlayer) = 100
- dReactor1.SetValue (0)
- dReactor2.SetValue (0)
- fRtens.ImageA = "-"
- fRones.ImageA = "---"
- fRtens.TimerInterval = 250
- fRtens.TimerEnabled = True
- fRones.TimerEnabled = False
- End If
- CheckReactorCritical
- End Sub
- Sub AddReactorPercent (value)
- Dim obj
- If debugReactor then debug.print "*****SUB:" & "AddReactorPercent " & value
- ReactorPercent(CurrentPlayer) = ReactorPercent(CurrentPlayer) + value
- If ReactorPercent(CurrentPlayer) > 100 Then
- ReactorPercent(CurrentPlayer) = 100
- ElseIf ReactorPercent(CurrentPlayer) < 0 Then
- ReactorPercent(CurrentPlayer) = 0
- End If
- If ReactorPercent(CurrentPlayer) < 100 Then
- drtens = Int(ReactorPercent(CurrentPlayer)/10)
- drones = Int(ReactorPercent(CurrentPlayer)-drtens*10)
- ' dReactor1.SetValue (drtens + 1)
- ' dReactor2.SetValue (drones + 1)
- fRtens.ImageA = Eval(drtens)
- fRones.ImageA = Eval(drones)
- Else
- ' dReactor1.SetValue (0)
- ' dReactor2.SetValue (0)
- fRtens.ImageA = "-"
- fRones.ImageA = "---"
- fRtens.TimerInterval = 250
- fRtens.TimerEnabled = True
- fRones.TimerEnabled = False
- End If
- 'Increase reactor inserts as percentage goes up
- ' For each obj in aInsertsReactor
- ' If ReactorPercent(CurrentPlayer) < 60 Then
- ' obj.intensityscale = ReactorPercent(CurrentPlayer)/200
- ' Else
- ' obj.intensityscale = ReactorPercent(CurrentPlayer)/100
- ' End If
- ' Next
- CheckReactorCritical
- End Sub
- Dim fRtenscount
- Sub fRtens_Timer
- fRtenscount = (fRtenscount + 1) Mod 2
- If fRtenscount = 0 Then
- fRtens.ImageA = "---"
- fRones.ImageA = "-"
- Else
- fRtens.ImageA = "-"
- fRones.ImageA = "---"
- End If
- End Sub
- Sub AddReactorPercentForSpinner
- AddReactorPercent ReactorSpinnerPercent
- End Sub
- Sub AddReactorPercentForSwitch
- debug.print
- Dim value
- If ReactorLevel(CurrentPlayer) < 7 Then
- value = ReactorSwitchPercent - ((ReactorLevel(CurrentPlayer) - 1)*2)
- Else
- value = 5
- End IF
- AddReactorPercent value
- End Sub
- Sub CheckReactorCritical 'Called when reactor targets percent increased
- If debugReactor then debug.print "*****SUB:" & "CheckReactorCritical"
- If ReactorState(CurrentPlayer) = 2 Then
- If ReactorPercent(CurrentPlayer) >= 100 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "CRITICAL"), eBlinkfast, 1800, True, "tna_reactorcriticalvoice"
- SetReactorCritical
- StartReactorCriticalMusic
- End If
- End If
- End Sub
- Sub SetReactorCritical
- If debugReactor then debug.print "*****SUB:" & "SetReactorCritical [ReactorState(CurrentPlayer)=3]"
- SaveRAD
- ReactorState(CurrentPlayer) = 3 'Reactor Critical
- SetReactorDestroyCount ReactorLevel(CurrentPlayer)
- SetReactorInserts 1
- ResetReactorLoopInserts
- 'Light Reactor
- 'Extra ball Award
- If ReactorLevel(CurrentPlayer) = ExtraBallAward1 Then
- AwardExtraBall
- ElseIf ReactorLevel(CurrentPlayer) = ExtraBallAward2 Then
- AwardExtraBall
- End If
- Select Case ReactorLevel(CurrentPlayer)
- Case 1:
- SetLight lReactor1, "red", 2
- Case 2:
- SetLight lReactor2, "red", 2
- Case 3:
- SetLight lReactor3, "red", 2
- Case 4:
- SetLight lReactor4, "red", 2
- Case 5:
- SetLight lReactor5, "red", 2
- Case 6:
- SetLight lReactor6, "red", 2
- Case 7
- SetLight lReactor7, "red", 2
- Case 8:
- SetLight lReactor8, "red", 2
- Case 9:
- SetLight lReactor9, "red", 2
- End Select
- End Sub
- Sub SetReactorDestroyCount (value) 'Setup the reactor critical inserts 1-9
- If debugReactor then debug.print "*****SUB:" & "SetReactorDestroyCount " & value
- dim tmp, tmp2
- ReactorDestroyCount(CurrentPlayer) = 0
- tmp2 = value
- if tmp2 > 7 then tmp2 = 7 'There are only 7 targets so blink up to 7 inserts
- do while ReactorDestroyCount(CurrentPlayer) < tmp2
- tmp = INT(RND * 7)
- If debugReactor then debug.print "Reactor Target = " & tmp
- if ReactorLevel(CurrentPlayer) < 3 AND tmp < 3 then 'Dont light the RAD targets on first 2 reactor levels
- tmp = tmp + 3
- If debugReactor then debug.print "Reactor Target Changed = " & tmp
- end if
- If debugReactor then debug.print tmp &" : "& tmp2
- if aDTGT(tmp).state = 0 then
- 'aDTGT(tmp).state = 2
- SetLight aDTGT(tmp), "white", 2
- if (tmp < 5) Then
- aDFTGT(tmp).state = 2
- Else
- aDFTGT(5).state = 2
- End If
- ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) + 1
- End If
- loop
- ReactorDestroyCount(CurrentPlayer) = value
- If debugReactor then debug.print " " & "ReactorDestroyCount(CurrentPlayer) " & value
- ''ttReactorTgt.text = "Tgts = " &ReactorDestroyCount(CurrentPlayer)
- End Sub
- Sub DecreaseReactorDestroyCount (obj, obj2)
- If ReactorState(CurrentPlayer) = 3 Then
- If ReactorDestroyCount(CurrentPlayer) <=7 Then
- 'Special case since Bumper has 2 inserts. Check both
- If obj.name = "lD3" Then
- If lD3.state = 2 Then
- lD3.state = 0
- ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
- PlaySound "tna_toptarget"
- ElseIf lD4.state = 2 Then
- lD4.state = 0
- ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
- PlaySound "tna_toptarget"
- End If
- 'Check if bumper should be turned off
- If (ld3.state = 0) AND (ld4.state = 0) then obj2.state = 0
- ElseIf obj.State = 2 Then
- obj.State = 0
- obj2.State = 0
- ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
- PlaySound "tna_toptarget"
- Else 'target not lit
- Playsound "tna_targetreject"
- End If
- Else 'Keep all inserts lit, decrease count until below 7
- ReactorDestroyCount(CurrentPlayer) = ReactorDestroyCount(CurrentPlayer) - 1
- PlaySound "tna_toptarget"
- End If
- If debugReactor then debug.print "*****SUB:" & "DecreaseReactorDestroyCount:(), ReactorDestroyCount(CurrentPlayer)=" & ReactorDestroyCount(CurrentPlayer)
- if ReactorDestroyCount(CurrentPlayer) = 0 Then
- If debugReactor then debug.print " Reactor Destroyed!!!"
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "DESTROYED!!!"), eBlinkfast, 1800, True, "tna_reactordestroyed"
- AddScore ReactorValue(CurrentPlayer)
- AddScoreForReactor
- AddReactorBonus ReactorValue(CurrentPlayer)
- AddBonusLights
- ReactorLevel(CurrentPlayer) = ReactorLevel(CurrentPlayer) + 1
- 'Enable BallSave
- EnableBallSaver 10
- If ReactorLevel(CurrentPlayer) <= ReactorLevelMax Then
- GiReactorStopped
- ResetReactor
- ResetGrid
- StartMAxTarget
- stopsound "tna_reactorcritical"
- StartBackgroundMusic
- 'See if GRID completed previously
- 'vpmtimer.addtimer 1000, "CheckGrid '"
- Else 'Game Over! Game Over! Game Over
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "GAME OVER,MAN"), eBlinkfast, 60000, True, "tna_totalannihilation"
- ResetReactor
- ResetGrid
- stopsound "TNAreactorcritical"
- ReactorLevel(CurrentPlayer) = 10
- StartBackgroundMusic
- StartRainbow "all"
- LightSeqAttract.Play SeqRandom, 40, 1000, 0
- End If
- End if
- Else
- Playsound "tna_targetreject"
- End If
- 'ttReactorTgt.text = "ReacTgts = " &ReactorDestroyCount(CurrentPlayer)
- End Sub
- Sub SetReactorInserts (newstate)
- If debugReactor then debug.print "*****SUB:" & "SetReactorInserts " & newstate
- l5.state = newstate
- l6.state = newstate
- l7.state = newstate
- l8.state = newstate
- l9.state = newstate
- l10.state = newstate
- l11.state = newstate
- End sub
- Dim ReactorBonus
- Sub AddReactorBonus (value)
- ReactorBonus = ReactorBonus + value
- debug.print ReactorBonus
- End Sub
- Sub ResetReactorBonus
- ReactorBonus = 0
- End Sub
- '=============================================
- Dim LUStep
- Sub Slingshot1_Slingshot
- If debugReactor then debug.print "*****SUB:Slingshot1_Slingshot"
- PlaySound SoundFXDOF("fx_slingshot", 117, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
- AddscoreSpecial UpperSlingshotScore
- LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
- l8.TimerEnabled = True
- PlaySound "tna_reactorslingloud"
- LeftUpSling4.Visible = 1:LeftUpSling1.Visible = 0
- LUemk.RotX = 26
- LUStep = 0
- Slingshot1.TimerEnabled = True
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- SetLastSwitchHit "Slingshot1"
- End Sub
- Sub SlingShot1_Timer
- Select Case LUStep
- Case 1:LeftUpSLing4.Visible = 0:LeftUpSLing3.Visible = 1:LUemk.RotX = 14:
- Case 2:LeftUpSLing3.Visible = 0:LeftUpSLing2.Visible = 1:LUemk.RotX = 2:
- Case 3:LeftUpSLing2.Visible = 0:LeftUpSLing1.Visible = 1:LUemk.RotX = -10:SlingShot1.TimerEnabled = False
- End Select
- LUStep = LUStep + 1
- End Sub
- Dim RUStep
- Sub Slingshot2_Slingshot
- If debugReactor then debug.print "*****SUB:Slingshot2_Slingshot"
- PlaySound SoundFXDOF("fx_slingshot", 118, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
- AddscoreSpecial UpperSlingshotScore
- LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
- l8.TimerEnabled = True
- PlaySound "tna_reactorslingloud"
- RightUpSling4.Visible = 1:RightUpSling1.Visible = 0
- RUemk.RotX = 26
- RUStep = 0
- Slingshot2.TimerEnabled = True
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- SetLastSwitchHit "Slingshot2"
- End Sub
- Sub SlingShot2_Timer
- Select Case RUStep
- Case 1:RightUpSLing4.Visible = 0:RightUpSLing3.Visible = 1:RUemk.RotX = 14:
- Case 2:RightUpSLing3.Visible = 0:RightUpSLing2.Visible = 1:RUemk.RotX = 2:
- Case 3:RightUpSLing2.Visible = 0:RightUpSLing1.Visible = 1:RUemk.RotX = -10:SlingShot2.TimerEnabled = False
- End Select
- RUStep = RUStep + 1
- End Sub
- Sub ReactorWall_Hit
- If debugReactor then debug.print "*****SUB:ReactorWall_Hit"
- AddscoreSpecial UpperSlingshotScore
- LightSeqReactorInserts.Play SeqRandom, 20, 1, 0
- l8.TimerEnabled = True
- PlaySound "tna_reactorslingloud"
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- SetLastSwitchHit "ReactorWall"
- End Sub
- L8.TimerInterval = 500
- Sub l8_Timer
- LightSeqReactorInserts.StopPlay
- l8.TimerEnabled = False
- End Sub
- ''*********************
- '' Section; Reactor Max Targets
- ''*********************
- Sub Target1_Hit
- PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
- AddScoreSpecial TargetScore
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- Check123MaxTarget lt1
- SetLastSwitchHit "Target1"
- End Sub
- Sub Target2_Hit
- PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
- AddScoreSpecial TargetScore
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- Check123MaxTarget lt2
- SetLastSwitchHit "Target2"
- End Sub
- Sub Target3_Hit
- PlaySound SoundFXDOF("", 114, DOFPulse, DOFTargets)
- AddScoreSpecial TargetScore
- If ReactorState(CurrentPlayer) = 2 Then
- AddReactorPercentForSwitch
- End If
- Check123MaxTarget lt3
- SetLastSwitchHit "Target3"
- End Sub
- 'Dim MaxTargetFlag
- Sub ResetMaxTarget
- If debugReactor Then debug.print "*****SUB:ResetMaxTarget"
- SetLight lt1, "red", 0
- SetLight lt2, "red", 0
- SetLight lt3, "red", 0
- 'MaxTargetFlag = False
- End Sub
- Sub StartMAxTarget
- If debugReactor Then debug.print "*****SUB:StartMaxTarget"
- SetLight lt1, "red", 2
- SetLight lt2, "red", 0
- SetLight lt3, "red", 0
- 'MaxTargetFlag = False
- End Sub
- Sub Check123MaxTarget (obj)
- If debugReactor Then debug.print "*****SUB:Check123MaxTarget"
- If Obj.state = 2 Then
- obj.state = 1
- playsound "tna_toptarget"
- Else
- playsound "tna_targetreject"
- End If
- If (lt1.State = 1 and lt2.State = 1 and lt3.State = 1) Then
- ' If ReactorState(CurrentPlayer) = 2 Then
- ' SetReactorPercent 100
- ' StartMAxTarget
- ' Else
- ' MaxTargetFlag = True
- ' End If
- SetReactorMaxed
- AddBonusLights
- StartMAxTarget
- 'to do lightseq
- DMDFlush
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MAX REACTOR"), eBlinkfast, 1800, True, "tna_superskillshot"
- FlashForMs lt1, 2000, 100, 2
- FlashForMs lt2, 2000, 100, 2
- FlashForMs lt3, 2000, 100, 2
- lt1.TimerInterval = 2000
- lt1.TimerEnabled = True
- ElseIf lt2.state = 1 Then
- lt3.state = 2
- ElseIf lt1.state = 1 Then
- lt2.state = 2
- End If
- End Sub
- '
- Sub lt1_timer
- If debugReactor Then debug.print "*****SUB:lt1_timer"
- lt1.TimerEnabled = False
- 'do something
- End Sub
- ''*********************
- '' Section; Gate control
- ''*********************
- ' REactor Targeted mode
- ' Plunge - full loop. Lgate up on plunge. Lgate down after a switch
- ' Right Loop - full loop. Lgate up on RLswitch. Lgate down after a switch
- ' Left Loop - into toplanes.
- 'Reactor Started mode
- 'Both into toplanes
- 'Multiball
- 'both loops do full loop
- 'Reactor Critical
- ' Left Loop - full loop
- Dim loopDirection '1 = CW, -1 = CCW
- Sub swLLoop_Hit
- LoopEnter 1
- SetLastSwitchHit "swLLoop"
- End Sub
- Sub swRLoop_Hit
- LoopEnter -1
- SetLastSwitchHit "swRLoop"
- End Sub
- Dim JustPlunged
- Sub LoopEnter (value)
- LoopDirection = loopDirection + value
- If JustPlunged = True Then
- GateL.open = 1
- GateR.open = 1
- JustPlunged = False
- ElseIf bMultiBallMode = True Then
- GateL.open = 1
- GateR.open = 1
- ElseIf ReactorState(CurrentPlayer) = 2 Then'Reactor Started
- If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then
- If lLoopR.state = 2 Then 'CCW goes to reactor
- If loopDirection = -1 Then
- GateL.open = 0
- GateR.open = 0
- Else
- GateL.open = 1
- GateR.open = 1
- End If
- Else 'lLoopL.state = 2
- If loopDirection = -1 Then
- GateL.open = 1
- GateR.open = 1
- Else
- GateL.open = 0
- GateR.open = 0
- End If
- End If
- Else '< 3 both gates open
- GateR.open = 0
- GateL.open = 0
- End If
- ElseIf loopDirection = -1 Then 'ball is going CCW
- GateL.open = 1
- GateR.open = 0
- ElseIf loopDirection = 1 Then
- GateR.open = 0
- ElseIf loopDirection = 0 Then
- GateR.open = 0
- GateL.open = 0
- Else
- LoopDirection = 0
- GateR.open = 0
- GateL.open = 0
- End If
- End Sub
- Sub ResetGate
- loopDirection = 0
- GateL.open = 0
- GateR.open = 0
- End Sub
- ''*********************
- '' Section; RAD target
- ''*********************
- Sub TargetRAD1_HIt
- PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
- If debugDestroyRAD Then debug.print "*****SUB:TargetRAD1_HIt"
- 'Addscore RADScore
- CheckRADMysteryAward (lRad1)
- DecreaseReactorDestroyCount lRad1, fRad1
- SetLastSwitchHit "TargetRAD1"
- End Sub
- Sub TargetRAD2_HIt
- PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
- If debugDestroyRAD Then debug.print "*****SUB:TargetRAD2_HIt"
- 'Addscore RADScore
- CheckRADMysteryAward (lRad2)
- DecreaseReactorDestroyCount lRad2, fRad2
- SetLastSwitchHit "TargetRAD2"
- End Sub
- Sub TargetRAD3_HIt
- PlaySound SoundFXDOF("", 108, DOFPulse, DOFTargets)
- If debugDestroyRAD Then debug.print "*****SUB:TargetRAD3_HIt"
- 'Addscore RADScore
- CheckRADMysteryAward(lRad3)
- DecreaseReactorDestroyCount lRad3, fRad3
- SetLastSwitchHit "TargetRAD3"
- End Sub
- Sub ResetRAD
- If debugDestroyRAD Then debug.print "*****SUB:ResetRAD"
- SetLight lRAD1, "red", 0
- SetLight lRAD2, "red", 0
- SetLight lRAD3, "red", 0
- End Sub
- Sub StartRad
- If debugDestroyRAD Then debug.print "*****SUB:StartRad"
- If ReactorState(CurrentPlayer) <> 3 Then
- SetLight lRAD1, "red", 0
- SetLight lRAD2, "red", 0
- SetLight lRAD3, "red", 2
- End If
- End Sub
- Dim PausedRAD1
- Dim PausedRAD2
- Dim PausedRAD3
- Sub SaveRAD
- PausedRAD1 = lRAD1.State
- PausedRAD2 = lRAD2.State
- PausedRAD3 = lRAD3.State
- lRAD1.State = 0
- lRAD2.State = 0
- lRAD3.State = 0
- End Sub
- Sub RestoreRAD
- SetLight lRAD1, "red", PausedRAD1
- SetLight lRAD2, "red", PausedRAD2
- SetLight lRAD3, "red", PausedRAD3
- If (lRAD3.State = 0) Then
- lRAD1.State = 0
- lRAD2.State = 0
- lRAD3.State = 2
- End If
- End Sub
- ''*********************
- '' Section; Mystery Award
- ''*********************
- Dim MysteryState(4)
- Sub ResetMysteryAward
- If debugMysteryAward Then debug.print "*****SUB:ResetMysteryAward"
- MysteryState(CurrentPlayer) = 0
- lMystery.State = 0
- End Sub
- Sub DecrementMysteryAward
- If debugMysteryAward Then debug.print "*****SUB:DecrementMysteryAward"
- If MysteryState(CurrentPlayer) > 0 Then
- MysteryState(CurrentPlayer) = MysteryState(CurrentPlayer) - 1
- End If
- If MysteryState(CurrentPlayer) <= 0 then
- ResetMysteryAward
- End If
- End Sub
- Sub SetMysteryAward
- If debugMysteryAward Then debug.print "*****SUB:SetMysteryAward"
- MysteryState(CurrentPlayer) = MysteryState(CurrentPlayer) + 1
- lMystery.State = 2
- End Sub
- Sub InitMysteryAwardData
- Dim i
- For i = 1 to MaxPlayers
- MysteryState(i) = 0
- Next
- End Sub
- Sub SaveMysteryAwardData
- 'Nothing needed as always stored in MysteryState(4)
- End Sub
- Sub RestoreMysteryAwardData
- If MysteryState(CurrentPlayer) > 0 then
- lMystery.State = 2
- Else
- lMystery.State = 0
- End If
- End Sub
- 'CheckMysteryAward
- Sub CheckRADMysteryAward (obj)
- If debugMysteryAward Then debug.print "*****SUB:CheckMysteryAward"
- If ReactorState(CurrentPlayer) <> 3 Then
- If Obj.state = 2 Then
- obj.state = 1
- playsound "tna_toptarget"
- Addscore RADScore
- End If
- If (lRAD1.State = 1 and lRAD2.State = 1 and lRAD3.State = 1) Then
- StartRAD
- AddBonusLights
- 'to do lightseq
- DMDFlush
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, "MYSTERY LIT"), eBlinkfast, 1800, True, "tna_superskillshot"
- FlashForMs lRAD1, 2000, 100, 2
- FlashForMs lRAD2, 2000, 100, 2
- FlashForMs lRAD3, 2000, 100, 2
- lRAD1.TimerInterval = 2000
- lRAD1.TimerEnabled = True
- ElseIf lRAD2.state = 1 Then
- lRAD1.state = 2
- ElseIf lRAD3.state = 1 Then
- lRAD2.state = 2
- End If
- End If
- End Sub
- Sub lRAD1_Timer
- If debugMysteryAward Then debug.print "*****SUB:lRAD1_Timer"
- lRAD1.TimerEnabled = False
- SetMysteryAward
- End Sub
- 'CollectMysterAward (Video: More4k 9:28)
- Dim MysteryStep, MysRandom0, MysRandom1, MysRandom2, MysRandom3
- Const MaxMysteryItems = 13
- Function CollectMysteryAward
- If debugMysteryAward Then debug.print "*****SUB:CollectMysteryAward"
- If MysteryState(CurrentPlayer) > 0 Then
- PlaySound "tna_mysteryselect"
- MysteryStep = 0
- 'Generate 4 random awards. avoid duplicates
- MysRandom0 = INT(RND * MaxMysteryItems)
- MysRandom1 = INT(RND * MaxMysteryItems)
- MysRandom2 = INT(RND * MaxMysteryItems)
- MysRandom3 = INT(RND * MaxMysteryItems)
- If debugMysteryAward Then debug.print MysRandom0 & "-" & MysRandom1 & "-" & MysRandom2 & "-" & MysRandom3
- If MysRandom1 = MysRandom0 Then MysRandom1 = (MysRandom1+1) Mod MaxMysteryItems
- If ((MysRandom2 = MysRandom0) or (MysRandom2 = MysRandom1)) Then MysRandom2 = (MysRandom2+1) Mod MaxMysteryItems
- If ((MysRandom2 = MysRandom0) or (MysRandom2 = MysRandom1)) Then MysRandom2 = (MysRandom2+1) Mod MaxMysteryItems
- If ((MysRandom3 = MysRandom0) or (MysRandom3 = MysRandom1) or (MysRandom3 = MysRandom2)) Then MysRandom3 = (MysRandom3+1) Mod MaxMysteryItems
- If ((MysRandom3 = MysRandom0) or (MysRandom3 = MysRandom1) or (MysRandom3 = MysRandom2)) Then MysRandom3 = (MysRandom3+1) Mod MaxMysteryItems
- If debugMysteryAward Then debug.print MysRandom0 & "-" & MysRandom1 & "-" & MysRandom2 & "-" & MysRandom3
- ListMysteryAward MysRandom0, displayTime, 0
- DecrementMysteryAward
- lMystery.TimerInterval = 750
- lMystery.TimerEnabled = True
- CollectMysteryAward = 1 'Return 1
- End If
- End Function
- Const DisplayTime = 400
- Sub lMystery_Timer
- If debugMysteryAward Then debug.print "*****SUB:lMystery_Timer"
- MysteryStep = MysteryStep + 1
- Select Case MysteryStep
- Case 1
- ListMysteryAward MysRandom1, displayTime, 0
- Case 2
- ListMysteryAward MysRandom2, displayTime, 0
- Case 3
- ListMysteryAward MysRandom3, displayTime * 3, 1
- Case 4
- PlaySound "TNALeftScoopAwardEject"
- lMystery.TimerEnabled = False
- LeftScoop.TimerInterval = 1100
- LeftScoop.TimerEnabled = True
- 'LightSeqAutoLaunch.Play SeqDownOn, 10, 1, 0
- End Select
- End Sub
- Dim DelayedBallSaver
- Sub LeftScoop_Timer
- If DelayedBallSaver = 1 Then
- DelayedBallSaver = 0
- EnableBallSaver BallSaverTime
- End If
- LeftScoop.TimerEnabled = False
- 'eject ball
- LeftScoopExit
- End Sub
- Sub ListMysteryAward (value, duration, giveaward)
- Select Case value
- Case 0,MaxMysteryItems
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+10,000")), eBlink, duration, True, ""
- Case 1
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+25,000")), eBlink, duration, True, ""
- Case 2
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+150,000")), eBlink, duration, True, ""
- Case 3
- If ReactorState(CurrentPlayer) = 0 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("START REACTOR")), eBlink, duration, True, ""
- 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
- 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
- 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
- 'Critical 3 - targets not active, no check grid, gates 2-way
- ElseIf giveaward = 0 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("WARP TO LVL 9")), eBlink, duration, True, ""
- Else
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+50,000")), eBlink, duration, True, ""
- End If
- Case 4
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("BALLSAVER")), eBlink, duration, True, ""
- Case 5
- If bLockIsLit = False Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("LOCKS ARE LIT")), eBlink, duration, True, ""
- ElseIf giveaward = 0 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("LIONMAN!!!")), eBlink, duration, True, ""
- Else
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+40,000")), eBlink, duration, True, ""
- End If
- Case 6
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+1 LANESAVE")), eBlink, duration, True, ""
- Case 7
- If SuperSpinnerValue <> 2 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("SUPER SPINNER")), eBlink, duration, True, ""
- Else
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+30,000")), eBlink, duration, True, ""
- End If
- Case 8
- If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+1X BONUS")), eBlink, duration, True, ""
- Else
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+20,000")), eBlink, duration, True, ""
- End If
- Case 9
- If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("4X MAX BONUS")), eBlink, duration, True, ""
- Else
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+35,000")), eBlink, duration, True, ""
- End If
- Case 10
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("EXTRA BALL")), eBlink, duration, True, ""
- Case 11
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("MAX REACTOR")), eBlink, duration, True, ""
- Case 12
- If ReactorState(CurrentPlayer) = 0 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("KEYPAD UNLOCK")), eBlink, duration, True, ""
- 'Targeted 0 - targets active checkgrid, grid not complete, gates 2-way
- 'Ready 1 - targets not active, no check grid, grid completed, gates 1 way
- 'Started 2 - targets active but dont check grid, reactor percent building, gates 1 way
- 'Critical 3 - targets not active, no check grid, gates 2-way
- ElseIf giveaward = 0 Then
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("GAME OVER")), eBlink, duration, True, ""
- Else
- DMD "", eNone, "", eNone, "", eNone, CenterLine(3, ("+50,000")), eBlink, duration, True, ""
- End If
- End Select
- If giveaward = 1 Then
- Select Case value
- Case 0,MaxMysteryItems
- AddScore 10000
- Case 1
- AddScore 25000
- Case 2
- AddScore 150000
- Case 3
- If ReactorState(CurrentPlayer) = 0 Then
- ByPassGrid
- CheckReactorStart
- Else
- AddScore 50000
- End If
- Case 4
- DelayedBallSaver = 1
- Case 5
- If bLockIsLit = False Then
- DropTargetResetLockIsLit 0
- Else
- AddScore 40000
- End If
- Case 6
- AwardSAVE 1
- Case 7
- If SuperSpinnerValue <> 2 Then
- SetSuperSpinner
- Else
- AddScore 30000
- End If
- Case 8
- If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
- AddBonusMultiplier 1
- Else
- AddScore 20000
- End If
- Case 9
- If BonusMultiplier(CurrentPlayer) < MaxMultiplier Then
- SetBonusMultiplier(MaxMultiplier)
- Else
- AddScore 35000
- End If
- Case 10
- AwardExtraBallNoCallout
- Case 11
- SetReactorMaxed
- Case 12
- If ReactorState(CurrentPlayer) = 0 Then
- ByPassGrid
- Else
- AddScore 50000
- End If
- End Select
- End If
- End Sub
- ''*********************
- '' Section; DESTROY target
- ''*********************
- Sub TargetD1_Hit
- PlaySound SoundFXDOF("", 110, DOFPulse, DOFTargets)
- If debugDestroyRAD Then debug.print "*****SUB:TargetD1_Hit"
- Addscore DESTROYScore
- DecreaseReactorDestroyCount lD1, fD1
- SetLastSwitchHit "TargetD1"
- End Sub
- Sub TargetD2_Hit
- PlaySound SoundFXDOF("", 111, DOFPulse, DOFTargets)
- If debugDestroyRAD Then debug.print "*****SUB:TargetD2_Hit"
- Addscore DESTROYScore
- DecreaseReactorDestroyCount lD2, fD2
- SetLastSwitchHit "TargetD2"
- End Sub
- Sub ResetDESTROY
- If debugDestroyRAD Then debug.print "*****SUB:ResetDESTROY"
- lD1.State = 0
- lD2.State = 0
- lD3.State = 0
- lD4.State = 0
- End Sub
- '********
- ' Section; Bumper
- '********
- Sub Bumper1_Hit
- If debugDestroyRAD Then debug.print "*****SUB:Bumper1_Hit"
- If Tilted Then Exit Sub
- PlaySound SoundFXDOF("fx_bumper", 107, DOFPulse, DOFContactors), 0, 1, pan(ActiveBall)
- PlaySound "tna_bumperloud"
- DOF 119, DOFPulse
- ' FlashForMs lBumperFlash, 500, 50, 0:FlashForMs lBumperFlash1, 500, 50, 0
- AddScore BumperScore
- DecreaseReactorDestroyCount lD3, lBumperflash
- LightSeqBumper.StopPlay
- LightSeqBumper.UpdateInterval = 1
- LightSeqBumper.Play SeqCircleOutOn, 5, 1
- SwitchReactorLoopInserts
- SetLastSwitchHit "Bumper1"
- End Sub
- ''*********************
- '' Section; Debug routines
- ''*********************
- 'BlockerWall for debug testing
- Dim BLState
- 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
- Sub BlockerWalls
- BLState = (BLState + 1) Mod 4
- debug.print "BlockerWalls"
- Playsound "fx_next"
- Select Case BLState:
- Case 0
- 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
- Case 1:
- 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
- Case 2:
- 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
- Case 3:
- 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
- End Select
- End Sub
- '************TODO
- 'fix multi player
- 'ball x multiplier during multiball
- ' do a sound check of all objects
- ' loop combo
- ' lock is lit add target and scoop hit before lit
- 'ReactorStarted is carried over after drain
- 'ReactorCritical is carried over after drain
- 'Hands free skill shot awards 3 ball saves and Reactor Ready.
- '5 second delay when Reactor Starting (scoop shot)
- 'multiball lane - all targets up at multiball start. need to knock down all 3 and hit scoop to Light Lock
- 'Reactor Value
- 'Reactor 1 20,000
- '
- 'ReactorPercent(CurrentPlayer) 16, 17, 17, 16, 17, 17 (16,33,50,66,83,100)
- 'BR=16 then 17, T = 34, L = 17
- 'maybe goes 16 then 17 then
- 'Everything 2X during multiball
- 'Handsfree skillshot for 3 ball saves
- '??? stars and standups increase reactor
- 'add reactor jackpot if grid comleted again
- ' 500 points for CORE lanes, slings, stars reactor
- ' bonus increase for completing CORE
- ' 50,000 for getting skillshot using flipper
- ' ???? for hands free skillshot
- 'Extra Ball earned at 3rd reactor and 6th
- ' 20,000 for multiball lock
- ' 1st reactor core 25,000
- 'Common for all players
- ' Multiball targets carry over unchanged
- 'TRACK for EACH PLAYER
- ' Grid is player specific
- ' Reactor complete
- ' Reactor percent
- 'Reactor level
- 'Reset on new
- ' CORE is player specific
- '
- 'Black playfield
- 'RGB inserts from Orbital
- 'Glowball
- 'Shadows
- 'Match not implemented
- 'SKIP 'reactor core should increase in intensity
- 'DONE 'grid lights diff color when blinking (blue)
- 'YELLOW ' should bonus inserts be white?
- 'DONE mball inserts green. red during multiball/jackpot
- 'DONE reactor inserts blue
- 'DONE reactor light turn red blinking when critical
- 'DONE loop lights turn off when reactor gets critical
- 'DONEloop lights and triangle rotate
- 'DONE super spiner insert blue
- 'core switch gi blink also during skill shot
- 'drain on scoop eject will do a ballsave
- 'gi by rad, destroy bumper blink during criticalreactor
- Sub SetBallsOnPlayfield (value)
- If value < 0 Then
- value = 0
- End If
- BallsOnPlayfield = value
- Select Case BallsOnPlayfield
- Case 1: 'Not multiball so resume based current X multiplier
- Select Case BonusMultiplier(CurrentPlayer):
- Case 1:
- SetLight l2x, "white", 0
- SetLight l3x, "white", 0
- SetLight l4x, "white", 0
- Case 2:
- SetLight l2x, "white", 1
- SetLight l3x, "white", 0
- SetLight l4x, "white", 0
- Case 3:
- SetLight l2x, "white", 1
- SetLight l3x, "white", 1
- SetLight l4x, "white", 0
- Case 4:
- SetLight l2x, "white", 1
- SetLight l3x, "white", 1
- SetLight l4x, "white", 1
- Case Else:
- SetLight l2x, "white", 1
- SetLight l3x, "white", 1
- SetLight l4x, "white", 1
- End Select
- Case 2:
- SetLight l2x, "red", 2
- SetLight l3x, "red", 0
- SetLight l4x, "red", 0
- Case 3:
- SetLight l2x, "red", 0
- SetLight l3x, "red", 2
- SetLight l4x, "red", 0
- Case 4:
- SetLight l2x, "red", 0
- SetLight l3x, "red", 0
- SetLight l4x, "red", 2
- End Select
- End Sub
- Sub AddBallsOnPlayfield (value)
- Dim tmp
- tmp = BallsOnPlayfield + value
- SetBallsOnPlayfield tmp
- End Sub
- 'Section; Save Player Data
- '1. Create player array
- '2. Create Save routine
- '3. Create Restore routine
- '4. Add to Master Save routine
- '5. Add to Master Restore routine
- Sub InitializePlayerData
- InitLaneSaveData
- InitMysteryAwardData
- InitGridPlayerData
- InitReactorData
- InitiReactorDestroyData
- End Sub
- Sub SavePlayerData
- SaveLaneSaveData
- SaveMysteryAwardData
- SaveGridData
- 'SaveReactorData - already saved
- SaveReactorDestroyData
- End Sub
- Sub RestorePlayerData
- RestoreLaneSaveData
- RestoreMysteryAwardData
- RestoreGridData
- RestoreReactorData
- RestoreReactorDestroyData
- End Sub
- Sub InitReactorData
- Dim i
- For i = 1 To MaxPlayers
- ReactorState(i) = 0
- ReactorLevel(i) = 1
- ReactorPercent(i) = -1
- ReactorDestroyCount(i) = 0
- ReactorValue(i) = ReactorValue1
- ReactorValueMax(i) = ReactorValue1 * ReactorMaxMultiplier
- ResetReactorLoopInserts
- Next
- End Sub
- Sub SaveReactorData
- Line 5071: Dim ReactorState(4)
- Line 5072: Dim ReactorLevel(4)
- Line 5073: Dim ReactorPercent(4)
- Line 5074: Dim ReactorDestroyCount(4)
- Line 5075: Dim ReactorValue(4)
- Line 5076: Dim ReactorValueMax(4)
- End Sub
- Sub RestoreReactorData
- Dim tmpcolor
- Dim i
- 'Set all inserts off, light destroyed reactor green, then current reactor blinking red or green
- If ReactorState(CurrentPlayer) = 3 Then 'Critical
- tmpcolor = "red"
- Else
- tmpcolor = "green"
- End If
- For i = 0 to 8
- SetLight aReactorLevelInserts(i), "red", 0
- Next
- For i = 0 to (ReactorLevel(CurrentPlayer) - 2)
- If i >=0 Then SetLight aReactorLevelInserts(i), "red", 1
- Next
- i = ReactorLevel(CurrentPlayer) - 1
- If i >=0 Then
- SetLight aReactorLevelInserts(i), tmpcolor, 2
- End If
- 'Set table to default state
- ResetReactorLoopInserts
- lStart.State = 0
- SetReactorInserts 0
- SetReactorPercent ReactorPercent(CurrentPlayer)
- fRones.TimerEnabled = False
- GIReactorStoppedImmediate
- stopsound "tna_reactorcritical"
- 'Set up active items
- Select Case ReactorState(CurrentPlayer)
- Case 0: 'Targeted
- Case 1: 'Ready
- SetReactorReady
- Case 2: 'Started
- SetReactorInserts 2
- GIReactorStarted
- If ReactorLevel(CurrentPlayer) > LastReactorBeforeDifficultyKicksIn Then 'Enable Reactor Percentage drop logic and only one loop
- fRones.TimerInterval = ReactorPercentLossTime * 1000
- fRones.TimerEnabled = True
- StartReactorRightLoopInserts
- Else 'ReactorLevel(CurrentPlayer) 1 and 2 and 3
- StartReactorLoopInserts
- End If
- Case 3: 'Critical
- SetReactorInserts 1
- ChangeGiImmediate("red")
- StartReactorCriticalMusic
- 'Need to restore Destroy targets count and inserts
- End Select
- End Sub
- Dim PlayeraDTGT1(4)
- Dim PlayeraDTGT2(4)
- Dim PlayeraDTGT3(4)
- Dim PlayeraDTGT4(4)
- Dim PlayeraDTGT5(4)
- Dim PlayeraDTGT6(4)
- Dim PlayeraDTGT7(4)
- Sub InitiReactorDestroyData
- Dim i
- For i = 1 To MaxPlayers
- PlayeraDTGT1(i) = 0
- PlayeraDTGT2(i) = 0
- PlayeraDTGT3(i) = 0
- PlayeraDTGT4(i) = 0
- PlayeraDTGT5(i) = 0
- PlayeraDTGT6(i) = 0
- PlayeraDTGT7(i) = 0
- Next
- End Sub
- Sub SaveReactorDestroyData
- If ReactorState(CurrentPlayer) = 3 Then
- PlayeraDTGT1(CurrentPlayer) = lRAD1.State
- PlayeraDTGT2(CurrentPlayer) = lRAD2.State
- PlayeraDTGT3(CurrentPlayer) = lRAD3.State
- PlayeraDTGT4(CurrentPlayer) = lD1.State
- PlayeraDTGT5(CurrentPlayer) = lD2.State
- PlayeraDTGT6(CurrentPlayer) = lD3.State
- PlayeraDTGT7(CurrentPlayer) = lD4.State
- Else
- PlayeraDTGT1(CurrentPlayer) = 0
- PlayeraDTGT2(CurrentPlayer) = 0
- PlayeraDTGT3(CurrentPlayer) = 0
- PlayeraDTGT4(CurrentPlayer) = 0
- PlayeraDTGT5(CurrentPlayer) = 0
- PlayeraDTGT6(CurrentPlayer) = 0
- PlayeraDTGT7(CurrentPlayer) = 0
- End If
- End Sub
- Sub RestoreReactorDestroyData
- ' SetLight lRAD1, "white", PlayeraDTGT1(CurrentPlayer)
- ' SetLight lRAD2, "white", PlayeraDTGT2(CurrentPlayer)
- ' SetLight lRAD3, "white", PlayeraDTGT3(CurrentPlayer)
- ' SetLight lD1, "white", PlayeraDTGT4(CurrentPlayer)
- ' SetLight lD2, "white", PlayeraDTGT5(CurrentPlayer)
- ' SetLight lD3, "white", PlayeraDTGT6(CurrentPlayer)
- ' SetLight lD4, "white", PlayeraDTGT7(CurrentPlayer)
- SetLight aDTGT(0), "white", PlayeraDTGT1(CurrentPlayer)
- SetLight aDTGT(1), "white", PlayeraDTGT2(CurrentPlayer)
- SetLight aDTGT(2), "white", PlayeraDTGT3(CurrentPlayer)
- SetLight aDTGT(3), "white", PlayeraDTGT4(CurrentPlayer)
- SetLight aDTGT(4), "white", PlayeraDTGT5(CurrentPlayer)
- SetLight aDTGT(5), "white", PlayeraDTGT6(CurrentPlayer)
- SetLight aDTGT(6), "white", PlayeraDTGT7(CurrentPlayer)
- SetLight aDFTGT(0), "white", PlayeraDTGT1(CurrentPlayer)
- SetLight aDFTGT(1), "white", PlayeraDTGT2(CurrentPlayer)
- SetLight aDFTGT(2), "white", PlayeraDTGT3(CurrentPlayer)
- SetLight aDFTGT(3), "white", PlayeraDTGT4(CurrentPlayer)
- SetLight aDFTGT(4), "white", PlayeraDTGT5(CurrentPlayer)
- SetLight aDFTGT(5), "white", PlayeraDTGT6(CurrentPlayer)
- SetLight aDFTGT(5), "white", PlayeraDTGT7(CurrentPlayer) 'bumper shared with dtgt6 and 7
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment