Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '************************************************************
- ' SpongeBob's Bikini Bottom Pinball
- ' Table Author: SkillShot
- ' Version 1.00
- ' Release: Mar 2021
- '
- ' Based on the Attack & Revenge from Mars table
- ' Made by jpsalas with DOF by arngrim
- '************************************************************
- 'DOF UPDATE BY OUTHERE
- '101 Left Flipper
- '102 Right Flipper
- '103 Left Slingshot
- '104
- '105 Right Slingshot
- '106
- '107 Bumper Left
- '108 Bumper Center
- '109 Bumper Right
- '110 Ball Release
- '111 AutoPlunger
- '112 RandomKickerS
- '113 Shaker
- '114 Beacon
- '115 Krabby Patty
- '116 PatRick
- '117 Squidward
- '118 Spongebob
- Option Explicit
- Randomize
- ExecuteGlobal GetTextFile("core.vbs")
- On Error Resume Next
- ExecuteGlobal GetTextFile("Controller.vbs")
- If Err Then MsgBox "Unable to open Controller.vbs. Ensure that it is in the scripts folder."
- On Error Goto 0
- Dim RomSoundVolume
- Dim MechSoundVolume
- Dim B2SonDesktop
- Dim TiltLevel
- '********************
- 'User Settings
- '********************
- TiltLevel = .15 'Threshold for Analog Nudge. Raise value to tilt less often. Values are small, only adjust by .01 at a time.
- B2SonDesktop = 0 '0= No B2S when in desktop mode. 1= Use B2S backglass in desktop mode (B2S server must be configured)
- '********************
- 'Initialize B2S
- '********************
- If ShowDT = False Or B2SonDesktop = 1 Then
- BallsText.Y = BallsText.Y - 500
- DMDText.Y = DMDText.Y - 500
- ScoreText.Y = ScoreText.Y - 500
- ScoreText2.Y = ScoreText2.Y - 500
- ScoreText3.Y = ScoreText3.Y - 500
- ScoreText4.Y = ScoreText4.Y - 500
- Dim Controller
- Set Controller = CreateObject("B2S.Server")
- Controller.B2SName = "spongebob"
- ' Controller.Run
- End If
- '********************
- 'Standard definitions
- '********************
- Const UseLamps = 0
- Const UseSync = 0
- Const HandleMech = 0
- ' special fastflips
- Const cSingleLFlip = 0
- Const cSingleRFlip = 0
- ' Standard Sounds
- Const SSolenoidOn = "fx_Solenoidon"
- Const SSolenoidOff = "fx_solenoidoff"
- Const SCoin = "fx_Coin"
- Dim bsTrough, bsL, bsR, dtDrop, x, BallFrame, plungerIM, Mech3bank
- Dim BankMove, MoveSpeed, currpos, NewBankDown, ShakeThree, ShakeMain, ShakeSponge, ShakePatty, ShakePatrick, ShakeSquidward, i
- Dim HSI1, HSI2, HSI3
- Dim StartGame
- Dim CurrentBall
- Dim Players
- Dim CurrentPlayer
- Dim PreviousPlayer
- Dim ROrbitHit
- Dim LOrbitHit
- Dim RRampHit
- Dim LRampHit
- Dim PlayTime
- Dim OrbitSaved
- Dim RoundScore
- Dim BallInLane
- Dim SkillShot
- Dim SkillShot2
- Dim SSText
- Dim LEDMessage2
- Dim AreLightsOff
- Dim DelayMusic
- Dim DScoreValue
- Dim SongNumber
- Dim LaneTune
- Dim HSDisplay
- Dim HSDisplay2
- Dim ScoreNumber
- Dim HSDigit
- Dim HSChr
- Dim DrainSave
- Dim SideSave
- Dim LTiltPower
- Dim RTiltPower
- Dim CTiltPower
- Dim LeftPress
- Dim RightPress
- Dim CenterPress
- Dim WarningCount
- Dim TiltGame
- Dim SkillSelect
- Dim SeqNum
- Dim SpongeBalls
- Dim soundcount
- Dim TiltTime
- Dim HSTextFile
- Dim PartyMode
- Dim B2sLightState
- Dim FanfareSelect
- Dim HighScores(4,1)
- Dim b2sChrLookup2(96)
- Dim MusicInterval(11)
- Dim DMDDisplay(9,1)
- Dim MultiBallReady(4)
- Dim ModeText(4)
- Dim TotalScore(4)
- Dim KickerSave(4)
- Dim BallSaveTime(4)
- Dim ExtraBall
- Dim BonusRounds
- Dim BankDown(4)
- Dim TriggerWallCollide(4)
- Dim TriggerDown(4)
- Dim ModeReady(4)
- Dim CurrentMode
- Dim NextMode(4)
- Dim ModesComplete(4)
- Dim BallsLocked(4)
- Dim SJPReady(4)
- Dim L01State(4)
- Dim L02State(4)
- Dim L03State(4)
- Dim L04State(4)
- Dim L05State(4)
- Dim L06State(4)
- Dim L07State(4)
- Dim L08State(4)
- Dim L09State(4)
- Dim L10State(4)
- Dim L11State(4)
- Dim L12State(4)
- Dim L13State(4)
- Dim L14State(4)
- Dim L15State(4)
- Dim L16State(4)
- Dim L17State(4)
- Dim L18State(4)
- Dim L19State(4)
- Dim L20State(4)
- Dim L21State(4)
- Dim L22State(4)
- Dim L23State(4)
- Dim L24State(4)
- Dim L25State(4)
- Dim L26State(4)
- Dim L27State(4)
- Dim L28State(4)
- Dim L29State(4)
- Dim L30State(4)
- Dim L31State(4)
- Dim L32State(4)
- Dim L33State(4)
- Dim L34State(4)
- Dim L35State(4)
- Dim L36State(4)
- Dim L37State(4)
- Dim L38State(4)
- Dim L39State(4)
- Dim L40State(4)
- Dim L41State(4)
- Dim L42State(4)
- Dim L43State(4)
- Dim L44State(4)
- Dim L45State(4)
- Dim L46State(4)
- Dim L47State(4)
- Dim L48State(4)
- Dim L49State(4)
- Dim L50State(4)
- Wall002.IsDropped = True
- Wall003.IsDropped = True
- Wall004.IsDropped = True
- Wall005.IsDropped = True
- ' Predefined characters, A-Z 0-9 and + - * " ' ( ) / < = > [ \ ] _ `
- b2sChrLookup2(34)=514:b2sChrLookup2(35)=0:b2sChrLookup2(39)=1024:b2sChrLookup2(40)=5120:b2sChrLookup2(41)=16640:b2sChrLookup2(42)=32576
- b2sChrLookup2(43)=10816:b2sChrLookup2(44)=16384:b2sChrLookup2(45)=2112:b2sChrLookup2(47)=17408:b2sChrLookup2(48)=17471
- b2sChrLookup2(49)=8704:b2sChrLookup2(50)=2139:b2sChrLookup2(51)=2127:b2sChrLookup2(52)=2150:b2sChrLookup2(53)=2157:b2sChrLookup2(54)=2173
- b2sChrLookup2(55)=7:b2sChrLookup2(56)=2175:b2sChrLookup2(57)=2159:b2sChrLookup2(60)=5120:b2sChrLookup2(61)=2120:b2sChrLookup2(62)=16640
- b2sChrLookup2(65)=2167:b2sChrLookup2(66)=10767:b2sChrLookup2(67)=57:b2sChrLookup2(68)=8719:b2sChrLookup2(69)=2169:b2sChrLookup2(70)=2161
- b2sChrLookup2(71)=2109:b2sChrLookup2(72)=2166:b2sChrLookup2(73)=8713:b2sChrLookup2(74)=30:b2sChrLookup2(75)=5232:b2sChrLookup2(76)=56
- b2sChrLookup2(77)=1334:b2sChrLookup2(78)=4406:b2sChrLookup2(79)=63:b2sChrLookup2(80)=2163:b2sChrLookup2(81)=4159:b2sChrLookup2(82)=6259
- b2sChrLookup2(83)=2157:b2sChrLookup2(84)=8705:b2sChrLookup2(85)=62:b2sChrLookup2(86)=17456:b2sChrLookup2(87)=20534:b2sChrLookup2(88)=21760
- b2sChrLookup2(89)=9472:b2sChrLookup2(90)=17417:b2sChrLookup2(91)=57:b2sChrLookup2(92)=4352:b2sChrLookup2(93)=15:b2sChrLookup2(95)=8:
- b2sChrLookup2(96)=256
- ScoreText.Text = ""
- ScoreText2.Text = ""
- ScoreText3.Text = ""
- ScoreText4.Text = ""
- BallsText.Text = ""
- LoadVolumeLevel
- Call PlayTableMusic(12)
- InsertSequence.Play SeqCircleOutOn,50,100
- DMDText.Text = "Bikini Bottom Pinball: Press Start" : LEDText("Bikini Bottom Pinball Press Start")
- '******************
- ' RealTime Updates
- '******************
- Sub RealTimeUpdates
- RollingUpdate
- End Sub
- '************
- ' Table init.
- '************
- Const cGameName = "spongebob"
- Sub Table1_Init
- LoadEM
- BankMove = 0
- NewBankDown = 0
- StartGame = 0
- CurrentBall = 3
- Players = 0
- CurrentPlayer = 0
- CurrentMode = 0
- ROrbitHit = 0
- LOrbitHit = 0
- RRampHit = 0
- LRampHit = 0
- PlayTime = 0
- ExtraBall = 0
- OrbitSaved = 0
- RoundScore = 0
- BonusRounds = 0
- BallInLane = 0
- SkillShot = 0
- SSText = 0
- AreLightsOff = 0
- DelayMusic = 0
- DScoreValue = 0
- HSDisplay2 = 0
- ScoreNumber = ""
- HSDigit = 0
- HsChr = 65
- DrainSave = 0
- SideSave = 0
- SeqNum = 0
- SpongeBalls = 0
- soundcount = 0
- B2sLightState = 1
- WarningCount = 0
- TiltGame = 1
- FanfareSelect = int(rnd*5)
- SongNumber = int(rnd*7)
- for i = 0 To 4
- BankDown(i)=0
- TriggerWallCollide(i)=True
- TriggerDown(i)=False
- ModeReady(i)=0
- MultiBallReady(i) = 0
- ModesComplete(i)=0
- NextMode(i)=0
- BallsLocked(i)=0
- BallSaveTime(i)=10
- KickerSave(i) = 2
- TotalScore(i) = 0
- SJPReady(i) = 0
- ModeText(i) = ""
- L01State(i)=0
- L02State(i)=0
- L03State(i)=0
- L04State(i)=0
- L05State(i)=0
- L06State(i)=0
- L07State(i)=0
- L08State(i)=0
- L09State(i)=0
- L10State(i)=0
- L11State(i)=0
- L12State(i)=0
- L13State(i)=0
- L14State(i)=0
- L15State(i)=0
- L16State(i)=0
- L17State(i)=0
- L18State(i)=0
- L19State(i)=0
- L20State(i)=0
- L21State(i)=0
- L22State(i)=0
- L23State(i)=0
- L24State(i)=0
- L25State(i)=0
- L26State(i)=0
- L27State(i)=0
- L28State(i)=0
- L29State(i)=0
- L30State(i)=0
- L31State(i)=0
- L32State(i)=0
- L33State(i)=0
- L34State(i)=0
- L35State(i)=0
- L36State(i)=0
- L37State(i)=0
- L38State(i)=0
- L39State(i)=0
- L40State(i)=0
- L41State(i)=0
- L42State(i)=0
- L43State(i)=0
- L44State(i)=0
- L45State(i)=0
- L46State(i)=0
- L47State(i)=0
- L48State(i)=0
- L49State(i)=0
- L50State(i)=0
- Next
- For i = 0 To 9
- DMDDisplay(i,0) = ""
- DMDDisplay(i,1) = ""
- Next
- For i = 0 To 11
- MusicInterval(i) = 2000
- Next
- MusicInterval(1) = 6096 '17948
- MusicInterval(2) = 6372
- MusicInterval(3) = 3930 '5312
- MusicInterval(4) = 5928
- MusicInterval(5) = 9148
- MusicInterval(6) = 8668 '16210
- MusicInterval(7) = 6524
- MusicInterval(8) = 9854
- MusicInterval(9) = 8284
- MusicInterval(10) = 9376
- MusicInterval(11) = 9376
- LoadHighScores
- UpdateLights
- Call ChangeGILights(0)
- Diverter.RotateToStart
- TriggerWall.Collidable = True
- sw77.IsDropped = False
- HSDisplay = 1 : DisplayHS.Enabled = True
- ' Impulse Plunger
- Const IMPowerSetting = 42 'Plunger Power
- Const IMTime = 0.6 ' Time in seconds for Full Plunge
- Set plungerIM = New cvpmImpulseP
- With plungerIM
- .InitImpulseP swplunger, IMPowerSetting, IMTime
- .Random 0.3
- .InitExitSnd SoundFX("fx_plunger",DOFContactors), SoundFX("fx_plunger",DOFContactors)
- .CreateEvents "plungerIM"
- End With
- End Sub
- Sub ResetPlayer
- ROrbitHit = 0
- LOrbitHit = 0
- LRampHit = 0
- RRampHit = 0
- WarningCount = 0
- LGate.Open=False
- RGate.Open=False
- PreviousPlayer = CurrentPlayer - 1
- If CurrentPlayer = 0 OR CurrentPlayer = 1 Then PreviousPlayer = Players
- If CurrentBall > 0 Then
- If BankDown(CurrentPlayer) = 1 AND BankDown(PreviousPlayer) = 0 Then currpos = 50 : Call Update3Bank(50,0)
- If BankDown(CurrentPlayer) = 0 AND BankDown(PreviousPlayer) = 1 Then currpos = 0 : Call Update3Bank(0,50)
- End If
- sw77.IsDropped = TriggerDown(CurrentPlayer)
- TriggerWall.Collidable = TriggerWallCollide(CurrentPlayer)
- UpdateLights
- Diverter.RotateToStart
- If ModeReady(CurrentPlayer) = 1 And MultiBallReady(CurrentPlayer) = 0 Then Diverter.RotateToEnd
- End Sub
- Sub startB2S(aB2S)
- If B2SOn Then
- Controller.B2SSetData 1,0
- Controller.B2SSetData 2,0
- Controller.B2SSetData 3,0
- Controller.B2SSetData 4,0
- Controller.B2SSetData 5,0
- Controller.B2SSetData 6,0
- Controller.B2SSetData 7,0
- Controller.B2SSetData 8,0
- Controller.B2SSetData 9,0
- Controller.B2SSetData 10,0
- Controller.B2SSetData 11,0
- Controller.B2SSetData 12,0
- Controller.B2SSetData 13,0
- Controller.B2SSetData 14,0
- Controller.B2SSetData aB2S,1
- End If
- End Sub
- '**********
- ' Keys
- '**********
- Sub table1_KeyDown(ByVal Keycode)
- If keycode = PlungerKey Then
- If BallInLane = 1 Then SkillShot = 1 : SkillShotMessage.Enabled = False : SkillShotTimer.Enabled = True : DMDText.TimerEnabled = False
- End If
- If keycode = LeftTiltKey Then LeftPress = 1
- If keycode = RightTiltKey Then RightPress = 1
- If keycode = CenterTiltKey Then CenterPress = 1
- If Keycode = LeftFlipperKey Then
- If PartyMode = 1 Then StopSound "Sfx_Airhorn" : PlaySound "Sfx_Airhorn",0,RomSoundVolume
- If FanfareTimer.Enabled = True Then FanfareSfx
- If TiltGame <> 1 Then
- If ScoreNumber = "" Then
- If CurrentMode <> 2 Then
- PlaySoundAt SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), LeftFlipper
- LeftFlipper.RotateToEnd
- Else
- PlaySoundAt SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), RightFlipper
- RightFlipper.RotateToEnd
- End If
- End If
- End If
- End If
- If Keycode = RightFlipperKey Then
- If PartyMode = 1 Then StopSound "Sfx_Airhorn" : PlaySound "Sfx_Airhorn",0,RomSoundVolume
- If FanfareTimer.Enabled = True Then FanfareSfx
- If TiltGame <> 1 Then
- If ScoreNumber = "" Then
- If CurrentMode <> 2 Then
- PlaySoundAt SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), RightFlipper
- RightFlipper.RotateToEnd
- Else
- PlaySoundAt SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), LeftFlipper
- LeftFlipper.RotateToEnd
- End If
- End If
- End If
- End If
- End Sub
- Sub table1_KeyUp(ByVal Keycode)
- If keycode = LeftMagnaSave Then
- If StartGame = 0 Then
- MechSoundVolume = MechSoundVolume + .1
- If MechSoundVolume > 1 Then MechSoundVolume = 0
- StopSound "fx_Bumper"
- PlaySoundAt SoundFX("fx_bumper", DOFContactors), Bumper1
- SaveVolumeLevel
- DMDText.Text = "Mech Sound Volume " & MechSoundVolume * 100 : LEDText("Mech Sound Volume " & MechSoundVolume * 100)
- DisplayHS.Enabled = False
- VolumeTimer.Enabled = False
- VolumeTimer.Enabled = True
- End If
- End If
- If keycode = RightMagnaSave Then
- If StartGame = 0 Then
- RomSoundVolume = RomSoundVolume + .1
- If RomSoundVolume > 1 Then RomSoundVolume = 0
- StopTableMusic
- PlaySound "Mode0",0,RomSoundVolume
- SaveVolumeLevel
- DMDText.Text = "Music Volume " & RomSoundVolume * 100 : LEDText("Music Volume " & RomSoundVolume * 100)
- DisplayHS.Enabled = False
- VolumeTimer.Enabled = False
- VolumeTimer.Enabled = True
- End If
- End If
- If keycode = PlungerKey Then
- If BallInLane = 1 Then SkillShot = 0 : Auto_Plunger
- End If
- If keycode = LeftTiltKey Then LeftPress = 0 : Nudge 90, LTiltPower/5 : PlaySound SoundFX("fx_nudge",0), 0, 1, -0.1, 0.25:a3BankShake2:CheckTilt
- If keycode = RightTiltKey Then RightPress = 0 : Nudge 270, RTiltPower/5 : PlaySound SoundFX("fx_nudge",0), 0, 1, 0.1, 0.25:a3BankShake2:CheckTilt
- If keycode = CenterTiltKey Then CenterPress = 0 : Nudge 0, CTiltPower/5 : PlaySound SoundFX("fx_nudge",0), 0, 1, 0, 0.25:a3BankShake2:CheckTilt
- If keycode = LeftFlipperKey Then
- If TiltGame <> 1 Then
- If ScoreNumber = "" Then
- If CurrentMode <> 2 Then
- PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
- LeftFlipper.RotateToStart
- Else
- PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
- RightFlipper.RotateToStart
- End If
- End If
- If ScoreNumber <> "" Then
- If HSDigit = 0 Then HSDigit = 1
- HSChr = HSChr - 1
- If HSChr = 64 Then HSChr = 90
- EnterHS
- End If
- End If
- End If
- If keycode = RightFlipperKey Then
- If TiltGame <> 1 Then
- If ScoreNumber = "" Then
- If CurrentMode <> 2 Then
- PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
- RightFlipper.RotateToStart
- Else
- PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
- LeftFlipper.RotateToStart
- End If
- End If
- If ScoreNumber <> "" Then
- If HSDigit = 0 Then HSDigit = 1
- HSChr = HSChr + 1
- If HSChr = 91 Then HSChr = 65
- EnterHS
- End If
- End If
- End If
- If keycode = StartGameKey Then
- If ScoreNumber = "" Then
- If CurrentBall = 3 and Players < 4 Then
- If Players = 0 Then : ScoreText.Text = "" : ScoreText2.Text = "" : ScoreText3.Text = "" : ScoreText4.Text = "" : ScoresClear
- Players = Players + 1
- If Players = 1 Then
- ScoreText.Text = 0
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 10, b2sChrLookup2(Asc(0))
- End If
- If Players = 2 Then
- ScoreText2.Text = 0
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 20, b2sChrLookup2(Asc(0))
- StopSound "Sfx_NewPlayer": PlaySound "Sfx_NewPlayer",0,RomSoundVolume
- End If
- If Players = 3 Then
- ScoreText3.Text = 0
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 30, b2sChrLookup2(Asc(0))
- StopSound "Sfx_NewPlayer": PlaySound "Sfx_NewPlayer",0,RomSoundVolume
- End If
- If Players = 4 Then
- ScoreText4.Text = 0
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 40, b2sChrLookup2(Asc(0))
- StopSound "Sfx_NewPlayer": PlaySound "Sfx_NewPlayer",0,RomSoundVolume
- End If
- If StartGame = 0 Then
- If RoosterTimer.Enabled = False Then
- StopTableMusic
- InsertSequence.StopPlay()
- HSDisplay = 0 : DisplayHS.Enabled = False
- HSMusicPlaying.Enabled = False
- Call DMDMessage("GAME START", 2)
- PlaySound "Sfx_StartGame",0,RomSoundVolume
- RoosterTimer.Enabled = True
- End If
- End If
- End If
- End If
- If HSDigit >= 1 Then
- HSDigit = HSDigit + 1
- HSChr = 65
- If HSDigit > 4 Then HSDigit = 4
- EnterHS
- End If
- UpdateText
- End If
- End Sub
- Sub RoosterTimer_Timer
- RoosterTimer.Enabled = False
- BallRelease.CreateBall
- DOF 110, DOFPulse
- BallRelease.Kick 80,6
- startB2S(5)
- BallInLane = 1
- TiltGame = 0
- PlayTableMusic(13)
- Call ChangeGILights(1)
- StartGame = 1
- CurrentPlayer = 1
- Call DMDMessage("Player 1", 1)
- UpdateText
- End Sub
- '********************
- 'Current Ball Text
- '********************
- Sub UpdateText
- If StartGame = 1 And 4 - CurrentBall < 4 Then
- BallsText.Text = 4 - CurrentBall
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81, b2sChrLookup2(Asc(4 - CurrentBall))
- Else
- BallsText.Text = ""
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81, b2sChrLookup2(Asc(" "))
- End If
- End Sub
- '********************
- 'Lights
- '********************
- Sub UpdateLights
- If AreLightsOff = 0 Then
- 'l01.State = L01State(CurrentPlayer)
- l02.State = L02State(CurrentPlayer)
- l03.State = L03State(CurrentPlayer)
- l04.State = L04State(CurrentPlayer)
- l05.State = L05State(CurrentPlayer)
- l06.State = L06State(CurrentPlayer)
- l07.State = L07State(CurrentPlayer)
- l08.State = L08State(CurrentPlayer)
- l09.State = L09State(CurrentPlayer)
- l10.State = L10State(CurrentPlayer)
- l11.State = L11State(CurrentPlayer)
- l12.State = L12State(CurrentPlayer)
- l13.State = L13State(CurrentPlayer)
- If KickerSave(CurrentPlayer) < 1 Then l14.State = L14State(CurrentPlayer)
- l15.State = L15State(CurrentPlayer)
- If KickerSave(CurrentPlayer) < 1 Then l16.State = L16State(CurrentPlayer)
- l17.State = L17State(CurrentPlayer)
- l18.State = L18State(CurrentPlayer)
- l19.State = L19State(CurrentPlayer)
- l20.State = L20State(CurrentPlayer)
- l21.State = L21State(CurrentPlayer)
- l22.State = L22State(CurrentPlayer)
- l23.State = L23State(CurrentPlayer)
- l24.State = L24State(CurrentPlayer)
- l25.State = L25State(CurrentPlayer)
- l26.State = L26State(CurrentPlayer)
- l27.State = L27State(CurrentPlayer)
- l28.State = L28State(CurrentPlayer)
- l29.State = L29State(CurrentPlayer)
- l30.State = L30State(CurrentPlayer)
- l31.State = L31State(CurrentPlayer)
- l32.State = L32State(CurrentPlayer)
- l33.State = L33State(CurrentPlayer)
- l34.State = L34State(CurrentPlayer)
- l35.State = L35State(CurrentPlayer)
- l36.State = L36State(CurrentPlayer)
- If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 OR MultiBallReady(CurrentPlayer) = 1 then l37.State = L37State(CurrentPlayer) : l37.BlinkPattern = "10"
- If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 OR MultiBallReady(CurrentPlayer) = 1 then l38.State = L38State(CurrentPlayer) : l38.BlinkPattern = "10"
- If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 OR MultiBallReady(CurrentPlayer) = 1 then l39.State = L39State(CurrentPlayer) : l39.BlinkPattern = "10"
- l40.State = L40State(CurrentPlayer)
- l41.State = L41State(CurrentPlayer)
- l42.State = L42State(CurrentPlayer)
- l43.State = L43State(CurrentPlayer)
- l44.State = L44State(CurrentPlayer)
- l45.State = L45State(CurrentPlayer)
- l46.State = L46State(CurrentPlayer)
- l47.State = L47State(CurrentPlayer)
- l48.State = L48State(CurrentPlayer)
- l49.State = L49State(CurrentPlayer)
- l50.State = L50State(CurrentPlayer)
- If ModeReady(CurrentPlayer) = 1 Then
- ModeReadyLights
- If CurrentMode = 4 Then Call DMDMessage("MR KRABS MODE COMPLETE", 1) : CurrentMode = 0 : IntroMusic : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- End If
- If CurrentMode <> 0 Then BonusLights
- If SJPReady(CurrentPlayer) = 1 Then
- TurnLightsOff
- If CurrentMode = 11 Then L33.State = 2 : L34.State = 2 : L35.State = 2 : L36.State = 2
- If CurrentMode = 0 Then ModeReadyLights
- End If
- End If
- End Sub
- Sub ModeReadyLights
- If ModeReady(CurrentPlayer) = 1 Then
- For i = 0 to 49
- If InsertLights(i).State = 2 then
- If i <> 0 AND i <> 11 AND i <> 12 AND i <> 13 AND i <> 14 AND i <> 15 AND i <> 23 AND i <> 24 AND i <> 25 AND i <> 39 AND i <> 46 Then InsertLights(i).State = 0
- End If
- Next
- If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 And SJPReady(CurrentPlayer) = 0 Then l04.state = 2
- If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then l37.state = 2 : l37.BlinkPattern = "100"
- If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then l38.state = 2 : l38.BlinkPattern = "010"
- If CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then l39.state = 2 : l39.BlinkPattern = "001"
- If SJPReady(CurrentPlayer) = 1 Then l13.state = 2
- End If
- End Sub
- Sub ModeLights
- If ModesComplete(CurrentPlayer) = 1 Then L05State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 2 Then L06State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 3 Then L07State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 4 Then L08State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 5 Then L09State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 6 Then L10State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 7 Then L11State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 8 Then L12State(CurrentPlayer) = 1
- If ModesComplete(CurrentPlayer) = 9 Then
- L13State(CurrentPlayer) = 1
- l40State(CurrentPlayer) = 0 : l41State(CurrentPlayer) = 0 : l42State(CurrentPlayer) = 0
- l27State(CurrentPlayer) = 0 : l28State(CurrentPlayer) = 0 : l29State(CurrentPlayer) = 0
- l43State(CurrentPlayer) = 0 : l44State(CurrentPlayer) = 0 : l45State(CurrentPlayer) = 0
- l37State(CurrentPlayer) = 0 : l38State(CurrentPlayer) = 0 : l39State(CurrentPlayer) = 0
- l46State(CurrentPlayer) = 0 : l47State(CurrentPlayer) = 0 : l48State(CurrentPlayer) = 0
- l24State(CurrentPlayer) = 0 : l25State(CurrentPlayer) = 0 : l26State(CurrentPlayer) = 0
- l18State(CurrentPlayer) = 0 : l19State(CurrentPlayer) = 0 : l20State(CurrentPlayer) = 0
- l21State(CurrentPlayer) = 0 : l22State(CurrentPlayer) = 0 : l23State(CurrentPlayer) = 0
- l30State(CurrentPlayer) = 0 : l31State(CurrentPlayer) = 0 : l32State(CurrentPlayer) = 0
- End If
- End Sub
- Sub ResetModeLights
- If ModesComplete(CurrentPlayer) = 10 Then
- L05State(CurrentPlayer) = 0
- L06State(CurrentPlayer) = 0
- L07State(CurrentPlayer) = 0
- L08State(CurrentPlayer) = 0
- L09State(CurrentPlayer) = 0
- L10State(CurrentPlayer) = 0
- L11State(CurrentPlayer) = 0
- L12State(CurrentPlayer) = 0
- L13State(CurrentPlayer) = 0
- End If
- End Sub
- Sub BonusLights
- If CurrentMode = 1 Then l40.State = 2 : l41.State = 2 : l42.State = 2
- If CurrentMode = 2 Then l27.State = 2 : l28.State = 2 : l29.State = 2
- If CurrentMode = 3 Then l43.State = 2 : l44.State = 2 : l45.State = 2
- If CurrentMode = 4 Then l37.State = 2 : l38.State = 2 : l39.State = 2
- If CurrentMode = 5 Then l46.State = 2 : l47.State = 2 : l48.State = 2
- If CurrentMode = 6 Then l24.State = 2 : l25.State = 2 : l26.State = 2
- If CurrentMode = 7 Then l18.State = 2 : l19.State = 2 : l20.State = 2
- If CurrentMode = 8 Then l21.State = 2 : l22.State = 2 : l23.State = 2
- If CurrentMode = 9 Then l30.State = 2 : l31.State = 2 : l32.State = 2
- If CurrentMode = 11 Then l36.State = 2
- End Sub
- Sub TurnLightsOff
- For i = 0 to 39
- GILights(i).State = 0
- Next
- For i = 0 to 37
- GILights2(i).State = 0
- Next
- For i = 0 to 49
- InsertLights(i).State = 0
- Next
- End Sub
- Sub ChangeGILights(GILightState)
- If GILightState = 0 Then
- For i = 0 to 39
- GILights(i).State = 0
- Next
- For i = 0 to 37
- GILights2(i).State = 0
- Next
- End If
- If GILightState = 1 Then
- For i = 0 to 39
- GILights(i).State = 1
- Next
- For i = 0 to 37
- GILights2(i).State = 1
- Next
- End If
- End Sub
- Sub JackpotSequence(SequenceTime)
- InsertSequence.Play SeqRandom,10,,SequenceTime
- GISequence.Play SeqRandom,10,,SequenceTime
- GISequence2.Play SeqRandom,10,,SequenceTime
- End Sub
- Sub SJPSequence
- If SJPReady(CurrentPlayer) = 2 Then
- If SeqNum = 1 Then
- InsertSequence.UpdateInterval = 10 : GISequence.UpdateInterval = 10 : GISequence2.UpdateInterval = 10
- SJPLight.Interval = 9603 : SJPLight.Enabled = True
- InsertSequence.Play SeqHatch1VertOn,10,100
- GISequence.Play SeqHatch1VertOn,10,100
- GISequence2.Play SeqHatch1VertOn,10,100
- End If
- If SeqNum = 2 Then
- InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
- SJPLight.Interval = 5830 : SJPLight.Enabled = True
- InsertSequence.Play SeqCircleInOn,10,100
- GISequence.Play SeqCircleInOn,10,100
- GISequence2.Play SeqCircleInOn,10,100
- End If
- If SeqNum = 3 Then
- InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
- InsertSequence.UpdateInterval = 20 : GISequence.UpdateInterval = 20 : GISequence2.UpdateInterval = 20
- InsertSequence.Play SeqRandom,10,,3177
- GISequence.Play SeqRandom,10,,3177
- GISequence2.Play SeqRandom,10,,3177
- SeqNum = 0
- End If
- Else
- If SeqNum = 1 Then
- PlaySound "Sfx_SJP2",0,RomSoundVolume
- InsertSequence.UpdateInterval = 10 : GISequence.UpdateInterval = 10 : GISequence2.UpdateInterval = 10
- SJPLight.Interval = 7085 : SJPLight.Enabled = True
- InsertSequence.Play SeqCircleInOn,10,100
- GISequence.Play SeqCircleInOn,10,100
- GISequence2.Play SeqCircleInOn,10,100
- End If
- If SeqNum = 2 Then
- InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
- SJPLight.Interval = 10719 : SJPLight.Enabled = True
- InsertSequence.Play SeqHatch1VertOn,10,100
- GISequence.Play SeqHatch1VertOn,10,100
- GISequence2.Play SeqHatch1VertOn,10,100
- End If
- If SeqNum = 3 Then
- InsertSequence.StopPlay() : GISequence.StopPlay() : GISequence2.StopPlay()
- InsertSequence.UpdateInterval = 20 : GISequence.UpdateInterval = 20 : GISequence2.UpdateInterval = 20
- InsertSequence.Play SeqRandom,10,,3000
- GISequence.Play SeqRandom,10,,3000
- GISequence2.Play SeqRandom,10,,3000
- SeqNum = 0
- End If
- End If
- End Sub
- Sub SJPLight_Timer
- SJPLight.Enabled = False
- SeqNum = SeqNum + 1
- Call SJPSequence
- End Sub
- 'Sub gi038_Timer
- ' gi038.TimerEnabled = False
- ' If BumperLightTop.State = 1 Then BumperLightTop.State = 0
- ' If BumperLightRight.State = 1 Then BumperLightRight.State = 0
- ' If BumperLightLeft.State = 1 Then BumperLightLeft.State = 0
- ' If CurrentMode <> 2 Then gi038.State = 1
- ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 0
- 'End Sub
- Sub ThunderTimer_Timer
- ThunderTimer.Enabled = False
- If CurrentMode = 2 Then
- PlaySound "Sfx_Thunder",0,RomSoundVolume
- ' gi038.State = 1 : gi038.TimerEnabled = True
- Nudge int(rnd*360), 5
- ThunderTimer.Interval = int(rnd*10000)
- ThunderTimer.Enabled = True
- End If
- End Sub
- Sub MBIntroLights_Timer
- MBIntroLights.Enabled = False
- JackpotSequence(1394)
- End Sub
- '********************
- 'Slings & div switches
- '********************
- Dim LStep, RStep
- Sub LeftSlingShot_Slingshot
- startB2S(7)
- 'startB2S(10)
- PlaySoundAt SoundFXDOF("fx_Slingshot",103,DOFPulse, DOFContactors), Lemk
- AddScore(101230) : SlingSfx
- LeftSling4.Visible = 1
- Lemk.RotX = 26
- LStep = 0
- LeftSlingShot.TimerEnabled = 1
- End Sub
- Sub LeftSlingShot_Timer
- Select Case LStep
- Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
- Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
- Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -10:LeftSlingShot.TimerEnabled = 0
- End Select
- LStep = LStep + 1
- End Sub
- Sub RightSlingShot_Slingshot
- startB2S(12)
- 'startB2S(10)
- PlaySoundAt SoundFXDOF("fx_Slingshot",105,DOFPulse, DOFContactors), Remk
- AddScore(101230) : SlingSfx
- RightSling4.Visible = 1
- Remk.RotX = 26
- RStep = 0
- RightSlingShot.TimerEnabled = 1
- End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
- Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
- Case 3:RightSLing2.Visible = 0:Remk.RotX = -10:RightSlingShot.TimerEnabled = 0
- End Select
- RStep = RStep + 1
- End Sub
- '********************
- 'Bumpers
- '********************
- Sub Bumper1_Hit
- startB2S(3)
- PlaySoundAt SoundFXDOF("fx_bumper",108,DOFPulse, DOFContactors), Bumper1
- AddScore(53120) : BumperSfx
- BumperLightTop.State = 1
- ' If CurrentMode <> 2 Then gi038.State = 0
- ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 1
- ' gi038.TimerEnabled = True
- If CurrentMode = 5 Then AddScore(446880)
- End Sub
- Sub Bumper2_Hit
- startB2S(10)
- PlaySoundAt SoundFXDOF("fx_bumper",109,DOFPulse, DOFContactors), Bumper2
- AddScore(53120) : BumperSfx
- BumperLightRight.State = 1
- ' If CurrentMode <> 2 Then gi038.State = 0
- ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 1
- ' gi038.TimerEnabled = True
- If CurrentMode = 5 Then AddScore(446880)
- End Sub
- Sub Bumper3_Hit
- startB2S(11)
- PlaySoundAt SoundFXDOF("fx_bumper",107,DOFPulse, DOFContactors), Bumper3
- AddScore(53120) : BumperSfx
- BumperLightLeft.State = 1
- ' If CurrentMode <> 2 Then gi038.State = 0
- ' If CurrentMode = 2 Or SJPReady(CurrentPlayer) > 0 Then gi038.State = 1
- ' gi038.TimerEnabled = True
- If CurrentMode = 5 Then AddScore(446880)
- End Sub
- '********************
- 'Drain holes, vuks & saucers
- '********************
- Sub Drain_Hit
- startB2S(9)
- Drain.DestroyBall
- If SJPReady(CurrentPlayer) = 2 Then Exit Sub
- PlaysoundAt "fx_drain", drain
- SideSave = 0
- If OrbitSaved = 1 Then OrbitSaved = 0 : Exit Sub
- If CurrentMode <> 11 Then L49State(CurrentPlayer) = 0 : L50State(CurrentPlayer) = 0
- If Playtime < BallSaveTime(CurrentPlayer) Then
- If CurrentMode <> 11 Then BallSaverTimer.Enabled = False
- If DrainSave = 0 Then
- Call RandomKicker(4)
- DrainSave = 1
- Else
- Call RandomKicker(3)
- End If
- Call DMDMessage("Ball Saved", 1) : StopSound "Sfx_BallSaved" : PlaySound "Sfx_BallSaved",0,RomSoundVolume
- DOF 110, DOFPulse
- UpdateLights
- End If
- If Playtime >= BallSaveTime(CurrentPlayer) Then
- If CurrentMode <> 11 Then
- BallSaverTimer.Enabled = False
- TurnLightsOff
- StopTableMusic
- SongTimer.Enabled = False
- EndingMusic
- Drain.TimerEnabled = True
- RoundEndTimer.Enabled = True
- TiltGame = 1
- LeftFlipper.RotateToStart : RightFlipper.RotateToStart
- DOF 101, DOFOff
- DOF 102, DOFOff
- ClearDMD
- Call DMDMessage("Round Over", 1)
- Call DelayScore(((RoundScore/10) * (BonusRounds+1)),3.5)
- Call DMDMessage("BONUS SCORE " & FormatNumber(RoundScore/10,0,,,-1), 1)
- Call DMDMessage("MULTIPLIER X" & BonusRounds + 1, 1)
- Call DMDMessage("TOTAL BONUS " & FormatNumber((RoundScore/10) * (BonusRounds + 1),0,,,-1), 1)
- Else
- CurrentMode = 0
- Call ChangeGILights(1)
- ModeReady(CurrentPlayer) = 0
- SJPReady(CurrentPlayer) = 0
- If BankDown(CurrentPlayer) = 1 Then
- If MoveSpeed < 48 Then NewBankDown = 0
- If MoveSpeed > 47 Then currpos = 0 : Call Update3Bank(0,50)
- End If
- sw77.IsDropped = False : TriggerDown(CurrentPlayer) = False
- TriggerWall.Collidable = True : TriggerWallCollide(CurrentPlayer)=True
- L33State(CurrentPlayer) = 0 : L34State(CurrentPlayer) = 0 : L35State(CurrentPlayer) = 0 : L36State(CurrentPlayer) = 0
- If NextMode(CurrentPlayer) > 0 Then ModeReady(CurrentPlayer) = 1 : Diverter.RotateToEnd
- Call ChangeGILights(1)
- UpdateLights
- Call DMDMessage("Multiball Complete", 1)
- IntroMusic
- End If
- End If
- End Sub
- Sub Drain_Timer
- Drain.TimerEnabled = False
- If Playtime >= BallSaveTime(CurrentPlayer) Then
- If CurrentMode <> 11 Then
- RoundScore = 0
- BonusRounds = 0
- TiltGame = 0
- TiltTime = 0
- If ExtraBall = 0 then
- If CurrentBall = 1 Then CheckHighScores
- If CurrentPlayer = Players Then
- CurrentBall = CurrentBall - 1
- CurrentPlayer = 1
- Else
- CurrentPlayer = CurrentPlayer +1
- End If
- PlayTime = 0
- CurrentMode = 0
- StartNewPlayer
- Else
- PlayTime = 0
- ExtraBall = ExtraBall - 1
- Call DMDMessage("Extra Ball: Shoot Again", 1)
- BallRelease.CreateBall : BallRelease.Kick 80,6
- SongNumber = int(rnd*7)
- PlayTableMusic(13)
- BallInLane = 1
- Call ChangeGILights(1)
- CurrentMode = 0
- UpdateLights
- End If
- End If
- End If
- End Sub
- Sub StartNewPlayer
- If ScoreNumber = "" Then
- If CurrentBall > 0 Then
- HSMusicPlaying.Enabled = False
- BallRelease.CreateBall
- DOF 110, DOFPulse
- BallRelease.Kick 80,6
- BallInLane = 1
- Call ChangeGILights(1)
- Call DMDMessage("Player " & CurrentPlayer, 1)
- SongNumber = int(rnd*7)
- PlayTableMusic(13)
- End If
- 'PlayTime = 0
- 'CurrentMode = 0
- ResetPlayer
- l14.State = L14State(CurrentPlayer) : l16.State = L16State(CurrentPlayer)
- If CurrentBall = 0 Then
- If BankDown(PreviousPlayer) = 1 Then currpos = 0 : Call Update3Bank(0,50)
- l14.State = 0 : l16.State = 0
- Table1_Init
- EndingMusic
- End If
- UpdateText
- End If
- End Sub
- Sub sw36a_Hit
- PlaySoundAt "fx_kicker_enter", sw36a : StopQuotes
- sw36a.DestroyBall
- TiltGame = 1
- ClearDMD
- BallSaverTimer.Enabled = False
- If ModesComplete(CurrentPlayer) = 4 Then ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1) : Call JackpotSequence(750) : StopTableMusic : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then
- SJPReady(CurrentPlayer) = 0
- TiltGame = 1
- FanfareTimer.Interval = 21026 : FanfareTimer.Enabled = True
- Call DelayScore(20000000, 19.304)
- Call DMDMessage(" ", 1) : Call DMDMessage("ALL MODES OPENED", 7.085) : Call DMDMessage("SUPER JACKPOT", 10.719) : Call DMDMessage("20 MILLION", 3.222)
- SJPLight.Interval = 1000 : SJPLight.Enabled = True
- StopTableMusic
- End If
- Call ChangeGILights(0)
- Call DMDMessage(" ", 2) : Call DMDMessage(ModeText(CurrentPlayer), (((MusicInterval(NextMode(CurrentPlayer)))/1000)-2))
- If ModesComplete(CurrentPlayer) <> 8 Then AddScore(500000)
- Diverter.RotateToStart
- sw36a.TimerInterval = MusicInterval(NextMode(CurrentPlayer))
- If ModesComplete(CurrentPlayer) = 4 Then sw36a.TimerInterval = sw36a.TimerInterval + 1000
- If ModesComplete(CurrentPlayer) = 8 Then sw36a.TimerInterval = sw36a.TimerInterval + 22026
- sw36a.TimerEnabled = True
- ModeReady(CurrentPlayer)=0
- BonusRounds = BonusRounds + 1
- ModesComplete(CurrentPlayer) = ModesComplete(CurrentPlayer) + 1
- If ModesComplete(CurrentPlayer) = 10 Then ResetModeLights : ModesComplete(CurrentPlayer) = 1
- CurrentMode = NextMode(CurrentPlayer)
- If ModesComplete(CurrentPlayer) <> 5 AND ModesComplete(CurrentPlayer) <> 9 Then IntroMusic
- If ModesComplete(CurrentPlayer) = 5 Then DelayMusic = 1 : SongTimer.Interval = 1000 : SongTimer.Enabled = True
- If ModesComplete(CurrentPlayer) = 9 Then DelayMusic = 1 : SongTimer.Interval = 22026 : SongTimer.Enabled = True
- LeftFlipper.RotateToStart : RightFlipper.RotateToStart
- DOF 101, DOFOff
- DOF 102, DOFOff
- NextMode(CurrentPlayer) = 0
- ModeLights
- UpdateLights
- TurnLightsOff
- End Sub
- Sub sw36a_Timer
- sw36a.TimerEnabled = False
- TiltGame = 0
- Call RandomKicker(3)
- PlayTime = 0
- BallSaverTimer.Enabled = True
- If CurrentMode <> 2 Then Call ChangeGILights(1)
- If CurrentMode = 2 Then ThunderTimer.Interval = int(rnd*10000) : ThunderTimer.Enabled = True
- UpdateLights
- End Sub
- Sub sw37a_Hit
- PlaySoundAt "fx_hole_enter", sw37a
- sw37a.DestroyBall
- sw37a.TimerEnabled = True
- If CurrentMode <> 11 Then StopTableMusic : StopQuotes : TiltGame = 1 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
- DOF 101, DOFOff
- DOF 102, DOFOff
- If CurrentMode <> 11 Then ChangeGILights(0)
- PlaySound "Sfx_SecretShot",0,RomSoundVolume
- Call DMDMessage("SECRET SHOT", .75) : Call DMDMessage("1 MILLION", .75)
- Call DelayScore(1000000, 1)
- InsertSequence.Play SeqRandom,10,,1500
- End Sub
- Sub sw37a_Timer
- sw37a.TimerEnabled = False
- RandomKicker(3)
- If CurrentMode <> 2 And SJPReady(CurrentPlayer) = 0 Then ChangeGILights(1)
- If CurrentMode <> 11 Then Call PlayTableMusic(CurrentMode) : TiltGame = 0
- End Sub
- Dim aBall
- Sub sw78_Hit
- startB2S(4)
- PlaySoundAt "fx_hole_enter", sw78 : StopQuotes
- DOF 113,2
- DOF 114,2
- ' startB2S(2)
- ShakeMain=1
- a3BankShake
- sw78.DestroyBall
- TiltGame = 1 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
- DOF 101, DOFOff
- DOF 102, DOFOff
- ClearDMD
- BallSaverTimer.Enabled = False
- ChangeGILights(0)
- If CurrentMode <> 11 Then AddScore(500000)
- If CurrentMode = 11 Then
- Call DelayScore(20000000, 18.534)
- Call DMDMessage(" ", 2.622) : Call DMDMessage("SUPER JACKPOT", 15.412) : Call DMDMessage("20 MILLION", 4.077) : Call DMDMessage("LETS DO IT AGAIN", 2)
- StopTableMusic
- PlaySound "Sfx_SJP1",0,RomSoundVolume
- FanfareTimer.Interval = 22111 : FanfareTimer.Enabled = True
- SJPLight.Interval = 2622 : SJPLight.Enabled = True
- SJPReady(CurrentPlayer) = 2
- SongTimer.Enabled = False
- sw78.TimerInterval = 22141
- TiltGame = 1
- LeftFlipper.RotateToStart : RightFlipper.RotateToStart
- DOF 101, DOFOff
- DOF 102, DOFOff
- End If
- sw77.IsDropped = False : TriggerDown(CurrentPlayer) = False
- TriggerWall.Collidable = True : TriggerWallCollide(CurrentPlayer)=True
- If CurrentMode < 10 Then BallsLocked(CurrentPlayer) = BallsLocked(CurrentPlayer)+1
- If BallsLocked(CurrentPlayer) = 1 Then Call DMDMessage("Ball Locked", 2.5) : StopTableMusic : PlaySound "Sfx_Lock1",0,RomSoundVolume : SongTimer.Enabled = False : sw78.TimerInterval = 2500
- If BallsLocked(CurrentPlayer) = 2 Then CurrentMode = 10 : MultiBallReady(CurrentPlayer) = 0 : BallsLocked(CurrentPlayer) = 0 : StopTableMusic : PlaySound "Sfx_Lock2",0,RomSoundVolume : DelayMusic = 1 : PartyMode = 1 : TiltGame = 1 : SongTimer.Interval = 3380 : SongTimer.Enabled = True : MBIntroLights.Enabled = True : Call DMDMessage("BALL LOCKED", 3.38) : Call DMDMessage("ARE YOU READY KIDS", 3) : Call DMDMessage("I CANT HEAR YOU", 4) : Call DMDMessage("OHHHHHHHH", 2) : Call DMDMessage("MULTI-BALL", 2) : sw78.TimerInterval = MusicInterval(11) + 3380 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
- DOF 101, DOFOff
- DOF 102, DOFOff
- sw78.TimerEnabled = True
- currPos = 0
- Call Update3Bank(0,50)
- BankMove = 0
- L33State(CurrentPlayer) = 0
- L34State(CurrentPlayer) = 0
- L35State(CurrentPlayer) = 0
- L36State(CurrentPlayer) = 0 : L03State(CurrentPlayer) = 0
- If BallsLocked(CurrentPlayer) = 0 Then L02State(CurrentPlayer) = 0
- If BallsLocked(CurrentPlayer) = 1 Then L02State(CurrentPlayer) = 1
- UpdateLights
- TurnLightsOff : AreLightsOff = 1
- End Sub
- ' PlaySoundAt SoundFXDOF("fx_bumper",108,DOFPulse, DOFContactors), Bumper1
- Sub sw78_Timer
- sw78.TimerEnabled = False
- sw78.TimerInterval = 1000
- BallSaverTimer.Enabled = True
- If CurrentMode = 10 Then CurrentMode = 11 : ModeReady(CurrentPlayer) = 1 : PlayTime = 0 : KickerSave(CurrentPlayer) = 2 : Diverter.RotateToStart : RandomKicker(4) : sw78.TimerEnabled = True : UpdateLights: PartyMode = 0 : TiltGame = 0 : Exit Sub
- TiltGame = 0
- RandomKicker(3)
- If CurrentMode <> 11 Or SJPReady(CurrentPlayer) = 2 Then Call PlayTableMusic(CurrentMode)
- If SJPReady(CurrentPlayer) = 2 Then RandomKicker(4) : SJPReady(CurrentPlayer) = 0 : TiltGame = 0
- If CurrentMode <> 2 Then Call ChangeGILights(1)
- AreLightsOff = 0
- UpdateLights
- End Sub
- Dim bBall
- Sub sw37_Hit
- startB2S(5)
- PlaySoundAt "fx_hole_enter", sw37
- SpongeBalls = SpongeBalls + 1
- sw37.DestroyBall
- If CurrentMode <> 1 Then AddScore(350000) : Call PlayQuote(3)
- If CurrentMode = 1 Then AddScore(2500000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("2,5 MILLION", .75) : Call JackpotSequence(1000) : JackpotSfx
- sw37.TimerEnabled = True
- ShakeSponge = 2
- SpongeTimer.Interval = 250
- SpongeTimer.Enabled = True
- If L42State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L42State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=1 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Do the Sponge Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L40State(CurrentPlayer) = 1 AND L41State(CurrentPlayer) = 0 Then L41State(CurrentPlayer) = 1 : L42State(CurrentPlayer) = 2 : UpdateLights
- If L40State(CurrentPlayer) = 0 Then L40State(CurrentPlayer) = 1 : UpdateLights
- End Sub
- Sub sw37_Timer
- sw37.TimerEnabled = False
- SpongeBalls = SpongeBalls - 1
- RandomKicker(int(rnd(1)*3))
- If SpongeBalls > 0 Then sw37.TimerEnabled = True
- End Sub
- Sub RandomKicker(KickerSelect)
- Select Case KickerSelect
- Case 0 : sw37.CreateBall : sw37.Kick int(rnd(1)*2 + 199), int(rnd(1)*2 + 23) : PlaySoundAt SoundFXDOF("fx_popper",112,DOFPulse,DOFContactors), sw37
- Case 1 : sw37.CreateBall : sw37.Kick int(rnd(1)*2 + 190), int(rnd(1)*2 + 14) : PlaySoundAt SoundFXDOF("fx_popper",112,DOFPulse,DOFContactors), sw37
- Case 2 : DrainShooter.CreateBall : DrainShooter2.Enabled = True : DrainShooter.Kick 0, 40 : PlaySoundAt SoundFXDOF("fx_popper",110,DOFPulse,DOFContactors), DrainShooter
- Case 3 : sw36.CreateBall : sw36.Kick int(rnd(1)*2 - 1), int(rnd(1)*2 + 1) : PlaySoundAt SoundFXDOF("fx_popper",112,DOFPulse,DOFContactors), sw36
- Case 4 : BallRelease.CreateBall : BallRelease.Kick 80,6 : BallRelease.TimerEnabled = True
- End Select
- End Sub
- Sub BallRelease_Timer
- BallRelease.TimerEnabled = False
- Auto_Plunger
- DOF 111, DOFPulse
- End Sub
- Sub DrainShooter2_Hit
- DrainShooter2.Kick int(rnd(1)*30 - 15), int(rnd(1)*2 + 19)
- DrainShooter2.Enabled = False
- End Sub
- '********************
- 'Rollovers & Ramp Switches
- '********************
- Sub sw16_Hit
- PlaySoundAt "fx_sensor", sw16
- If PlayTime < BallSaveTime(CurrentPlayer) Then BallSaverTimer.Enabled = False
- If PlayTime > BallSaveTime(CurrentPlayer)-1 Then
- If SideSave = 0 Then KickerSave(CurrentPlayer) = KickerSave(CurrentPlayer) - 1
- If KickerSave(CurrentPlayer) >= 0 And SJPReady(CurrentPlayer) <> 2 Then
- If SideSave = 0 Then Call RandomKicker(2) : OrbitSaved = 1 : SideSave = 1 : Call DMDMessage("Ball Saved", 1) : StopSound "Sfx_BallSaved" : PlaySound "Sfx_BallSaved",0,RomSoundVolume
- End If
- If KickerSave(CurrentPlayer) < 0 Then L14State(CurrentPlayer)=1
- If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
- ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1.5) : Call JackpotSequence(750) : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
- L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
- End If
- UpdateLights
- End If
- End Sub
- Sub sw26_Hit
- PlaySoundAt "fx_sensor", sw26
- If LRampHit = 0 Then L15State(CurrentPlayer) = 1
- LRampHit = 0
- If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
- ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1.5) : Call JackpotSequence(750) : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
- L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
- End If
- UpdateLights
- End Sub
- Sub sw26_UnHit:End Sub
- Sub sw17_Hit
- PlaySoundAt "fx_sensor", sw17
- If RRampHit = 0 Then L17State(CurrentPlayer) = 1
- RRampHit = 0
- If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
- ExtraBall = ExtraBall + 1 : Call DMDMessage("ExtraBall", 1)
- L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
- End If
- UpdateLights
- End Sub
- Sub sw17_UnHit:End Sub
- Sub sw27_Hit
- PlaySoundAt "fx_sensor", sw27
- If PlayTime < BallSaveTime(CurrentPlayer) Then BallSaverTimer.Enabled = False
- If PlayTime > BallSaveTime(CurrentPlayer)-1 Then
- If SideSave = 0 Then KickerSave(CurrentPlayer) = KickerSave(CurrentPlayer) - 1
- If KickerSave(CurrentPlayer) >= 0 And SJPReady(CurrentPlayer) <> 2 Then
- If SideSave = 0 Then Call RandomKicker(2) : OrbitSaved = 1 : SideSave = 1 : Call DMDMessage("Ball Saved", 1) : StopSound "Sfx_BallSaved" : PlaySound "Sfx_BallSaved",0,RomSoundVolume
- End If
- If KickerSave(CurrentPlayer) < 0 Then L16State(CurrentPlayer)=1
- If L14State(CurrentPlayer) = 1 AND L15State(CurrentPlayer) = 1 AND L16State(CurrentPlayer) = 1 AND L17State(CurrentPlayer) = 1 Then
- ExtraBall = ExtraBall + 1 : Call DMDMessage("Extra Ball", 1.5) : Call JackpotSequence(750) : PlaySound "Sfx_ExtraBall",0,RomSoundVolume
- L14State(CurrentPlayer) = 0 : L15State(CurrentPlayer) = 0 : L16State(CurrentPlayer) = 0 : L17State(CurrentPlayer) = 0
- End If
- UpdateLights
- End If
- End Sub
- Sub sw27_UnHit:End Sub
- Sub sw38_Hit
- PlaySoundAt "fx_sensor", sw38
- L49State(CurrentPlayer)=1
- If L49State(CurrentPlayer) = 1 AND L50State(CurrentPlayer) = 1 Then
- BallSaveTime(CurrentPlayer) = BallSaveTime(CurrentPlayer) + 1
- StopSound "Sfx_Timer" : PlaySound "Sfx_Timer",0,RomSoundVolume
- Call DMDMessage("Ball Save Now " & BallSaveTime(CurrentPlayer) & " sec", 2)
- L49State(CurrentPlayer) = 0 : L50State(CurrentPlayer) = 0
- End If
- UpdateLights
- End Sub
- Sub sw38_Unhit:End Sub
- Sub sw48_Hit
- PlaySoundAt "fx_sensor", sw48
- L50State(CurrentPlayer)=1
- If L49State(CurrentPlayer) = 1 AND L50State(CurrentPlayer) = 1 Then
- BallSaveTime(CurrentPlayer) = BallSaveTime(CurrentPlayer) + 1
- StopSound "Sfx_Timer" : PlaySound "Sfx_Timer",0,RomSoundVolume
- Call DMDMessage("Ball Save Now " & BallSaveTime(CurrentPlayer) & " sec", 2)
- L49State(CurrentPlayer) = 0 : L50State(CurrentPlayer) = 0
- End If
- UpdateLights
- End Sub
- Sub sw48_Unhit:End Sub
- Sub sw71_Hit
- PlaySoundAt "fx_sensor", sw71
- LGate.Open=True : sw71.TimerEnabled=True
- End Sub
- Sub sw71_UnHit:End Sub
- Sub sw71_Timer
- sw71.TimerEnabled=False
- LGate.Open=False
- End Sub
- Sub sw72_Hit
- startB2S(7)
- startB2S(5)
- PlaySoundAt "fx_sensor", sw72 : StopLOrbitSfx
- If ActiveBall.VelY < 0 Then
- LOrbitSfx
- sw72.TimerEnabled = False
- sw72.TimerEnabled = True
- End If
- End Sub
- Sub sw72_Unhit:End Sub
- Sub sw72_Timer
- sw72.TimerEnabled = False
- End Sub
- Sub sw73_Hit
- PlaySoundAt "fx_sensor", sw73
- End Sub
- Sub sw73_Unhit:End Sub
- Sub sw74_Hit
- 'startB2S(8)
- startB2S(5)
- PlaySoundAt "fx_sensor", sw74 : StopSound "Sfx_ROrbit"
- If ActiveBall.VelY < 0 Then
- PlaySound "Sfx_ROrbit",0,RomSoundVolume
- sw74.TimerEnabled = False
- sw74.TimerEnabled = True
- End If
- End Sub
- Sub sw74_Unhit:End Sub
- Sub sw74_Timer
- sw74.TimerEnabled = False
- End Sub
- Sub sw61_Hit
- startB2S(5)
- RRampHit = RRampHit + 1
- If RRampHit > 1 Then RRampHit = 0
- If ActiveBall.VelY < 0 Then
- RRampSfx
- Else
- StopRRampSfx
- End If
- End Sub
- Sub sw61_Unhit:End Sub
- Sub sw62_Hit
- If ModeReady(CurrentPlayer) = 0 OR CurrentMode = 11 Then RGate.Open=True : sw62.TimerEnabled=True
- End Sub
- Sub sw62_Unhit:End Sub
- Sub sw62_Timer
- sw62.TimerEnabled=False
- If ModeReady(CurrentPlayer)=1 AND CurrentMode <> 11 then Diverter.RotateToEnd : RGate.Open=False
- If ModeReady(CurrentPlayer)=0 OR CurrentMode = 11 then RGate.Open=False
- End Sub
- Sub DiverterStuck_Hit
- If ModeReady(CurrentPlayer)=1 AND CurrentMode <> 11 And MultiBallReady(CurrentPlayer) = 0 Then
- Diverter.RotateToStart
- sw62.TimerEnabled=True
- End If
- End Sub
- Sub sw63_Hit
- startB2S(5)
- If ActiveBall.VelY < 0 Then
- If CurrentMode <> 2 Then LRampSfx
- If CurrentMode = 2 Then Call PlayQuote(5)
- Else
- StopLRampSfx
- End If
- End Sub
- Sub sw63_Unhit:End Sub
- Sub LeftRamp_Hit
- LRampHit = LRampHit + 1
- StopLRampSfx
- If CurrentMode <> 2 Then AddScore(500000)
- If CurrentMode = 2 Then AddScore(10000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("10 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
- If L29State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L29State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=2 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Plankton has Taken Over" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L27State(CurrentPlayer) = 1 AND L28State(CurrentPlayer) = 0 Then L28State(CurrentPlayer) = 1 : L29State(CurrentPlayer) = 2 : UpdateLights
- If L27State(CurrentPlayer) = 0 Then L27State(CurrentPlayer) = 1 : UpdateLights
- End Sub
- Sub RightRamp_Hit
- RRampHit = RRampHit + 1
- StopRRampSfx
- If RRampHit = 2 Then
- If CurrentMode <> 3 Then AddScore(500000)
- If CurrentMode = 3 Then AddScore(5000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("5 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
- If L45State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L45State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=3 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Sandy's Rodeo Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L43State(CurrentPlayer) = 1 AND L44State(CurrentPlayer) = 0 Then L44State(CurrentPlayer) = 1 : L45State(CurrentPlayer) = 2 : UpdateLights
- If L43State(CurrentPlayer) = 0 Then L43State(CurrentPlayer) = 1 : UpdateLights
- End If
- End Sub
- Sub sw64_Hit:End Sub
- Sub sw64_Unhit:End Sub
- Sub sw65_Hit:End Sub
- Sub sw65_Unhit:End Sub
- Sub sw65a_Hit:End Sub
- Sub sw65a_Unhit:End Sub
- Sub Gate001_Hit
- If ActiveBall.VelY < 0 Then
- If CurrentMode <> 4 Then AddScore(350000) : Call PlayQuote(2)
- If CurrentMode = 4 Then AddScore(7000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("7 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
- If L39State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L39State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=4 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Mr Krabs Money Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L37State(CurrentPlayer) = 1 AND L38State(CurrentPlayer) = 0 Then L38State(CurrentPlayer) = 1 : L39State(CurrentPlayer) = 2 : UpdateLights
- If L37State(CurrentPlayer) = 0 Then L37State(CurrentPlayer) = 1 : UpdateLights
- End If
- End Sub
- Sub LGateTrigger_Hit
- If sw74.TimerEnabled = True AND ActiveBall.VelX < 0 Then 'ROrbitHit = 3 Then
- AddScore(350000)
- If CurrentMode = 5 Then Call DMDMessage("Jackpot", 1.5) : Call JackpotSequence(1000) : JackpotSfx
- If L48State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L48State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=5 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Jellyfish Party Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L46State(CurrentPlayer) = 1 AND L47State(CurrentPlayer) = 0 Then L47State(CurrentPlayer) = 1 : L48State(CurrentPlayer) = 2 : UpdateLights
- If L46State(CurrentPlayer) = 0 Then L46State(CurrentPlayer) = 1 : UpdateLights
- End If
- End Sub
- Sub RGate_Hit
- If sw72.TimerEnabled = True AND ActiveBall.VelY < 0 Then 'LOrbitHit = 3 Then
- If CurrentMode <> 6 Then AddScore(350000)
- If CurrentMode = 6 Then AddScore(5000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("5 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
- If L26State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L26State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=6 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Boating School Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L24State(CurrentPlayer) = 1 AND L25State(CurrentPlayer) = 0 Then L25State(CurrentPlayer) = 1 : L26State(CurrentPlayer) = 2 : UpdateLights
- If L24State(CurrentPlayer) = 0 Then L24State(CurrentPlayer) = 1 : UpdateLights
- End If
- End Sub
- '********************
- 'Targets
- '********************
- Sub sw56_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakeSquidward=1:a3BankShake:PlaySoundAt "fx_solenoidon2", alien5:LeftTargetsHit:End Sub
- Sub sw57_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakeSquidward=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien5:LeftTargetsHit:End Sub
- Sub sw58_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakeSquidward=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien5:LeftTargetsHit:End Sub
- Sub LeftTargetsHit
- DOF 117,DOFPulse
- startB2S(14)
- If CurrentMode <> 7 Then AddScore(250000) : Call PlayQuote(1)
- If CurrentMode = 7 Then AddScore(2500000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("2,5 MILLION", .75) : Call JackpotSequence(1000) : JackpotSfx
- If L20State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L20State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=7 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Squidward's Tiki Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L18State(CurrentPlayer) = 1 AND L19State(CurrentPlayer) = 0 Then L19State(CurrentPlayer) = 1 : L20State(CurrentPlayer) = 2 : UpdateLights
- If L18State(CurrentPlayer) = 0 Then L18State(CurrentPlayer) = 1 : UpdateLights
- End Sub
- Sub sw41_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakePatrick=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien14:RightTargetsHit:End Sub
- Sub sw42_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakePatrick=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien14:RightTargetsHit:End Sub
- Sub sw44_Hit:PlaySoundAtBall SoundFX("fx_target", DOFTargets):ShakePatrick=1:a3BankShake:PlaySoundAt "fx_solenoidon2", Alien14:RightTargetsHit:End Sub
- Sub RightTargetsHit
- DOF 116,DOFPulse
- startB2S(13)
- If CurrentMode <> 8 Then AddScore(250000) : Call PlayQuote(4)
- If CurrentMode = 8 Then AddScore(2500000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("2,5 MILLION", .75) : Call JackpotSequence(1000) : JackpotSfx
- If L23State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L23State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=8 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Goofy Goobers Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L21State(CurrentPlayer) = 1 AND L22State(CurrentPlayer) = 0 Then L22State(CurrentPlayer) = 1 : L23State(CurrentPlayer) = 2 : UpdateLights
- If L21State(CurrentPlayer) = 0 Then L21State(CurrentPlayer) = 1 : UpdateLights
- End Sub
- Sub sw43_Hit
- DOF 115,DOFPulse
- startB2S(8)
- PlaySoundAtBall SoundFX("fx_target", DOFTargets)
- ShakePatty=1 : a3BankShake : PlaySoundAt "fx_solenoidon2", Alien6
- If CurrentMode <> 9 Then AddScore(250000) : TargetSfx
- If CurrentMode = 9 Then AddScore(5000000) : Call DMDMessage("Jackpot", .75) : Call DMDMessage("5 Million", .75) : Call JackpotSequence(1000) : JackpotSfx
- If L32State(CurrentPlayer) = 2 And ModeReady(CurrentPlayer)= 0 And MultiBallReady(CurrentPlayer) = 0 Then
- L32State(CurrentPlayer) = 1 : Diverter.RotateToEnd : ModeReady(CurrentPlayer)=1 : NextMode(CurrentPlayer)=9 : Call DMDMessage("Mode Ready", 1) : ModeText(CurrentPlayer) = "Krusty Krab Mode" : PlaySound "Sfx_ModeReady",0,RomSoundVolume
- If ModesComplete(CurrentPlayer) = 8 Then SJPReady(CurrentPlayer) = 1 : CurrentMode = 0 : IntroMusic
- UpdateLights
- End If
- If L30State(CurrentPlayer) = 1 AND L31State(CurrentPlayer) = 0 Then L31State(CurrentPlayer) = 1 : L32State(CurrentPlayer) = 2 : UpdateLights
- If L30State(CurrentPlayer) = 0 Then L30State(CurrentPlayer) = 1 : UpdateLights
- End Sub
- Sub sw75_Hit
- DOF 113,DOFPulse
- startB2S(4)
- PlaySoundAtBall SoundFX("fx_target", DOFTargets) : TargetSfx
- ShakeMain=1
- a3BankShake
- AddScore(100000)
- If L34State(CurrentPlayer) <> 2 And SJPReady(CurrentPlayer) = 0 Then L33State(CurrentPlayer) = 1
- If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
- TriggerWall.Collidable = False : TriggerWallCollide(CurrentPlayer)=False
- sw77.IsDropped = True : TriggerDown(CurrentPlayer) = True
- L34State(CurrentPlayer) = 2
- L36State(CurrentPlayer) = 2
- If BallsLocked(CurrentPlayer) = 0 AND CurrentMode <> 11 Then L02State(CurrentPlayer) = 2 : Call DMDMessage("Ball Lock Ready", 1)
- If BallsLocked(CurrentPlayer) = 1 AND CurrentMode <> 11 Then
- L03State(CurrentPlayer) = 2 : L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2 : Call DMDMessage("MULTI-BALL READY", 2) : Call ChangeGILights(1)
- MultiBallReady(CurrentPlayer) = 1
- CurrentMode = 0 : IntroMusic : ModeReady(CurrentPlayer) = 1 : Diverter.RotateToStart
- End If
- If CurrentMode = 11 Then
- L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2
- SJPReady(CurrentPlayer) = 1
- IntroMusic
- End If
- End If
- UpdateLights
- End Sub
- Sub sw76_Hit
- DOF 113,DOFPulse
- startB2S(3)
- PlaySoundAtBall SoundFX("fx_target", DOFTargets) : TargetSfx
- ShakeMain=1
- a3BankShake
- AddScore(100000)
- If L34State(CurrentPlayer) <> 2 And SJPReady(CurrentPlayer) = 0 Then L35State(CurrentPlayer) = 1
- If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
- TriggerWall.Collidable = False : TriggerWallCollide(CurrentPlayer)=False
- sw77.IsDropped = True : TriggerDown(CurrentPlayer) = True
- L34State(CurrentPlayer) = 2
- L36State(CurrentPlayer) = 2
- If BallsLocked(CurrentPlayer) = 0 AND CurrentMode <> 11 Then L02State(CurrentPlayer) = 2 : Call DMDMessage("Ball Lock Ready", 1)
- If BallsLocked(CurrentPlayer) = 1 AND CurrentMode <> 11 Then
- L03State(CurrentPlayer) = 2 : L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2 : Call DMDMessage("MULTI-BALL READY", 2) : Call ChangeGILights(1)
- MultiBallReady(CurrentPlayer) = 1
- CurrentMode = 0 : IntroMusic : ModeReady(CurrentPlayer) = 1 : Diverter.RotateToStart
- End If
- If CurrentMode = 11 Then
- L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2
- SJPReady(CurrentPlayer) = 1
- IntroMusic
- End If
- End If
- UpdateLights
- End Sub
- '********************
- '3 Bank
- '********************
- Sub sw45_Hit
- DOF 113,DOFPulse
- startB2S(5)
- PlaySoundAtBall SoundFX("fx_target", DOFTargets)
- If MoveSpeed > 47 Or MoveSpeed = 0 Then
- ShakeThree=1
- ShakeMain=.5
- a3BankShake
- TargetSfx
- AddScore(250000)
- BankMove = BankMove + 1
- L33State(CurrentPlayer) = 1
- UpdateLights
- currpos = 50
- If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
- Call Update3Bank(50, 0)
- L33State(CurrentPlayer) = 0
- L34State(CurrentPlayer) = 0
- L35State(CurrentPlayer) = 0
- L36State(CurrentPlayer) = 1 : L03State(CurrentPlayer) = 0
- End If
- End If
- End Sub
- Sub sw46_Hit
- DOF 113,DOFPulse
- startB2S(5)
- PlaySoundAtBall SoundFX("fx_target", DOFTargets)
- If MoveSpeed > 47 Or MoveSpeed = 0 Then
- ShakeThree=1
- ShakeMain=.5
- a3BankShake
- TargetSfx
- AddScore(250000)
- BankMove = BankMove + 1
- L34State(CurrentPlayer) = 1
- UpdateLights
- currpos = 50
- If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
- Call Update3Bank(50, 0)
- L33State(CurrentPlayer) = 0
- L34State(CurrentPlayer) = 0
- L35State(CurrentPlayer) = 0
- L36State(CurrentPlayer) = 1 : L03State(CurrentPlayer) = 0
- End If
- End If
- End Sub
- Sub sw47_Hit
- DOF 113,DOFPulse
- startB2S(5)
- PlaySoundAtBall SoundFX("fx_target", DOFTargets)
- If MoveSpeed > 47 Or MoveSpeed = 0 Then
- ShakeThree=1
- ShakeMain=.5
- a3BankShake
- TargetSfx
- AddScore(250000)
- BankMove = BankMove + 1
- L35State(CurrentPlayer) = 1
- UpdateLights
- currpos = 50
- If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
- Call Update3Bank(50, 0)
- L33State(CurrentPlayer) = 0
- L34State(CurrentPlayer) = 0
- L35State(CurrentPlayer) = 0
- L36State(CurrentPlayer) = 1 : L03State(CurrentPlayer) = 0
- End If
- End If
- End Sub
- '********************
- 'Droptarget
- '********************
- Sub TriggerWall_Hit
- PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw77 : TargetSfx
- ShakeMain= 1
- a3BankShake
- AddScore(100000)
- If SJPReady(CurrentPlayer) = 0 Then L34State(CurrentPlayer) = 1
- If L33State(CurrentPlayer) = 1 AND L34State(CurrentPlayer) = 1 AND L35State(CurrentPlayer) = 1 Then
- TriggerWall.Collidable = False : TriggerWallCollide(CurrentPlayer)=False
- sw77.IsDropped = True : TriggerDown(CurrentPlayer) = True
- L34State(CurrentPlayer) = 2
- L36State(CurrentPlayer) = 2
- If BallsLocked(CurrentPlayer) = 0 AND CurrentMode <> 11 Then L02State(CurrentPlayer) = 2 : Call DMDMessage("Ball Lock Ready", 1)
- If BallsLocked(CurrentPlayer) = 1 AND CurrentMode <> 11 Then
- L03State(CurrentPlayer) = 2 : L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2 : Call DMDMessage("MULTI-BALL READY", 2) : Call ChangeGILights(1)
- MultiBallReady(CurrentPlayer) = 1
- CurrentMode = 0 : IntroMusic : ModeReady(CurrentPlayer) = 1 : Diverter.RotateToStart
- End If
- If CurrentMode = 11 Then
- L33State(CurrentPlayer) = 2 : L34State(CurrentPlayer) = 2 : L35State(CurrentPlayer) = 2
- SJPReady(CurrentPlayer) = 1
- IntroMusic
- End If
- End If
- UpdateLights
- End Sub
- Sub sw77_Hit
- DOF 113, DOFPulse
- End Sub
- Sub PlungerLaneTrigger_Hit
- startB2S(5)
- BallSaverTimer.Enabled = True
- If PlayTime < BallSaveTime(CurrentPlayer) Then
- l01.State=2
- Else
- If ExtraBall > 0 Then l01.State=1
- End If
- If BallInLane = 1 Then
- SkillShot = 0
- SSText = 0
- If DMDText.Text = "PINEAPPLE" Then
- IntroMusic : Call DMDMessage("SKILL SHOT", .5) : Call DMDMessage("1 MILLION", 1) : AddScore(1000000) : InsertSequence.Play SeqRandom,10,,750
- Else
- StopTableMusic : PlaySound "Sfx_SkillMiss",0,RomSoundVolume : DelayMusic = 0 : SongTimer.Interval = 459 : SongTimer.Enabled = True
- Call DMDMessage("SKILL SHOT MISSED", 1)
- End If
- End If
- BallInLane = 0
- DrainSave = 0
- End Sub
- '********************
- 'Ball Save Timer
- '********************
- Sub BallSaverTimer_Timer()
- BallSaverTimer.Enabled = False
- PlayTime = PlayTime+1
- If PlayTime < BallSaveTime(CurrentPlayer) Then
- l01.State=2
- L14.State = L14State(CurrentPlayer) : L16.State = L16State(CurrentPlayer)
- End If
- If PlayTime > BallSaveTime(CurrentPlayer)-1 Then
- If ExtraBall = 0 Then l01.State=0
- If ExtraBall > 0 Then l01.State=1
- If KickerSave(CurrentPlayer) > 0 Then L14.State = 2 : L16.State = 2
- End If
- BallSaverTimer.Enabled = True
- End Sub
- '**********************
- ' Skill Shot
- '**********************
- Sub SkillShotDMD
- Call DMDMessage("WHO", .15)
- Call DMDMessage("LIVES", .15)
- Call DMDMessage("IN A", .15)
- Call DMDMessage("PINEAPPLE", .15)
- Call DMDMessage("UNDER", .15)
- Call DMDMessage("THE SEA", .15)
- End Sub
- Sub SkillShotTimer_Timer
- SkillShotTimer.Enabled = False
- If SkillShot = 1 Then
- SkillShotSfx
- If SkillShot2 = 0 Then DMDText.Text = "WHO" : LEDText("WHO")
- If SkillShot2 = 1 Then DMDText.Text = "LIVES" : LEDText("LIVES")
- If SkillShot2 = 2 Then DMDText.Text = "IN A" : LEDText("IN A")
- If SkillShot2 = 3 Then DMDText.Text = "PINEAPPLE" : LEDText("PINEAPPLE")
- If SkillShot2 = 4 Then DMDText.Text = "UNDER" : LEDText("UNDER")
- If SkillShot2 = 5 Then DMDText.Text = "THE SEA" : LEDText("THE SEA")
- SkillShot2 = SkillShot2 + 1
- If SkillShot2 = 6 Then SkillShot2 = 0
- SkillShotTimer.Enabled = True
- End If
- End Sub
- Sub SkillShotMessage_Timer
- SkillShotMessage.Enabled = False : SkillShotMessage.Interval = 10
- If SSText = 0 AND SkillShot = 0 AND BallInLane = 1 Then DMDText.Text = "HOLD PLUNGER BUTTON" : LEDText("HOLD PLUNGER BUTTON")
- If SSText = 1 AND SkillShot = 0 AND BallInLane = 1 Then DMDText.Text = "STOP ON PINEAPPLE FOR SKILL SHOT" : LEDText("STOP ON PINEAPPLE FOR SKILL SHOT")
- If SSText = 2 AND SkillShot = 0 AND BallInLane = 1 Then DMDText.Text = "PLAYER " & CurrentPlayer : LEDText("PLAYER " & CurrentPlayer)
- If SkillShot = 0 AND BallInLane = 1 Then SSText = SSText + 1
- If SSText = 3 Then SSText = 0
- If BallInLane = 1 AND SkillShot = 0 Then SkillShotMessage.Enabled = True : SkillShotMessage.Interval = 1000
- End Sub
- '*********
- 'Solenoids
- '*********
- Sub Auto_Plunger
- PlungerIM.AutoFire
- End Sub
- '********************
- ' JP Flippers
- '********************
- Sub LeftFlipper_Collide(parm)
- PlaySound "fx_rubber_flipper", 0, (parm/60) * MechSoundVolume, pan(ActiveBall), 0.2, 0, 0, 0, AudioFade(ActiveBall)
- End Sub
- Sub RightFlipper_Collide(parm)
- PlaySound "fx_rubber_flipper", 0, (parm/60) * MechSoundVolume, pan(ActiveBall), 0.2, 0, 0, 0, AudioFade(ActiveBall)
- End Sub
- '******************
- 'Motor Bank Up Down
- '******************
- Sub Update3Bank(currpos, lastpos)
- If currpos <> lastpos Then
- PlaySound "fx_motor",0,MechSoundVolume * .3
- MoveSpeed = 0
- c3BankTimer.Enabled = True
- End If
- If currpos > 40 Then
- NewBankDown = 1
- sw45.Isdropped = 1
- sw46.Isdropped = 1
- sw47.Isdropped = 1
- 'UFORotSpeedMedium
- End If
- If currpos < 10 Then
- NewBankDown = 0
- sw45.Isdropped = 0
- sw46.Isdropped = 0
- sw47.Isdropped = 0
- 'UFORotSpeedSlow
- End If
- End Sub
- Sub c3BankTimer_Timer
- MoveSpeed = MoveSpeed + 1
- If currpos = 50 AND MoveSpeed < 48 Then
- BackBank.Z = BackBank.Z - 1
- swp45.Z = swp45.Z - 1
- swp46.Z = swp45.Z - 1
- swp47.Z = swp47.Z - 1
- BankDown(CurrentPlayer) = 1
- End If
- If currpos = 0 AND MoveSpeed < 48 Then
- BackBank.Z = BackBank.Z + 1
- swp45.Z = swp45.Z + 1
- swp46.Z = swp45.Z + 1
- swp47.Z = swp47.Z + 1
- BankDown(CurrentPlayer) = 0
- End If
- If MoveSpeed > 47 Then
- c3BankTimer.Enabled = False
- UpdateLights
- If BankDown(CurrentPlayer) = 1 AND NewBankDown = 0 Then currpos = 0 : Call Update3Bank(0,50)
- End If
- End Sub
- '*************
- ' 3Bank Shake
- '*************
- Dim ccBall
- Const cMod = .65 'percentage of hit power transfered to the 3 Bank of targets
- ShakeMain = 0
- ShakeThree = 0
- ShakeSponge = 0
- ShakePatty = 0
- ShakePatrick = 0
- ShakeSquidward = 0
- a3BankInit
- Sub a3BankShake
- ccball.velx = activeball.velx * cMod
- ccball.vely = activeball.vely * cMod
- a3BankTimer.enabled = True
- b3BankTimer.enabled = True
- End Sub
- Sub a3BankShake2 'when nudging
- ShakeThree=1
- ShakeMain=.5
- a3BankTimer.enabled = True
- b3BankTimer.enabled = True
- End Sub
- Sub a3BankInit
- Set ccBall = hball.createball
- hball.Kick 0, 0
- ccball.Mass = 1.6
- End Sub
- Sub a3BankTimer_Timer 'start animation
- Dim x, y
- x = (hball.x - ccball.x) / 4 'reduce the X axis movement
- y = (hball.y - ccball.y) / 2
- backbank.transy = x * ShakeThree
- backbank.transx = - y * ShakeThree
- swp45.transy = x * ShakeThree
- swp45.transx = - y * ShakeThree
- swp46.transy = x * ShakeThree
- swp46.transx = - y * ShakeThree
- swp47.transy = x * ShakeThree
- swp47.transx = - y * ShakeThree
- Ufo1.transx = ((rnd(1) * 20) - 10) * ShakeMain
- Ufo1.transz = rnd(1) * 10 * ShakeMain
- Alien5.Transy = 20 * ShakeSquidward : If ShakeSquidward = 1 Then Wall002.IsDropped = False
- Alien6.Transy = 20 * ShakePatty : If ShakePatty = 1 Then Wall004.IsDropped = False
- Alien14.Transy = 20 * ShakePatrick : If ShakePatrick = 1 Then Wall003.IsDropped = False
- End Sub
- Sub b3BankTimer_Timer 'stop animation
- backbank.transx = 0
- backbank.transy = 0
- swp45.transz = 0
- swp45.transx = 0
- swp46.transz = 0
- swp46.transx = 0
- swp47.transz = 0
- swp47.transx = 0
- Ufo1.transx = 0
- Ufo1.transz = 0
- Alien5.Transy = 0 : Wall002.IsDropped = True
- Alien6.Transy = 0 : Wall004.IsDropped = True
- Alien14.Transy = 0 : Wall003.IsDropped = True
- a3BankTimer.enabled = False
- b3BankTimer.enabled = False
- ShakeMain = 0
- ShakeThree = 0
- ShakePatty = 0
- ShakePatrick = 0
- ShakeSquidward = 0
- End Sub
- Sub SpongeTimer_Timer
- SpongeTimer.Enabled = False
- If ShakeSponge > 0 Then
- Alien8.Transy = 20 : Wall005.IsDropped = False
- PlaySoundAt SoundFXDOF("fx_solenoidon2",118,DOFPulse,DOFContactors) , Alien8
- 'PlaySoundAt "fx_solenoidon2", Alien8
- startB2S(1)
- ShakeSponge = ShakeSponge - 1
- ShakeDown.Enabled = True
- Else
- Alien8.Transy = 0 : : Wall005.IsDropped = True
- End If
- End Sub
- Sub ShakeDown_Timer
- ShakeDown.Enabled = False
- Alien8.Transy = 0
- SpongeTimer.Interval = 125
- SpongeTimer.Enabled = True
- End Sub
- '******************************
- ' Diverse Collection Hit Sounds
- '******************************
- Sub aMetals_Hit(idx):PlaySoundAtBall "fx_MetalHit":End Sub
- Sub aRubbers_Hit(idx):PlaySoundAtBall "fx_rubber_band":End Sub
- Sub aPostRubbers_Hit(idx):PlaySoundAtBall "fx_rubber_post":End Sub
- Sub aRubber_Pins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub
- Sub aPlastics_Hit(idx):PlaySoundAtBall "fx_PlasticHit":End Sub
- Sub aGates_Hit(idx):PlaySoundAtBall "fx_Gate":End Sub
- Sub aWoods_Hit(idx):PlaySoundAtBall "fx_Woodhit":End Sub
- ' *********************************************************************
- ' Supporting Ball & Sound Functions
- ' *********************************************************************
- Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
- Vol = Csng(BallVel(ball) ^2 / 2000)
- End Function
- Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
- Dim tmp
- tmp = ball.x * 2 / table1.width-1
- If tmp > 0 Then
- Pan = Csng(tmp ^10)
- Else
- Pan = Csng(-((- tmp) ^10))
- End If
- End Function
- Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
- Pitch = BallVel(ball) * 20
- End Function
- Function BallVel(ball) 'Calculates the ball speed
- BallVel = (SQR((ball.VelX ^2) + (ball.VelY ^2)))
- End Function
- Function AudioFade(ball) 'only on VPX 10.4 and newer
- Dim tmp
- tmp = ball.y * 2 / Table1.height-1
- If tmp > 0 Then
- AudioFade = Csng(tmp ^10)
- Else
- AudioFade = Csng(-((- tmp) ^10))
- End If
- End Function
- Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
- PlaySound soundname, 0, MechSoundVolume, Pan(tableobj), 0.06, 0, 0, 0, AudioFade(tableobj)
- End Sub
- Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets, metals, plastics
- PlaySound soundname, 0, Vol(ActiveBall) * MechSoundVolume, pan(ActiveBall), 0.2, 0, 0, 0, AudioFade(ActiveBall)
- End Sub
- '********************************************
- ' JP's VP10 Rolling Sounds + Ballshadow
- ' uses a collection of shadows, aBallShadow
- '********************************************
- Const tnob = 3 ' total number of balls
- Const lob = 0 'number of locked balls
- ReDim rolling(tnob)
- InitRolling
- Sub InitRolling
- Dim i
- For i = 0 to tnob
- rolling(i) = False
- Next
- End Sub
- Sub RollingTimer_Timer()
- Dim BOT, b, ballpitch, ballvol, X, Y
- BOT = GetBalls
- NudgeSensorStatus X, Y
- 'Tilt Routines
- If LeftPress = 1 Then LTiltPower = LTiltPower + 1
- If RightPress = 1 Then RTiltPower = RTiltPower + 1
- If CenterPress = 1 Then CTiltPower = CTiltPower + 1
- If TiltGame = 0 Then
- If WarningCount = 1 And TiltTime < 51 Then TiltTime = TiltTime + 1
- If abs(X) > TiltLevel Or abs(Y) > TiltLevel Then
- If WarningCount = 0 Then CTiltPower = 30 : CheckTilt
- If WarningCount = 1 And TiltTime > 50 Then CTiltPower = 30 : CheckTilt
- End If
- End If
- 'Flipper Primitive
- batleft.ObjRotZ = LeftFlipper.CurrentAngle
- batright.ObjRotZ = RightFlipper.CurrentAngle
- ' 'B2S Lights
- ' If ShowDT = False Or B2SonDesktop = 1 Then
- ' If B2sLightState <> gi038.State Then
- ' Controller.B2SSetData 1, gi038.State
- ' Controller.B2SSetData 2, gi038.State
- ' Controller.B2SSetData 3, gi038.State
- ' Controller.B2SSetData 4, gi038.State
- ' Controller.B2SSetData 5, gi038.State
- ' Controller.B2SSetData 6, gi038.State
- ' Controller.B2SSetData 7, gi038.State
- ' Controller.B2SSetData 8, gi038.State
- ' Controller.B2SSetData 9, gi038.State
- ' Controller.B2SSetData 10, gi038.State
- ' Controller.B2SSetData 11, gi038.State
- ' Controller.B2SSetData 12, gi038.State
- ' Controller.B2SSetData 13, gi038.State
- ' Controller.B2SSetData 14, gi038.State
- ' Controller.B2SSetData 15, gi038.State
- ' Controller.B2SSetData 16, gi038.State
- ' B2sLightState = gi038.State
- ' End If
- ' End If
- ' stop the sound of deleted balls
- For b = UBound(BOT) + 1 to tnob
- rolling(b) = False
- StopSound("fx_ballrolling" & b)
- Next
- ' exit the sub if no balls on the table
- If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table
- ' play the rolling sound for each ball and draw the shadow
- For b = lob to UBound(BOT)
- If BallVel(BOT(b) )> 1 Then
- If BOT(b).z <30 Then
- ballpitch = Pitch(BOT(b) )
- ballvol = Vol(BOT(b) ) * 10
- Else
- ballpitch = Pitch(BOT(b) ) + 25000 'increase the pitch on a ramp
- ballvol = Vol(BOT(b) ) * 10
- End If
- rolling(b) = True
- PlaySound("fx_ballrolling" & b), -1, ballvol * MechSoundVolume, Pan(BOT(b) ), 0, ballpitch, 1, 0, AudioFade(BOT(b) )
- Else
- If rolling(b) = True Then
- StopSound("fx_ballrolling" & b)
- rolling(b) = False
- End If
- End If
- ' rothbauerw's Dropping Sounds
- If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
- PlaySound "fx_balldrop", 0, (ABS(BOT(b).velz)/17) * MechSoundVolume, Pan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- End If
- Next
- End Sub
- '**********************
- ' Ball Collision Sound
- '**********************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, (Csng(velocity) ^2 / 2000) * MechSoundVolume, Pan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
- End Sub
- '********************
- 'Adding Score
- '********************
- Sub AddScore(points)
- If Drain.TimerEnabled = False Then RoundScore = RoundScore + points
- TotalScore(CurrentPlayer) = TotalScore(CurrentPlayer) + points
- If CurrentPlayer = 1 Then ScoreText.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
- If CurrentPlayer = 2 Then ScoreText2.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
- If CurrentPlayer = 3 Then ScoreText3.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
- If CurrentPlayer = 4 Then ScoreText4.Text = FormatNumber(TotalScore(CurrentPlayer),0,,,-1)
- If ShowDT = False Or B2SonDesktop = 1 Then
- For i = 0 to Len(TotalScore(CurrentPlayer)) - 1
- Controller.B2SSetLED ((10*CurrentPlayer)-i), b2sChrLookup2(Asc(Mid(TotalScore(CurrentPlayer),Len(TotalScore(CurrentPlayer)) - i,1)))
- If i = 3 OR i = 6 OR i = 9 Then
- Controller.B2SSetLED ((10*CurrentPlayer)-i), b2sChrLookup2(Asc(Mid(TotalScore(CurrentPlayer),Len(TotalScore(CurrentPlayer)) - i,1))) + 128
- End If
- Next
- If Len(LEDMessage2) <= 0 AND BallInLane = 0 AND DMDText.TimerEnabled = False Then
- For i = 0 to Len(FormatNumber(TotalScore(CurrentPlayer),0,,,-1)) - 1
- Controller.B2SSetLED (80 - i), b2sChrLookup2(Asc(Mid(FormatNumber(TotalScore(CurrentPlayer),0,,,-1),Len(FormatNumber(TotalScore(CurrentPlayer),0,,,-1)) - i,1)))
- Next
- End If
- End If
- End Sub
- Sub DelayScore(dscore, dtime)
- DScoreValue = dscore
- DelayScoreTimer.Interval = dtime * 1000
- DelayScoreTimer.Enabled = True
- End Sub
- Sub DelayScoreTimer_Timer
- DelayScoreTimer.Enabled = False
- AddScore(DScoreValue)
- End Sub
- '**********************
- ' DMD Display
- '**********************
- Dim h, j
- Sub DMDMessage(Message, DisplayTime)
- For h = 0 to 9
- If DMDDisplay(h,0) = "" Then
- DMDDisplay(h,0) = Message
- DMDDisplay(h,1) = DisplayTime
- Exit For
- End If
- Next
- If DMDText.TimerEnabled = False Then
- DMDText.Text = Message : LEDText(Message)
- DMDText.TimerInterval = DisplayTime * 1000
- DMDText.TimerEnabled = True
- End If
- End Sub
- Sub DMDText_Timer
- DMDText.TimerEnabled = False
- For j = 0 to 8
- DMDDisplay(j,0) = DMDDisplay(j+1,0)
- DMDDisplay(j,1) = DMDDisplay(j+1,1)
- Next
- DMDDisplay(9,0) = ""
- DMDDisplay(9,1) = ""
- If DMDDisplay(0,0) <> "" Then
- DMDText.Text = DMDDisplay(0,0) : LEDText(DMDDisplay(0,0))
- DMDText.TimerInterval = DMDDisplay(0,1) * 1000
- DMDText.TimerEnabled = True
- Else
- If StartGame = 0 Then
- ClearDMD
- If ScoreNumber = "" Then DMDText.Text = "Game Over" : LEDText("Game Over"):startB2S(6)
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81,0
- If ScoreNumber <> "" Then EnterHS
- Else
- Select Case CurrentMode
- Case 0
- If SkillShot = 0 Then
- If ScoreNumber = "" Then DMDText.Text = "Player " & CurrentPlayer : LEDText("Player " & CurrentPlayer)
- If ModesComplete(CurrentPlayer) = 8 Then DMDText.Text = "Shoot Vault for Super Jackpot" : LEDText("Shoot Vault for Super Jackpot")
- If ScoreNumber <> "" Then EnterHS
- If BallInLane = 1 Then SkillShotMessage.Enabled = True
- End If
- Case 1 : DMDText.Text = "Shoot Spongebob for Jackpot" : LEDText("Shoot Spongebob for Jackpot")
- Case 2 : DMDText.Text = "Shoot Left Ramp for Jackpot" : LEDText("Shoot Left Ramp for Jackpot")
- Case 3 : DMDText.Text = "Shoot Right Ramp for Jackpot" : LEDText("Shoot Right Ramp for Jackpot")
- Case 4 : DMDText.Text = "Shoot Mr Krab's Vault for Jackpot" : LEDText("Shoot Mr Krab's Vault for Jackpot")
- Case 5 : DMDText.Text = "BUMPERS SCORE 500 THOUSAND" : LEDText("BUMPERS SCORE 500 THOUSAND")
- Case 6 : DMDText.Text = "Shoot Left Orbit for Jackpot" : LEDText("Shoot Left Orbit for Jackpot")
- Case 7 : DMDText.Text = "Shoot Squidward for Jackpot" : LEDText("Shoot Squidward for Jackpot")
- Case 8 : DMDText.Text = "Shoot Patrick for Jackpot" : LEDText("Shoot Patrick for Jackpot")
- Case 9 : DMDText.Text = "Shoot Krabby Patty for Jackpot" : LEDText("Shoot Krabby Patty for Jackpot")
- Case 11 : DMDText.Text = "Shoot Pineapple for Super Jackpot" : LEDText("Shoot Pineapple for Super Jackpot")
- End Select
- End If
- End If
- End Sub
- Sub ScoresClear
- If ShowDT = False Or B2SonDesktop = 1 Then
- For i = 1 to 40
- Controller.B2SSetLED i,0
- Next
- Controller.B2SSetLED 81,0
- End If
- End Sub
- Sub LEDText(LEDMessage)
- If ShowDT = False Or B2SonDesktop = 1 Then
- LEDMessage2 = ""
- If Len(LEDMessage) > 20 Then
- LEDMessage2 = Mid(LEDMessage, InStrRev(LEDMessage," ",20) + 1, Len(LEDMessage))
- LEDMessage = Mid(LEDMessage, 1, InStrRev(LEDMessage," ",20))
- End If
- For i = 41 to 80
- Controller.B2SSetLED i, 0
- Next
- For i = 1 to Len(LEDMessage)
- Controller.B2SSetLED 40 + i, b2sChrLookup2(Asc(UCase(Mid(LEDMessage,i,1))))
- Next
- If Len(LEDMessage2) > 0 Then
- For i = 1 to Len(LEDMessage2)
- Controller.B2SSetLED 60 + i, b2sChrLookup2(Asc(UCase(Mid(LEDMessage2,i,1))))
- Next
- End If
- End If
- End Sub
- Sub ClearDMD
- DMDText.TimerEnabled = False
- For h = 0 to 9
- DMDDisplay(h,0) = ""
- DMDDisplay(h,1) = ""
- Next
- End Sub
- '**********************
- ' Music & Sound Routines
- '**********************
- Sub PlayTableMusic(SongSelect)
- StopTableMusic
- Select Case SongSelect
- Case 0
- If MultiBallReady(CurrentPlayer) = 1 Then
- PlaySound "Mode0d", -1 , RomSoundVolume
- ElseIf SJPReady(CurrentPlayer) = 1 Then
- PlaySound "Sfx_SJPReady",-1,RomSoundVolume
- Else
- If SongNumber = 0 Then PlaySound "Mode0", -1, RomSoundVolume
- If SongNumber = 1 Then PlaySound "Mode0a", -1, RomSoundVolume
- If SongNumber = 2 Then PlaySound "Mode0b", -1, RomSoundVolume
- If SongNumber = 3 Then PlaySound "Mode0c", -1, RomSoundVolume
- If SongNumber = 4 Then PlaySound "Mode0e", -1, RomSoundVolume
- If SongNumber = 5 Then PlaySound "Sfx_Greenhorn", -1, RomSoundVolume
- If SongNumber = 6 Then PlaySound "Sfx_Clownfish", -1, RomSoundVolume
- End If
- Case 1 : PlaySound "Mode1", -1, RomSoundVolume
- Case 2 : PlaySound "Mode2", -1, RomSoundVolume
- Case 3 : PlaySound "Mode3", -1, RomSoundVolume
- Case 4 : PlaySound "Mode4", -1, RomSoundVolume
- Case 5 : PlaySound "Mode5", -1, RomSoundVolume
- Case 6 : PlaySound "Mode6", -1, RomSoundVolume
- Case 7 : PlaySound "Mode7", -1, RomSoundVolume
- Case 8 : PlaySound "Mode8", -1, RomSoundVolume
- Case 9 : PlaySound "Mode9", -1, RomSoundVolume
- Case 10 : PlaySound "Mode11", -1, RomSoundVolume
- Case 11
- If SJPReady(CurrentPlayer) = 1 Then
- PlaySound "Sfx_SJPReady",-1,RomSoundVolume
- Else
- PlaySound "Mode11", -1, RomSoundVolume
- End If
- Case 12: PlaySound "Opening", 0, RomSoundVolume
- Case 13
- If MultiBallReady(CurrentPlayer) = 1 Then
- PlaySound "ShooterLaned", -1, RomSoundVolume
- ElseIf SJPReady(CurrentPlayer) = 1 Then
- PlaySound "Sfx_SJPReadyShooter",-1,RomSoundVolume
- Else
- If SongNumber = 0 Then PlaySound "ShooterLane", -1, RomSoundVolume
- If SongNumber = 1 Then PlaySound "ShooterLanea", -1, RomSoundVolume
- If SongNumber = 2 Then PlaySound "ShooterLaneb", -1, RomSoundVolume
- If SongNumber = 3 Then PlaySound "ShooterLanec", -1, RomSoundVolume
- If SongNumber = 4 Then PlaySound "ShooterLanee", -1, RomSoundVolume
- If SongNumber = 5 Then PlaySound "Sfx_GreenhornShooter", -1, RomSoundVolume
- If SongNumber = 6 Then PlaySound "Sfx_ClownfishShooter", -1, RomSoundVolume
- End If
- End Select
- End Sub
- Sub StopTableMusic
- StopSound "Opening"
- StopSound "ShooterLane"
- StopSound "ShooterLanea"
- StopSound "ShooterLaneb"
- StopSound "ShooterLanec"
- StopSound "ShooterLaned"
- StopSound "ShooterLanee"
- StopSound "Mode0"
- StopSound "Mode0a"
- StopSound "Mode0b"
- StopSound "Mode0c"
- StopSound "Mode0d"
- StopSound "Mode0e"
- StopSound "IntroMode0"
- StopSound "IntroMode0a"
- StopSound "IntroMode0b"
- StopSound "IntroMode0c"
- StopSound "IntroMode0d"
- StopSound "IntroMode0e"
- StopSound "IntroMode1"
- StopSound "Mode1"
- StopSound "Mode2"
- StopSound "Mode3"
- StopSound "Mode4"
- StopSound "Mode5"
- StopSound "Mode6"
- StopSound "IntroMode6"
- StopSound "Mode7"
- StopSound "Mode8"
- StopSound "Mode9"
- StopSound "Mode11"
- StopSound "GameOverMusic"
- StopSound "HSMusic"
- StopSound "Sfx_ROrbit"
- StopSound "Sfx_ModeReady"
- StopSound "Sfx_Greenhorn"
- StopSound "Sfx_GreenhornShooter"
- StopSound "Sfx_GreenhornIntro"
- StopSound "Sfx_Clownfish"
- StopSound "Sfx_ClownfishShooter"
- StopSound "Sfx_ClownfishIntro"
- StopSound "Sfx_SJPReady"
- StopSound "Sfx_SJPReadyShooter"
- StopSound "Sfx_SJPReadyIntro"
- StopJackpotSfx
- StopLOrbitSfx
- End Sub
- Sub IntroMusic
- StopTableMusic
- Select Case CurrentMode
- Case 0
- If MultiBallReady(CurrentPlayer) = 1 Then
- PlaySound "IntroMode0d",0,RomSoundVolume : SongTimer.Interval = 1589 : SongTimer.Enabled = True
- ElseIf SJPReady(CurrentPlayer) = 1 Then
- PlaySound "Sfx_SJPReadyIntro",0,RomSoundVolume : SongTimer.Interval = 800 : SongTimer.Enabled = True
- Else
- If SongNumber = 0 Then PlaySound "IntroMode0",0,RomSoundVolume : SongTimer.Interval = 919 : SongTimer.Enabled = True
- If SongNumber = 1 Then PlaySound "IntroMode0a",0,RomSoundVolume : SongTimer.Interval = 1261 : SongTimer.Enabled = True
- If SongNumber = 2 Then PlaySound "IntroMode0b",0,RomSoundVolume : SongTimer.Interval = 1589 : SongTimer.Enabled = True
- If SongNumber = 3 Then PlaySound "IntroMode0c",0,RomSoundVolume : SongTimer.Interval = 2053 : SongTimer.Enabled = True
- If SongNumber = 4 Then PlaySound "IntroMode0e",0,RomSoundVolume : SongTimer.Interval = 919 : SongTimer.Enabled = True
- If SongNumber = 5 Then PlaySound "Sfx_GreenhornIntro",0,RomSoundVolume : SongTimer.Interval = 1499 : SongTimer.Enabled = True
- If SongNumber = 6 Then PlaySound "Sfx_ClownfishIntro",0,RomSoundVolume : SongTimer.Interval = 1580 : SongTimer.Enabled = True
- End If
- Case 1 : PlaySound "IntroMode1",0,RomSoundVolume : SongTimer.Interval = 17948 : SongTimer.Enabled = True
- Case 2 : PlaySound "IntroMode2",0,RomSoundVolume : SongTimer.Interval = 6372 : SongTimer.Enabled = True
- Case 3 : PlaySound "IntroMode3",0,RomSoundVolume : SongTimer.Interval = 5312 : SongTimer.Enabled = True
- Case 4 : PlaySound "IntroMode4",0,RomSoundVolume : SongTimer.Interval = 5928 : SongTimer.Enabled = True
- Case 5 : PlaySound "IntroMode5",0,RomSoundVolume : SongTimer.Interval = 9148 : SongTimer.Enabled = True
- Case 6 : PlaySound "IntroMode6",0,RomSoundVolume : SongTimer.Interval = 16210 : SongTimer.Enabled = True
- Case 7 : PlaySound "IntroMode7",0,RomSoundVolume : SongTimer.Interval = 6524 : SongTimer.Enabled = True
- Case 8 : PlaySound "IntroMode8",0,RomSoundVolume : SongTimer.Interval = 9854 : SongTimer.Enabled = True
- Case 9 : PlaySound "IntroMode9",0,RomSoundVolume : SongTimer.Interval = 8284 : SongTimer.Enabled = True
- Case 10 : PlaySound "IntroMode11",0,RomSoundVolume : SongTimer.Interval = 9376 : SongTimer.Enabled = True
- Case 11
- If SJPReady(CurrentPlayer) = 1 Then
- PlaySound "Sfx_SJPReadyIntro",0,RomSoundVolume : SongTimer.Interval = 800 : SongTimer.Enabled = True
- Else
- PlaySound "IntroMode11",0,RomSoundVolume : SongTimer.Interval = 9376 : SongTimer.Enabled = True
- End If
- End Select
- End Sub
- Sub EndingMusic
- If StartGame = 0 Then InsertSequence.Play SeqCircleOutOn,50,100
- If HSMusicPlaying.Enabled = True Then Exit Sub
- If StartGame = 0 Then PlaySound "GameOverMusic",0,RomSoundVolume : Exit Sub
- Select Case CurrentMode
- Case 0
- If MultiBallReady(CurrentPlayer) = 1 Then
- PlaySound "EndingMode0b",0,RomSoundVolume
- ElseIf SJPReady(CurrentPlayer) = 1 Then
- PlaySound "Sfx_SJPReadyEnding",0,RomSoundVolume
- Else
- If SongNumber = 0 Then PlaySound "EndingMode0",0,RomSoundVolume
- If SongNumber = 1 Then PlaySound "EndingMode0a",0,RomSoundVolume
- If SongNumber = 2 Then PlaySound "EndingMode0b",0,RomSoundVolume
- If SongNumber = 3 Then PlaySound "EndingMode0c",0,RomSoundVolume
- If SongNumber = 4 Then PlaySound "EndingMode0e",0,RomSoundVolume
- If SongNumber = 5 Then PlaySound "Sfx_GreenhornEnding",0,RomSoundVolume
- If SongNumber = 6 Then PlaySound "Sfx_ClownfishEnding",0,RomSoundVolume
- End If
- Case 1 : PlaySound "EndingMode1",0,RomSoundVolume
- Case 2 : PlaySound "EndingMode2",0,RomSoundVolume
- Case 3 : PlaySound "EndingMode3",0,RomSoundVolume
- Case 4 : PlaySound "EndingMode4",0,RomSoundVolume
- Case 5 : PlaySound "EndingMode5",0,RomSoundVolume
- Case 6 : PlaySound "EndingMode6",0,RomSoundVolume
- Case 7 : PlaySound "EndingMode7",0,RomSoundVolume
- Case 8 : PlaySound "EndingMode8",0,RomSoundVolume
- Case 9 : PlaySound "EndingMode9",0,RomSoundVolume
- Case 10 : PlaySound "EndingMode11",0,RomSoundVolume
- Case 11
- If SJPReady(CurrentPlayer) = 1 Then
- PlaySound "Sfx_SJPReadyEnding",0,RomSoundVolume
- Else
- PlaySound "EndingMode11",0,RomSoundVolume
- End If
- End Select
- End Sub
- Sub SongTimer_Timer
- SongTimer.Enabled = False
- If DelayMusic = 0 Then Call PlayTableMusic(CurrentMode)
- If DelayMusic = 1 Then IntroMusic : DelayMusic = 0
- End Sub
- Sub HSMusicPlaying_Timer
- HSMusicPlaying.Enabled = False
- End Sub
- Sub PlayQuote(QuoteNumber)
- Dim QuoteSelect
- If CurrentMode = 2 Then QuoteNumber = 5
- Select Case QuoteNumber
- Case 1
- If QuoteTimer.Enabled = True Then SlingSfx
- If QuoteTimer.Enabled = False Then
- QuoteSelect = int(rnd*11)
- Select Case QuoteSelect
- Case 0 : PlaySound "Sfx_Squid1",0,RomSoundVolume : QuoteTimer.Interval = 5070 : QuoteTimer.Enabled = True
- Case 1 : PlaySound "Sfx_Squid2",0,RomSoundVolume : QuoteTimer.Interval = 7128 : QuoteTimer.Enabled = True
- Case 2 : PlaySound "Sfx_Squid3",0,RomSoundVolume : QuoteTimer.Interval = 2564 : QuoteTimer.Enabled = True
- Case 3 : PlaySound "Sfx_Squid4",0,RomSoundVolume : QuoteTimer.Interval = 1904 : QuoteTimer.Enabled = True
- Case 4 : PlaySound "Sfx_Squid5",0,RomSoundVolume : QuoteTimer.Interval = 2611 : QuoteTimer.Enabled = True
- Case 5 : PlaySound "Sfx_Squid6",0,RomSoundVolume : QuoteTimer.Interval = 3380 : QuoteTimer.Enabled = True
- Case 6 : PlaySound "Sfx_Squid7",0,RomSoundVolume : QuoteTimer.Interval = 1477 : QuoteTimer.Enabled = True
- Case 7 : PlaySound "Sfx_Squid8",0,RomSoundVolume : QuoteTimer.Interval = 3302 : QuoteTimer.Enabled = True
- Case 8 : PlaySound "Sfx_Squid9",0,RomSoundVolume : QuoteTimer.Interval = 2323 : QuoteTimer.Enabled = True
- Case 9 : PlaySound "Sfx_Squid10",0,RomSoundVolume : QuoteTimer.Interval = 2713 : QuoteTimer.Enabled = True
- Case 10 : PlaySound "Sfx_Squid11",0,RomSoundVolume : QuoteTimer.Interval = 2692 : QuoteTimer.Enabled = True
- End Select
- End If
- Case 2
- If QuoteTimer.Enabled = False Then
- QuoteSelect = int(rnd*10)
- Select Case QuoteSelect
- Case 0 : PlaySound "Sfx_Krabs1",0,RomSoundVolume : QuoteTimer.Interval = 4320 : QuoteTimer.Enabled = True
- Case 1 : PlaySound "Sfx_Krabs2",0,RomSoundVolume : QuoteTimer.Interval = 2356 : QuoteTimer.Enabled = True
- Case 2 : PlaySound "Sfx_Krabs3",0,RomSoundVolume : QuoteTimer.Interval = 4978 : QuoteTimer.Enabled = True
- Case 3 : PlaySound "Sfx_Krabs4",0,RomSoundVolume : QuoteTimer.Interval = 3352 : QuoteTimer.Enabled = True
- Case 4 : PlaySound "Sfx_Krabs5",0,RomSoundVolume : QuoteTimer.Interval = 1941 : QuoteTimer.Enabled = True
- Case 5 : PlaySound "Sfx_Krabs6",0,RomSoundVolume : QuoteTimer.Interval = 3601 : QuoteTimer.Enabled = True
- Case 6 : PlaySound "Sfx_Krabs7",0,RomSoundVolume : QuoteTimer.Interval = 4750 : QuoteTimer.Enabled = True
- Case 7 : PlaySound "Sfx_Krabs8",0,RomSoundVolume : QuoteTimer.Interval = 4435 : QuoteTimer.Enabled = True
- Case 8 : PlaySound "Sfx_Krabs9",0,RomSoundVolume : QuoteTimer.Interval = 3576 : QuoteTimer.Enabled = True
- Case 9 : PlaySound "Sfx_Krabs10",0,RomSoundVolume : QuoteTimer.Interval = 2261 : QuoteTimer.Enabled = True
- End Select
- End If
- Case 3
- If QuoteTimer.Enabled = False Then
- QuoteSelect = int(rnd*16)
- Select Case QuoteSelect
- Case 0 : PlaySound "Sfx_Sponge1",0,RomSoundVolume : QuoteTimer.Interval = 3917 : QuoteTimer.Enabled = True
- Case 1 : PlaySound "Sfx_Sponge2",0,RomSoundVolume : QuoteTimer.Interval = 3552 : QuoteTimer.Enabled = True
- Case 2 : PlaySound "Sfx_Sponge3",0,RomSoundVolume : QuoteTimer.Interval = 3133 : QuoteTimer.Enabled = True
- Case 3 : PlaySound "Sfx_Sponge4",0,RomSoundVolume : QuoteTimer.Interval = 3032 : QuoteTimer.Enabled = True
- Case 4 : PlaySound "Sfx_Sponge5",0,RomSoundVolume : QuoteTimer.Interval = 5167 : QuoteTimer.Enabled = True
- Case 5 : PlaySound "Sfx_Sponge6",0,RomSoundVolume : QuoteTimer.Interval = 4846 : QuoteTimer.Enabled = True
- Case 6 : PlaySound "Sfx_Sponge7",0,RomSoundVolume : QuoteTimer.Interval = 6999 : QuoteTimer.Enabled = True
- Case 7 : PlaySound "Sfx_Sponge8",0,RomSoundVolume : QuoteTimer.Interval = 2801 : QuoteTimer.Enabled = True
- Case 8 : PlaySound "Sfx_Sponge9",0,RomSoundVolume : QuoteTimer.Interval = 5277 : QuoteTimer.Enabled = True
- Case 9 : PlaySound "Sfx_Sponge10",0,RomSoundVolume : QuoteTimer.Interval = 3472 : QuoteTimer.Enabled = True
- Case 10 : PlaySound "Sfx_Sponge11",0,RomSoundVolume : QuoteTimer.Interval = 4456 : QuoteTimer.Enabled = True
- Case 11 : PlaySound "Sfx_Sponge12",0,RomSoundVolume : QuoteTimer.Interval = 6586 : QuoteTimer.Enabled = True
- Case 12 : PlaySound "Sfx_Sponge13",0,RomSoundVolume : QuoteTimer.Interval = 6221 : QuoteTimer.Enabled = True
- Case 13 : PlaySound "Sfx_Sponge14",0,RomSoundVolume : QuoteTimer.Interval = 4418 : QuoteTimer.Enabled = True
- Case 14 : PlaySound "Sfx_Sponge15",0,RomSoundVolume : QuoteTimer.Interval = 5053 : QuoteTimer.Enabled = True
- Case 15 : PlaySound "Sfx_Sponge16",0,RomSoundVolume : QuoteTimer.Interval = 6505 : QuoteTimer.Enabled = True
- End Select
- End If
- Case 4
- If QuoteTimer.Enabled = True Then SlingSfx
- If QuoteTimer.Enabled = False Then
- QuoteSelect = int(rnd*10)
- Select Case QuoteSelect
- Case 0 : PlaySound "Sfx_Patrick1",0,RomSoundVolume : QuoteTimer.Interval = 4340 : QuoteTimer.Enabled = True
- Case 1 : PlaySound "Sfx_Patrick2",0,RomSoundVolume : QuoteTimer.Interval = 3960 : QuoteTimer.Enabled = True
- Case 2 : PlaySound "Sfx_Patrick3",0,RomSoundVolume : QuoteTimer.Interval = 5170 : QuoteTimer.Enabled = True
- Case 3 : PlaySound "Sfx_Patrick4",0,RomSoundVolume : QuoteTimer.Interval = 5790 : QuoteTimer.Enabled = True
- Case 4 : PlaySound "Sfx_Patrick5",0,RomSoundVolume : QuoteTimer.Interval = 2657 : QuoteTimer.Enabled = True
- Case 5 : PlaySound "Sfx_Patrick6",0,RomSoundVolume : QuoteTimer.Interval = 5520 : QuoteTimer.Enabled = True
- Case 6 : PlaySound "Sfx_Patrick7",0,RomSoundVolume : QuoteTimer.Interval = 1670 : QuoteTimer.Enabled = True
- Case 7 : PlaySound "Sfx_Patrick8",0,RomSoundVolume : QuoteTimer.Interval = 4060 : QuoteTimer.Enabled = True
- Case 8 : PlaySound "Sfx_Patrick9",0,RomSoundVolume : QuoteTimer.Interval = 3643 : QuoteTimer.Enabled = True
- Case 9 : PlaySound "Sfx_Patrick10",0,RomSoundVolume : QuoteTimer.Interval = 1768 : QuoteTimer.Enabled = True
- End Select
- End If
- Case 5
- If QuoteTimer.Enabled = False Then
- QuoteSelect = int(rnd*10)
- Select Case QuoteSelect
- Case 0 : PlaySound "Sfx_Plankton1",0,RomSoundVolume : QuoteTimer.Interval = 4030 : QuoteTimer.Enabled = True
- Case 1 : PlaySound "Sfx_Plankton2",0,RomSoundVolume : QuoteTimer.Interval = 2990 : QuoteTimer.Enabled = True
- Case 2 : PlaySound "Sfx_Plankton3",0,RomSoundVolume : QuoteTimer.Interval = 3880 : QuoteTimer.Enabled = True
- Case 3 : PlaySound "Sfx_Plankton4",0,RomSoundVolume : QuoteTimer.Interval = 1490 : QuoteTimer.Enabled = True
- Case 4 : PlaySound "Sfx_Plankton5",0,RomSoundVolume : QuoteTimer.Interval = 2101 : QuoteTimer.Enabled = True
- Case 5 : PlaySound "Sfx_Plankton6",0,RomSoundVolume : QuoteTimer.Interval = 6370 : QuoteTimer.Enabled = True
- Case 6 : PlaySound "Sfx_Plankton7",0,RomSoundVolume : QuoteTimer.Interval = 2167 : QuoteTimer.Enabled = True
- Case 7 : PlaySound "Sfx_Plankton8",0,RomSoundVolume : QuoteTimer.Interval = 3440 : QuoteTimer.Enabled = True
- Case 8 : PlaySound "Sfx_Plankton9",0,RomSoundVolume : QuoteTimer.Interval = 4055 : QuoteTimer.Enabled = True
- Case 9 : PlaySound "Sfx_Plankton10",0,RomSoundVolume : QuoteTimer.Interval = 2695 : QuoteTimer.Enabled = True
- End Select
- End If
- End Select
- End Sub
- Sub SlingSfx
- Dim SfxSelect
- SfxSelect = int(rnd*6)
- StopSfx
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_Sling1",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_Sling2",0,RomSoundVolume
- Case 2 : PlaySound "Sfx_Sling3",0,RomSoundVolume
- Case 3 : PlaySound "Sfx_Sling4",0,RomSoundVolume
- Case 4 : PlaySound "Sfx_Sling5",0,RomSoundVolume
- Case 5 : PlaySound "Sfx_Sling6",0,RomSoundVolume
- End Select
- End Sub
- Sub TargetSfx
- Dim SfxSelect
- SfxSelect = int(rnd*7)
- StopSfx
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_Target1",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_Target2",0,RomSoundVolume
- Case 2 : PlaySound "Sfx_Target3",0,RomSoundVolume
- Case 3 : PlaySound "Sfx_Target4",0,RomSoundVolume
- Case 4 : PlaySound "Sfx_Target5",0,RomSoundVolume
- Case 5 : PlaySound "Sfx_Target6",0,RomSoundVolume
- Case 6 : PlaySound "Sfx_Target7",0,RomSoundVolume
- End Select
- End Sub
- Sub BumperSfx
- Dim SfxSelect
- SfxSelect = int(rnd*3)
- StopSound "Sfx_Bumper1" : StopSound "Sfx_Bumper2" : StopSound "Sfx_Bumper3"
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_Bumper1",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_Bumper2",0,RomSoundVolume
- Case 2 : PlaySound "Sfx_Bumper3",0,RomSoundVolume
- End Select
- End Sub
- Sub LOrbitSfx
- Dim SfxSelect
- SfxSelect = int(rnd*4)
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_LOrbit",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_LOrbit2",0,RomSoundVolume
- Case 2 : PlaySound "Sfx_LOrbit3",0,RomSoundVolume
- Case 3 : PlaySound "Sfx_LOrbit4",0,RomSoundVolume
- End Select
- End Sub
- Sub LRampSfx
- Dim SfxSelect
- SfxSelect = int(rnd*2)
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_LRamp1",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_LRamp2",0,RomSoundVolume
- End Select
- End Sub
- Sub RRampSfx
- Dim SfxSelect
- SfxSelect = int(rnd*2)
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_RRamp1",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_RRamp2",0,RomSoundVolume
- End Select
- End Sub
- Sub JackpotSfx
- Dim SfxSelect
- SfxSelect = int(rnd*4)
- StopJackpotSfx
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_Jackpot",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_Jackpot2",0,RomSoundVolume
- Case 2 : PlaySound "Sfx_Jackpot3",0,RomSoundVolume
- Case 3 : PlaySound "Sfx_Jackpot4",0,RomSoundVolume
- End Select
- End Sub
- Sub SkillShotSfx
- Select Case SkillSelect
- Case 0 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
- Case 1 : PlaySound "Sfx_Skill9",0,RomSoundVolume *.15
- Case 2 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
- Case 3 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
- Case 4 : PlaySound "Sfx_Skill0",0,RomSoundVolume *.15
- Case 5 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
- Case 6 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
- Case 7 : PlaySound "Sfx_Skill9",0,RomSoundVolume *.15
- Case 8 : PlaySound "Sfx_Skill7",0,RomSoundVolume *.15
- Case 9 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
- Case 10 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
- Case 11 : PlaySound "Sfx_Skill4",0,RomSoundVolume *.15
- End Select
- SkillSelect = SkillSelect + 1
- If SkillSelect > 11 Then SkillSelect = 0
- End Sub
- Sub RoundBonusSfx
- Dim SfxSelect
- SfxSelect = int(rnd*7)
- Select Case SfxSelect
- Case 0 : PlaySound "Sfx_Bonus1",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_Bonus2",0,RomSoundVolume
- Case 2 : PlaySound "Sfx_Bonus3",0,RomSoundVolume
- Case 3 : PlaySound "Sfx_Bonus4",0,RomSoundVolume
- Case 4 : PlaySound "Sfx_Bonus5",0,RomSoundVolume
- Case 5 : PlaySound "Sfx_Bonus6",0,RomSoundVolume
- Case 6 : PlaySound "Sfx_Bonus7",0,RomSoundVolume
- End Select
- End Sub
- Sub StopQuotes
- StopSound "Sfx_Squid1"
- StopSound "Sfx_Squid2"
- StopSound "Sfx_Squid3"
- StopSound "Sfx_Squid4"
- StopSound "Sfx_Squid5"
- StopSound "Sfx_Squid6"
- StopSound "Sfx_Squid7"
- StopSound "Sfx_Squid8"
- StopSound "Sfx_Squid9"
- StopSound "Sfx_Squid10"
- StopSound "Sfx_Squid11"
- StopSound "Sfx_Krabs1"
- StopSound "Sfx_Krabs2"
- StopSound "Sfx_Krabs3"
- StopSound "Sfx_Krabs4"
- StopSound "Sfx_Krabs5"
- StopSound "Sfx_Krabs6"
- StopSound "Sfx_Krabs7"
- StopSound "Sfx_Krabs8"
- StopSound "Sfx_Krabs9"
- StopSound "Sfx_Krabs10"
- StopSound "Sfx_Sponge1"
- StopSound "Sfx_Sponge2"
- StopSound "Sfx_Sponge3"
- StopSound "Sfx_Sponge4"
- StopSound "Sfx_Sponge5"
- StopSound "Sfx_Sponge6"
- StopSound "Sfx_Sponge7"
- StopSound "Sfx_Sponge8"
- StopSound "Sfx_Sponge9"
- StopSound "Sfx_Sponge10"
- StopSound "Sfx_Sponge11"
- StopSound "Sfx_Sponge12"
- StopSound "Sfx_Sponge13"
- StopSound "Sfx_Sponge14"
- StopSound "Sfx_Sponge15"
- StopSound "Sfx_Sponge16"
- StopSound "Sfx_Patrick1"
- StopSound "Sfx_Patrick2"
- StopSound "Sfx_Patrick3"
- StopSound "Sfx_Patrick4"
- StopSound "Sfx_Patrick5"
- StopSound "Sfx_Patrick6"
- StopSound "Sfx_Patrick7"
- StopSound "Sfx_Patrick8"
- StopSound "Sfx_Patrick9"
- StopSound "Sfx_Patrick10"
- QuoteTimer.Enabled = False
- End Sub
- Sub StopSfx
- StopSound "Sfx_Sling1"
- StopSound "Sfx_Sling2"
- StopSound "Sfx_Sling3"
- StopSound "Sfx_Sling4"
- StopSound "Sfx_Sling5"
- StopSound "Sfx_Sling6"
- StopSound "Sfx_Target1"
- StopSound "Sfx_Target2"
- StopSound "Sfx_Target3"
- StopSound "Sfx_Target4"
- StopSound "Sfx_Target5"
- StopSound "Sfx_Target6"
- StopSound "Sfx_Target7"
- End Sub
- Sub StopLOrbitSfx
- StopSound "Sfx_LOrbit"
- StopSound "Sfx_LOrbit2"
- StopSound "Sfx_LOrbit3"
- StopSound "Sfx_LOrbit4"
- End Sub
- Sub StopLRampSfx
- StopSound "Sfx_LRamp1"
- StopSound "Sfx_LRamp2"
- End Sub
- Sub StopRRampSfx
- StopSound "Sfx_RRamp1"
- StopSound "Sfx_RRamp2"
- End Sub
- Sub StopJackpotSfx
- StopSound "Sfx_Jackpot"
- StopSound "Sfx_Jackpot2"
- StopSound "Sfx_Jackpot3"
- StopSound "Sfx_Jackpot4"
- End Sub
- Sub QuoteTimer_Timer
- QuoteTimer.Enabled = False
- End Sub
- Sub RoundEndTimer_Timer
- RoundEndTimer.Enabled = False
- If soundcount < 3 Then RoundBonusSfx : soundcount = soundcount + 1
- If soundcount < 3 Then RoundEndTimer.Enabled = True
- If soundcount = 3 Then soundcount = 0
- End Sub
- Sub FanfareSfx
- FanfareSelect = FanfareSelect + 1
- If FanfareSelect > 4 Then FanfareSelect = 0
- StopFanfareSfx
- Select Case FanfareSelect
- Case 0 : PlaySound "Sfx_Cheer1",0,RomSoundVolume
- Case 1 : PlaySound "Sfx_Cheer4",0,RomSoundVolume
- Case 2 : PlaySound "Sfx_Cheer2",0,RomSoundVolume
- Case 3 : PlaySound "Sfx_Cheer5",0,RomSoundVolume
- Case 4 : PlaySound "Sfx_Cheer3",0,RomSoundVolume
- End Select
- End Sub
- Sub StopFanfareSfx
- StopSound "Sfx_Cheer1"
- StopSound "Sfx_Cheer2"
- StopSound "Sfx_Cheer3"
- StopSound "Sfx_Cheer4"
- StopSound "Sfx_Cheer5"
- End Sub
- Sub FanfareTimer_Timer
- FanfareTimer.Enabled = False
- TiltGame = 0
- End Sub
- Sub LoadVolumeLevel
- Dim objReg, RKEY
- Set objReg = CreateObject("Wscript.shell")
- On Error Resume Next
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeMechVol")
- If RKey <> "" Then
- MechSoundVolume = RKey / 100
- Else
- MechSoundVolume = .3
- End If
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeRomVol")
- If RKey <> "" Then
- RomSoundVolume = RKey / 100
- Else
- RomSoundVolume = 1
- End If
- Set objReg = Nothing
- End Sub
- Sub SaveVolumeLevel
- Dim objReg, RKEY
- Set objReg = CreateObject("Wscript.shell")
- On Error Resume Next
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeMechVol",MechSoundVolume*100,"REG_DWORD")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeRomVol",RomSoundVolume*100,"REG_DWORD")
- Set objReg = Nothing
- End Sub
- '**********************
- ' High Scores
- '**********************
- Sub LoadHighScores
- Dim objReg, RKEY
- Set objReg = CreateObject("Wscript.shell")
- On Error Resume Next
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS1"): HighScores(0,0) = RKey
- If HighScores(0,0)>0 Then
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI1"):HighScores(0,1) = RKey
- Else
- HighScores(0,0)=200000000
- HighScores(0,1)="PLK"
- End If
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS2"): HighScores(1,0) = RKey
- If HighScores(1,0)>0 Then
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI2"):HighScores(1,1) = RKey
- Else
- HighScores(1,0)=150000000
- HighScores(1,1)="SPB"
- End If
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS3"): HighScores(2,0) = RKey
- If HighScores(2,0)>0 Then
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI3"):HighScores(2,1) = RKey
- Else
- HighScores(2,0)=100000000
- HighScores(2,1)="PAT"
- End If
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS4"): HighScores(3,0) = RKey
- If HighScores(3,0)>0 Then
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI4"):HighScores(3,1) = RKey
- Else
- HighScores(3,0)=70000000
- HighScores(3,1)="SQD"
- End If
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobHS5"): HighScores(4,0) = RKey
- If HighScores(4,0)>0 Then
- RKey = objReg.RegRead("HKCU\Software\PinballHS\SpongeBobI5"):HighScores(4,1) = RKey
- Else
- HighScores(4,0)=50000000
- HighScores(4,1)="KRB"
- End If
- Set objReg = Nothing
- End Sub
- Sub SaveHighScores
- Dim objReg, RKEY, FileObj, ScoreFile
- Dim P1,P2,P3,P4,P5
- Set objReg = CreateObject("Wscript.shell")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS1",HighScores(0,0),"REG_DWORD")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS2",HighScores(1,0),"REG_DWORD")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS3",HighScores(2,0),"REG_DWORD")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS4",HighScores(3,0),"REG_DWORD")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobHS5",HighScores(4,0),"REG_DWORD")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI1",HighScores(0,1),"REG_SZ")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI2",HighScores(1,1),"REG_SZ")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI3",HighScores(2,1),"REG_SZ")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI4",HighScores(3,1),"REG_SZ")
- RKEY = objReg.RegWrite("HKCU\Software\PinballHS\SpongeBobI5",HighScores(4,1),"REG_SZ")
- Set objReg = Nothing
- 'Save HS Text Files
- HSTextFile = 0
- If HSTextFile = 1 Then
- Set FileObj=CreateObject("Scripting.FileSystemObject")
- If Not FileObj.FolderExists(UserDirectory) then
- Exit Sub
- End if
- P1 = "1. " & HighScores(0,1) & " " & HighScores(0,0)
- P2 = "2. " & HighScores(1,1) & " " & HighScores(1,0)
- P3 = "3. " & HighScores(2,1) & " " & HighScores(2,0)
- P4 = "4. " & HighScores(3,1) & " " & HighScores(3,0)
- P5 = "5. " & HighScores(4,1) & " " & HighScores(4,0)
- Set ScoreFile=FileObj.CreateTextFile("C:\Games\HiScores\" & cGameName & ".txt",True)
- ScoreFile.WriteLine "High Scores"
- ScoreFile.WriteLine P1
- ScoreFile.WriteLine P2
- ScoreFile.WriteLine P3
- ScoreFile.WriteLine P4
- ScoreFile.WriteLine P5
- ScoreFile.Close
- Set ScoreFile=Nothing
- Dim dd, mm, yy, hh, nn, ss
- Dim datevalue, timevalue, dtsnow, dtsvalue
- 'Store DateTimeStamp once.
- dtsnow = Now()
- 'Individual date components
- dd = Right("00" & Day(dtsnow), 2)
- mm = Right("00" & Month(dtsnow), 2)
- yy = Year(dtsnow)
- hh = Right("00" & Hour(dtsnow), 2)
- nn = Right("00" & Minute(dtsnow), 2)
- ss = Right("00" & Second(dtsnow), 2)
- 'Build the date string in the format mm/dd/yyyy
- datevalue = mm & "/" & dd & "/" & yy
- 'Build the time string in the format hh:mm:ss
- timevalue = hh & ":" & nn & ":" & ss
- 'Concatenate both together to build the timestamp mm/dd/yyyy hh:mm:ss
- dtsvalue = datevalue & " " & timevalue
- Set ScoreFile=FileObj.OpenTextFile("C:\Games\HiScores\log.txt",8,False)
- ScoreFile.WriteLine dtsvalue & ", Changed, " & cGameName & ".nv"
- Set ScoreFile=Nothing
- Set FileObj=Nothing
- End If
- End Sub
- Sub CheckHighScores
- For i = 0 to 4
- If TotalScore(CurrentPlayer) > HighScores(i,0) Then
- ScoreNumber = i
- If i = 0 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = HighScores(2,0) : HighScores(2,0) = HighScores(1,0) : HighScores(1,0) = HighScores(0,0) : HighScores(0,0) = TotalScore(CurrentPlayer)
- If i = 0 Then HighScores(4,1) = HighScores(3,1) : HighScores(3,1) = HighScores(2,1) : HighScores(2,1) = HighScores(1,1) : HighScores(1,1) = HighScores(0,1) : Exit For
- If i = 1 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = HighScores(2,0) : HighScores(2,0) = HighScores(1,0) : HighScores(1,0) = TotalScore(CurrentPlayer)
- If i = 1 Then HighScores(4,1) = HighScores(3,1) : HighScores(3,1) = HighScores(2,1) : HighScores(2,1) = HighScores(1,1) : Exit For
- If i = 2 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = HighScores(2,0) : HighScores(2,0) = TotalScore(CurrentPlayer)
- If i = 2 Then HighScores(4,1) = HighScores(3,1) : HighScores(3,1) = HighScores(2,1) : Exit For
- If i = 3 Then HighScores(4,0) = HighScores(3,0) : HighScores(3,0) = TotalScore(CurrentPlayer)
- If i = 3 Then HighScores(4,1) = HighScores(3,1) : Exit For
- If i = 4 Then HighScores(4,0) = TotalScore(CurrentPlayer) : Exit For
- Else
- ScoreNumber = ""
- End If
- Next
- End Sub
- Sub EnterHS
- HSDisplay = 0 : DisplayHS.Enabled = False
- If HSDigit = 0 Then DMDText.Text = "HIGH SCORE " & ScoreNumber+1 & " -- ENTER INITIALS WITH FLIPPERS" : LEDText("HIGH SCORE " & ScoreNumber+1 & " -- ENTER INITIALS") : PlaySound "HSMusic",0,RomSoundVolume : HSMusicPlaying.Enabled = True
- If HSDigit = 1 Then DMDText.Text = Chr(HSChr) : LEDText(Chr(HSChr)) : HSI1 = Chr(HSChr)
- If HSDigit = 2 Then DMDText.Text = HSI1 & Chr(HSChr) : LEDText(HSI1 & Chr(HSChr)) : HSI2 = Chr(HSChr)
- If HSDigit = 3 Then DMDText.Text = HSI1 & HSI2 & Chr(HSChr) : LEDText(HSI1 & HSI2 & Chr(HSChr)) : HSI3 = Chr(HSChr) : HighScores(ScoreNumber, 1) = HSI1 & HSI2 & HSI3
- If HSDigit = 4 Then
- SaveHighScores
- DMDText.Text = "NUMBER " & ScoreNumber+1 & " SCORE -- CONGRATULATIONS" : LEDText("NUMBER " & ScoreNumber+1 & " SCORE -- CONGRATULATIONS")
- HSDigit = 0 : ScoreNumber = ""
- If StartGame = 1 Then StartNewPlayer
- If StartGame = 0 Then
- HSDisplay = 1 : DisplayHS.Interval = 5000 : DisplayHS.Enabled = True
- If ShowDT = False Or B2SonDesktop = 1 Then Controller.B2SSetLED 81,0
- End If
- End If
- End Sub
- Sub DisplayHS_Timer
- DisplayHS.Enabled = False
- DisplayHS.Interval = 2000
- If HSDisplay = 1 Then
- If HSDisplay2 = 0 Then DMDText.Text = "Bikini Bottom Pinball: Press Start" : LEDText("Bikini Bottom Pinball Press Start")
- If HSDisplay2 = 1 Then DMDText.Text = "HS 1- " & FormatNumber(HighScores(0,0),0,,,-1) & " " & HighScores(0,1) : LEDText("HS 1- " & FormatNumber(HighScores(0,0),0,,,-1) & " " & HighScores(0,1))
- If HSDisplay2 = 2 Then DMDText.Text = "HS 2- " & FormatNumber(HighScores(1,0),0,,,-1) & " " & HighScores(1,1) : LEDText("HS 2- " & FormatNumber(HighScores(1,0),0,,,-1) & " " & HighScores(1,1))
- If HSDisplay2 = 3 Then DMDText.Text = "HS 3- " & FormatNumber(HighScores(2,0),0,,,-1) & " " & HighScores(2,1) : LEDText("HS 3- " & FormatNumber(HighScores(2,0),0,,,-1) & " " & HighScores(2,1))
- If HSDisplay2 = 4 Then DMDText.Text = "HS 4- " & FormatNumber(HighScores(3,0),0,,,-1) & " " & HighScores(3,1) : LEDText("HS 4- " & FormatNumber(HighScores(3,0),0,,,-1) & " " & HighScores(3,1))
- If HSDisplay2 = 5 Then DMDText.Text = "HS 5- " & FormatNumber(HighScores(4,0),0,,,-1) & " " & HighScores(4,1) : LEDText("HS 5- " & FormatNumber(HighScores(4,0),0,,,-1) & " " & HighScores(4,1))
- HSDisplay2 = HSDisplay2 + 1
- If HSDisplay2 = 6 Then HSDisplay2 = 0
- DisplayHS.Enabled = True
- End If
- End Sub
- Sub VolumeTimer_Timer
- VolumeTimer.Enabled = False
- DisplayHS_Timer
- End Sub
- '**********************
- ' Tilt
- '**********************
- Sub CheckTilt
- If StartGame = 1 And TiltGame = 0 And BallInLane = 0 And Drain.TimerEnabled = False Then
- If LTiltPower > 25 Or RTiltPower > 25 Or CTiltPower > 25 Then
- WarningCount = WarningCount + 1
- If WarningCount = 1 Then ClearDMD : Call DMDMessage("WARNING",1) : Playsound "Sfx_Warning", 0, RomSoundVolume
- End If
- If WarningCount > 1 Then ClearDMD : Call DMDMessage("TILT",2) : TiltGame = 1 : Playtime = 100 : StopTableMusic : PlaySound "Sfx_Tilt",0,RomSoundVolume : WarningCount = 0 : LeftFlipper.RotateToStart : RightFlipper.RotateToStart
- DOF 101, DOFOff
- DOF 102, DOFOff
- End If
- LTiltPower = 0 : RTiltPower = 0 : CTiltPower = 0
- End Sub
- Sub Table1_Exit
- If B2SOn Then Controller.Stop
- End Sub
Add Comment
Please, Sign In to add comment