
'Eight Ball Remix 
'Script v. pb2
'Scripted by Hakyoku Seiken




dim BumperFrame(2)
dim StandUpFrame(3)
dim AttractModeSequencer
dim Credits
dim GameInProgress   '0 = False, 1 = True
dim Arrow
dim BallsPerGame
dim BallsLeft
dim BallInPlay
dim First7           'Flag to know if balls 1-7 are active
dim BonusDelay
dim PostBonusDelay
dim RackCounter
dim EightBallReady
dim KickBackReady
dim ExtraBall
dim SpecialReady
dim SuperBonusEnabled 
dim TempRackCounter
dim TempPocketedBalls(16)
dim BGM
dim SuperBonusCounted
dim BonusMultiplier
dim PocketedBalls(16)
dim CountedBalls(16)
dim BankShotAward
dim Tilt
dim OptionMode
dim CurrentOption
dim CurrentOptionValue
dim OptionBallSaver
dim OptionBallsPerGame
dim OptionDifficultyLevel
dim OptionMusic
dim HighScore
dim AttractModePart
dim DoingSequencer
dim AwardingRack
dim ArrowEnabled
dim KickBackBlinker
dim RolledScore
dim BallSaverLeeway
dim MachineBroken
dim DoNotPlay
dim MachineWear
dim BallGraphic
dim TheBall
dim RubberWear

'--------------------------------------------These will hold the sound effects for various events for easy editing...well, easiER editing.
dim BumperSound
dim CreditSound
dim ExtraBallSound
dim LaneLitSound
dim LaneSound
dim KickBackSound
dim SlingshotSound
dim GetBonusSound
dim BankShotSound
dim SpinnerUnlitSound
dim SpinnerLitSound
dim TargetSound
dim EightBallReadySound
dim EightBallCollectedSound
dim GetKickBackSound
dim SpecialSound
dim TiltWarningSound
dim TiltSound
dim GameSong1
dim GameSong2
dim GameSong3
dim GameSong4
'------------------------------------------------Set the sounds for the events yourself, bitches.  That's right, I said BITCHES.





























Sub Table1_KeyDown(ByVal keycode)
    
    If keycode = 24 Then
       If GameInProgress = 0 And OptionMode = 0 Then
          OptionMode = 1
          BottomWall.TimerEnabled = False
          StopMusic
          CreditLight.State = 0
          Plastic1Off.TimerEnabled = False
          Plastic2Off.TimerEnabled = False
          Plastic5Off.TimerEnabled = False
          Plastic6Off.TimerEnabled = False
          Plastic7aOff.TimerEnabled = False
          Plastic8Off.TimerEnabled = False
          AllLightsSequencer.StopPlay
          AllLightsOff
          AllPlasticsOff
          CurrentOption = 1
          DoingSequencer = 0
          OptionBox.Text = "FLIPPER KEYS ADJUST VALUE, PLUNGER KEY ADVANCES OPTION, O-KEY RETURNS TO ATTRACT MODE"
          If OptionBallSaver = "ON" Then 
             CurrentOptionValue = 2
          ElseIf OptionBallSaver = "OFF" Then
             CurrentOptionValue = 1
          End If
          UpdateOptionMode
       ElseIf GameInProgress = 0 And OptionMode = 1 Then
          SaveOptions
          OptionMode = 0
          OptionBox.Text = "                                                                                     "         
          BallInPlayBox.Text = "                    "
          If Credits = 0 Then
             AllPlasticsOn
             AttractMode
          ElseIf Credits > 0 Then
             AllPlasticsOff
             CreditLight.State = 2
             StatusBox.Text = "PUSH START"
          End If
       End If
     End If
     
     If keycode = 61 Then
        If GameInProgress = 0 And OptionMode = 0 Then
           MachineBroken = 0
           MachineWear = 0
           ApplyTableWearAndTear
           SaveOptions
           MsgBox "This machine has been restored to full working order."
        End If
     End If


    
    If keycode = StartGameKey Then
       If GameInProgress = 0 and Credits > 0 And OptionMode = 0 Then
          StartNewGame
       End If
    End If
    
    If keycode = AddCreditKey Then
       If Wall1.TimerEnabled = False And OptionMode = 0 Then
          PlaySound "Coin3"
          Wall1.TimerInterval = 1300
          Wall1.TimerEnabled = True
       End If
    End If

   
	If keycode = PlungerKey Then
        If OptionMode = 0 Then
           Plunger.PullBack
        ElseIf OptionMode = 1 Then
           AdvanceOption
        End If
	End If

	If keycode = LeftFlipperKey Then
	    If GameInProgress = 1 And Tilt = 0 And BonusCounter.Enabled = False Then
	      Eval("LeftFlipper"&(MachineWear+1)).RotateToEnd
	      PlaySound "FlipperUp"
        ElseIf OptionMode = 1 Then
           ChangeOptionValue -1
        End If
	End If
    
	If keycode = RightFlipperKey Then
	   If GameInProgress = 1 And Tilt = 0 And BonusCounter.Enabled = False Then
          PlaySound "FlipperUp"
	      Eval("RightFlipper"&(MachineWear+1)).RotateToEnd
       ElseIf OptionMode = 1 Then
          ChangeOptionValue 1  
       End If
	End If
    
	If keycode = LeftTiltKey Then
		Nudge (RND*10) + 85, (RND*2.5) + 1
	End If
    
	If keycode = RightTiltKey Then
		Nudge (RND*10) + 260, (RND*2.5)+ 1
	End If
    
	If keycode = CenterTiltKey Then
		Nudge (RND*10), (RND*2.5)+ 1
    End If
End Sub

Sub Table1_KeyUp(ByVal keycode)

	If keycode = PlungerKey Then
	    If OptionMode = 0 Then
           Plunger.Fire
           StopSound "plungerrelease"
           PlaySound "plungerrelease"
        End If
	End If
    
	If keycode = LeftFlipperKey Then
	   If MachineWear < 4 Then
          Eval("LeftFlipper"&(MachineWear + 1)).RotateToStart
       ElseIf MachineWear = 4 Then
          upperlimit = 20 
          lowerlimit = 0 
          L = Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit)
          If L > 1 Then
             Eval("LeftFlipper"&(MachineWear + 1)).RotateToStart
          End If
       End If
       
	   If GameInProgress = 1 And Tilt = 0 Then
          PlaySound "FlipperDown"       
       End If
    End If 
    
	If keycode = RightFlipperKey Then
	   If MachineWear < 4 Then
          Eval("RightFlipper"&(MachineWear + 1)).RotateToStart
       ElseIf MachineWear = 4 Then
          upperlimit = 20 
          lowerlimit = 0 
          R = Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit)
          If R > 1 Then
             Eval("RightFlipper"&(MachineWear + 1)).RotateToStart
          End If
       End If
       
	   If GameInProgress = 1 And Tilt = 0 Then
          PlaySound "FlipperDown"       
       End If
	End If
	
	
	

End Sub
'----------------------------------------------------------------------------



'--------------------------------------------------------OPTION MODE SHIT




Sub UpdateOptionMode()
    If CurrentOption = 1 Then
       StatusBox.Text = "BALL SAVER FEATURE"
       BallInPlayBox.Text = OptionBallSaver
    ElseIf CurrentOption = 2 Then
       StatusBox.Text = "BALLS PER GAME"
       BallInPlayBox.Text = OptionBallsPerGame
    ElseIf CurrentOption = 3 Then
       StatusBox.Text = "DIFFICULTY LEVEL"
       BallInPlayBox.Text = OptionDifficultyLevel
    ElseIf CurrentOption = 4 Then
       StatusBox.Text = "MUSIC"
       BallInPlayBox.Text = OptionMusic
    End If
End Sub




Sub ChangeOptionValue(value)
    CurrentOptionValue = CurrentOptionValue + Value
    If CurrentOption = 1 Then
       If CurrentOptionValue =< 0 Then 
          CurrentOptionValue = 1
          OptionBallSaver = "OFF"
       ElseIf CurrentOptionValue = 1 Then
          OptionBallSaver = "OFF"
       ElseIf CurrentOptionValue = 2 Then
          OptionBallSaver = "ON"
       ElseIf CurrentOptionValue > 2 Then
          CurrentOptionValue = 2
          OptionBallSaver = "ON"
       End If
    ElseIf CurrentOption = 2 Then
       If CurrentOptionValue =< 0 Then
          CurrentOptionValue = 1
          OptionBallsPerGame = 3
       ElseIf CurrentOptionValue = 1 Then
          OptionBallsPerGame = 3
       ElseIf CurrentOptionValue = 2 Then
          OptionBallsPerGame = 5
       ElseIf CurrentOptionValue > 2 Then
          CurrentOptionValue = 2
          OptionBallsPerGame = 5
       End If
    ElseIf CurrentOption = 3 Then
       If CurrentOptionValue =< 0 Then
          CurrentOptionValue = 1
          OptionDifficultyLevel = "EASY"
       ElseIf CurrentOptionValue = 1 Then
          OptionDifficultyLevel = "EASY"
       ElseIf CurrentOptionValue = 2 Then 
          OptionDifficultyLevel = "HARD"
       ElseIf CurrentOptionValue > 2 Then
          CurrentOptionValue = 2
          OptionDifficultyLevel = "HARD"
       End If
    ElseIf CurrentOption = 4 Then
       If CurrentOptionValue <= 0 Then
          CurrentOptionValue = 1
          OptionMusic = "ON"
       ElseIf CurrentOptionValue = 1 Then
          OptionMusic = "ON"
       ElseIf CurrentOptionValue = 2 Then
          OptionMusic = "OFF"
       ElseIf CurrentOptionValue > 2 Then
          CurrentOptionValue = 2
          OptionMusic = "OFF"
       End If
    End IF
    UpdateOptionMode
End Sub
       

Sub AdvanceOption
    CurrentOption = CurrentOption + 1:    If CurrentOption = 5 Then CurrentOption = 1
    
    If CurrentOption = 1 Then
       If OptionBallSaver = "OFF" Then 
          CurrentOptionValue = 1
       ElseIf OptionBallSaver = "ON" Then
          CurrentOptionValue = 2
       End If
    ElseIf CurrentOption = 2 Then
       If OptionBallsPerGame = 3 Then
          CurrentOptionValue = 1
       ElseIf OptionBallsPerGame = 5 Then
          CurrentOptionValue = 2
       End If
    ElseIf CurrentOption = 3 Then
       If OptionDifficultyLevel = "EASY" Then
          CurrentOptionValue = 1
       ElseIf OptionDifficultyLevel = "HARD" Then
          CurrentOptionValue = 2
       End If
    ElseIf CurrentOption = 4 Then
       If OptionMusic = "ON" Then
          CurrentOptionValue = 1
       ElseIf OptionMusic = "OFF" Then
          CurrentOptionValue = 2
       End If
    End If
    UpdateOptionMode
End Sub

   




'----------------------------------------------------------------BALL LOST SHIT
'Bonus Count Up
Sub Drain_Hit()
    PlaySound "Gobble2"
	Drain.DestroyBall
     If Tilt = 0 And BallSaving.Enabled = False Then
    	Eval("LeftFlipper"&(MachineWear + 1)).RotateToStart
	    Eval("RightFlipper"&(MachineWear + 1)).RotateToStart
        BonusCountUp
	 ElseIf Tilt = 0 And BallSaving.Enabled = True Then
	   BallMaker.CreateBall 
	   BallMaker.Kick 75, 10
       If StatusBox.Text = "               " Then
          StatusBox.Text = "BALL SAVED"
          StatusBox.TimerInterval = 3000 
          StatusBox.TimerEnabled = True
        End If
     ElseIf Tilt = 1 Then
    	Eval("LeftFlipper"&(MachineWear + 1)).RotateToStart
	    Eval("RightFlipper"&(MachineWear + 1)).RotateToStart
        DoNextBall
     End If
End Sub







Sub BonusCountUp
    StopMusic
    If OptionMusic = "ON" Then
       PlaySound "MusicLazyAfternoon", -1
    End If
    BonusDelay = 0
    AllPlasticsOff
    AllLightsOff
    If SuperBonusEnabled = 1 Then
       SuperBonusLight.State = 1
    End If
    For x = 1 to 15
        CountedBalls(x) = 0
        If PocketedBalls(x) = 1 Then
           Eval("Bonus" & x & "Light").State = 1
           f = f + 1
        End If
    Next
    For x = 1 to 16
        TempPocketedBalls(x) = PocketedBalls(x)
    Next
    TempRackCounter = 0 
    BonusCounter.Interval = 250
    BonusCounter.Enabled = True
    PostBonusDelay = 8 + f + (RackCounter * 15)
    If OptionMusic = "ON" Then
       If PostBonusDelay < 30 Then PostBonusDelay = 30
    End If
    SuperBonusCounted = 0
End Sub





Sub BonusCounter_Timer()
    l = 0
    m = 0
    BonusDelay = BonusDelay + 1
    If SuperBonusEnabled Then
       If BonusDelay = 2 Then
          PlaySound KickBackSound
          SuperBonusLight.State = 0
          SuperBonusCounted = 1
          AddScore 24000
       End If
    End If
    If BonusDelay > 4 Then
     For x = 1 to 16
      If TempPocketedBalls(x) = 0 Then
       If x = 16 And BonusDelay => PostBonusDelay Then
        DoNextBall
        BonusCounter.Enabled = False
       End If
      ElseIf TempPocketedBalls(x) = 1 And CountedBalls(x) = 0 Then
       CountedBalls(x) = 1
       PlaySound GetBonusSound
       AddScore 3000 * BonusMultiplier
       Eval("Bonus" & x & "Light").State = 0
       x = 15
      End If
     Next
    End If

    For x = 1 to 15
     l = l + TempPocketedBalls(x)
     m = m + CountedBalls(x)
    Next 
    If l = m Then
       TempRackCounter = TempRackCounter + 1
       If TempRackCounter <= RackCounter Then
          For x = 1 to 15
              TempPocketedBalls(x) = 1
              CountedBalls(x) = 0
              Eval("Bonus" & x & "Light").State = 1
          Next
       End If
    End If
      
End Sub

     








Sub DoNextBall
    Tilt = 0
    StatusBox.Text = "               " 
    If ExtraBall = 0 Then
        BallInPlay = BallInPlay + 1
        BallsLeft = BallsLeft - 1
    ElseIf ExtraBall > 0 Then
        ExtraBall = ExtraBall - 1
        If ExtraBall = 0 Then
           ShootAgainLight.State = 0
        End If
    End If
    If BallsLeft = -1 Then
       EndGame
    Else
       If OptionBallSaver = "ON" Then
          ShootAgainLight.BlinkInterval = 50
          ShootAgainLight.State = 2
          BallSaverLeeway = 1
       End If
       BallInPlayBox.Text = "Ball " & BallInPlay 
       BallMaker.TimerInterval = 500
       BallMaker.TimerEnabled = True
       AllPlasticsOn
       ResetLights
       StopMusic
       If OptionMusic = "ON" Then
          PlayNextBGM
       End If
    End If
End Sub

Sub BallMaker_Timer()
    Set TheBall = BallMaker.CreateBall
    TheBall.Image = BallGraphic
    BallMaker.Kick 75, 10
    BallMaker.TimerEnabled = False
    PlaySound "Knock"
End Sub



Sub EndGame()
    SaveHighScore
    StopMusic
    Timer1.Interval = 1000
    Timer1.Enabled = True
End Sub

Sub Timer1_Timer()
    Timer1.Enabled = False
    GameInProgress = 0
    If Credits > 0 Then 
       BallInPlayBox.Text = "PUSH 'O' FOR OPTIONS"
       StatusBox.Text = "PUSH START"
       CreditLight.State = 2
       AllPlasticsOff
       AllLightsOff
    ElseIf Credits < 1 Then 
       AllPlasticsOn
       AttractMode
       CreditLight.State = 0
    End If
End Sub
'------------------------------------------------------------------------------













'--------------------------------------------------------------------COIN SHIT
Sub Wall1_Timer() 

    Plastic1Off.TimerEnabled = False
    Plastic2Off.TimerEnabled = False
    Plastic5Off.TimerEnabled = False
    Plastic6Off.TimerEnabled = False
    Plastic7aOff.TimerEnabled = False
    Plastic8Off.TimerEnabled = False

    If DoNotPlay = 0 Then     
      Credits = Credits + 1
      StopSounds
      PlaySound CreditSound
      Wall1.TimerEnabled = False    
      If GameInProgress = 0 Then
         AllLightsSequencer.StopPlay
         StatusBox.Text = "PUSH START"
         StopMusic
         CreditLight.BlinkInterval = 100
         CreditLight.State = 2
         BottomWall.TimerEnabled = False
         AllPlasticsOff
         AllLightsOff
      End If
    ElseIf DoNotPlay = 1 Then
      StopMusic
      Wall1.TimerEnabled = False
      AllLightsSequencer.StopPlay
      BottomWall.TimerEnabled = False
      AllPlasticsOff
      AllLightsOff
      PlaySound "Broken"
    End If
End Sub
'-----------------------------------------------------------------------------


Sub Table1_Paused()
    SaveOptions
End Sub








'-----------------------------------------------------------------TILT MECH SHIT
 Sub TiltSensor_Hit()
     If GameInProgress = 1 And BonusCounter.Enabled = False And StatusBox.Text = "               " And Tilt = 0 Then
        StatusBox.Text = "Careful!!"
        TiltCradle.TimerInterval = 250
        TiltCradle.TimerEnabled = True
        StatusBox.TimerInterval = 3000
        StatusBox.TimerEnabled = True
        StopSounds
        PlaySound TiltWarningSound
     ElseIf GameInProgress = 1 And BonusCounter.Enabled = False And StatusBox.Text = "Careful!!" And TiltCradle.TimerEnabled = False Then
        StatusBox.Text = "TILT"
        StatusBox.TimerEnabled = False
        Tilt = 1
        For x = 0 to 4
          CRightSlingShot(x).Disabled = True
          CLeftSlingShot(x).Disabled = True
        Next 
        Bump1.Disabled = True
        Bump2.Disabled = True
        Bump3.Disabled = True
        AllLightsOff
        AllPlasticsOff
    	Eval("LeftFlipper"&(MachineWear + 1)).RotateToStart
	    Eval("RightFlipper"&(MachineWear + 1)).RotateToStart
        StopSounds
        PlaySound TiltSound
        StopMusic
        BallSaving.Enabled = False
        ShootAgainLight.State = 0
     End If
End Sub
 
Sub TiltCradle_Timer()
    TiltCradle.TimerEnabled = False
End Sub 
Sub StatusBox_Timer()
    StatusBox.Text = "               "
    StatusBox.TimerEnabled = False
End Sub





'-------------------------------------------------------------------SOUND SHIT
Sub StopSounds()
    StopSound "SE1"
    StopSound "SE2"
    StopSound "SE3"
    StopSound "SE4"
    StopSound "SE5"
    StopSound "SE6"
    StopSound "SE7"
    StopSound "SE8"
    StopSound "SE9"
    StopSound "SE10"
    StopSound "SE11"
    StopSound "SE12"
    StopSound "SE13"
    StopSound "SE14"
    StopSound "SE15"
    StopSound "SE16"
    StopSound "SE17"
    StopSound "SE18"
End Sub


Sub StopMusic()
    StopSound "MusicMeteorMan"
    StopSound "MusicFightItOut"
    StopSound "MusicMidnightKiss"
    StopSound "MusicLazyAfternoon"
    StopSound "MusicSunnyMorning"
    StopSound "MusicTheLounge"
End Sub


Sub PlayNextBGM
    BGM = BGM + 1
    If BGM = 5 Then BGM = 1
    PlaySound Eval("GameSong" & BGM), -1
End Sub
'-----------------------------------------------------------------------------















'----------------------------------------------------------------NEW GAME SHIT
Sub StartNewGame()
    RolledScore = 0
    ArrowEnabled = 0
    Arrow = 0
    AwardingRack = 0
    Tilt = 0
    StatusBox.Text = "               "
    StopMusic
    BGM = 0
    If OptionMusic = "ON" Then
       PlayNextBGM
    End If
    BonusMultiplier = 1
    SpecialReady = 0
    SuperBonusEnabled = 0
    KickBackReady = 0
    EightBallReady = 0
    RackCounter = 0  '<--- number of times you've sunk all 15 balls
    First7 = 1
    For x = 1 to 15
        PocketedBalls(x) = 0 
    Next
    BallInPlay = 1
    BallInPlayBox.Text = "Ball " & BallInPlay
    BallsLeft = OptionBallsPerGame
    Credits = Credits - 1
    CreditLight.State = 1
    Score = 0
    ResetScore
    Addscore 0
    BottomWall.TimerEnabled = False
    AllLightsOff
    AllPlasticsOn
    ResetLights
    GameInProgress = 1
    BallMaker.TimerInterval = 1000
    BallMaker.TimerEnabled = True
    BallsLeft = BallsLeft - 1
End Sub












Sub ResetLights()
    For x = 0 to 4
      CRightSlingShot(x).Disabled = False
      CLeftSlingShot(x).Disabled = False
    Next
    Bump1.Disabled = False
    Bump2.Disabled = False
    Bump3.Disabled = False

    BonusMultiplier = 1
    BankShotAward = 1
    KickBackHelper.IsDropped = True
    BankShot1Light.State = 1
    BankShot2Light.State = 0
    BankShot3Light.State = 0
    BankShot4Light.State = 0
    BankShot5Light.State = 0
    BankShot6Light.State = 0
    BankShotLightOn
    
    If ArrowEnabled = 1 Then
       If Arrow = 1 Then
          LeftArrowLight.State = 0
          RightArrowLight.State = 1
       ElseIf Arrow = -1 Then
          LeftArrowLight.State = 1
          RightArrowLight.State = 0
       End If 
    End If 
    Bump1On
    Bump2On
    Bump3On

    KickBackLight.State = 0
    
    If SuperBonusEnabled = 0 Then
       SuperBonusLight.State = 0
    ElseIf SuperBonusEnabled = 1 Then
       SuperBonusLight.State = 1
    End If
    
    SpinnerLight.State = 0
    
    If SpecialReady = 0 Then
       SpecialLight.State = 0
    ElseIf SpecialReady = 1 Then
       SpecialLight.State = 1
    End If
    
    If OptionBallSaver = "ON" Then
       BallSaverLeeway = 1
       ShootAgainLight.BlinkInterval = 50
       ShootAgainLight.State = 2
       BallSaving.Interval = 10000
    ElseIf OptionBallSaver = "OFF" Then
       If ExtraBall = 0 Then
          ShootAgainLight.State = 0
       ElseIf ExtraBall > 0 Then
          ShootAgainLight.State = 1
       End If
    End If
    
    ResetBalls

End Sub

Sub ResetBalls()
    For x = 1 to 15
        CountedBalls(x) = 0
        If PocketedBalls(x) = 1 Then
           Eval("Bonus" & x & "Light").State = 1
           If First7 = 1 Then
              If x = 1 Then
                 OneBallLight.State = 0
              ElseIf x = 2 Then
                 TwoBallLight.State = 0
              ElseIf x = 3 Then
                 ThreeBallLight.State = 0
              ElseIf x = 4 Then
                 FourBallLight.State = 0
              ElseIf x = 5 Then
                 FiveBallLight.State = 0
              ElseIf x = 6 Then
                 SixBallLight.State = 0
              ElseIf x = 7 Then
                 SevenBallLight.State = 0
              End If
           ElseIf First7 = 0 Then
              ElseIf x = 9 Then
                 NineBallLight.State = 0
              ElseIf x = 10 Then
                 TenBallLight.State = 0
              ElseIf x = 11 Then
                 ElevenBallLight.State = 0
              ElseIf x = 12 Then
                 TwelveBallLight.State = 0
              ElseIf x = 13 Then
                 ThirteenBallLight.State = 0
              ElseIf x = 14 Then 
                 FourteenBallLight.State = 0
              ElseIf x = 15 Then
                 FifteenBallLight.State = 0
              End If
          ElseIf PocketedBalls(x) = 0 Then
            Eval("Bonus" & x & "Light").State = 0
            If First7 = 1 Then
               If x = 1 Then
                  OneBallLight.State = 1
               ElseIf x = 2 Then
                  TwoBallLight.State = 1
               ElseIf x = 3 Then
                  ThreeBallLight.State = 1
               ElseIf x = 4 Then
                  FourBallLight.State = 1
               ElseIf x = 5 Then
                  FiveBallLight.State = 1
               ElseIf x = 6 Then
                  SixBallLight.State = 1
               ElseIf x = 7 Then
                  SevenBallLight.State = 1
               End If
            ElseIf First7 = 0 Then
               Bonus8Light.State = 1
               If x = 9 Then
                  NineBallLight.State = 1
               ElseIf x = 10 Then
                  TenBallLight.State = 1
               ElseIf x = 11 Then
                  ElevenBallLight.State = 1
               ElseIf x = 12 Then
                  TwelveBallLight.State = 1
               ElseIf x = 13 Then
                  ThirteenBallLight.State = 1
               ElseIf x = 14 Then 
                  FourteenBallLight.State = 1
               ElseIf x = 15 Then
                  FifteenBallLight.State = 1
               End If
          End If
       End If
    Next
    
    If EightBallReady = 1 Then
       EightBallLight.State = 1
    End If
End Sub


Sub BallSaving_Timer()
    
    BallSaving.Enabled = False
    If BallSaverLeeway = 1 Then
       BallSaverLeeway = 0
       BallSaving.Interval = 1000
       BallSaving.Enabled = True
       If ExtraBall = 0 Then
          ShootAgainLight.State = 0
       ElseIf ExtraBall > 0 Then
          ShootAgainLight.State = 1
       End If
    ElseIf BallSaverLeeway = 0 Then
       BallSaving.Enabled = False
    End If
End Sub
'---------------------------------------------------------------------------
    











'-------------------------------------------------------------GI EFFECTS SHIT
Sub AllLightsOff()
    OneBallLight.State = 0
    TwoBallLight.State = 0
    ThreeBallLight.State = 0
    FourBallLight.State = 0
    FiveBallLight.State = 0
    SixBallLight.State = 0
    SevenBallLight.State = 0
    EightBallLight.State = 0
    NineBallLight.State = 0
    TenBallLight.State = 0
    ElevenBallLight.State = 0
    TwelveBallLight.State = 0
    ThirteenBallLight.State = 0
    FourteenBallLight.State = 0
    FifteenBallLight.State = 0
    Bonus1Light.State = 0
    Bonus2Light.State = 0
    Bonus3Light.State = 0
    Bonus4Light.State = 0
    Bonus5Light.State = 0
    Bonus6Light.State = 0
    Bonus7Light.State = 0
    Bonus8Light.State = 0
    Bonus9Light.State = 0
    Bonus10Light.State = 0
    Bonus11Light.State = 0
    Bonus12Light.State = 0
    Bonus13Light.State = 0
    Bonus14Light.State = 0
    Bonus15Light.State = 0
    LeftArrowLight.State = 0
    RightArrowLight.State = 0
    SpinnerLight.State = 0
    X2Light.State = 0
    X3Light.State = 0
    X5Light.State = 0
    KickBackLightOff
    Bump1Off
    Bump2Off 
    Bump3Off
    BankShotLightOff
    BankShot1Light.State = 0
    BankShot2Light.State = 0
    BankShot3Light.State = 0
    BankShot4Light.State = 0
    BankShot5Light.State = 0
    BankShot6Light.State = 0
    SuperBonusLight.State = 0
    SpecialLight.State = 0    
End Sub
    
Sub AllLightsOn()
    OneBallLight.State = 1
    TwoBallLight.State = 1
    ThreeBallLight.State = 1
    FourBallLight.State = 1
    FiveBallLight.State = 1
    SixBallLight.State = 1
    SevenBallLight.State = 1
    EightBallLight.State = 1
    NineBallLight.State = 1
    TenBallLight.State = 1
    ElevenBallLight.State = 1
    TwelveBallLight.State = 1
    ThirteenBallLight.State = 1
    FourteenBallLight.State = 1
    FifteenBallLight.State = 1
    Bonus1Light.State = 1
    Bonus2Light.State = 1
    Bonus3Light.State = 1
    Bonus4Light.State = 1
    Bonus5Light.State = 1
    Bonus6Light.State = 1
    Bonus7Light.State = 1
    Bonus8Light.State = 1
    Bonus9Light.State = 1
    Bonus10Light.State = 1
    Bonus11Light.State = 1
    Bonus12Light.State = 1
    Bonus13Light.State = 1
    Bonus14Light.State = 1
    Bonus15Light.State = 1
    LeftArrowLight.State = 1
    RightArrowLight.State = 1
    SpinnerLight.State = 1
    SuperBonusLight.State = 1
    X2Light.State = 1
    X3Light.State = 1
    X5Light.State = 1
    Bump1On
    Bump2On
    Bump3On
    KickBackLightOn
    BankShot1Light.State = 1
    BankShot2Light.State = 1
    BankShot3Light.State = 1
    BankShot4Light.State = 1
    BankShot5Light.State = 1
    BankShot6Light.State = 1
    BankShotLightOn
    SpecialLight.State = 1
End Sub




Sub AllPlasticsOn()
    Playfield1Off.IsDropped = True
    Plastic1Off.IsDropped = True
    Playfield2Off.IsDropped = True
    Plastic2Off.IsDropped = True
    Plastic5Off.IsDropped = True
    Playfield5Off.IsDropped = True
    Plastic6Off.IsDropped = True
    Playfield6Off.IsDropped = True
    Divider1.State = 1
    Divider2.State = 1
    Divider3.State = 1
    Playfield7Off.IsDropped = True
    Plastic7aOff.IsDropped = True
    Plastic7bOff.IsDropped = True
    Playfield8Off.IsDropped = True
    Plastic8Off.IsDropped = True
    Bump1.State = 1
    Bump2.State = 1
    Bump3.State = 1
'   Bulb1a.State = 1
'   Bulb1b.State = 1
'   Bulb2a.State = 1
    Bulb2b.State = 1
    Bulb5a.State = 1
'   Bulb6a.State = 1
'   Bulb6b.State = 1
    Bulb7a.State = 1
    Bulb7b.State = 1
    Bulb7c.State = 1
    Bulb7d.State = 1    
    Bulb7e.State = 1
    Bulb7f.State = 1    
    Bulb7g.State = 1
'   Bulb8a.State = 1
'   Bulb8b.State = 1
    Bulb9a.State = 1
    Bulb9b.State = 1
    Bulb9c.State = 1
End Sub




Sub AllPlasticsOff()
    Playfield1Off.IsDropped = False
    Plastic1Off.IsDropped = False
    Playfield2Off.IsDropped = False
    Plastic2Off.IsDropped = False
    Plastic5Off.IsDropped = False
    Playfield5Off.IsDropped = False
    Plastic6Off.IsDropped = False
    Playfield6Off.IsDropped = False
    Divider1.State = 0
    Divider2.State = 0
    Divider3.State = 0
    Playfield7Off.IsDropped = False
    Plastic7aOff.IsDropped = False
    Plastic7bOff.IsDropped = False
    Playfield8Off.IsDropped = False
    Plastic8Off.IsDropped = False
    Bump1.State = 0
    Bump2.State = 0
    Bump3.State = 0
'   Bulb1a.State = 0
'   Bulb1b.State = 0
'   Bulb2a.State = 0
    Bulb2b.State = 0
    Bulb5a.State = 0
'   Bulb6a.State = 0
'   Bulb6b.State = 0
    Bulb7a.State = 0
    Bulb7b.State = 0
    Bulb7c.State = 0
    Bulb7d.State = 0    
    Bulb7e.State = 0
    Bulb7f.State = 0    
    Bulb7g.State = 0
'   Bulb8a.State = 0
'   Bulb8b.State = 0
    Bulb9a.State = 0
    Bulb9b.State = 0
    Bulb9c.State = 0

End Sub



Sub BankShotLightOn()
    BankShotLight.State = 1
    BankRailGlow.IsDropped = False
    BankRailNormal.IsDropped = True
End Sub

Sub BankShotLightOff
    BankShotLight.State = 0
    BankRailGlow.IsDropped = True
    BankRailNormal.IsDropped = False
End Sub


Sub KickBackLightOn()
    KickBackLight.State = 1
    KBRailGlow.IsDropped = False
    KBRailNormal.IsDropped = True
End Sub

Sub KickBackLightOff
    KickBackLight.State = 0
    KBRailGlow.IsDropped = True
    KBRailNormal.IsDropped = False
End Sub


Sub Plastic1Flash(Length)
    Plastic1Off.IsDropped = False
    Playfield1Off.IsDropped = False
'   Bulb1a.State = 0
'   Bulb1b.State = 0
    Plastic1Off.TimerInterval = Length
    Plastic1Off.TimerEnabled = True
End Sub
Sub Plastic1Off_Timer()
    Plastic1Off.IsDropped = True
    Playfield1Off.IsDropped = True
    Plastic1Off.TimerEnabled = False
'   Bulb1a.State = 1
'   Bulb1b.State = 1
End Sub






Sub Plastic2Flash(Length)
    Plastic2Off.IsDropped = False
    Playfield2Off.IsDropped = False
'   Bulb2a.State = 0
    Bulb2b.State = 0
    Plastic2Off.TimerInterval = Length
    Plastic2Off.TimerEnabled = True
End Sub
Sub Plastic2Off_Timer()
    Plastic2Off.IsDropped = True
    Playfield2Off.IsDropped = True
    Plastic2Off.TimerEnabled = False
'   Bulb2a.State = 1
    Bulb2b.State = 1
End Sub








Sub Plastic5Flash(Length)
    Plastic5Off.IsDropped = False
    Playfield5Off.IsDropped = False
    Bulb5a.State = 0
    Plastic5Off.TimerInterval = Length
    Plastic5Off.TimerEnabled = True
End Sub
Sub Plastic5Off_Timer()
    Plastic5Off.IsDropped = True
    Playfield5Off.IsDropped = True
    Plastic5Off.TimerEnabled = False
    Bulb5a.State = 1
End Sub




Sub Plastic6Flash(Length)
    Plastic6Off.IsDropped = False
    Playfield6Off.IsDropped = False
'   Bulb6a.State = 0
'   Bulb6b.State = 0
    Plastic6Off.TimerInterval = Length
    Plastic6Off.TimerEnabled = True
End Sub
Sub Plastic6Off_Timer()
    Plastic6Off.IsDropped = True
    Playfield6Off.IsDropped = True
    Plastic6Off.TimerEnabled = False
'   Bulb6a.State = 1
'   Bulb6b.State = 1
End Sub





Sub Plastic7Flash(Length)
    Plastic7aOff.IsDropped = False
    Plastic7bOff.IsDropped = False
    Playfield7Off.IsDropped = False
    Divider1.State = 0
    Divider2.State = 0
    Divider3.State = 0
    Bulb7a.State = 0
    Bulb7b.State = 0
    Bulb7c.State = 0
    Bulb7d.State = 0    
    Bulb7e.State = 0
    Bulb7f.State = 0    
    Bulb7g.State = 0
    Plastic7aOff.TimerInterval = Length
    Plastic7aOff.TimerEnabled = True
End Sub
Sub Plastic7aOff_Timer()
    Divider1.State = 1
    Divider2.State = 1
    Divider3.State = 1
    Bulb7a.State = 1
    Bulb7b.State = 1
    Bulb7c.State = 1
    Bulb7d.State = 1    
    Bulb7e.State = 1
    Bulb7f.State = 1    
    Bulb7g.State = 1
    Plastic7aOff.IsDropped = True
    Plastic7bOff.IsDropped = True
    Playfield7Off.IsDropped = True
    Plastic7aOff.TimerEnabled = False
End Sub





Sub Plastic8Flash(Length)
    Plastic8Off.IsDropped = False
    Playfield8Off.IsDropped = False
'   Bulb8a.State = 0
'   Bulb8b.State = 0
    Plastic8Off.TimerInterval = Length
    Plastic8Off.TimerEnabled = True
End Sub
Sub Plastic8Off_Timer()
    Plastic8Off.IsDropped = True
    Playfield8Off.IsDropped = True
    Plastic8Off.TimerEnabled = False
'   Bulb8a.State = 1
'   Bulb8b.State = 1
End Sub





'--------------------------------------------------------------------------













'-----------------------------------------------------------SLINGSHOT SHIT
Sub CLeftSlingshot_Slingshot(Index)
    PlaySound "rsling"
    PlaySound SlingshotSound
    Plastic1Flash 100
    AddScore 10
End Sub

Sub CRightSlingshot_Slingshot(Index)
    PlaySound "rsling"
    PlaySound SlingshotSound
    Plastic2Flash 100
    Addscore 10
End Sub
'--------------------------------------------------------------------------


 
 
 '-----------------------------------------------------------SPRINGY GATES SHIT
 Sub GateSpringDown2_Hit()
     GateSpring2.IsDropped = True
 End Sub
 
 Sub GateSpringUp2_Hit()
     GateSpring2.IsDropped = False
 End Sub
 
 Sub GateSpringDown1_Hit()
     GateSpring1.IsDropped = True
 End Sub
 
 Sub GateSpringUp1_Hit()
     GateSpring1.IsDropped = False
     If OptionBallSaver = "ON" and BallSaving.Enabled = False And ShootAgainLight.State = 2 Then
        BallSaving.Interval = 10000
        BallSaving.Enabled = True
     End If
 End Sub
     
 
     
 
 



'-----------------------------------------------------------SPINNER SHIT
Sub Spinner_Spin()
    ChangeArrow
    If SpinnerLight.State = 0 Then
       AddScore 10
       StopSounds
       PlaySound SpinnerUnlitSound
    ElseIf SpinnerLight.State <> 0 Then
       AddScore 1000
       StopSounds
       PlaySound SpinnerLitSound
    End If
End Sub
'---------------------------------------------------------------------




'-------------------------------------------------------------ROLLOVER SHIT
Sub Lane1Rollover_Hit()
    If Tilt = 0 Then
       StopSounds    
       If First7 = 1 Then
          If Bonus1Light.State = 0 Then
             PlaySound LaneSound
             Bonus1Light.BlinkInterval = 50
             Bonus1Light.State = 2
             Bonus1Light.TimerInterval = 500
             Bonus1Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          OneBallLight.State = 0
          PocketedBalls(1) = 1
       ElseIf First7 = 0 Then
          If Bonus9Light.State = 0 Then
             PlaySound LaneSound
             Bonus9Light.BlinkInterval = 50
             Bonus9Light.State = 2
             Bonus9Light.TimerInterval = 500
             Bonus9Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          NineBallLight.State = 0
          PocketedBalls(9) = 1
      End If          
      AddScore 500
      CheckBalls
      CheckArrow
    End If
End Sub  







Sub Lane2Rollover_Hit()
    If Tilt = 0 Then
       StopSounds    
       If First7 = 1 Then
          If Bonus2Light.State = 0 Then
             PlaySound LaneSound
             Bonus2Light.BlinkInterval = 50
             Bonus2Light.State = 2
             Bonus2Light.TimerInterval = 500
             Bonus2Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          TwoBallLight.State = 0
          PocketedBalls(2) = 1
       ElseIf First7 = 0 Then
          If Bonus10Light.State = 0 Then
             PlaySound LaneSound
             Bonus10Light.BlinkInterval = 50
             Bonus10Light.State = 2
             Bonus10Light.TimerInterval = 500
             Bonus10Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          TenBallLight.State = 0
          PocketedBalls(10) = 1
      End If          
      AddScore 500
      CheckBalls
      CheckArrow
      If ArrowEnabled = 1 Then
         If Arrow = -1 and X2Light.TimerEnabled = False and X3Light.TimerEnabled = False and X5Light.TimerEnabled = False and  ShootAgainLight.TimerEnabled = False  Then AwardBankShot
      End If
    End If
End Sub  








Sub Lane3Rollover_Hit()
    If Tilt = 0 Then
       StopSounds    
       If First7 = 1 Then
          If Bonus3Light.State = 0 Then
             PlaySound LaneSound
             Bonus3Light.BlinkInterval = 50
             Bonus3Light.State = 2
             Bonus3Light.TimerInterval = 500
             Bonus3Light.TimerEnabled = True             
          Else
             PlaySound LaneLitSound
          End If
          ThreeBallLight.State = 0
          PocketedBalls(3) = 1
       ElseIf First7 = 0 Then
          If Bonus11Light.State = 0 Then
             PlaySound LaneSound
             Bonus11Light.BlinkInterval = 50
             Bonus11Light.State = 2
             Bonus11Light.TimerInterval = 500
             Bonus11Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          ElevenBallLight.State = 0
          PocketedBalls(11) = 1
      End If          
      AddScore 500
      CheckBalls
      CheckArrow
      If ArrowEnabled = 1 Then
         If Arrow = 1 and X2Light.TimerEnabled = False and X3Light.TimerEnabled = False and X5Light.TimerEnabled = False and  ShootAgainLight.TimerEnabled = False  Then AwardBankShot
      End If
    End If
End Sub  





Sub Lane4Rollover_Hit()
    If Tilt = 0 Then
       StopSounds    
       If First7 = 1 Then
          If Bonus4Light.State = 0 Then
             PlaySound LaneSound
             Bonus4Light.BlinkInterval = 50
             Bonus4Light.State = 2
             Bonus4Light.TimerInterval = 500
             Bonus4Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          FourBallLight.State = 0
          PocketedBalls(4) = 1
       ElseIf First7 = 0 Then
          If Bonus12Light.State = 0 Then
             PlaySound LaneSound
             Bonus12Light.BlinkInterval = 50
             Bonus12Light.State = 2
             Bonus12Light.TimerInterval = 500
             Bonus12Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          TwelveBallLight.State = 0
          PocketedBalls(12) = 1
      End If          
      AddScore 500
      CheckBalls
      CheckArrow
    End If
End Sub  








Sub ReturnLaneRollover_Hit()
    If Tilt = 0 Then
       StopSounds
       If First7 = 1 Then
          If Bonus7Light.State = 0 Then
             PlaySound LaneSound
             Bonus7Light.BlinkInterval = 50
             Bonus7Light.State = 2
             Bonus7Light.TimerInterval = 500
             Bonus7Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          SevenBallLight.State = 0
          PocketedBalls(7) = 1
       ElseIf First7 = 0 Then
          If Bonus15Light.State = 0 Then
             PlaySound LaneSound
             Bonus15Light.BlinkInterval = 50
             Bonus15Light.State = 2
             Bonus15Light.TimerInterval = 500
             Bonus15Light.TimerEnabled = True
          Else
             PlaySound LaneLitSound
          End If
          FifteenBallLight.State = 0
          PocketedBalls(15) = 1
      End If          
      AddScore 500
      CheckBalls
    End If
End Sub  









Sub LeftOutlaneRollover_Hit()
    If Tilt = 0 Then
       If KickBackLight.State <> 0 Then
          KickBackReady = 0
          StopSounds
          PlaySound KickBackSound
          KickBack.TimerInterval = 250
          KickBack.TimerEnabled = True
          KickBack.Fire
          KickBackBlink 25
          KickBackLight.TimerInterval = 750
          KickBackLight.TimerEnabled = True
          Addscore 4000
          PlaySound "jet3"
       ElseIf KickBackLight.State = 0 Then
          StopSounds
          PlaySound LaneLitSound
          Addscore 1000
       End If
    End If
End Sub

Sub KickBack_Timer()
    KickBack.PullBack
    KickBack.TimerEnabled = False
End Sub





Sub RightOutlaneRollover_Hit()
    If Tilt = 0 Then
       If SpecialLight.State <> 0 Then 
          AddScore 100000
          ExtraBall = ExtraBall + 1
          ShootAgainLight.BlinkInterval = 25
          ShootAgainLight.State = 2
          ShootAgainLight.TimerInterval = 500
          ShootAgainLight.TimerEnabled = True
          StopSounds
          PlaySound SpecialSound
          SpecialLight.State = 0 
          SpecialReady = 0
       ElseIf SpecialLight.State = 0 Then
          StopSounds
          PlaySound LaneLitSound
          AddScore 1000
       End If
    End If
End Sub
Sub ShootAgainLight_Timer()
    ShootAgainLight.State = 1
    ShootAgainLight.TimerEnabled = False
End Sub          
            





Sub BankShotRollover_Hit()
  If Tilt = 0 Then
    If BankShotAward = 1 Then
       AddScore 300
    ElseIf BankShotAward = 2 Then
       AddScore 600
    ElseIf BankShotAward = 3 Then
       AddScore 900
    ElseIf BankShotAward = 4 Then
       AddScore 1200
    ElseIf BankShotAward = 5 Then
       AddScore 1500
    ElseIf BankShotAward => 6 Then
       AddScore 5000
    End If
    AwardBankShot
  End If
End Sub
'------------------------------------------------------------------------------






'--------------------------------------------------------------------ARROW SHIT!
Sub CheckArrow()
    If ArrowEnabled = 0 Then
     If OptionDifficultyLevel = "EASY" Then
       If Bonus2Light.State <> 0 And Bonus3Light.State <> 0 Then
          ArrowEnabled = 1
          Arrow = 1
          LeftArrowLight.State = 0
          RightArrowLight.State = 1
          StopSounds
          PlaySound BankShotSound
       End IF
     ElseIf OptionDifficultyLevel = "HARD" Then
       If Bonus1Light.State <> 0 And Bonus2Light.State <> 0 And Bonus3Light.State <> 0 And Bonus4Light.State <> 0 Then
          ArrowEnabled = 1
          Arrow = 1
          LeftArrowLight.State = 0
          RightArrowLight.State = 1
          StopSounds
          PlaySound BankShotSound
       End If
     End If
   End IF
End Sub          


'------------------------------------------------------------------BANK SHOT SHIT
Sub AwardBankShot()
    StopSounds
    PlaySound BankShotSound
    If BankShotAward = 1 Then
       BankShot1Light.State = 0
       BankShot2Light.State = 1
    ElseIf BankShotAward = 2 Then
       BonusMultiplier = 2
       X2Light.BlinkInterval = 25
       X2Light.State = 2
       X2Light.TimerInterval = 1000
       X2Light.TimerEnabled = True
       BankShot2Light.State = 0
       BankShot3Light.State = 1
    ElseIf BankShotAward = 3 Then
       BonusMultiplier = 3
       X3Light.BlinkInterval = 25
       X3Light.State = 2
       X3Light.TimerInterval = 1000
       X3Light.TimerEnabled = True
       BankShot3Light.State = 0
       BankShot4Light.State = 1    
    ElseIf BankShotAward = 4 Then
       BonusMultiplier = 5
       X5Light.BlinkInterval = 25
       X5Light.State = 2
       X5Light.TimerInterval = 1000
       X5Light.TimerEnabled = True
       BankShot4Light.State = 0
       BankShot5Light.State = 1    
    ElseIf BankShotAward = 5 Then
       StopSounds
       PlaySound ExtraBallSound
       ShootAgainLight.BlinkInterval = 25
       ShootAgainLight.State = 2
       ShootAgainLight.TimerInterval = 1000
       ShootAgainLight.TimerEnabled = True
       ExtraBall = ExtraBall + 1
       BankShot5Light.State = 0
       BankShot6Light.State = 1
    End If
    BankShotAward = BankShotAward + 1
    BankShotLightOff
    BankShotLight.TimerInterval = 100
    BankShotLight.TimerEnabled = True
End SUb

Sub BankShotLight_Timer()
    BankShotLightOn
    BankShotLight.TimerEnabled = False
End Sub


Sub X2Light_Timer()
    X2Light.State = 1
    X2Light.TimerEnabled = False
End Sub

Sub X3Light_Timer()
    X3Light.State = 1
    X3Light.TimerEnabled = False
End Sub


Sub X5Light_Timer()
    X5Light.State = 1
    X5Light.TimerEnabled = False
End Sub





'---------------------------------------------------------------CHECK FOR SEVEN BALLS SHIT
Sub CheckBalls


    If First7 = 1 Then
       For x = 1 to 7
           If Eval("Bonus" & x & "Light").State = 0 Then Exit Sub
       Next
       EightBallReady = 1
       If EightBallLight.State = 0 Then
          StopSounds
          PlaySound EightBallReadySound
          EightBallLight.BlinkInterval = 25
          EightBallLight.State = 2
          EightBallLight.TimerInterval = 800
          EightBallLight.TimerEnabled = True
       End If
    ElseIf First7 = 0 Then
       For x = 9 to 15
           If PocketedBalls(x) = 0 Then Exit Sub
       Next 
       EightBallReady = 1
       If EightBallLight.State = 0 Then
          StopSounds
          PlaySound EightBallReadySound
          EightBallLight.BlinkInterval = 25
          EightBallLight.State = 2
          EightBallLight.TimerInterval = 800
          EightBallLight.TimerEnabled = True
       End If          
    End If

End Sub  
Sub EightBallLight_Timer()
    EightBallLight.State = 1
    EightBallLight.TimerEnabled = False
End Sub
 
 
 
 
 Sub BallSound_UnHit()
     PlaySound "BallRoll2"
 End Sub
'---------------------------------------------------------------------------















'---------------------------------------------------------------TARGET SHIT
'specific targets hit
Sub Stand3a_Hit()
    If Tilt = 0 Then
       StopSounds    
       If First7 = 1 Then
          SixBallLight.State = 0
          If Bonus6Light.State = 0 Then
             Bonus6Light.BlinkInterval = 50
             Bonus6Light.State = 2
             Bonus6Light.TimerInterval = 500
             Bonus6Light.TimerEnabled = True
          End If
          PocketedBalls(6) = 1
       End If
       If First7 = 0 Then
          FourteenBallLight.State = 0
          If Bonus14Light.State = 0 Then
             Bonus14Light.BlinkInterval = 50
             Bonus14Light.State = 2
             Bonus14Light.TimerInterval = 500
             Bonus14Light.TimerEnabled = True
          End If
          PocketedBalls(14) = 1
       End If
       AddScore 300
       StopSounds
       PlaySound TargetSound
       CheckBalls
    End If
End Sub


Sub Stand1a_Hit()
    If Tilt = 0 Then
       StopSounds
       If First7 = 1 Then
          FiveBallLight.State = 0
          If Bonus5Light.State = 0 Then
             Bonus5Light.BlinkInterval = 50
             Bonus5Light.State = 2
             Bonus5Light.TimerInterval = 500
             Bonus5Light.TimerEnabled = True
          End If
          PocketedBalls(5) = 1
       End If
       If First7 = 0 Then
          ThirteenBallLight.State = 0
          If Bonus13Light.State = 0 Then
             Bonus13Light.BlinkInterval = 50
             Bonus13Light.State = 2
             Bonus13Light.TimerInterval = 500
             Bonus13Light.TimerEnabled = True
          End If
          PocketedBalls(13) = 1
       End If
       AddScore 300
       StopSounds
       PlaySound TargetSound
       CheckBalls
    End If
End Sub




Sub Stand2a_Hit()
    If Tilt = 0 Then
      AddScore 300
      StopSounds
      PlaySound TargetSound
      
      If SpinnerLight.State = 0 Then
         SpinnerLight.BlinkInterval = 25
         SpinnerLight.State = 2
         SpinnerLight.TimerInterval = 800
         SpinnerLight.TimerEnabled = True
         StopSounds
         PlaySound TargetSound
      End If
      
      If KickBackLight.State = 0 Then 
         If KBRailGlow.TimerEnabled = False Then
            KickBackBlink 25
            KickBackLight.TimerInterval = 800
            KickBackLight.TimerEnabled = True
            StopSounds
            PlaySound GetKickBackSound
            KickBackReady = 1
         End IF
      End If
   End If

End Sub



Sub KickBackBlink(Rate)
    KickBackBlinker = 1
    KBRailGlow.TimerInterval = Rate
    KBRailGlow.TimerEnabled = True
End Sub

Sub KBRailGlow_Timer()
    If KickBackBlinker = 1 Then
       KickBackLightOn
       KickBackBlinker = 0
    ElseIf KickBackBlinker = 0 Then 
       KickBackLightOff
       KickBackBlinker = 1
    End If
End Sub        




Sub Stand4a_Hit()
   If Tilt = 0 Then
   
      AddScore 300
      StopSounds
      PlaySound TargetSound
      
      If SpinnerLight.State = 0 Then
         SpinnerLight.BlinkInterval = 25
         SpinnerLight.State = 2
         SpinnerLight.TimerInterval = 800
         SpinnerLight.TimerEnabled = True
         StopSounds
         PlaySound TargetSound
      End If
      
      If KickBackLight.State = 0 Then 
         KickBackLight.BlinkInterval = 25
         KickBackLight.State = 2
         KickBackLight.TimerInterval = 800
         KickBackLight.TimerEnabled = True
         StopSounds
         PlaySound GetKickBackSound
         KickBackReady = 1
      End If

      If EightBallLight.State <> 0 Then
         StopSounds
         PlaySound EightBallCollectedSound
         AddScore 600
         Bonus8Light.State = 1
         EightBallLight.State = 0
         EightBallReady = 0
        If First7 = 1 Then
           First7 = 0
           If OptionDifficultyLevel = "EASY" Then
              If RackCounter = 0 Then
                 SuperBonusEnabled = 1
                 SuperBonusLight.State = 1
              ElseIf RackCounter > 0 Then
                 StopSounds
                 PlaySound ExtraBallSound
                 ShootAgainLight.State = 1
              End If
           End If
           PocketedBalls(8) = 1
           NineBallLight.State = 1
           TenBallLight.State = 1
           ElevenBallLight.State = 1
           TwelveBallLight.State = 1
           ThirteenBallLight.State = 1
           FourteenBallLight.State = 1
           FifteenBallLight.State = 1
        ElseIf First7 = 0 Then
           If OptionDifficultyLevel = "EASY" Then
              If RackCounter = 0 Then
                 SpecialReady = 1
                 SpecialLight.State = 1
              End If
           ElseIf OptionDifficultyLevel = "HARD" Then
              If RackCounter = 0 Then
                 SuperBonusEnabled = 1
                 SuperBonusLight.State = 1
              ElseIf RackCounter = 1 Then
                 SpecialReady = 1
                 SpecialLight.State = 1
              ElseIf RackCounter >= 2 Then
                 StopSounds
                 PlaySound ExtraBallSound
                 ShootAgainLight.State = 1
              End If
           End If
           For x = 1 to 15
               Eval("Bonus" & x & "Light").State = 0
               PocketedBalls(x) = 0
           Next
           RackCounter = RackCounter + 1
           First7 = 1
           AwardingRack = 1
           For x = 1 to 15
               Eval("Bonus" & x & "Light").BlinkInterval = 50
               Eval("Bonus" & x & "Light").State = 2
           Next
           Bonus1Light.TimerInterval = 1000
           Bonus1Light.TimerEnabled = True
           OneBallLight.State = 1
           TwoBallLight.State = 1
           ThreeBallLight.State = 1
           FourBallLight.State = 1
           FiveBallLight.State = 1
           SixBallLight.State = 1
           SevenBallLight.State = 1
         End If
      End If
   End If
End Sub          

Sub Bonus1Light_Timer()
    If AwardingRack = 1 Then
       ResetBalls
       AwardingRack = 0
    ElseIf AwardingRack = 0 Then
       Bonus1Light.State = 1
    End If
    Bonus1Light.TimerEnabled = False
End Sub

Sub Bonus2Light_Timer()
    Bonus2Light.State = 1
    Bonus2Light.TimerEnabled = False
End Sub

Sub Bonus3Light_Timer()
    Bonus3Light.State = 1
    Bonus3Light.TimerEnabled = False
End Sub

Sub Bonus4Light_Timer()
    Bonus4Light.State = 1
    Bonus4Light.TimerEnabled = False
End Sub

Sub Bonus5Light_Timer()
    Bonus5Light.State = 1
    Bonus5Light.TimerEnabled = False
End Sub

Sub Bonus6Light_Timer()
    Bonus6Light.State = 1
    Bonus6Light.TimerEnabled = False
End Sub

Sub Bonus7Light_Timer()
    Bonus7Light.State = 1
    Bonus7Light.TimerEnabled = False
End Sub

Sub Bonus8Light_Timer()
    Bonus8Light.State = 1
    Bonus8Light.TimerEnabled = False
End Sub

Sub Bonus9Light_Timer()
    Bonus9Light.State = 1
    Bonus9Light.TimerEnabled = False
End Sub

Sub Bonus10Light_Timer()
    Bonus10Light.State = 1
    Bonus10Light.TimerEnabled = False
End Sub

Sub Bonus11Light_Timer()
    Bonus11Light.State = 1
    Bonus11Light.TimerEnabled = False
End Sub

Sub Bonus12Light_Timer()
    Bonus12Light.State = 1
    Bonus12Light.TimerEnabled = False
End Sub

Sub Bonus13Light_Timer()
    Bonus13Light.State = 1
    Bonus13Light.TimerEnabled = False
End Sub

Sub Bonus14Light_Timer()
    Bonus14Light.State = 1
    Bonus14Light.TimerEnabled = False
End Sub

Sub Bonus15Light_Timer()
    Bonus15Light.State = 1
    Bonus15Light.TimerEnabled = False
End Sub


Sub SpinnerLight_Timer()
    SpinnerLight.State = 1
    SpinnerLight.TimerEnabled = False
End Sub

Sub KickBackLight_Timer() 
    If KickBackReady = 1 Then
       KickBackLightOn
       KickBackHelper.IsDropped = False
    ElseIf KickBackReady = 0 Then
       KickBackLightOff
       KickBackHelper.IsDropped = True
    End If
    KickBackLight.TimerEnabled = False
    KBRailGlow.TimerEnabled = False
End Sub
       




'target animations
Sub CStanda_Hit(Index)
    StandUpFrame(Index) = 1
    PlaySound "Click"
    CStanda(Index).IsDropped = True
    CStandb(Index).IsDropped = False
    CStanda(Index).TimerInterval = 25
    CStanda(Index).TimerEnabled = True
End Sub

Sub CStanda_Timer(Index)
    If StandUpFrame(Index) = 1 Then
       CStandb(Index).IsDropped = True
       CStandc(Index).IsDropped = False
    ElseIf StandUpFrame(Index) = 2 Then
       CStandc(Index).IsDropped = True
       CStandb(Index).IsDropped = False
    ElseIf StandUpFrame(Index) = 3 Then
       CStandb(Index).IsDropped = True
       CStanda(Index).IsDropped = False
       CStanda(Index).TimerEnabled = False
    End If
    StandUpFrame(Index) = StandUpFrame(Index) + 1
End Sub
'-------------------------------------------------------------------------









'------------------------------------------------------------REBOUNDING SHIT
Sub Points1_Hit()
    If Tilt = 0 Then
       StopSounds
       PlaySound SpinnerUnlitSound
       AddScore 10
    End If
End Sub

Sub Points2_Hit()
    If Tilt = 0 Then
       StopSounds
       PlaySound SpinnerUnlitSound
       AddScore 10
    End If
End Sub

Sub Points3_Hit()
    If Tilt = 0 Then
       StopSounds
       PlaySound SpinnerUnlitSound
       AddScore 10
    End If
End Sub

Sub Points4_Hit()
    If Tilt = 0 Then
       StopSounds
       PlaySound SpinnerUnlitSound
       AddScore 10
    End If
End Sub







'--------------------------------------------------------------BUMPER SHIT
Sub CBumpers_Hit(Index)
    StopSounds
    PlaySound BumperSound
    AnimateBumpers(Index)
    ChangeArrow
    AddScore 100
End Sub

Sub AnimateBumpers(Index)
    BumperFrame(Index) = 1
    CBumpersRing1(Index).IsDropped = False
    CBumpers(Index).TimerInterval = 30
    CBumpers(Index).TimerEnabled = True
    If Index = 0 Then Bump1Off
    If Index = 1 Then Bump2Off
    If Index = 2 Then Bump3Off
End Sub

Sub CBumpers_Timer(Index)
    If BumperFrame(Index) = 1 Then
       CBumpersRing1(Index).IsDropped = True
       CBumpersRing2(Index).IsDropped = False
    ElseIf BumperFrame(Index) = 2 Then
       CBumpersRing2(Index).IsDropped = True
       CBumpersRing3(Index).IsDropped = False
    ElseIf BumperFrame(Index) = 3 Then
       CBumpersRing3(Index).IsDropped = True
       CBumpersRing2(Index).IsDropped = False
    ElseIf BumperFrame(Index) = 4 Then
       CBumpersRing2(Index).IsDropped = True
       CBumpersRing1(Index).IsDropped = False
    ElseIf BumperFrame(Index) = 5 Then
       CBumpersRing1(Index).IsDropped = True
       CBumpers(Index).TimerEnabled = False
       If Index = 0 Then Bump1On
       If Index = 1 Then Bump2On
       If Index = 2 Then Bump3On
    End If
    BumperFrame(Index) = BumperFrame(Index) + 1
End Sub





Sub ChangeArrow()
    If ArrowEnabled = 1 Then
       Arrow = -Arrow
       If Arrow = 1 Then
          LeftArrowLight.State = 0
          RightArrowLight.State = 1
       ElseIf Arrow = -1 Then
          LeftArrowLight.State = 1
          RightArrowLight.State = 0
       End If
    End If
End Sub



Sub Bump1Off()
    Bump1.State = 0
    Bump1DarkBaseA.IsDropped = False
    Bump1DarkBaseB.IsDropped = False
    Bump1DarkBaseC.IsDropped = False
    Bump1DarkBaseD.IsDropped = False
    Bump1Glow.IsDropped = False
End Sub

Sub Bump1On()
    Bump1.State = 1
    Bump1DarkBaseA.IsDropped = True
    Bump1DarkBaseB.IsDropped = True
    Bump1DarkBaseC.IsDropped = True
    Bump1DarkBaseD.IsDropped = True
    Bump1Glow.IsDropped = True
End Sub


Sub Bump2Off()
    Bump2.State = 0
    Bump2DarkBaseA.IsDropped = False
    Bump2DarkBaseB.IsDropped = False
    Bump2DarkBaseC.IsDropped = False
    Bump2DarkBaseD.IsDropped = False
    Bump2Glow.IsDropped = False
End Sub

Sub Bump2On()
    Bump2.State = 1
    Bump2DarkBaseA.IsDropped = True
    Bump2DarkBaseB.IsDropped = True
    Bump2DarkBaseC.IsDropped = True
    Bump2DarkBaseD.IsDropped = True
    Bump2Glow.IsDropped = True
End Sub

Sub Bump3Off()
    Bump3.State = 0
    Bump3DarkBaseA.IsDropped = False
    Bump3DarkBaseB.IsDropped = False
    Bump3DarkBaseC.IsDropped = False
    Bump3DarkBaseD.IsDropped = False
    Bump3Glow.IsDropped = False
End Sub

Sub Bump3On()
    Bump3.State = 1
    Bump3DarkBaseA.IsDropped = True
    Bump3DarkBaseB.IsDropped = True
    Bump3DarkBaseC.IsDropped = True
    Bump3DarkBaseD.IsDropped = True
    Bump3Glow.IsDropped = True
End Sub





Sub Bump1_Hit()
    PlaySound "Jet1"
End Sub


Sub Bump2_Hit()
    PlaySound "Jet2"
End Sub


Sub Bump3_Hit()
    PlaySound "Jet1"
End Sub


'----------------------------------------------------------------------------- 


 
  
   
    
     
      
       
        
         
          
           
             
'-------------------------------------------------------------------LED SCORE SHIT (from Bendigo!) 
Dim Value,Tmp,Tmp2,Rst,Segment,Score,Points,Count,LED,Selected,Calc,OverFlow,CCount,Pattern(9)

' ************************************ Define the segment patterns *****************************

Pattern(0)=Array(1,1,1,1,1,1,0,0,0,0)				'Pattern for 0				
Pattern(1)=Array(0,0,0,0,0,0,1,1,0,0)				'Pattern for 1 
Pattern(2)=Array(1,0,1,1,0,1,0,0,1,1)				'Pattern for 2
Pattern(3)=Array(1,1,1,0,0,1,0,0,1,1)				'Pattern for 3
Pattern(4)=Array(0,0,0,0,1,0,1,1,1,1)				'Pattern for 4
Pattern(5)=Array(0,1,1,0,1,1,0,0,1,1)				'Pattern for 5
Pattern(6)=Array(0,1,1,1,1,1,0,0,1,1)				'Pattern for 6
Pattern(7)=Array(1,1,0,0,0,1,0,0,0,0)				'Pattern for 7
Pattern(8)=Array(1,1,1,1,1,1,0,0,1,1)				'Pattern for 8
Pattern(9)=Array(1,1,1,0,1,1,0,0,1,1)				'Pattern for 9

' *********************************** The AddScore Sub *****************************************

Sub AddScore(Points)
    Score=Score+Points
    If Score > 999999 Then
        RolledScore = RolledScore + 1
    	Score=Score-1000000							' Detect score overflow
    	OverFlow=True								' If score overflows, set a flag
    	ResetScore									' Blank leading digits
    End If
    
    Tmp=Score										' Tmp=value to process - DON'T alter 'Score'
    For Selected=Len(Tmp) to 1 Step -1				' Get the number of digits to process 
    	Calc=(10^Selected/10)						' The required formula
    	Value=Tmp\Calc								' Get the value of the highest digit
		Tmp=Tmp-(Value*Calc)						' Remove the highest digit from value of Tmp
    	For Count=(Selected*10)-9 To (Selected*10)	' Calculate display digit number
    		Segment=(Count-1) Mod 10				' Calculate segment number within digit
    		Tmp2=Eval("Pattern("&Value&")("&Segment&")") 'Get the segment state from the array
    		Eval("LED"&Count).State=Tmp2			' Update the segment
    	Next										' Repeat until all 10 segments are updated
    Next											' Repeat until all digits are updated
End Sub

' ************************************* The SCORE RESET sub ************************************

Sub ResetScore										' Reset the LED's after reset or overflow
	For Rst=11 to 60 : Eval("LED"&Rst).State=0 : Next ' Turn all LED's off
	AddScore 0										' Display score or "0" if score=0
	If OverFlow=True Then
		OverFlow=False								' Reset overflow flag
		'Over.Text="Score Overflow"					' TEXT box - for demo only
	End If
End Sub


' ************************************* End of demo code ***************************************


'----------------------------------------------TABLE INITIALIZATION SHIT
Sub Table1_Init()
    SlingshotSound = "SE13"
    BumperSound = "SE1"
    CreditSound = "SE2"
    ExtraBallSound = "SE3"
    LaneSound = "SE6"
    LaneLitSound = "SE5"
    GetBonusSound = "SE10"
    BankShotSound = "SE15"
    SpinnerUnlitSound = "SE9"
    SpinnerLitSound = "SE14"
    TargetSound = "SE16"
    KickBackSound = "SE12"
    EightBallReadySound = "SE11"
    EightBallCollectedSound = "SE8"
    GetKickBackSound = "SE7"
    SpecialSound = "SE20"
    TiltWarningSound = "SE17"
    TiltSound = "SE18"
    GameSong1 = "MusicMidnightKiss"
    GameSong2 = "MusicTheLounge"
    GameSong3 = "MusicFightItOut"
    GameSong4 = "MusicMeteorMan"
    Score=0	                                        ' Reset score value 
	AddScore 0                                      ' Activate the display
	BankRailNormal.IsDropped = True
	BankRailGlow.IsDropped = False
    For x = 0 to 2
        CBumpersRing1(x).IsDropped = True
        CBumpersRing2(x).IsDropped = True
        CBumpersRing3(x).IsDropped = True    
    Next
    For x = 0 to 3
        CStandb(x).IsDropped = True
        CStandc(x).IsDropped = True
    Next
    KickBack.PullBack
    Arrow = 1
    LoadOptions
    PowerOn
     
End Sub








Sub LoadOptions()
    On Error Resume Next
    MachineBroken=Cdbl(LoadValue("Eight Ball Remix", "MachineBroken"))
    OptionBallsPerGame=Cdbl(LoadValue("Eight Ball Remix","OptionBallsPerGame"))
    OptionBallSaver=(LoadValue("Eight Ball Remix","OptionBallSaver"))
    OptionDifficultyLevel=(LoadValue("Eight Ball Remix", "OptionDifficultyLevel"))
    OptionMusic=(LoadValue("Eight Ball Remix", "OptionMusic"))
    If MachineBroken = "" Then MachineBroken = 0
    If OptionBallsPerGame = "" Then OptionBallsPerGame = 3
    If OptionBallSaver = "" Then OptionBallSaver = "OFF"
    If OptionDifficultyLevel = "" Then OptionDifficultyLevel = "EASY"
    If OptionMusic = "" Then OptionMusic = "ON"
    LoadHighScore
End Sub

Sub LoadHighScore()
    HighScore = ""
    On Error Resume Next
    If OptionBallsPerGame = 3 And OptionBallSaver = "OFF" And OptionDifficultyLevel = "EASY" Then
       HighScore=Cdbl(LoadValue("Eight Ball Remix", "AAAHighScore"))
    ElseIf OptionBallsPerGame = 5 And OptionBallSaver = "OFF" And OptionDifficultyLevel = "EASY" Then
       HighScore=Cdbl(LoadValue("Eight Ball Remix", "BAAHighScore"))
    ElseIf OptionBallsPerGame = 3 And OptionBallSaver = "ON" And OptionDifficultyLevel = "EASY" Then
       HighScore=Cdbl(LoadValue("Eight Ball Remix", "ABAHighScore"))
    ElseIf OptionBallsPerGame = 3 And OptionBallSaver = "OFF" And OptionDifficultyLevel = "HARD" Then
       HighScore=Cdbl(LoadValue("Eight Ball Remix", "AABHighScore"))
    ElseIf OptionBallsPerGame = 5 And OptionBallSaver = "ON" And OptionDifficultyLevel = "EASY" Then
       HighScore=Cdbl(LoadValue("Eight Ball Remix", "BBAHighScore"))
    ElseIf OptionBallsPerGame = 3 And OptionBallSaver = "ON" And OptionDifficultyLevel = "HARD" Then
       HighScore=Cdbl(LoadValue("Eight Ball Remix", "ABBHighScore"))
    ElseIf OptionBallsPerGame = 5 And OptionBallSaver = "ON" And OptionDifficultyLevel = "HARD" Then
       HighScore=Cdbl(LoadValue("Eight Ball Remix", "BBBHighScore"))
    End If
    If HighScore = "" Then HighScore = 100000
    HighScoreBox.Text = HighScore
End Sub

Sub SaveHighScore()
    Score = Score + (RolledScore * 1000000)
    If HighScore < Score Then 
       HighScore = Score
       HighScoreBox.Text = HighScore
       If OptionBallsPerGame = 3 And OptionBallSaver = "OFF" And OptionDifficultyLevel = "EASY" Then
          SaveValue "Eight Ball Remix", "AAAHighScore", HighScore
       ElseIf OptionBallsPerGame = 5 And OptionBallSaver = "OFF" And OptionDifficultyLevel = "EASY" Then
          SaveValue "Eight Ball Remix", "BAAHighScore", HighScore
       ElseIf OptionBallsPerGame = 3 And OptionBallSaver = "ON" And OptionDifficultyLevel = "EASY" Then
          SaveValue "Eight Ball Remix", "ABAHighScore", HighScore
       ElseIf OptionBallsPerGame = 3 And OptionBallSaver = "OFF" And OptionDifficultyLevel = "HARD" Then
          SaveValue "Eight Ball Remix", "AABHighScore", HighScore
       ElseIf OptionBallsPerGame = 5 And OptionBallSaver = "ON" And OptionDifficultyLevel = "EASY" Then
          SaveValue "Eight Ball Remix", "BBAHighScore", HighScore
       ElseIf OptionBallsPerGame = 3 And OptionBallSaver = "ON" And OptionDifficultyLevel = "HARD" Then
          SaveValue "Eight Ball Remix", "ABBHighScore", HighScore
       ElseIf OptionBallsPerGame = 5 And OptionBallSaver = "ON" And OptionDifficultyLevel = "HARD" Then
          SaveValue "Eight Ball Remix", "BBBHighScore", HighScore
       End If
    End If
End Sub


Sub SaveOptions()
    SaveValue "Eight Ball Remix","MachineBroken", MachineBroken
    SaveValue "Eight Ball Remix","OptionBallsPerGame", OptionBallsPerGame
    SaveValue "Eight Ball Remix","OptionBallSaver", OptionBallSaver
    SaveValue "Eight Ball Remix","OptionDifficultyLevel", OptionDifficultyLevel
    SaveValue "Eight Ball Remix","OptionMusic", OptionMusic
    LoadHighScore
End Sub










Sub PowerOn()
    MachineBroken = MachineBroken + 1
   
    If MachineBroken => 24 Then
      DoNotPlay = 1
      MachineBroken = 0
      SuicideNote.SetValue (1)
    Else 
      DoNotPlay = 0
      SuicideNote.SetValue (0)
      If MachineBroken => 0 and MachineBroken <= 9 Then
         MachineWear = 0
      ElseIf MachineBroken => 10 And MachineBroken <= 14 Then
         MachineWear = 1
      ElseIf MachineBroken => 15 And MachineBroken <= 17 Then
         MachineWear = 2 
      ElseIf MachineBroken => 18 And MachineBroken <= 20 Then
         MachineWear = 3
      ElseIf MAchineBroken => 21 and MachineBroken <= 23 Then
         MachineWear = 4
      End If 
    End If
    ApplyTableWearAndTear
    AllLightsOff
    AllPlasticsOn
    AttractMode
    TiltBall.CreateBall
    TiltBall.Kick 0,0
End Sub

'---------------------------------------------------------TABLE GETS USED SHIT
Sub ApplyTableWearAndTear
    If MachineWear = 0 Then
       Table1.Slope = 5.2
       For x = 0 to 23
           CRubbers1(x).IsDropped = False
           CRubbers2(x).IsDropped = True 
           CRubbers3(x).IsDropped = True
           CRubbers4(x).IsDropped = True
           CRubbers5(x).IsDropped = True
       Next
       LeftFlipper1.Visible = True
       LeftFlipper2.Visible = False
       LeftFlipper3.Visible = False
       LeftFlipper4.Visible = False
       LeftFlipper5.Visible = False
       
       RightFlipper1.Visible = True
       RightFlipper2.Visible = False
       RightFlipper3.Visible = False
       RightFlipper4.Visible = False
       RightFlipper5.Visible = False
       
       BallGraphic = "Ball1"
    ElseIf MachineWear = 1 Then
       Table1.Slope = 5.1
       For x = 0 to 23
           CRubbers1(x).IsDropped = True
           CRubbers2(x).IsDropped = False
           CRubbers3(x).IsDropped = True
           CRubbers4(x).IsDropped = True
           CRubbers5(x).IsDropped = True
       Next
       LeftFlipper1.Visible = False
       LeftFlipper2.Visible = True 
       LeftFlipper3.Visible = False
       LeftFlipper4.Visible = False
       LeftFlipper5.Visible = False
       
       RightFlipper1.Visible = False
       RightFlipper2.Visible = True 
       RightFlipper3.Visible = False
       RightFlipper4.Visible = False
       RightFlipper5.Visible = False       
       BallGraphic = "Ball2"
    ElseIf MachineWear = 2 Then
       Table1.Slope = 5
       For x = 0 to 23
           CRubbers1(x).IsDropped = True
           CRubbers2(x).IsDropped = True 
           CRubbers3(x).IsDropped = False
           CRubbers4(x).IsDropped = True
           CRubbers5(x).IsDropped = True
       Next
       LeftFlipper1.Visible = False
       LeftFlipper2.Visible = False
       LeftFlipper3.Visible = True 
       LeftFlipper4.Visible = False
       LeftFlipper5.Visible = False
       
       RightFlipper1.Visible = False
       RightFlipper2.Visible = False
       RightFlipper3.Visible = True 
       RightFlipper4.Visible = False
       RightFlipper5.Visible = False
       BallGraphic = "Ball3"
    ElseIf MachineWear = 3 Then
       Table1.Slope = 4.75
       For x = 0 to 23
           CRubbers1(x).IsDropped = True
           CRubbers2(x).IsDropped = True 
           CRubbers3(x).IsDropped = True
           CRubbers4(x).IsDropped = False
           CRubbers5(x).IsDropped = True
       Next
       LeftFlipper1.Visible = False
       LeftFlipper2.Visible = False
       LeftFlipper3.Visible = False
       LeftFlipper4.Visible = True
       LeftFlipper5.Visible = False
       
       RightFlipper1.Visible = False
       RightFlipper2.Visible = False
       RightFlipper3.Visible = False
       RightFlipper4.Visible = True
       RightFlipper5.Visible = False
       BallGraphic = "Ball4"
    ElseIf MachineWear = 4 Then
       Table1.Slope = 4.5
       For x = 0 to 23
           CRubbers1(x).IsDropped = True
           CRubbers2(x).IsDropped = True 
           CRubbers3(x).IsDropped = True
           CRubbers4(x).IsDropped = True
           CRubbers5(x).IsDropped = False
       Next
       LeftFlipper1.Visible = False
       LeftFlipper2.Visible = False
       LeftFlipper3.Visible = False
       LeftFlipper4.Visible = False
       LeftFlipper5.Visible = True
       
       RightFlipper1.Visible = False
       RightFlipper2.Visible = False
       RightFlipper3.Visible = False
       RightFlipper4.Visible = False
       RightFlipper5.Visible = True
       BallGraphic = "Ball5"
    End If
End Sub



    

'----------------------------------------------------------------ATTRACT MODE SHIT
Sub AttractMode
    StopMusic
    If OptionMusic = "ON" Then
       PlaySound "MusicSunnyMorning", -1
    End If
    AttractModePart = 0 
    DoingSequencer = 0 
    AttractModeSequencer = 1
    BottomWall.TimerInterval = 250
    BottomWall.TimerEnabled = True
    StatusBox.Text = "INSERT COIN"
    BallInPlayBox.Text = "PUSH 'O' FOR OPTIONS"
End Sub
Sub BottomWall_Timer()
    If DoingSequencer = 0 Then
     If AttractModeSequencer = 1 Then
        Plastic1Flash 500
         
        OneBallLight.State = 1
        TwoBallLight.State = 0
        ThreeBallLight.State = 0
        FourBallLight.State = 0  

        FiveBallLight.State = 0
        SixBallLight.State = 0
        ThirteenBallLight.State = 0
        FourteenBallLight.State = 1     

 
        EightBallLight.State = 1

        NineBallLight.State = 0
        TenBallLight.State = 0
        ElevenBallLight.State = 0
        TwelveBallLight.State = 1
       
        SevenBallLight.State = 0
        FifteenBallLight.State = 0

        Bonus1Light.State = 1
        Bonus2Light.State = 0
        Bonus3Light.State = 0
        Bonus4Light.State = 0
        Bonus5Light.State = 0
        Bonus6Light.State = 0
        Bonus7Light.State = 0
        Bonus8Light.State = 0
        Bonus9Light.State = 0
        Bonus10Light.State = 0
        Bonus11Light.State = 0
        Bonus12Light.State = 0
        Bonus13Light.State = 0
        Bonus14Light.State = 0
        Bonus15Light.State = 0 

        LeftArrowLight.State = 1 
        RightArrowLight.State = 1 

        SpinnerLight.State = 0 

        SuperBonusLight.State = 1
        X2Light.State = 1
        X3Light.State = 0
        X5Light.State = 0

        KickBackLightOn

        Bump1On
        Bump2Off
        Bump3Off

        BankShot1Light.State = 1
        BankShot2Light.State = 0
        BankShot3Light.State = 0
        BankShot4Light.State = 1
        BankShot5Light.State = 0
        BankShot6Light.State = 0
        BankShotLightOn
 
        ShootAgainLight.State = 0


     ElseIf AttractModeSequencer = 2 Then

       OneBallLight.State = 1
       TwoBallLight.State = 1
       ThreeBallLight.State = 0
       FourBallLight.State = 0

       FiveBallLight.State = 0
       SixBallLight.State = 0
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 1

       EightBallLight.State = 0

       NineBallLight.State = 0
       TenBallLight.State = 0
       ElevenBallLight.State = 1
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 1
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 0
       X3Light.State = 1
       X5Light.State = 0

       KickBackLightOff

       Bump1Off
       Bump2On
       Bump3Off

       BankShot1Light.State = 0
       BankShot2Light.State = 1
       BankShot3Light.State = 0
       BankShot4Light.State = 0
       BankShot5Light.State = 1
       BankShot6Light.State = 0
       BankShotLightOn
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 3 Then

       Plastic2Flash 500

       OneBallLight.State = 1
       TwoBallLight.State = 1
       ThreeBallLight.State = 1
       FourBallLight.State = 0

       FiveBallLight.State = 0
       SixBallLight.State = 0
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 1

       EightBallLight.State = 1

       NineBallLight.State = 0
       TenBallLight.State = 1
       ElevenBallLight.State = 1
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 1
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 0
       X3Light.State = 0
       X5Light.State = 1

       KickBackLight.State = 0

       Bump1Off
       Bump2Off
       Bump3On

       BankShot1Light.State = 0
       BankShot2Light.State = 0
       BankShot3Light.State = 1
       BankShot4Light.State = 0
       BankShot5Light.State = 0
       BankShot6Light.State = 1
       BankShotLightOn
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 4 Then

       OneBallLight.State = 1
       TwoBallLight.State = 1
       ThreeBallLight.State = 1
       FourBallLight.State = 1

       FiveBallLight.State = 0
       SixBallLight.State = 0
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 1

       EightBallLight.State = 0

       NineBallLight.State = 1
       TenBallLight.State = 1
       ElevenBallLight.State = 1
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 1
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 1
       X3Light.State = 0
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1On
       Bump2Off
       Bump3Off

       BankShot1Light.State = 1
       BankShot2Light.State = 0
       BankShot3Light.State = 0
       BankShot4Light.State = 1
       BankShot5Light.State = 0
       BankShot6Light.State = 0
       BankShotLightOff
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 5 Then


       OneBallLight.State = 0
       TwoBallLight.State = 1
       ThreeBallLight.State = 1
       FourBallLight.State = 1

       FiveBallLight.State = 0
       SixBallLight.State = 1
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 1

       EightBallLight.State = 1

       NineBallLight.State = 1
       TenBallLight.State = 1
       ElevenBallLight.State = 1
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 1
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 0
       X3Light.State = 1
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1Off
       Bump2On
       Bump3Off

       BankShot1Light.State = 0
       BankShot2Light.State = 1
       BankShot3Light.State = 0
       BankShot4Light.State = 0
       BankShot5Light.State = 1
       BankShot6Light.State = 0
       BankShotLightOff
 
       ShootAgainLight.State = 0       

    ElseIf AttractModeSequencer = 6 Then

       OneBallLight.State = 0
       TwoBallLight.State = 0
       ThreeBallLight.State = 1
       FourBallLight.State = 1

       FiveBallLight.State = 0
       SixBallLight.State = 1
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 1

       EightBallLight.State = 0

       NineBallLight.State = 1
       TenBallLight.State = 1
       ElevenBallLight.State = 0
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 1
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 0
       X3Light.State = 0
       X5Light.State = 1

       KickBackLight.State = 0

       Bump1Off
       Bump2Off
       Bump3On

       BankShot1Light.State = 0
       BankShot2Light.State = 0
       BankShot3Light.State = 1
       BankShot4Light.State = 0
       BankShot5Light.State = 0
       BankShot6Light.State = 1
       BankShotLightOff
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 7 Then


       OneBallLight.State = 0
       TwoBallLight.State = 0
       ThreeBallLight.State = 0
       FourBallLight.State = 1

       FiveBallLight.State = 1 
       SixBallLight.State = 1
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 1

       EightBallLight.State = 1

       NineBallLight.State = 1
       TenBallLight.State = 0
       ElevenBallLight.State = 0
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 1
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 1
       X3Light.State = 0
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1On
       Bump2Off
       Bump3Off

       BankShot1Light.State = 1
       BankShot2Light.State = 0
       BankShot3Light.State = 0
       BankShot4Light.State = 1
       BankShot5Light.State = 0
       BankShot6Light.State = 0
       BankShotLightOn
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 8 Then

       OneBallLight.State = 0
       TwoBallLight.State = 0
       ThreeBallLight.State = 0
       FourBallLight.State =  0

       FiveBallLight.State = 1
       SixBallLight.State = 1
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 1

       EightBallLight.State = 0

       NineBallLight.State = 0
       TenBallLight.State = 0
       ElevenBallLight.State = 0
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 1
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 0
       X3Light.State = 1
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1Off
       Bump2On
       Bump1Off

       BankShot1Light.State = 0
       BankShot2Light.State = 1
       BankShot3Light.State = 0
       BankShot4Light.State = 0
       BankShot5Light.State = 1
       BankShot6Light.State = 0
       BankShotLightOn
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 9 Then

       Plastic5Flash 500

       OneBallLight.State = 1
       TwoBallLight.State = 1
       ThreeBallLight.State = 1
       FourBallLight.State = 1

       FiveBallLight.State = 0
       SixBallLight.State = 0
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 0

       EightBallLight.State = 1

       NineBallLight.State = 1
       TenBallLight.State = 1
       ElevenBallLight.State = 1
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 1
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 0
       X3Light.State = 0
       X5Light.State = 1

       KickBackLight.State = 0

       Bump1Off
       Bump2Off
       Bump3On

       BankShot1Light.State = 0
       BankShot2Light.State = 0
       BankShot3Light.State = 1
       BankShot4Light.State = 0
       BankShot5Light.State = 0
       BankShot6Light.State = 1
       BankShotLightOn
 
       ShootAgainLight.State = 0       

    ElseIf AttractModeSequencer = 10 Then

       OneBallLight.State = 0
       TwoBallLight.State = 0
       ThreeBallLight.State = 0
       FourBallLight.State = 0

       FiveBallLight.State = 1
       SixBallLight.State = 1
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 1

       EightBallLight.State = 0

       NineBallLight.State = 0
       TenBallLight.State = 0
       ElevenBallLight.State = 0
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 1

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 1
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 1
       X3Light.State = 0
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1On
       Bump2Off
       Bump3Off

       BankShot1Light.State = 1
       BankShot2Light.State = 0
       BankShot3Light.State = 0
       BankShot4Light.State = 1
       BankShot5Light.State = 0
       BankShot6Light.State = 0
       BankShotLightOn
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 11 Then

       Plastic6Flash 500

       OneBallLight.State = 0
       TwoBallLight.State = 0
       ThreeBallLight.State = 0
       FourBallLight.State = 1

       FiveBallLight.State = 1
       SixBallLight.State = 1
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 0

       EightBallLight.State = 1

       NineBallLight.State = 1
       TenBallLight.State = 0
       ElevenBallLight.State = 0
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 1

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 1
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 0
       X3Light.State = 1
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1Off
       Bump2On
       Bump3Off

       BankShot1Light.State = 0
       BankShot2Light.State = 1
       BankShot3Light.State = 0
       BankShot4Light.State = 0
       BankShot5Light.State = 1
       BankShot6Light.State = 0
       BankShotLightOff
 
       ShootAgainLight.State = 0       

    ElseIf AttractModeSequencer = 12 Then

       OneBallLight.State = 0
       TwoBallLight.State = 0
       ThreeBallLight.State = 1
       FourBallLight.State = 1

       FiveBallLight.State = 1
       SixBallLight.State = 1
       ThirteenBallLight.State = 1
       FourteenBallLight.State = 0

       EightBallLight.State = 0

       NineBallLight.State = 1
       TenBallLight.State = 1
       ElevenBallLight.State = 0
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 1
       FifteenBallLight.State = 1

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 1
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 0
       X3Light.State = 0
       X5Light.State = 1

       KickBackLight.State = 0

       Bump1Off
       Bump2Off
       Bump3On

       BankShot1Light.State = 0
       BankShot2Light.State = 0
       BankShot3Light.State = 1
       BankShot4Light.State = 0
       BankShot5Light.State = 0
       BankShot6Light.State = 1
       BankShotLightOff
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 13 Then

       Plastic7Flash 500

       OneBallLight.State = 0
       TwoBallLight.State = 1
       ThreeBallLight.State = 1
       FourBallLight.State = 1

       FiveBallLight.State = 1
       SixBallLight.State = 1
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 0

       EightBallLight.State = 1

       NineBallLight.State = 1
       TenBallLight.State = 1
       ElevenBallLight.State = 1
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 1

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 1
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 1
       X3Light.State = 0
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1On
       Bump2Off
       Bump3Off

       BankShot1Light.State = 1
       BankShot2Light.State = 0
       BankShot3Light.State = 0
       BankShot4Light.State = 1
       BankShot5Light.State = 0
       BankShot6Light.State = 0
       BankShotLightOff
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 14 Then

       OneBallLight.State = 1
       TwoBallLight.State = 1
       ThreeBallLight.State = 1
       FourBallLight.State = 1

       FiveBallLight.State = 1
       SixBallLight.State = 1
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 0

       EightBallLight.State = 0

       NineBallLight.State = 1
       TenBallLight.State = 1
       ElevenBallLight.State = 1
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 1

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 1
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 0
       X3Light.State = 1
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1Off
       Bump2On
       Bump3Off

       BankShot1Light.State = 0
       BankShot2Light.State = 1
       BankShot3Light.State = 0
       BankShot4Light.State = 0
       BankShot5Light.State = 1
       BankShot6Light.State = 0
       BankShotLightOn
 
       ShootAgainLight.State = 0       

 
    ElseIf AttractModeSequencer = 15 Then

       Plastic8Flash 500

       OneBallLight.State = 1
       TwoBallLight.State = 1
       ThreeBallLight.State = 1
       FourBallLight.State = 0

       FiveBallLight.State = 1
       SixBallLight.State = 0
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 0

       EightBallLight.State = 1

       NineBallLight.State = 0
       TenBallLight.State = 1
       ElevenBallLight.State = 1
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 1

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 1

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 1
       X2Light.State = 0
       X3Light.State = 0
       X5Light.State = 1

       KickBackLight.State = 0

       Bump1Off
       Bump2Off
       Bump3On

       BankShot1Light.State = 0
       BankShot2Light.State = 0
       BankShot3Light.State = 1
       BankShot4Light.State = 0
       BankShot5Light.State = 0
       BankShot6Light.State = 1
       BankShotLightOn
 
       ShootAgainLight.State = 0       

    ElseIf AttractModeSequencer = 16 Then

       OneBallLight.State = 1
       TwoBallLight.State = 1
       ThreeBallLight.State = 0
       FourBallLight.State = 0

       FiveBallLight.State = 1
       SixBallLight.State = 0
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 0

       EightBallLight.State = 0

       NineBallLight.State = 0
       TenBallLight.State = 0
       ElevenBallLight.State = 1
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 0

       Bonus1Light.State = 0
       Bonus2Light.State = 0
       Bonus3Light.State = 0
       Bonus4Light.State = 0
       Bonus5Light.State = 0
       Bonus6Light.State = 0
       Bonus7Light.State = 0
       Bonus8Light.State = 0
       Bonus9Light.State = 0
       Bonus10Light.State = 0
       Bonus11Light.State = 0
       Bonus12Light.State = 0
       Bonus13Light.State = 0
       Bonus14Light.State = 0
       Bonus15Light.State = 0

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 1
       X3Light.State = 0
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1On
       Bump2Off
       Bump3Off

       BankShot1Light.State = 1
       BankShot2Light.State = 0
       BankShot3Light.State = 0
       BankShot4Light.State = 1
       BankShot5Light.State = 0
       BankShot6Light.State = 0
       BankShotLightOff
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 17 Then


       OneBallLight.State = 1
       TwoBallLight.State = 0
       ThreeBallLight.State = 0
       FourBallLight.State = 0

       FiveBallLight.State = 0
       SixBallLight.State = 0
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 0

       EightBallLight.State = 1

       NineBallLight.State = 0
       TenBallLight.State = 0
       ElevenBallLight.State = 0
       TwelveBallLight.State = 1
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 0

       Bonus1Light.State = 1
       Bonus2Light.State = 1
       Bonus3Light.State = 1
       Bonus4Light.State = 1
       Bonus5Light.State = 1
       Bonus6Light.State = 1
       Bonus7Light.State = 1
       Bonus8Light.State = 1
       Bonus9Light.State = 1
       Bonus10Light.State = 1
       Bonus11Light.State = 1
       Bonus12Light.State = 1
       Bonus13Light.State = 1
       Bonus14Light.State = 1
       Bonus15Light.State = 1

       LeftArrowLight.State = 1
       RightArrowLight.State = 1

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 0
       X3Light.State = 1
       X5Light.State = 0

       KickBackLight.State = 0

       Bump1Off
       Bump2On
       Bump3Off

       BankShot1Light.State = 0
       BankShot2Light.State = 1
       BankShot3Light.State = 0
       BankShot4Light.State = 0
       BankShot5Light.State = 1
       BankShot6Light.State = 0
       BankShotLightOff
 
       ShootAgainLight.State = 0       


    ElseIf AttractModeSequencer = 18 Then

       OneBallLight.State = 0
       TwoBallLight.State = 0
       ThreeBallLight.State = 0
       FourBallLight.State = 0

       FiveBallLight.State = 0
       SixBallLight.State = 0
       ThirteenBallLight.State = 0
       FourteenBallLight.State = 0

       EightBallLight.State = 0

       NineBallLight.State = 0
       TenBallLight.State = 0
       ElevenBallLight.State = 0
       TwelveBallLight.State = 0
       
       SevenBallLight.State = 0
       FifteenBallLight.State = 0

       Bonus1Light.State = 1
       Bonus2Light.State = 1
       Bonus3Light.State = 1
       Bonus4Light.State = 1
       Bonus5Light.State = 1
       Bonus6Light.State = 1
       Bonus7Light.State = 1
       Bonus8Light.State = 1
       Bonus9Light.State = 1
       Bonus10Light.State = 1
       Bonus11Light.State = 1
       Bonus12Light.State = 1
       Bonus13Light.State = 1
       Bonus14Light.State = 1
       Bonus15Light.State = 1

       LeftArrowLight.State = 0
       RightArrowLight.State = 0

       SpinnerLight.State = 0

       SuperBonusLight.State = 0
       X2Light.State = 0
       X3Light.State = 0
       X5Light.State = 1

       KickBackLight.State = 0

       Bump1Off
       Bump2Off
       Bump3On

       BankShot1Light.State = 0
       BankShot2Light.State = 0
       BankShot3Light.State = 1
       BankShot4Light.State = 0
       BankShot5Light.State = 0
       BankShot6Light.State = 1
       BankShotLightOff
 
       ShootAgainLight.State = 0       


     End If
     AttractModeSequencer = AttractModeSequencer + 1
     If AttractModeSequencer = 19 Then 
        AttractModeSequencer = 1
        AttractModePart = AttractModePart + 1
        If AttractModePart = 3 Then
           AllLightsSequencer.UpdateInterval = 20
           AllLightsOff
           AllPlasticsOff
           AllLightsSequencer.Play SeqMiddleInHorizOn, 50, 1, 0
           AllLightsSequencer.Play SeqMiddleOutVertOn, 50, 1, 0
           AllLightsSequencer.Play SeqCircleOutOn, 50, 1, 0
           AllLightsSequencer.UpdateInterval = 5
           AllLightsSequencer.Play SeqClockRightOn, 75, 1, 0
           AttractModePart = 0
           DoingSequencer = 1
        End If
     End If
    End If
          
End Sub

Sub AllLightsSequencer_PlayDone()
    DoingSequencer = 0
    AllPlasticsOn
End Sub

