Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '*
- '* Gottlieb's Jet Spin (1977)
- '* Table build/scripted by Loserman!
- '* Artwork redrawn by GNance
- '*
- '* Thanks to the following for their contributions (whether they know it or not!)
- '* If I have missed anyone, let me know as this table would not exist without the
- '* folks in the community.
- '*
- '*
- '* JPSalas - gameroom backdrop and methods gleaned from his fantastic tables
- '* EalaDubhSidhe - table object templates
- '* Black - HS save/load routines
- '* Itchigo - table templates
- '* CONRAM - various code ideas on his tables
- '* Inkochnito - scorecards/instruction cards
- '* Pinuck - Gottlieb chimes and score motor routines
- '* Herweh - directB2S designer and tools
- '* JimmyFingers - rolling ball and additional sound routines
- '* pbecker - roto code
- '*
- '* Of course, the team behind Visual Pinball - without them, there wouldn't be much choice for playing pinball on a PC
- '*
- option explicit
- Randomize
- On Error Resume Next
- ExecuteGlobal GetTextFile("controller.vbs")
- If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
- On Error Goto 0
- ExecuteGlobal GetTextFile("core.vbs")
- Dim B2SScore ' B2S Score Displayed
- Const HSFileName="JetSpin_77_2.txt"
- Const cGameName="JetSpin_1977"
- '* this value adjusts score motor behavior - 0 allows you to continue scoring while the score motor is running - 1 sets score motor to behave more like a real EM
- Const ScoreMotorAdjustment=1
- '* this is a debug setting to use an older scoring routine vs a newer score routine - don't change this value
- Const ScoreAdditionAdjustment=1
- '* this controls whether you hear bells (0) or chimes (1) when scoring
- Const ChimesOn=1
- dim ScoreChecker
- dim CheckAllScores
- dim sortscores(4)
- dim sortplayers(4)
- Dim TextStr,TextStr2
- Dim i
- Dim obj
- Dim bgpos
- Dim kgpos
- Dim dooralreadyopen
- Dim kgdooralreadyopen
- Dim TargetSpecialLit
- Dim Points210counter
- Dim Points500counter
- Dim Points1000counter
- Dim Points2000counter
- Dim BallsPerGame
- Dim InProgress
- Dim BallInPlay
- Dim CreditsPerCoin
- Dim Score100K(4)
- Dim Score(4)
- Dim ScoreDisplay(4)
- Dim HighScorePaid(4)
- Dim HighScore
- Dim HighScoreReward
- Dim BonusMultiplier
- Dim Credits
- Dim Match
- Dim Replay1
- Dim Replay2
- Dim Replay3
- Dim Replay1Paid(4)
- Dim Replay2Paid(4)
- Dim Replay3Paid(4)
- Dim TableTilted
- Dim TiltCount
- Dim debugscore
- Dim IncreaseBonusValue
- Dim OperatorMenu
- Dim BonusBooster
- Dim BonusBoosterCounter
- Dim BonusCounter
- Dim HoleCounter
- Dim Ones
- Dim Tens
- Dim Hundreds
- Dim Thousands
- Dim Player
- Dim Players
- Dim rst
- Dim bonuscountdown
- Dim TempMultiCounter
- dim TempPlayerup
- dim RotatorTemp
- dim GreenTargetsDownCounter
- dim BlueTargetsDownCounter
- dim YellowTargetsDownCounter
- Dim bump1
- Dim bump2
- Dim bump3
- Dim LastChime10
- Dim LastChime100
- Dim LastChime1000
- Dim Score10
- Dim Score100
- Dim LStep, LStep2, RStep, xx
- dim tempbumper
- Dim MotorRunning
- Dim Replay1Table(15)
- Dim Replay2Table(15)
- Dim Replay3Table(15)
- Dim ReplayTableSet
- Dim ReplayLevel
- Dim ReplayTableMax
- Dim RotoReplay1
- Dim RotoReplay2
- Dim RotoReplay3
- Dim RotoReplay4
- Dim ABCDReplay
- Dim KickerCounter
- Dim RotoLeftWheel(15) ' Actual Roto Wheel Number array
- Dim RotoCenterWheel(15) ' Actual Roto Wheel Number array
- Dim RotoRightWheel(15) ' Actual Roto Wheel Number array
- Dim RotoPos ' Index to Left Showing RotoWheel Number
- Dim RWAnim ' Wheel Animation Phase
- Dim RotoCycles ' Number of Digits To Animate on a Spin
- Dim X
- Dim mHole
- Dim ExtraBallFrequency
- Sub Table1_Init()
- LoadEM
- Set mHole = New cvpmMagnet
- With mHole
- .InitMagnet Umagnet, 3.85
- .GrabCenter = 0
- .MagnetOn = 0
- .CreateEvents "mHole"
- End With
- For each xx in LSling2:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- For each xx in LSling1:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- For each xx in RSling2:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- For each xx in RSling1:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- HideOptions
- SetupReplayTables
- PlasticsOff
- BumpersOff
- OperatorMenu=0
- ReplayLevel=1
- BallsPerGame=5
- ExtraBallFrequency=1
- EMReel1.ResetToZero
- HighScore=0
- MotorRunning=0
- HighScoreReward=3
- BallTextBox.text=""
- MatchTextBox.text=""
- Credits=0
- IncreaseBonusValue=0
- loadhs
- if HighScore=0 then HighScore=50000
- for each obj in AllTargets
- obj.IsDropped=0
- next
- for each obj in Triggers
- obj.IsDropped=1
- next
- RotoLeftWheel(0)=100
- RotoLeftWheel(1)=500
- RotoLeftWheel(2)=400
- RotoLeftWheel(3)=300
- RotoLeftWheel(4)=200
- RotoLeftWheel(5)=100
- RotoLeftWheel(6)=999
- RotoLeftWheel(7)=400
- RotoLeftWheel(8)=300
- RotoLeftWheel(9)=200
- RotoLeftWheel(10)=100
- RotoLeftWheel(11)=500
- RotoLeftWheel(12)=400
- RotoLeftWheel(13)=300
- RotoLeftWheel(14)=200
- RotoCenterWheel(0)=500
- RotoCenterWheel(1)=400
- RotoCenterWheel(2)=300
- RotoCenterWheel(3)=200
- RotoCenterWheel(4)=100
- RotoCenterWheel(5)=999
- RotoCenterWheel(6)=400
- RotoCenterWheel(7)=300
- RotoCenterWheel(8)=200
- RotoCenterWheel(9)=100
- RotoCenterWheel(10)=500
- RotoCenterWheel(11)=400
- RotoCenterWheel(12)=300
- RotoCenterWheel(13)=200
- RotoCenterWheel(14)=100
- RotoRightWheel(0)=400
- RotoRightWheel(1)=300
- RotoRightWheel(2)=200
- RotoRightWheel(3)=100
- RotoRightWheel(4)=999
- RotoRightWheel(5)=400
- RotoRightWheel(6)=300
- RotoRightWheel(7)=200
- RotoRightWheel(8)=100
- RotoRightWheel(9)=500
- RotoRightWheel(10)=400
- RotoRightWheel(11)=300
- RotoRightWheel(12)=200
- RotoRightWheel(13)=100
- RotoRightWheel(14)=500
- '
- For X=1 to 3
- EVAL("RotoAnim"&X).IsDropped=True
- Next
- For X=1 to 15
- EVAL("RotoStop"&X).IsDropped=True
- Next
- '
- RWAnim = 0 ' Not Animating Spin
- RotoPos = INT(RND()*15) ' Starting Rotowheel Position 0-14
- RotoNumsUp()
- for each obj in Triggers
- obj.IsDropped=1
- next
- for each obj in LeftVari
- obj.IsDropped=1
- next
- LeftVari(0).IsDropped=0
- TableTilted=false
- TiltReel.SetValue(1)
- Match=int(Rnd*10)*10
- MatchReel.SetValue((Match/10)+1)
- GameOverReel.SetValue(1)
- CanPlayReel.SetValue(0)
- BallInPlayReel.SetValue(0)
- For each obj in PlayerHuds
- obj.SetValue(0)
- next
- For each obj in PlayerScores
- obj.ResetToZero
- next
- For each obj in Player100K
- obj.ResetToZero
- next
- Replay1=Replay1Table(ReplayLevel)
- Replay2=Replay2Table(ReplayLevel)
- Replay3=Replay3Table(ReplayLevel)
- BonusCounter=0
- HoleCounter=0
- bgpos=6
- kgpos=0
- RotoReplay1=false
- RotoReplay2=false
- RotoReplay3=false
- RotoReplay4=false
- ABCDReplay=false
- For each obj in StartLightsOff
- obj.state=0
- next
- For each obj in StartLightsOn
- obj.state=0
- next
- for each obj in Bonus
- obj.state=0
- next
- dooralreadyopen=0
- kgdooralreadyopen=0
- BumperLight1.IsVisible=0
- Bumper1.state=0
- BumperLight2.IsVisible=0
- Bumper2.state=0
- InstructCard.image="IC"+FormatNumber(BallsPerGame,0)
- RefreshReplayCard
- ' ResetBalls
- ' PlaySound "Plunger"
- TargetSpecialLit = 0
- Points210counter=0
- Points500counter=0
- Points1000counter=0
- Points2000counter=0
- BonusBooster=3
- BonusBoosterCounter=0
- Players=0
- RotatorTemp=1
- InProgress=false
- ScoreText.text=HighScore
- If B2SOn Then
- if Match=0 then
- Controller.B2SSetMatch 100
- else
- Controller.B2SSetMatch Match
- end if
- Controller.B2SSetScoreRolloverPlayer1 0
- Controller.B2SSetScore 6,HighScore
- Controller.B2SSetTilt 0
- Controller.B2SSetCredits Credits
- Controller.B2SSetGameOver 1
- End If
- EMReel6.SetValue(Credits)
- for i=1 to 1
- player=i
- If B2SOn Then
- Controller.B2SSetScorePlayer player, 0
- End If
- next
- bump1=1
- bump2=1
- bump3=1
- InitPauser5.enabled=true
- If Credits > 0 Then DOF 123, DOFOn
- End Sub
- Sub Table1_exit()
- savehs
- If B2SOn Then Controller.Stop
- end sub
- Sub Table1_KeyDown(ByVal keycode)
- ' GNMOD
- if EnteringInitials then
- CollectInitials(keycode)
- exit sub
- end if
- if EnteringOptions then
- CollectOptions(keycode)
- exit sub
- end if
- If keycode = PlungerKey Then
- Plunger.PullBack
- PlungerPulled = 1
- End If
- if keycode = LeftFlipperKey and InProgress = false then
- OperatorMenuTimer.Enabled = true
- end if
- ' END GNMOD
- If keycode = LeftFlipperKey and InProgress=true and TableTilted=false Then
- LeftFlipper.RotateToEnd
- PlaySound SoundFXDOF("FlipperUp",101,DOFOn,DOFFlippers)
- PlaySound "buzzL",-1
- End If
- If keycode = RightFlipperKey and InProgress=true and TableTilted=false Then
- RightFlipper.RotateToEnd
- PlaySound "buzz",-1
- PlaySound SoundFXDOF("FlipperUp",102,DOFOn,DOFFlippers)
- End If
- If keycode = LeftTiltKey Then
- Nudge 90, 2
- TiltIt
- End If
- If keycode = RightTiltKey Then
- Nudge 270, 2
- TiltIt
- End If
- If keycode = CenterTiltKey Then
- Nudge 0, 2
- TiltIt
- End If
- If keycode = AddCreditKey then
- If B2SOn Then
- Controller.B2SSetScore 6,HighScore
- End If
- playsound "coinin"
- AddSpecial2
- end if
- if keycode = StartGameKey and Credits>0 and InProgress=true and Players>0 and Players<4 and BallInPlay<2 then
- Credits=Credits-1
- If Credits < 1 Then DOF 123, DOFOff
- EMReel6.SetValue(Credits)
- Players=Players+1
- CanPlayReel.SetValue(Players)
- playsound "click"
- If B2SOn Then
- Controller.B2SSetCanPlay Players
- If Players=2 Then
- Controller.B2SSetScoreRolloverPlayer2 0
- End If
- If Players=3 Then
- Controller.B2SSetScoreRolloverPlayer3 0
- End If
- If Players=4 Then
- Controller.B2SSetScoreRolloverPlayer4 0
- End If
- Controller.B2SSetCredits Credits
- End If
- end if
- if keycode=StartGameKey and Credits>0 and InProgress=false and Players=0 and EnteringOptions = 0 then
- 'GNMOD
- OperatorMenuTimer.Enabled = false
- 'END GNMOD
- Credits=Credits-1
- If Credits < 1 Then DOF 123, DOFOff
- EMReel6.SetValue(Credits)
- Players=1
- CanPlayReel.SetValue(Players)
- MatchReel.SetValue(0)
- GameOverReel.SetValue(0)
- Player=1
- playsound "StartUpSequence"
- TempPlayerUp=Player
- PlayerUpRotator.enabled=true
- rst=0
- BallInPlay=1
- InProgress=true
- resettimer.enabled=true
- BonusMultiplier=1
- If B2SOn Then
- Controller.B2SSetTilt 0
- Controller.B2SSetGameOver 0
- Controller.B2SSetMatch 0
- Controller.B2SSetCredits Credits
- Controller.B2SSetScore 6,HighScore
- Controller.B2SSetCanPlay 1
- Controller.B2SSetData 81,0
- Controller.B2SSetData 82,0
- Controller.B2SSetData 83,0
- Controller.B2SSetData 84,0
- Controller.B2SSetPlayerUp 1
- Controller.B2SSetData 81,1
- Controller.B2SSetBallInPlay BallInPlay
- Controller.B2SSetScoreRolloverPlayer1 0
- Controller.B2SSetScoreRolloverPlayer2 0
- Controller.B2SSetScoreRolloverPlayer3 0
- Controller.B2SSetScoreRolloverPlayer4 0
- Controller.B2SSetScorePlayer1 0
- Controller.B2SSetScorePlayer2 0
- Controller.B2SSetScorePlayer3 0
- Controller.B2SSetScorePlayer4 0
- End If
- For each obj in PlayerScores
- obj.ResetToZero
- next
- For each obj in PlayerHuds
- obj.SetValue(0)
- next
- For each obj in Player100K
- obj.ResetToZero
- next
- PlayerHuds(Player-1).SetValue(1)
- end if
- End Sub
- Sub Table1_KeyUp(ByVal keycode)
- ' GNMOD
- if EnteringInitials then
- exit sub
- end if
- If keycode = PlungerKey Then
- if PlungerPulled = 0 then
- exit sub
- end if
- PlaySound"plungerrelease"
- Plunger.Fire
- End If
- if keycode = LeftFlipperKey then
- OperatorMenuTimer.Enabled = false
- end if
- ' END GNMOD
- If keycode = LeftFlipperKey and InProgress=true and TableTilted=false Then
- LeftFlipper.RotateToStart
- PlaySound SoundFXDOF("FlipperDown",101,DOFOff,DOFFlippers)
- StopSound "buzzL"
- End If
- If keycode = RightFlipperKey and InProgress=true and TableTilted=false Then
- RightFlipper.RotateToStart
- StopSound "buzz"
- PlaySound SoundFXDOF("FlipperDown",102,DOFOff,DOFFlippers)
- End If
- End Sub
- Sub Drain_Hit()
- DOF 115, DOFPulse
- ClearBallId
- Drain.DestroyBall
- PlaySound "fx_drain"
- StopRollingSound
- Pause4Bonustimer.enabled=true
- End Sub
- Sub CloseGateTrigger_hit
- DOF 116, DOFPulse
- End Sub
- Sub Pause4Bonustimer_timer
- Pause4Bonustimer.enabled=0
- AddBonus
- End Sub
- '***********************
- ' Flipper Logos
- '***********************
- Sub UpdateFlipperLogos_Timer
- LFLogo.RotAndTra2 = LeftFlipper.CurrentAngle
- RFlogo.RotAndTra2 = RightFlipper.CurrentAngle
- End Sub
- '**********************************************************
- Sub LSLING_Slingshot
- If TableTilted=false then
- PlaySound SoundFXDOF("slingshot",103,DOFPulse,DOFContactors)
- AddScore(10)
- For each xx in LSling2:xx.topvisible = 1:xx.TriggerSingleUpdate:Next
- LStep = 0:Me.TimerEnabled = 1
- End If
- End Sub
- Sub LSLING_Timer
- Select Case LStep
- Case 0: 'pause
- Case 1: 'pause
- Case 2:For each xx in LSling2:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- For each xx in LSling1:xx.topvisible = 1:xx.TriggerSingleUpdate:Next
- Case 3: 'pause
- Case 4:For each xx in LSling1:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- Me.TimerEnabled = 0
- End Select
- LStep = LStep + 1
- End Sub
- Sub RSLING_Slingshot
- If TableTilted=false then
- PlaySound SoundFXDOF("slingshot",104,DOFPulse,DOFContactors)
- AddScore(10)
- For each xx in RSling2:xx.topvisible = 1:xx.TriggerSingleUpdate:Next
- RStep = 0:Me.TimerEnabled = 1
- End If
- End Sub
- Sub RSLING_Timer
- Select Case RStep
- Case 0: 'pause
- Case 1: 'pause
- Case 2:For each xx in RSling2:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- For each xx in RSling1:xx.topvisible = 1:xx.TriggerSingleUpdate:Next
- Case 3: 'Pause
- Case 4:For each xx in RSling1:xx.topvisible = 0:xx.TriggerSingleUpdate:Next
- Me.TimerEnabled = 0
- End Select
- RStep = RStep + 1
- End Sub
- Sub RubberWall4_Hit()
- If TableTilted=false then
- AddScore(10)
- end if
- end sub
- Sub RubberWall18_Hit()
- If TableTilted=false then
- AddScore(10)
- end if
- end sub
- Sub RubberWall2_Hit()
- If TableTilted=false then
- AddScore(10)
- end if
- end sub
- '***********************************
- Sub Bumper1_Hit
- If TableTilted=false then
- PlaySound SoundFXDOF("bumper1",105,DOFPulse,DOFContactors)
- bump1 = 1
- Bumper1.TimerEnabled = 1
- if BallsPerGame=5 then
- AddScore(100)
- else
- AddScore(1000)
- end if
- end if
- End Sub
- Sub Bumper1_Timer()
- Select Case bump1
- Case 1:Ring1.HeightTop = 15:Ring1.HeightBottom = 15:bump1 = 2
- Case 2:Ring1.HeightTop = 25:Ring1.HeightBottom = 25:bump1 = 3
- Case 3:Ring1.HeightTop = 35:Ring1.HeightBottom = 35:bump1 = 4
- Case 4:Ring1.HeightTop = 45:Ring1.HeightBottom = 45:Bumper1.TimerEnabled = 0
- End Select
- End Sub
- Sub Bumper2_Hit
- If TableTilted=false then
- PlaySound SoundFXDOF("bumper1",106,DOFPulse,DOFContactors)
- bump2 = 1
- Bumper2.TimerEnabled = 1
- if BallsPerGame=5 then
- AddScore(100)
- else
- AddScore(1000)
- end if
- end if
- End Sub
- Sub Bumper2_Timer()
- Select Case bump2
- Case 1:Ring2.HeightTop = 15:Ring2.HeightBottom = 15:bump2 = 2
- Case 2:Ring2.HeightTop = 25:Ring2.HeightBottom = 25:bump2 = 3
- Case 3:Ring2.HeightTop = 35:Ring2.HeightBottom = 35:bump2 = 4
- Case 4:Ring2.HeightTop = 45:Ring2.HeightBottom = 45:Bumper2.TimerEnabled = 0
- End Select
- End Sub
- '***********************************
- Sub TriggerTopA_Hit()
- DOF 107, DOFOn
- If TableTilted=false then
- PlaySound "sensor"
- SetMotor(500)
- If UpperALight.state=1 then
- RotoSpin
- IncreaseBonus
- End if
- end if
- trig_a.TopVisible=0
- End Sub
- Sub TriggerTopA_UnHit
- DOF 107, DOFOff
- trig_a.TopVisible=1
- end Sub
- Sub TriggerTopB_Hit()
- DOF 108, DOFOn
- If TableTilted=false then
- PlaySound "sensor"
- SetMotor(500)
- If UpperBLight.state=1 then
- RotoSpin
- IncreaseBonus
- End if
- end if
- trig_b.TopVisible=0
- End Sub
- Sub TriggerTopB_UnHit
- DOF 108, DOFOff
- trig_b.TopVisible=1
- end Sub
- Sub TriggerTopC_Hit()
- DOF 109, DOFOn
- If TableTilted=false then
- PlaySound "sensor"
- SetMotor(500)
- If UpperCLight.state=1 then
- RotoSpin
- IncreaseBonus
- End if
- end if
- trig_c.TopVisible=0
- End Sub
- Sub TriggerTopC_UnHit
- DOF 109, DOFOff
- trig_c.TopVisible=1
- end Sub
- Sub TriggerLeftInlane_Hit()
- DOF 111, DOFOn
- If TableTilted=false then
- PlaySound "sensor"
- SetMotor(1000)
- RotoSpin
- IncreaseBonus
- End If
- trig_leftin.TopVisible=0
- End Sub
- Sub TriggerLeftInlane_UnHit
- DOF 111, DOFOff
- trig_leftin.TopVisible=1
- end Sub
- Sub TriggerRightInlane_Hit()
- DOF 112, DOFOn
- If TableTilted=false then
- PlaySound "sensor"
- SetMotor(1000)
- RotoSpin
- IncreaseBonus
- End If
- trig_rightin.TopVisible=0
- End Sub
- Sub TriggerRightInlane_UnHit
- DOF 112, DOFOff
- trig_rightin.TopVisible=1
- end Sub
- Sub TriggerLeftOutlane_Hit()
- DOF 110, DOFOn
- If TableTilted=false then
- PlaySound "sensor"
- IncreaseBonusValue=3
- SetMotor(3000)
- end If
- trig_leftout.TopVisible=0
- End Sub
- Sub TriggerLeftOutlane_UnHit
- DOF 110, DOFOff
- trig_leftout.TopVisible=1
- end Sub
- Sub TriggerRightOutlane_Hit()
- DOF 113, DOFOn
- If TableTilted=false then
- PlaySound "sensor"
- IncreaseBonusValue=3
- SetMotor(3000)
- End If
- trig_rightout.TopVisible=0
- End Sub
- Sub TriggerRightOutlane_UnHit
- DOF 113, DOFOff
- trig_rightout.TopVisible=1
- end Sub
- '****************************************************
- sub Kicker1_Hit()
- Dim speedx,speedy,finalspeed
- speedx=activeball.velx
- speedy=activeball.vely
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- if TableTilted=true then
- Kicker1.Timerenabled=1
- exit sub
- end if
- if finalspeed>20 then
- Kicker1.Kick 0,0
- activeball.velx=speedx
- activeball.vely=speedy
- else
- mHole.MagnetOn=1
- KickerHolder1.enabled=1
- end if
- end sub
- sub KickerHolder1_timer
- if MotorRunning=0 then
- KickerHolder1.enabled=0
- Kicker1Process
- end if
- end sub
- sub Kicker1Process
- KickerCounter=1
- X=RotoCenterWheel(RotoPos)
- if X=999 then
- X=500
- end if
- X=X*10
- SetMotor(X)
- Kicker1.timerinterval=(500)
- Kicker1.timerenabled=1
- end sub
- Sub Kicker1_Timer()
- mHole.MagnetOn=0
- Kicker1.timerenabled=0
- ' RotoSpin
- Kicker1.kick 240,5
- DOF 120, DOFPulse
- DOF 121, DOFPulse
- end sub
- '****************************************************
- Sub RotoSpin()
- RotoNumsDown() ' Take Down Current Set of Numbers
- X=INT(RND()*10) ' get random Number from 0-9
- If X < 4 Then
- RotoPos=RotoPos+3 ' 40% of Time advance 3 positions
- RotoCycles=5
- Else
- If X < 8 Then
- RotoPos=RotoPos+4 ' 40% of Time Advance 4 Positions
- RotoCycles=6
- Else
- RotoPos=RotoPos+5 ' 20% of Time Advance 5 Positions
- RotoCycles=7
- End If
- End if
- RotoPos = RotoWrap(RotoPos) ' Wrap Circular Wheel
- If RWAnim <> 0 Then
- Exit Sub ' Animation Already Underway
- End If
- RotoAnim1.IsDropped=False ' Raise First Animation Shot
- RotoAnim1.TimerEnabled=True ' Start Animation timer
- StopSound "BuzzLeft" ' In Case Quick Hit
- PlaySound "RotoStart" ' Sound "Kick" Solenoid
- DOF 124, DOFPulse
- End Sub
- '
- ' RotoWheel Spin Animation Timer moves Through the Animation Stages
- ' for "RotoCycle" Digits Spinning by windows, and
- ' then Raises the newly Selected Wheel Position Digits
- '
- Sub RotoAnim1_Timer()
- RWAnim=RWAnim+1 'Advance Animation Phase
- Select Case RWAnim
- Case 1:
- StopSound "RotoStart"
- PlaySound "BuzzLeft", -1 'Sound "Hold" Solenoid Buzz Until Stopped
- RotoAnim1.IsDropped=True ' Move from Anim1 to Anim2
- RotoAnim2.IsDropped=False
- '
- Case 2:
- RotoAnim2.IsDropped=True ' Move from Anim6 to Anim7
- RotoAnim3.IsDropped=False
- If RotoCycles <= 1 Then
- StopSound "BuzzLeft" ' Stop "Solenoid Hold" Sound
- PlaySound "RotoStop" ' Sound Pawl Locking RotoWheel
- End If
- '
- Case 3:
- RotoAnim3.IsDropped=True ' End Animation of 1 Cycle
- RotoCycles=RotoCycles-1
- If RotoCycles > 0 Then
- RotoAnim1.IsDropped=False ' Begin Phase 1 of Next Cycle
- RWAnim=0
- Else
- RotoNumsUp() ' Display New Position Numbers
- RWAnim=0 ' Animation is over
- Me.TimerEnabled=False ' Stop the animation timer
- End If
- End Select
- End Sub
- '
- ' Display The Two RotoWheel Numbers at the current position
- '
- Sub RotoNumsUp()
- For X=1 to 3
- EVAL("RotoAnim"&X).IsDropped=True
- Next
- X=RotoPos+1 ' Get Left Roto number
- EVAL("RotoStop"&X).IsDropped=False ' Raise Left Number
- ' Raise Right Number
- End Sub
- '
- ' End Display of Numbers at Current RotoWheel Position
- '
- Sub RotoNumsDown()
- For X=1 to 15
- EVAL("RotoStop"&X).IsDropped=True
- Next
- X=RotoPos+1 ' Get Left Roto number
- EVAL("RotoStop"&X).IsDropped=True ' Drop Left Number
- End Sub
- ' Function to Wrap RotoWheel Index around the ends
- '
- Function RotoWrap(Index)
- If Index >= 0 and Index < 15 Then
- RotoWrap = Index ' No Wrapping Needed
- Exit Function
- End If
- ' Went Out An End
- If Index < 0 Then
- RotoWrap = Index + 15 ' Went out lower end
- Else
- RotoWrap = Index - 15 ' Went Out upper End
- End If
- End Function
- '
- '****************************************************
- Sub RotoNumLeft_Hit()
- PlaySound SoundFXDOF("Target",117,DOFPulse,DOFTargets)
- '
- ' Spot Left Roto Number
- '
- If RWAnim = 0 Then ' If Target Not In Motion
- X = RotoLeftWheel(RotoPos)
- if X=999 then
- X=500
- end if
- SetMotor(x)
- LeftRotoHitLight.state=1
- RotoHitLights.enabled=true
- Else
- '
- ' Hit Spinning Wheel. Figure out what target
- ' Would have been hit.
- '
- X=RotoPos - RotoCycles ' Position Wheel is Roughly At
- If RWAnim > 4 Then
- X = X+1 ' Closer to next position
- End If
- X = RotoWrap(X) ' Handle Wrapping
- X = RotoLeftWheel(X)
- if X=999 then
- X=500
- end if
- SetMotor(x)
- LeftRotoHitLight.state=1
- RotoHitLights.enabled=true
- End If
- End Sub
- '
- '
- ' Right Roto Number Hit
- '
- Sub RotoNumRight_Hit()
- PlaySound SoundFXDOF("Target",117,DOFPulse,DOFTargets)
- If RWAnim=0 Then ' If Target Not In Motion then
- X = RotoRightWheel(RotoPos)
- if X=999 then
- X=500
- end if
- SetMotor(x)
- RightRotoHitLight.state=1
- RotoHitLights.enabled=true
- Else
- '
- ' Hit Spinning Wheel. Figure out what target
- ' Would have been hit.
- '
- X= (RotoPos - RotoCycles)+3 ' Position Wheel is Roughly At
- If RWAnim > 4 Then
- X = X+1 ' Closer to next position
- End If
- X = RotoWrap(X) 'Handle Wrapping
- X = RotoRightWheel(X)
- if X=999 then
- X=500
- end if
- SetMotor(x)
- RightRotoHitLight.state=1
- RotoHitLights.enabled=true
- End If
- End Sub
- Sub RotoNumCenter_Hit()
- PlaySound SoundFXDOF("Target",117,DOFPulse,DOFTargets)
- If RWAnim=0 Then ' If Target Not In Motion then
- X = RotoCenterWheel(RotoPos)
- if X=999 then
- X=500
- If CenterRotoSpecialLight.state=1 then
- AddSpecial
- end if
- end if
- IncreaseBonusValue= x/100
- SetMotor(x*10)
- CenterRotoHitLight.state=1
- RotoHitLights.enabled=true
- Else
- '
- ' Hit Spinning Wheel. Figure out what target
- ' Would have been hit.
- '
- X= (RotoPos - RotoCycles)+3 ' Position Wheel is Roughly At
- If RWAnim > 4 Then
- X = X+1 ' Closer to next position
- End If
- X = RotoWrap(X) 'Handle Wrapping
- X = RotoCenterWheel(X)
- if X=999 then
- X=500
- If CenterRotoSpecialLight.state=1 then
- AddSpecial
- end if
- end if
- IncreaseBonusValue= x/100
- SetMotor(x*10)
- CenterRotoHitLight.state=1
- RotoHitLights.enabled=true
- End If
- End Sub
- '
- ' End Right Num hit Animation
- '
- Sub RotoHitLights_Timer()
- LeftRotoHitLight.state=0
- RightRotoHitLight.state=0
- CenterRotoHitLight.state=0
- RotoHitLights.enabled=false
- end sub
- '****************************************************
- Sub TargetCenter1_Hit()
- DOF 118, DOFPulse
- If TableTilted=false then
- If LeftTargetSpecialLight.state=0 then
- IncreaseBonusValue=3
- SetMotor(3000)
- else
- SetMotor(5000)
- AddSpecial
- LeftTargetSpecialLight.state=0
- End if
- End If
- center1p.transX=-10:TargetCenter1.timerEnabled=1
- end Sub
- Sub TargetCenter1_timer
- center1p.transX=0:TargetCenter1.timerEnabled=0
- end Sub
- Sub TargetCenter2_Hit()
- DOF 119, DOFPulse
- If TableTilted=false then
- X=RotoRightWheel(RotoPos)
- if X=999 then
- X=500
- end if
- SetMotor(X)
- If RightTargetExtraBallLight.state=1 then
- SamePlayerShootsAgain.state=1
- RightTargetExtraBallLight.state=0
- End if
- End If
- center2p.transX=-10:TargetCenter2.timerEnabled=1
- end Sub
- Sub TargetCenter2_timer
- center2p.transX=0:TargetCenter2.timerEnabled=0
- end Sub
- Sub TargetCenter3_Hit()
- DOF 118, DOFPulse
- If TableTilted=false then
- X=RotoLeftWheel(RotoPos)
- if X=999 then
- X=500
- end if
- SetMotor(X)
- If LeftTargetExtraBallLight.state=1 then
- SamePlayerShootsAgain.state=1
- LeftTargetExtraBallLight.state=0
- End if
- End If
- center3p.transX=-10:TargetCenter3.timerEnabled=1
- end Sub
- Sub TargetCenter3_timer
- center3p.transX=0:TargetCenter3.timerEnabled=0
- end Sub
- '****************************************************
- ' Varitarget
- Dim Lvariawarded, Lnewpos, Loldpos
- Dim Rvariawarded, Rnewpos, Roldpos
- Dim LeftPosition_Vari
- Dim RightPosition_Vari
- Dim Varimultiplier
- Lvariawarded = 0
- Lnewpos=0
- Loldpos=0
- Sub LeftVT_Hit(idx)
- DOF 126, DOFPulse
- Dim x
- Lnewpos=idx
- If ActiveBall.VelY <0 Then
- ActiveBall.VelY = ActiveBall.VelY * 0.875
- PlaySound "fx_solenoidoff"
- LeftVari(Loldpos).IsDropped = True
- LeftVari(Lnewpos).IsDropped = False
- LeftPosition_Vari = idx +1
- End If
- Loldpos=Lnewpos
- End Sub
- Sub LeftVT_UnHit(idx)
- If ActiveBall.VelY >0 Then
- TimerLeftVariTarget.Enabled = True
- End If
- End Sub
- Sub vt22_Hit()
- DOF 125, DOFPulse
- Dim x
- Lvariawarded = 1
- IncreaseBonusValue=5
- If BallsPerGame=5 then
- SetMotor(500)
- else
- SetMotor(5000)
- end if
- LeftTargetSpecialLight.state=1
- End Sub
- Sub TimerLeftVariTarget_Timer()
- LeftVari(LeftPosition_Vari).IsDropped = True
- LeftPosition_Vari = LeftPosition_Vari - 1
- If LeftPosition_Vari <0 Then
- LeftPosition_Vari = 0
- End If
- LeftVari(LeftPosition_Vari).IsDropped = False
- If LeftPosition_Vari = 17 AND Lvariawarded = 0 Then
- IncreaseBonusValue=5
- if BallsPerGame=5 then
- SetMotor(500)
- else
- SetMotor(5000)
- end if
- Lvariawarded = 1
- End If
- If LeftPosition_Vari = 14 AND Lvariawarded = 0 Then
- IncreaseBonusValue=4
- if BallsPerGame=5 then
- SetMotor(400)
- else
- SetMotor(4000)
- end if
- Lvariawarded = 1
- End If
- If LeftPosition_Vari = 11 AND Lvariawarded = 0 Then
- IncreaseBonusValue=3
- if BallsPerGame=5 then
- SetMotor(300)
- else
- SetMotor(3000)
- end if
- Lvariawarded = 1
- End If
- If LeftPosition_Vari = 7 AND Lvariawarded = 0 Then
- IncreaseBonusValue=2
- if BallsPerGame=5 then
- SetMotor(200)
- else
- SetMotor(2000)
- end if
- Lvariawarded = 1
- End If
- If LeftPosition_Vari = 4 AND Lvariawarded = 0 Then
- if BallsPerGame=5 then
- AddScore(100)
- else
- AddScore(1000)
- end if
- Lvariawarded = 1
- IncreaseBonus
- End If
- If LeftPosition_Vari = 0 Then
- Lvariawarded = 0
- RotoSpin
- TimerLeftVariTarget.Enabled = False
- End If
- End Sub
- '****************************************************
- Sub AddSpecial()
- PlaySound SoundFXDOF("knocker",122,DOFPulse,DOFKnocker)
- DOF 121, DOFPulse
- Credits=Credits+1
- DOF 123, DOFOn
- if Credits>9 then Credits=9
- If B2SOn Then
- Controller.B2SSetCredits Credits
- End If
- EMReel6.SetValue(Credits)
- End Sub
- Sub AddSpecial2()
- PlaySound"click"
- Credits=Credits+1
- DOF 123, DOFOn
- if Credits>9 then Credits=9
- If B2SOn Then
- Controller.B2SSetCredits Credits
- End If
- EMReel6.SetValue(Credits)
- End Sub
- Sub AddBonus()
- bonuscountdown=bonuscounter
- ScoreBonus.enabled=true
- End Sub
- Sub ToggleOutlane
- if LeftOutlaneLight.state=1 then
- LeftOutlaneLight.state=0
- RightOutlaneLight.state=1
- Else
- LeftOutlaneLight.state=1
- RightOutlaneLight.state=0
- end if
- end sub
- Sub ToggleBumper
- ' if Bumper1.state=1 then
- ' Bumper1.state=0
- ' Bumper1L.image="1000WhenLit-Unlit"
- ' Bumper1R.State = ABS(Bumper1R.State - 1) 'refresh light
- ' else
- ' Bumper1.state=1
- ' Bumper1L.image="1000WhenLit-Lit"
- ' Bumper1R.State = ABS(Bumper1R.State - 1) 'refresh light
- ' end if
- If TargetSpecialLit=1 then
- if UpperBlueLight.state=1 then
- UpperBlueLight.state=0
- UpperGreenLight.state=1
- else
- UpperBlueLight.state=1
- UpperGreenLight.state=0
- end if
- end if
- end sub
- Sub ResetBallDrops()
- BonusCounter=0
- HoleCounter=0
- End Sub
- Sub LightsOut
- BonusCounter=0
- HoleCounter=0
- BumperLight1.IsVisible=0
- Bumper1.state=0
- BumperLight2.IsVisible=0
- Bumper2.state=0
- For each obj in StartLightsOff
- obj.state=0
- next
- For each obj in StartLightsOn
- obj.state=0
- next
- StopSound "buzzL"
- StopSound "buzz"
- end sub
- Sub ResetDrops()
- for each obj in AllTargets
- obj.IsDropped=0
- next
- PlaySound"dropsup"
- BlueTargetsDownCounter=0
- YellowTargetsDownCounter=0
- GreenTargetsDownCounter=0
- End Sub
- Sub ResetBalls()
- TempMultiCounter=BallsPerGame-BallInPlay
- For each obj in StartLightsOff
- obj.state=0
- next
- For each obj in StartLightsOn
- obj.state=1
- next
- ResetBallDrops
- BonusMultiplier=1
- TableTilted=false
- TiltReel.SetValue(0)
- If B2Son then
- Controller.B2SSetTilt 0
- end if
- PlasticsOn
- BumpersOn
- RotoSpin
- CreateBallID BallRelease
- 'Ballrelease.CreateSizedBall 27
- Ballrelease.Kick 40,7
- DOF 114, DOFPulse
- BallInPlayReel.SetValue(BallInPlay)
- End Sub
- sub delaykgclose_timer
- delaykgclose.enabled=false
- closekg.enabled=true
- end sub
- sub resettimer_timer
- rst=rst+1
- If B2SOn Then
- if rst=4 then
- Controller.B2SSetScorePlayer 1, 0
- end if
- if rst=8 then
- Controller.B2SSetScorePlayer 2, 0
- end if
- if rst=12 then
- Controller.B2SSetScorePlayer 3, 0
- end if
- if rst=16 then
- Controller.B2SSetScorePlayer 4, 0
- end if
- End if
- if rst=20 then
- playsound "StartBall1"
- end if
- if rst=24 then
- newgame
- resettimer.enabled=false
- end if
- end sub
- sub ScoreBonus_timer
- if bonuscountdown<=0 then
- ScoreBonus.enabled=false
- ScoreBonus.interval=600
- NextBallDelay.enabled=true
- exit sub
- end if
- if BonusCountdown>10 then
- if TableTilted=false then
- SetMotor2(1000*BonusMultiplier)
- end if
- Bonus(bonuscountdown-10).state=0
- else
- if TableTilted=false then
- SetMotor2(1000*BonusMultiplier)
- end if
- Bonus(bonuscountdown).state=0
- end if
- If BonusMultiplier=1 then
- ScoreBonus.interval=50
- Else
- ScoreBonus.interval=50
- end if
- bonuscountdown=bonuscountdown-1
- if bonuscountdown>10 then
- Bonus(bonuscountdown-10).state=1
- exit sub
- end if
- if bonuscountdown>0 then
- Bonus(bonuscountdown).state=1
- end if
- end sub
- sub NextBallDelay_timer()
- NextBallDelay.enabled=false
- nextball
- end sub
- sub newgame
- InProgress=true
- debugscore=0
- queuedscore=0
- EMReel1.ResetToZero
- MatchTextBox.text=""
- BallTextBox.text=FormatNumber(BallInPlay,0)
- for i = 1 to 4
- Score(i)=0
- Score100K(1)=0
- HighScorePaid(i)=false
- Replay1Paid(i)=false
- Replay2Paid(i)=false
- Replay3Paid(i)=false
- next
- If B2SOn Then
- Controller.B2SSetTilt 0
- Controller.B2SSetGameOver 0
- Controller.B2SSetMatch 0
- Controller.B2SSetScorePlayer1 0
- Controller.B2SSetScorePlayer2 0
- Controller.B2SSetScorePlayer3 0
- Controller.B2SSetScorePlayer4 0
- Controller.B2SSetBallInPlay BallInPlay
- End if
- RotoReplay1=false
- RotoReplay2=false
- RotoReplay3=false
- RotoReplay4=false
- ABCDReplay=false
- For each obj in StartLightsOff
- obj.state=0
- next
- For each obj in StartLightsOn
- obj.state=1
- next
- ' Bumper1L.image="Bumper100Lit"
- BumperLight1.IsVisible=1
- Bumper1.state=1
- ' Bumper2L.image="Bumper100Lit"
- BumperLight2.IsVisible=1
- Bumper2.state=1
- ResetBalls
- End sub
- sub nextball
- If B2SOn Then
- Controller.B2SSetTilt 0
- End If
- If SamePlayerShootsAgain.state=0 then
- Player=Player+1
- else
- SamePlayerShootsAgain.state=0
- end if
- If Player>Players Then
- BallInPlay=BallInPlay+1
- If BallInPlay>BallsPerGame then
- PlaySound("MotorLeer")
- InProgress=false
- If B2SOn Then
- Controller.B2SSetGameOver 1
- Controller.B2SSetPlayerUp 0
- Controller.B2SSetData 81,0
- Controller.B2SSetData 82,0
- Controller.B2SSetData 83,0
- Controller.B2SSetData 84,0
- Controller.B2SSetBallInPlay 0
- Controller.B2SSetCanPlay 0
- End If
- For each obj in PlayerHuds
- obj.SetValue(0)
- next
- BallInPlayReel.SetValue(0)
- CanPlayReel.SetValue(0)
- GameOverReel.SetValue(1)
- LeftFlipper.RotateToStart
- RightFlipper.RotateToStart
- LightsOut
- PlasticsOff
- BallTextBox.text=""
- checkmatch
- CheckHighScore
- Players=0
- Else
- Player=1
- If B2SOn Then
- Controller.B2SSetPlayerUp Player
- Controller.B2SSetData 81,0
- Controller.B2SSetData 82,0
- Controller.B2SSetData 83,0
- Controller.B2SSetData 84,0
- Controller.B2SSetData 80+Player,1
- Controller.B2SSetBallInPlay BallInPlay
- End If
- PlaySound("RotateThruPlayers")
- TempPlayerUp=Player
- PlayerUpRotator.enabled=true
- PlayStartBall.enabled=true
- For each obj in PlayerHuds
- obj.SetValue(0)
- next
- PlayerHuds(Player-1).SetValue(1)
- BallTextBox.text=FormatNumber(BallInPlay,0)
- ResetBalls
- End If
- Else
- If B2SOn Then
- Controller.B2SSetPlayerUp Player
- Controller.B2SSetData 81,0
- Controller.B2SSetData 82,0
- Controller.B2SSetData 83,0
- Controller.B2SSetData 84,0
- Controller.B2SSetData 80+Player,1
- Controller.B2SSetBallInPlay BallInPlay
- End If
- PlaySound("RotateThruPlayers")
- TempPlayerUp=Player
- PlayerUpRotator.enabled=true
- PlayStartBall.enabled=true
- For each obj in PlayerHuds
- obj.SetValue(0)
- next
- PlayerHuds(Player-1).SetValue(1)
- BallTextBox.text=FormatNumber(BallInPlay,0)
- ResetBalls
- End If
- End sub
- sub CheckHighScore
- Dim playertops
- dim si
- dim sj
- dim stemp
- dim stempplayers
- for i=1 to 4
- sortscores(i)=0
- sortplayers(i)=0
- next
- playertops=0
- for i = 1 to Players
- sortscores(i)=Score(i)
- sortplayers(i)=i
- next
- for si = 1 to Players
- for sj = 1 to Players-1
- if sortscores(sj)>sortscores(sj+1) then
- stemp=sortscores(sj+1)
- stempplayers=sortplayers(sj+1)
- sortscores(sj+1)=sortscores(sj)
- sortplayers(sj+1)=sortplayers(sj)
- sortscores(sj)=stemp
- sortplayers(sj)=stempplayers
- end if
- next
- next
- ScoreChecker=4
- CheckAllScores=1
- NewHighScore sortscores(ScoreChecker),sortplayers(ScoreChecker)
- savehs
- end sub
- sub checkmatch
- Dim tempmatch
- tempmatch=Int(Rnd*10)
- Match=tempmatch*10
- MatchReel.SetValue(tempmatch+1)
- if Match=0 then
- MatchTextBox.text="Match: 00"
- else
- MatchTextBox.text="Match: " + FormatNumber(Match,0)
- end if
- If B2SOn Then
- If Match = 0 Then
- Controller.B2SSetMatch 100
- Else
- Controller.B2SSetMatch Match
- End If
- End if
- for i = 1 to Players
- if Match=(Score(i) mod 100) then
- AddSpecial
- end if
- next
- end sub
- Sub TiltTimer_Timer()
- if TiltCount > 0 then TiltCount = TiltCount - 1
- if TiltCount = 0 then
- TiltTimer.Enabled = False
- end if
- end sub
- Sub TiltIt()
- TiltCount = TiltCount + 1
- if TiltCount = 3 then
- TableTilted=True
- TiltReel.SetValue(1)
- PlasticsOff
- BumpersOff
- LeftFlipper.RotateToStart
- RightFlipper.RotateToStart
- If B2Son then
- Controller.B2SSetTilt 1
- end if
- else
- TiltTimer.Interval = 500
- TiltTimer.Enabled = True
- end if
- end sub
- Sub IncreaseBonus()
- If BonusCounter=15 then
- exit sub
- end if
- If BonusCounter<10 then
- Bonus(BonusCounter).state=0
- end if
- if BonusCounter>10 then
- Bonus(BonusCounter-10).state=0
- end if
- BonusCounter=BonusCounter+1
- if BonusCounter>10 then
- Bonus(10).State=1
- Bonus(BonusCounter-10).state=1
- else
- Bonus(BonusCounter).State=1
- end if
- RightTargetExtraBallLight.state=0
- LeftTargetExtraBallLight.state=0
- CenterRotoSpecialLight.state=0
- if BonusCounter=4 and ExtraBallFrequency=1 then
- RightTargetExtraBallLight.state=1
- end if
- if BonusCounter=6 then
- LeftTargetExtraBallLight.state=1
- end if
- if BonusCounter=8 then
- RightTargetExtraBallLight.state=1
- end if
- if BonusCounter=10 and BallsPerGame=3 then
- LeftTargetExtraBallLight.state=1
- end if
- if BonusCounter=15 then
- CenterRotoSpecialLight.state=1
- end if
- if UpperBLight.state=1 then
- UpperBLight.state=0
- UpperALight.state=1
- UpperCLight.state=1
- else
- UpperBLight.state=1
- UpperALight.state=0
- UpperCLight.state=0
- end if
- End Sub
- Sub BonusBoost_Timer()
- IncreaseBonus
- BonusBoosterCounter=BonusBoosterCounter-1
- If BonusBoosterCounter=0 then
- BonusBoost.enabled=false
- end if
- end sub
- Sub CheckForLightSpecial()
- if (TopLightA.state=0) and (TopLightB.state=0) and (TopLightC.state=0) then
- TopRightTargetLight.State=1
- TopLeftTargetLight.State=1
- end if
- end sub
- Sub PlayStartBall_timer()
- PlayStartBall.enabled=false
- PlaySound("ballrel")
- end sub
- Sub PlayerUpRotator_timer()
- If RotatorTemp<5 then
- TempPlayerUp=TempPlayerUp+1
- If TempPlayerUp>4 then
- TempPlayerUp=1
- end if
- For each obj in PlayerHuds
- obj.SetValue(0)
- next
- PlayerHuds(TempPlayerUp-1).SetValue(1)
- If B2SOn Then
- Controller.B2SSetPlayerUp TempPlayerUp
- Controller.B2SSetData 81,0
- Controller.B2SSetData 82,0
- Controller.B2SSetData 83,0
- Controller.B2SSetData 84,0
- Controller.B2SSetData 80+TempPlayerUp,1
- End If
- else
- if B2SOn then
- Controller.B2SSetPlayerUp Player
- Controller.B2SSetData 81,0
- Controller.B2SSetData 82,0
- Controller.B2SSetData 83,0
- Controller.B2SSetData 84,0
- Controller.B2SSetData 80+Player,1
- end if
- PlayerUpRotator.enabled=false
- RotatorTemp=1
- For each obj in PlayerHuds
- obj.SetValue(0)
- next
- PlayerHuds(Player-1).SetValue(1)
- end if
- RotatorTemp=RotatorTemp+1
- end sub
- sub savehs
- ' Based on Black's Highscore routines
- Dim FileObj
- Dim ScoreFile
- Set FileObj=CreateObject("Scripting.FileSystemObject")
- If Not FileObj.FolderExists(UserDirectory) then
- Exit Sub
- End if
- Set ScoreFile=FileObj.CreateTextFile(UserDirectory & HSFileName,True)
- ScoreFile.WriteLine 0
- ScoreFile.WriteLine Credits
- scorefile.writeline BallsPerGame
- scorefile.writeline ExtraBallFrequency
- ScoreFile.WriteLine ReplayLevel
- for xx=1 to 5
- scorefile.writeline HSScore(xx)
- next
- for xx=1 to 5
- scorefile.writeline HSName(xx)
- next
- ScoreFile.Close
- Set ScoreFile=Nothing
- Set FileObj=Nothing
- end sub
- sub loadhs
- ' Based on Black's Highscore routines
- Dim FileObj
- Dim ScoreFile
- dim temp1
- dim temp2
- dim temp3
- dim temp4
- dim temp5
- dim temp6
- dim temp7
- dim temp8
- dim temp9
- dim temp10
- dim temp11
- dim temp12
- dim temp13
- dim temp14
- dim temp15
- Set FileObj=CreateObject("Scripting.FileSystemObject")
- If Not FileObj.FolderExists(UserDirectory) then
- Exit Sub
- End if
- If Not FileObj.FileExists(UserDirectory & HSFileName) then
- Exit Sub
- End if
- Set ScoreFile=FileObj.GetFile(UserDirectory & HSFileName)
- Set TextStr=ScoreFile.OpenAsTextStream(1,0)
- If (TextStr.AtEndOfStream=True) then
- Exit Sub
- End if
- temp1=TextStr.ReadLine
- temp2=textstr.readline
- temp3=textstr.readline
- temp5=textstr.readline
- temp4=textstr.readline
- HighScore=cdbl(temp1)
- if HighScore<1 then
- temp6=textstr.readline
- temp7=textstr.readline
- temp8=textstr.readline
- temp9=textstr.readline
- temp10=textstr.readline
- temp11=textstr.readline
- temp12=textstr.readline
- temp13=textstr.readline
- temp14=textstr.readline
- temp15=textstr.readline
- end if
- TextStr.Close
- Credits=cdbl(temp2)
- BallsPerGame=cdbl(temp3)
- ExtraBallFrequency=cdbl(temp5)
- ReplayLevel=cdbl(temp4)
- if HighScore<1 then
- HSScore(1) = int(temp6)
- HSScore(2) = int(temp7)
- HSScore(3) = int(temp8)
- HSScore(4) = int(temp9)
- HSScore(5) = int(temp10)
- HSName(1) = temp11
- HSName(2) = temp12
- HSName(3) = temp13
- HSName(4) = temp14
- HSName(5) = temp15
- end if
- Set ScoreFile=Nothing
- Set FileObj=Nothing
- end sub
- Sub DisplayHighScore
- end sub
- sub InitPauser5_timer
- If B2SOn Then
- Controller.B2SSetScore 6,HighScore
- End If
- ' EMReel5.SetValue(HighScore)
- DisplayHighScore
- InitPauser5.enabled=false
- end sub
- sub ResetDropsTimer_timer
- ResetDropsTimer.enabled=0
- ResetDrops
- end sub
- sub BumpersOff
- BumperLight1.IsVisible=0
- BumperLight2.IsVisible=0
- end sub
- sub BumpersOn
- if Bumper1.state=1 then
- ' Bumper1L.image="Bumper100Lit"
- BumperLight1.IsVisible=1
- end if
- if Bumper2.state=1 then
- ' Bumper2L.image="Bumper100Lit"
- BumperLight2.IsVisible=1
- end if
- end sub
- Sub PlasticsOn
- For each obj in PlasticsUnlit
- obj.IsDropped=1
- next
- For each obj in PlasticsLit
- obj.IsDropped=0
- next
- For each obj in Flashers
- obj.IsVisible=1
- next
- end sub
- Sub PlasticsOff
- For each obj in PlasticsLit
- obj.IsDropped=1
- next
- For each obj in PlasticsUnlit
- obj.IsDropped=0
- next
- For each obj in Flashers
- obj.IsVisible=0
- next
- StopSound "buzzL"
- StopSound "buzz"
- end sub
- Sub SetupReplayTables
- Replay1Table(1)=70000
- Replay1Table(2)=80000
- Replay1Table(3)=80000
- Replay1Table(4)=90000
- Replay1Table(5)=90000
- Replay1Table(6)=100000
- Replay1Table(7)=100000
- Replay1Table(8)=110000
- Replay1Table(9)=110000
- Replay1Table(10)=120000
- Replay1Table(11)=120000
- Replay1Table(12)=999000
- Replay1Table(13)=999000
- Replay1Table(14)=999000
- Replay1Table(15)=999000
- Replay2Table(1)=100000
- Replay2Table(2)=100000
- Replay2Table(3)=110000
- Replay2Table(4)=110000
- Replay2Table(5)=120000
- Replay2Table(6)=120000
- Replay2Table(7)=130000
- Replay2Table(8)=130000
- Replay2Table(9)=140000
- Replay2Table(10)=140000
- Replay2Table(11)=150000
- Replay2Table(12)=999000
- Replay2Table(13)=999000
- Replay2Table(14)=999000
- Replay2Table(15)=999000
- Replay3Table(1)=180000
- Replay3Table(2)=180000
- Replay3Table(3)=180000
- Replay3Table(4)=180000
- Replay3Table(5)=180000
- Replay3Table(6)=180000
- Replay3Table(7)=190000
- Replay3Table(8)=190000
- Replay3Table(9)=190000
- Replay3Table(10)=190000
- Replay3Table(11)=999000
- Replay3Table(12)=999000
- Replay3Table(13)=999000
- Replay3Table(14)=999000
- Replay3Table(15)=999000
- ReplayTableMax=11
- end sub
- Sub RefreshReplayCard
- Dim tempst1
- Dim tempst2
- tempst1=FormatNumber(BallsPerGame,0)
- tempst2=FormatNumber(ReplayLevel,0)
- ReplayCard.image = "SC" + tempst2
- Replay1=Replay1Table(ReplayLevel)
- Replay2=Replay2Table(ReplayLevel)
- Replay3=Replay3Table(ReplayLevel)
- end sub
- '****************************************
- ' SCORE MOTOR
- '****************************************
- ScoreMotorTimer.Enabled = 1
- ScoreMotorTimer.Interval = 135 '135
- AddScoreTimer.Enabled = 1
- AddScoreTimer.Interval = 135
- Dim queuedscore
- Dim MotorMode
- Dim MotorPosition
- Sub SetMotor(y)
- Select Case ScoreMotorAdjustment
- Case 0:
- queuedscore=queuedscore+y
- Case 1:
- If MotorRunning<>1 And InProgress=true then
- queuedscore=queuedscore+y
- end if
- end Select
- end sub
- Sub SetMotor2(x)
- If MotorRunning<>1 And InProgress=true then
- MotorRunning=1
- Select Case x
- Case 10:
- AddScore(10)
- MotorRunning=0
- BumpersOn
- Case 20:
- MotorMode=10
- MotorPosition=2
- BumpersOff
- Case 30:
- MotorMode=10
- MotorPosition=3
- BumpersOff
- Case 40:
- MotorMode=10
- MotorPosition=4
- BumpersOff
- Case 50:
- MotorMode=10
- MotorPosition=5
- BumpersOff
- Case 100:
- AddScore(100)
- MotorRunning=0
- BumpersOn
- Case 200:
- MotorMode=100
- MotorPosition=2
- BumpersOff
- Case 300:
- MotorMode=100
- MotorPosition=3
- BumpersOff
- Case 400:
- MotorMode=100
- MotorPosition=4
- BumpersOff
- Case 500:
- MotorMode=100
- MotorPosition=5
- BumpersOff
- Case 1000:
- AddScore(1000)
- MotorRunning=0
- BumpersOn
- Case 2000:
- MotorMode=1000
- MotorPosition=2
- BumpersOff
- Case 3000:
- MotorMode=1000
- MotorPosition=3
- BumpersOff
- Case 4000:
- MotorMode=1000
- MotorPosition=4
- BumpersOff
- Case 5000:
- MotorMode=1000
- MotorPosition=5
- BumpersOff
- End Select
- End If
- End Sub
- Sub AddScoreTimer_Timer
- Dim tempscore
- If MotorRunning<>1 And InProgress=true then
- if queuedscore>=5000 then
- tempscore=5000
- queuedscore=queuedscore-5000
- SetMotor2(5000)
- exit sub
- end if
- if queuedscore>=4000 then
- tempscore=4000
- queuedscore=queuedscore-4000
- SetMotor2(4000)
- exit sub
- end if
- if queuedscore>=3000 then
- tempscore=3000
- queuedscore=queuedscore-3000
- SetMotor2(3000)
- exit sub
- end if
- if queuedscore>=2000 then
- tempscore=2000
- queuedscore=queuedscore-2000
- SetMotor2(2000)
- exit sub
- end if
- if queuedscore>=1000 then
- tempscore=1000
- queuedscore=queuedscore-1000
- SetMotor2(1000)
- exit sub
- end if
- if queuedscore>=500 then
- tempscore=500
- queuedscore=queuedscore-500
- SetMotor2(500)
- exit sub
- end if
- if queuedscore>=400 then
- tempscore=400
- queuedscore=queuedscore-400
- SetMotor2(400)
- exit sub
- end if
- if queuedscore>=300 then
- tempscore=300
- queuedscore=queuedscore-300
- SetMotor2(300)
- exit sub
- end if
- if queuedscore>=200 then
- tempscore=200
- queuedscore=queuedscore-200
- SetMotor2(200)
- exit sub
- end if
- if queuedscore>=100 then
- tempscore=100
- queuedscore=queuedscore-100
- SetMotor2(100)
- exit sub
- end if
- if queuedscore>=50 then
- tempscore=50
- queuedscore=queuedscore-50
- SetMotor2(50)
- exit sub
- end if
- if queuedscore>=40 then
- tempscore=40
- queuedscore=queuedscore-40
- SetMotor2(40)
- exit sub
- end if
- if queuedscore>=30 then
- tempscore=30
- queuedscore=queuedscore-30
- SetMotor2(30)
- exit sub
- end if
- if queuedscore>=20 then
- tempscore=20
- queuedscore=queuedscore-20
- SetMotor2(20)
- exit sub
- end if
- if queuedscore>=10 then
- tempscore=10
- queuedscore=queuedscore-10
- SetMotor2(10)
- exit sub
- end if
- End If
- end Sub
- Sub ScoreMotorTimer_Timer
- If MotorPosition > 0 Then
- Select Case MotorPosition
- Case 5,4,3,2:
- If MotorMode=1000 Then
- AddScore(1000)
- end if
- if MotorMode=100 then
- AddScore(100)
- End If
- if MotorMode=10 then
- AddScore(10)
- End if
- MotorPosition=MotorPosition-1
- Case 1:
- If MotorMode=1000 Then
- AddScore(1000)
- end if
- If MotorMode=100 then
- AddScore(100)
- End If
- if MotorMode=10 then
- AddScore(10)
- End if
- MotorPosition=0:MotorRunning=0:BumpersOn
- End Select
- End If
- If IncreaseBonusValue>0 then
- IncreaseBonus
- IncreaseBonusValue=IncreaseBonusValue-1
- End if
- End Sub
- Sub AddScore(x)
- Select Case ScoreAdditionAdjustment
- Case 0:
- AddScore1(x)
- Case 1:
- AddScore2(x)
- end Select
- end sub
- Sub AddScore1(x)
- ' debugtext.text=score
- Select Case x
- Case 1:
- PlayChime(10)
- Score(Player)=Score(Player)+1
- Case 10:
- PlayChime(100)
- Score(Player)=Score(Player)+10
- ' debugscore=debugscore+10
- ToggleBumper
- Case 100:
- PlayChime(1000)
- Score(Player)=Score(Player)+100
- ' debugscore=debugscore+100
- Case 1000:
- PlayChime(1000)
- Score(Player)=Score(Player)+1000
- ' debugscore=debugscore+1000
- End Select
- PlayerScores(Player-1).AddValue(x)
- If ScoreDisplay(Player)<100000 then
- ScoreDisplay(Player)=Score(Player)
- Else
- Score100K(Player)=Int(Score(Player)/100000)
- ScoreDisplay(Player)=Score(Player)-100000
- End If
- if Score(Player)=>100000 then
- If B2SOn Then
- If Player=1 Then
- Controller.B2SSetScoreRolloverPlayer1 Score100K(Player)
- End If
- If Player=2 Then
- Controller.B2SSetScoreRolloverPlayer2 Score100K(Player)
- End If
- If Player=3 Then
- Controller.B2SSetScoreRolloverPlayer3 Score100K(Player)
- End If
- If Player=4 Then
- Controller.B2SSetScoreRolloverPlayer4 Score100K(Player)
- End If
- End If
- End If
- If B2SOn Then
- Controller.B2SSetScorePlayer Player, ScoreDisplay(Player)
- End If
- If Score(Player)>Replay1 and Replay1Paid(Player)=false then
- Replay1Paid(Player)=True
- AddSpecial
- End If
- If Score(Player)>Replay2 and Replay2Paid(Player)=false then
- Replay2Paid(Player)=True
- AddSpecial
- End If
- If Score(Player)>Replay3 and Replay3Paid(Player)=false then
- Replay3Paid(Player)=True
- AddSpecial
- End If
- ' ScoreText.text=debugscore
- End Sub
- Sub AddScore2(x)
- Dim OldScore, NewScore, OldTestScore, NewTestScore
- OldScore = Score(Player)
- Select Case x
- Case 1:
- Score(Player)=Score(Player)+1
- Case 10:
- Score(Player)=Score(Player)+10
- Case 100:
- Score(Player)=Score(Player)+100
- Case 1000:
- Score(Player)=Score(Player)+1000
- End Select
- NewScore = Score(Player)
- if Score(Player)=>100000 then
- If B2SOn Then
- If Player=1 Then
- Controller.B2SSetScoreRolloverPlayer1 1
- End If
- If Player=2 Then
- Controller.B2SSetScoreRolloverPlayer2 1
- End If
- If Player=3 Then
- Controller.B2SSetScoreRolloverPlayer3 1
- End If
- If Player=4 Then
- Controller.B2SSetScoreRolloverPlayer4 1
- End If
- End If
- End If
- OldTestScore = OldScore
- NewTestScore = NewScore
- Do
- if OldTestScore < Replay1 and NewTestScore >= Replay1 then
- AddSpecial()
- NewTestScore = 0
- Elseif OldTestScore < Replay2 and NewTestScore >= Replay2 then
- AddSpecial()
- NewTestScore = 0
- Elseif OldTestScore < Replay3 and NewTestScore >= Replay3 then
- AddSpecial()
- NewTestScore = 0
- End if
- NewTestScore = NewTestScore - 100000
- OldTestScore = OldTestScore - 100000
- Loop While NewTestScore > 0
- OldScore = int(OldScore / 10) ' divide by 10 for games with fixed 0 in 1s position, by 1 for games with real 1s digits
- NewScore = int(NewScore / 10) ' divide by 10 for games with fixed 0 in 1s position, by 1 for games with real 1s digits
- ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore&", OldScore Mod 10="&OldScore Mod 10 & ", NewScore % 10="&NewScore Mod 10)
- if (OldScore Mod 10 <> NewScore Mod 10) then
- PlayChime(10)
- ToggleBumper
- end if
- OldScore = int(OldScore / 10)
- NewScore = int(NewScore / 10)
- ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore)
- if (OldScore Mod 10 <> NewScore Mod 10) then
- PlayChime(100)
- end if
- OldScore = int(OldScore / 10)
- NewScore = int(NewScore / 10)
- ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore)
- if (OldScore Mod 10 <> NewScore Mod 10) then
- PlayChime(1000)
- end if
- OldScore = int(OldScore / 10)
- NewScore = int(NewScore / 10)
- ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore)
- if (OldScore Mod 10 <> NewScore Mod 10) then
- PlayChime(1000)
- end if
- If B2SOn Then
- Controller.B2SSetScorePlayer Player, Score(Player)
- End If
- ' EMReel1.SetValue Score(Player)
- PlayerScores(Player-1).AddValue(x)
- End Sub
- Sub PlayChime(x)
- if ChimesOn=0 then
- Select Case x
- Case 10
- If LastChime10=1 Then
- PlaySound SoundFXDOF("SpinACard_1_10_Point_Bell",141,DOFPulse,DOFChimes)
- LastChime10=0
- Else
- PlaySound SoundFXDOF("SpinACard_1_10_Point_Bell",141,DOFPulse,DOFChimes)
- LastChime10=1
- End If
- Case 100
- If LastChime100=1 Then
- PlaySound SoundFXDOF("SpinACard_100_Point_Bell",142,DOFPulse,DOFChimes)
- LastChime100=0
- Else
- PlaySound SoundFXDOF("SpinACard_100_Point_Bell",142,DOFPulse,DOFChimes)
- LastChime100=1
- End If
- End Select
- else
- Select Case x
- Case 10
- If LastChime10=1 Then
- PlaySound SoundFXDOF("SJ_Chime_10a",141,DOFPulse,DOFChimes)
- LastChime10=0
- Else
- PlaySound SoundFXDOF("SJ_Chime_10b",141,DOFPulse,DOFChimes)
- LastChime10=1
- End If
- Case 100
- If LastChime100=1 Then
- PlaySound SoundFXDOF("SJ_Chime_100a",142,DOFPulse,DOFChimes)
- LastChime100=0
- Else
- PlaySound SoundFXDOF("SJ_Chime_100b",142,DOFPulse,DOFChimes)
- LastChime100=1
- End If
- Case 1000
- If LastChime1000=1 Then
- PlaySound SoundFXDOF("SJ_Chime_1000a",143,DOFPulse,DOFChimes)
- LastChime1000=0
- Else
- PlaySound SoundFXDOF("SJ_Chime_1000b",143,DOFPulse,DOFChimes)
- LastChime1000=1
- End If
- End Select
- end if
- End Sub
- '***************************** Operator Menu *******************************************
- Sub DisplayOptions()
- TextBox1.text = ""
- TextBox2.text = ""
- OptionsBox1.text = ""
- OptionsBox2.text = ""
- OptionsBox3.text = ""
- OptionsBox4.text = ""
- OptionsBox5.text = ""
- TextBox1.text = "Operator's Menu"
- TextBox2.text = "([) to exit"
- OptionsBox1.text = "(6) Balls/Game: " + FormatNumber(BallsPerGame,0)
- OptionsBox2.text = "(7) Extra Ball Light Frequency: "
- if ExtraBallFrequency=0 then
- OptionsBox2.text = OptionsBox2.text + "Conservative"
- else
- OptionsBox2.text = OptionsBox2.text + "Liberal"
- end if
- OptionsBox3.Text = "(8) Replay Settings: "
- if Replay3Table(ReplayLevel)=999000 then
- OptionsBox3.Text = OptionsBox3.Text + FormatNumber(Replay1Table(ReplayLevel),0) + "/" + FormatNumber(Replay2Table(ReplayLevel),0)
- else
- OptionsBox3.Text = OptionsBox3.Text + FormatNumber(Replay1Table(ReplayLevel),0) + "/" + FormatNumber(Replay2Table(ReplayLevel),0) + "/" + FormatNumber(Replay3Table(ReplayLevel),0)
- end if
- end sub
- Sub HideOptions()
- TextBox1.text = ""
- TextBox2.text = ""
- OptionsBox1.text = ""
- OptionsBox2.text = ""
- OptionsBox3.text = ""
- OptionsBox4.text = ""
- OptionsBox5.text = ""
- end sub
- '*********Sound Routines - Thanks to JimmyFingers
- dim MetalsSoundActive
- dim PlasticsSoundActive
- 'Metals
- Sub ametals_Hit(idx)
- If MetalsSoundActive=True Then Exit Sub
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 1 AND finalspeed < 6 AND ABS(activeball.vely) > 1 Then
- PlaySound "metalhit2_low"
- MetalsSoundActive=True
- MetalSoundTimer.Enabled=1
- ElseIf finalspeed >= 6 AND ABS(activeball.vely) > 2 Then
- PlaySound "metalhit2"
- MetalsSoundActive=True
- MetalSoundTimer.Enabled=1
- End If
- End sub
- Sub MetalSoundTimer_Timer()
- MetalsSoundActive=False
- Me.Enabled=0
- End Sub
- 'Plastic Sounds
- Sub aplastics_Hit(idx)
- If PlasticsSoundActive=True Then Exit Sub
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- if finalspeed > 1 AND finalspeed < 4 AND ABS(activeball.velx) > 1 Then
- PlaySound "woodhit_low"
- PlasticsSoundActive=True
- PlasticsSoundTimer.Enabled=1
- ElseIf finalspeed >= 4 AND ABS(activeball.velx) > 1 Then
- PlaySound "woodhit"
- PlasticsSoundActive=True
- PlasticsSoundTimer.Enabled=1
- End If
- End sub
- Sub PlasticsSoundTimer_Timer()
- PlasticsSoundActive=False
- Me.Enabled=0
- End Sub
- Sub arubberposts_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 14 then
- PlaySound "bump"
- End if
- If finalspeed >= 4 AND finalspeed <= 14 then
- RandomSoundRubber()
- End If
- If finalspeed < 4 AND finalspeed > 1 then
- RandomSoundRubberLowVolume()
- End If
- Dampen 5, .9, 20
- End sub
- Sub aRubbers_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 16 then
- PlaySound "bump"
- End if
- If finalspeed >= 8 AND finalspeed <= 16 then
- RandomSoundRubber()
- End If
- If finalspeed < 7 and finalspeed > 2 then
- RandomSoundRubberLowVolume
- End If
- Dampen 5, .9, 20
- End sub
- Sub RandomSoundRubber()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "rubber_hit_1"
- Case 2 : PlaySound "rubber_hit_2"
- Case 3 : PlaySound "rubber_hit_3"
- End Select
- End Sub
- Sub RandomSoundRubberLowVolume()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "rubber_hit_1_low"
- Case 2 : PlaySound "rubber_hit_2_low"
- Case 3 : PlaySound "rubber_hit_3_low"
- End Select
- End Sub
- Sub LeftFlipper_Collide(parm)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 4 then
- RandomSoundFlipper()
- Else
- RandomSoundFlipperLowVolume()
- End If
- Dampen 15, .5, 1
- End Sub
- Sub RightFlipper_Collide(parm)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 4 then
- RandomSoundFlipper()
- Else
- RandomSoundFlipperLowVolume()
- End If
- Dampen 15, .5, 1
- End Sub
- Sub RandomSoundFlipper()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "flip_hit_1"
- Case 2 : PlaySound "flip_hit_2"
- Case 3 : PlaySound "flip_hit_3"
- End Select
- End Sub
- Sub RandomSoundFlipperLowVolume()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "flip_hit_1_low"
- Case 2 : PlaySound "flip_hit_2_low"
- Case 3 : PlaySound "flip_hit_3_low"
- End Select
- End Sub
- Sub gate3_Hit:PlaySound "gate":End Sub
- Sub gatetrigger_Hit:PlaySound "gateback":End Sub
- Sub Dampen(dt,df,r) 'dt is threshold speed, df is dampen factor 0 to 1 (higher more dampening), r is randomness
- Dim dfRandomness
- r=cint(r)
- dfRandomness=INT(RND*(2*r+1))
- df=df+(r-dfRandomness)*.01
- If ABS(activeball.velx) > dt Then activeball.velx=activeball.velx*(1-df*(ABS(activeball.velx)/100))
- If ABS(activeball.vely) > dt Then activeball.vely=activeball.vely*(1-df*(ABS(activeball.vely)/100))
- End Sub
- '*************************************************
- ' destruk's new vpmCreateBall for ball collision
- ' use it: vpmCreateBall kicker
- '*************************************************
- Set vpmCreateBall = GetRef("mycreateball")
- Function mycreateball(aKicker)
- For cnt = 1 to ubound(ballStatus)
- If ballStatus(cnt) = 0 Then
- If Not IsEmpty(vpmBallImage) Then
- Set CurrentBall(cnt) = aKicker.CreateSizedBall(BSize).Image
- Else
- Set CurrentBall(cnt) = aKicker.CreateSizedBall(BSize)
- End If
- Set mycreateball = aKicker
- currentball(cnt).uservalue = cnt
- ballStatus(cnt) = 1
- ballStatus(0) = ballStatus(0) + 1
- If coff = False Then
- If ballStatus(0) > 1 and XYdata.enabled = False Then XYdata.enabled = True
- End If
- Exit For
- End If
- Next
- End Function
- '**************************************************************
- ' vpm Ball Collision based on the code by Steely & Pinball Ken
- ' added destruk's changes, ball size and height check by koadic
- '**************************************************************
- Const tnopb = 10 'max nr. of balls
- Const nosf = 10 'nr. of sound files
- ReDim CurrentBall(tnopb), BallStatus(tnopb)
- Dim iball, cnt, coff, errMessage
- XYdata.interval = 1
- coff = False
- For cnt = 0 to ubound(BallStatus):BallStatus(cnt) = 0:Next
- ' Create ball in kicker and assign a Ball ID used mostly in non-vpm tables
- Sub CreateBallID(aKicker)
- For cnt = 1 to ubound(ballStatus)
- If ballStatus(cnt) = 0 Then
- Set CurrentBall(cnt) = aKicker.CreateSizedBall(27)
- currentball(cnt).uservalue = cnt
- ballStatus(cnt) = 1
- ballStatus(0) = ballStatus(0) + 1
- If coff = False Then
- If ballStatus(0) > 1 and XYdata.enabled = False Then XYdata.enabled = True
- End If
- Exit For
- End If
- Next
- End Sub
- Sub ClearBallID
- On Error Resume Next
- iball = ActiveBall.uservalue
- currentball(iball).UserValue = 0
- If Err Then Msgbox Err.description & vbCrLf & iball
- ballStatus(iBall) = 0
- ballStatus(0) = ballStatus(0) -1
- On Error Goto 0
- End Sub
- ' Ball data collection and B2B Collision detection. jpsalas: added height check
- ReDim baX(tnopb, 4), baY(tnopb, 4), baZ(tnopb, 4), bVx(tnopb, 4), bVy(tnopb, 4), TotalVel(tnopb, 4)
- Dim cForce, bDistance, xyTime, cFactor, id, id2, id3, B1, B2
- Sub XYdata_Timer()
- xyTime = Timer + (XYdata.interval * .001)
- If id2 >= 4 Then id2 = 0
- id2 = id2 + 1
- For id = 1 to ubound(ballStatus)
- If ballStatus(id) = 1 Then
- baX(id, id2) = round(currentball(id).x, 2)
- baY(id, id2) = round(currentball(id).y, 2)
- baZ(id, id2) = round(currentball(id).z, 2)
- bVx(id, id2) = round(currentball(id).velx, 2)
- bVy(id, id2) = round(currentball(id).vely, 2)
- TotalVel(id, id2) = (bVx(id, id2) ^2 + bVy(id, id2) ^2)
- If TotalVel(id, id2) > TotalVel(0, 0) Then TotalVel(0, 0) = int(TotalVel(id, id2) )
- End If
- Next
- id3 = id2:B2 = 2:B1 = 1
- Do
- If ballStatus(B1) = 1 and ballStatus(B2) = 1 Then
- bDistance = int((TotalVel(B1, id3) + TotalVel(B2, id3) ) ^(1.04 * (CurrentBall(B1).radius + CurrentBall(B2).radius) / 50) )
- If((baX(B1, id3) - baX(B2, id3) ) ^2 + (baY(B1, id3) - baY(B2, id3) ) ^2) < (2800 * ((CurrentBall(B1).radius + CurrentBall(B2).radius) / 50) ^2) + bDistance Then
- If ABS(baZ(B1, id3) - baZ(B2, id3) ) < (CurrentBall(B1).radius + CurrentBall(B2).radius) Then collide B1, B2:Exit Sub
- End If
- End If
- B1 = B1 + 1
- If B1 = ubound(ballstatus) Then Exit Do
- If B1 >= B2 then B1 = 1:B2 = B2 + 1
- Loop
- If ballStatus(0) <= 1 Then XYdata.enabled = False
- If XYdata.interval >= 40 Then coff = True:XYdata.enabled = False
- If Timer > xyTime * 3 Then coff = True:XYdata.enabled = False
- If Timer > xyTime Then XYdata.interval = XYdata.interval + 1
- End Sub
- 'Calculate the collision force and play sound
- Dim cTime, cb1, cb2, avgBallx, cAngle, bAngle1, bAngle2
- Sub Collide(cb1, cb2)
- If TotalVel(0, 0) / 1.8 > cFactor Then cFactor = int(TotalVel(0, 0) / 1.8)
- avgBallx = (bvX(cb2, 1) + bvX(cb2, 2) + bvX(cb2, 3) + bvX(cb2, 4) ) / 4
- If avgBallx < bvX(cb2, id2) + .1 and avgBallx > bvX(cb2, id2) -.1 Then
- If ABS(TotalVel(cb1, id2) - TotalVel(cb2, id2) ) < .000005 Then Exit Sub
- End If
- If Timer < cTime Then Exit Sub
- cTime = Timer + .1
- GetAngle baX(cb1, id3) - baX(cb2, id3), baY(cb1, id3) - baY(cb2, id3), cAngle
- id3 = id3 - 1:If id3 = 0 Then id3 = 4
- GetAngle bVx(cb1, id3), bVy(cb1, id3), bAngle1
- GetAngle bVx(cb2, id3), bVy(cb2, id3), bAngle2
- cForce = Cint((abs(TotalVel(cb1, id3) * Cos(cAngle-bAngle1) ) + abs(TotalVel(cb2, id3) * Cos(cAngle-bAngle2) ) ) )
- If cForce < 4 Then Exit Sub
- cForce = Cint((cForce) / (cFactor / nosf) )
- If cForce > nosf-1 Then cForce = nosf-1
- PlaySound("fx_collide" & cForce)
- End Sub
- ' Get angle
- Dim Xin, Yin, rAngle, Radit, wAngle, Pi
- Pi = Round(4 * Atn(1), 6) '3.1415926535897932384626433832795
- Sub GetAngle(Xin, Yin, wAngle)
- If Sgn(Xin) = 0 Then
- If Sgn(Yin) = 1 Then rAngle = 3 * Pi / 2 Else rAngle = Pi / 2
- If Sgn(Yin) = 0 Then rAngle = 0
- Else
- rAngle = atn(- Yin / Xin)
- End If
- If sgn(Xin) = -1 Then Radit = Pi Else Radit = 0
- If sgn(Xin) = 1 and sgn(Yin) = 1 Then Radit = 2 * Pi
- wAngle = round((Radit + rAngle), 4)
- End Sub
- '******************************************
- ' Use RollingSoundTimer to call div subs
- '******************************************
- Sub RollingSoundTimer_Timer()
- RollingSound
- End Sub
- '****************************************
- ' JimmyFingers Enhanced Ball Rolling Script (Extension of Rascal's Original)
- '****************************************
- ReDim BRVeloY(tnopb), BRVeloX(tnopb), rolling(tnopb), rollingfast(tnopb)
- Dim b
- b = 0
- RollingSoundTimer.Interval = 60/tnopb
- Sub RollingSound()
- B = B + 1
- If B > tnopb Then B = 1
- If BallStatus(b) = 0 Then Exit Sub
- BRVeloY(b) = Cint(CurrentBall(b).VelY)
- BRVeloX(b) = Cint(CurrentBall(b).VelX)
- If((ABS(BRVeloY(b))> 3 AND (ABS(BRVeloY(b))< 10) or (ABS(BRVeloX(b) )> 3 AND (ABS(BRVeloX(b))< 10)))) Then
- If rolling(b) = True then
- Exit Sub
- Else
- If rollingfast(b) = True then
- StopSound "JF_rollingfaster"
- rollingfast(b) = False
- Else
- rolling(b) = True
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "JF_roll1"
- Case 2 : PlaySound "JF_roll2"
- Case 3 : PlaySound "JF_roll3"
- End Select
- End If
- End If
- ElseIf (ABS(BRVeloY(b) )> 10 or ABS(BRVeloX(b) )> 10) Then
- If rollingfast(b) = True then
- Exit Sub
- Else
- If rolling(b) = True then
- StopSound "JF_roll1"
- StopSound "JF_roll2"
- StopSound "JF_roll3"
- rolling(b) = False
- Else
- rollingfast(b) = True
- PlaySound "JF_rollingfaster"
- End If
- End If
- Else
- If rolling(b) = True Then
- StopSound "JF_roll1"
- StopSound "JF_roll2"
- StopSound "JF_roll3"
- rolling(b) = False
- ElseIf rollingfast(b) = True Then
- StopSound "JF_rollingfaster"
- rollingfast(b) = False
- End If
- End If
- End Sub
- Sub StopRollingSound()
- StopSound "JF_roll1"
- StopSound "JF_roll2"
- StopSound "JF_roll3"
- StopSound "JF_rollingfaster"
- End Sub
- ' ============================================================================================
- ' GNMOD - Multiple High Score Display and Collection
- ' ============================================================================================
- Dim EnteringInitials ' Normally zero, set to non-zero to enter initials
- EnteringInitials = 0
- Dim PlungerPulled
- PlungerPulled = 0
- Dim SelectedChar ' character under the "cursor" when entering initials
- Dim HSTimerCount ' Pass counter for HS timer, scores are cycled by the timer
- HSTimerCount = 5 ' Timer is initially enabled, it'll wrap from 5 to 1 when it's displayed
- Dim InitialString ' the string holding the player's initials as they're entered
- Dim AlphaString ' A-Z, 0-9, space (_) and backspace (<)
- Dim AlphaStringPos ' pointer to AlphaString, move forward and backward with flipper keys
- AlphaString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_<"
- Dim HSNewHigh ' The new score to be recorded
- Dim HSScore(5) ' High Scores read in from config file
- Dim HSName(5) ' High Score Initials read in from config file
- ' default high scores, remove this when the scores are available from the config file
- HSScore(1) = 75000
- HSScore(2) = 70000
- HSScore(3) = 60000
- HSScore(4) = 55000
- HSScore(5) = 50000
- HSName(1) = "AAA"
- HSName(2) = "ZZZ"
- HSName(3) = "XXX"
- HSName(4) = "ABC"
- HSName(5) = "BBB"
- Sub HighScoreTimer_Timer
- if EnteringInitials then
- if HSTimerCount = 1 then
- SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
- HSTimerCount = 2
- else
- SetHSLine 3, InitialString
- HSTimerCount = 1
- end if
- elseif InProgress then
- SetHSLine 1, "HIGH SCORE1"
- SetHSLine 2, HSScore(1)
- SetHSLine 3, HSName(1)
- HSTimerCount = 5 ' set so the highest score will show after the game is over
- elseif CheckAllScores then
- NewHighScore sortscores(ScoreChecker),sortplayers(ScoreChecker)
- else
- ' cycle through high scores
- HSTimerCount = HSTimerCount + 1
- if HsTimerCount > 5 then
- HSTimerCount = 1
- End If
- SetHSLine 1, "HIGH SCORE"+FormatNumber(HSTimerCount,0)
- SetHSLine 2, HSScore(HSTimerCount)
- SetHSLine 3, HSName(HSTimerCount)
- end if
- End Sub
- Function GetHSChar(String, Index)
- dim ThisChar
- dim FileName
- ThisChar = Mid(String, Index, 1)
- FileName = "PostIt"
- if ThisChar = " " or ThisChar = "" then
- FileName = FileName & "BL"
- elseif ThisChar = "<" then
- FileName = FileName & "LT"
- elseif ThisChar = "_" then
- FileName = FileName & "SP"
- else
- FileName = FileName & ThisChar
- End If
- GetHSChar = FileName
- End Function
- Sub SetHsLine(LineNo, String)
- dim Letter
- dim ThisDigit
- dim ThisChar
- dim StrLen
- dim LetterLine
- dim Index
- dim StartHSArray
- dim EndHSArray
- dim LetterName
- dim xfor
- StartHSArray=array(0,1,12,22)
- EndHSArray=array(0,11,21,31)
- StrLen = len(string)
- Index = 1
- for xfor = StartHSArray(LineNo) to EndHSArray(LineNo)
- Eval("HS"&xfor).image = GetHSChar(String, Index)
- Index = Index + 1
- next
- End Sub
- Sub NewHighScore(NewScore, PlayNum)
- if NewScore > HSScore(5) then
- HighScoreTimer.interval = 500
- HSTimerCount = 1
- AlphaStringPos = 1 ' start with first character "A"
- EnteringInitials = 1 ' intercept the control keys while entering initials
- InitialString = "" ' initials entered so far, initialize to empty
- SetHSLine 1, "PLAYER "+FormatNumber(PlayNum,0)
- SetHSLine 2, "ENTER NAME"
- SetHSLine 3, MID(AlphaString, AlphaStringPos, 1)
- HSNewHigh = NewScore
- For xx=1 to HighScoreReward
- AddSpecial
- next
- End if
- ScoreChecker=ScoreChecker-1
- if ScoreChecker=0 then
- CheckAllScores=0
- end if
- End Sub
- Sub CollectInitials(keycode)
- If keycode = LeftFlipperKey Then
- ' back up to previous character
- AlphaStringPos = AlphaStringPos - 1
- if AlphaStringPos < 1 then
- AlphaStringPos = len(AlphaString) ' handle wrap from beginning to end
- if InitialString = "" then
- ' Skip the backspace if there are no characters to backspace over
- AlphaStringPos = AlphaStringPos - 1
- End if
- end if
- SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
- PlaySound "DropTargetDropped"
- elseif keycode = RightFlipperKey Then
- ' advance to next character
- AlphaStringPos = AlphaStringPos + 1
- if AlphaStringPos > len(AlphaString) or (AlphaStringPos = len(AlphaString) and InitialString = "") then
- ' Skip the backspace if there are no characters to backspace over
- AlphaStringPos = 1
- end if
- SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
- PlaySound "DropTargetDropped"
- elseif keycode = StartGameKey or keycode = PlungerKey Then
- SelectedChar = MID(AlphaString, AlphaStringPos, 1)
- if SelectedChar = "_" then
- InitialString = InitialString & " "
- PlaySound("Ding10")
- elseif SelectedChar = "<" then
- InitialString = MID(InitialString, 1, len(InitialString) - 1)
- if len(InitialString) = 0 then
- ' If there are no more characters to back over, don't leave the < displayed
- AlphaStringPos = 1
- end if
- PlaySound("Ding100")
- else
- InitialString = InitialString & SelectedChar
- PlaySound("Ding10")
- end if
- if len(InitialString) < 3 then
- SetHSLine 3, InitialString & SelectedChar
- End If
- End If
- if len(InitialString) = 3 then
- ' save the score
- for i = 5 to 1 step -1
- if i = 1 or (HSNewHigh > HSScore(i) and HSNewHigh <= HSScore(i - 1)) then
- ' Replace the score at this location
- if i < 5 then
- ' MsgBox("Moving " & i & " to " & (i + 1))
- HSScore(i + 1) = HSScore(i)
- HSName(i + 1) = HSName(i)
- end if
- ' MsgBox("Saving initials " & InitialString & " to position " & i)
- EnteringInitials = 0
- HSScore(i) = HSNewHigh
- HSName(i) = InitialString
- HSTimerCount = 5
- HighScoreTimer_Timer
- HighScoreTimer.interval = 2000
- PlaySound("Ding1000")
- exit sub
- elseif i < 5 then
- ' move the score in this slot down by 1, it's been exceeded by the new score
- ' MsgBox("Moving " & i & " to " & (i + 1))
- HSScore(i + 1) = HSScore(i)
- HSName(i + 1) = HSName(i)
- end if
- next
- End If
- End Sub
- ' END GNMOD
- ' ============================================================================================
- ' GNMOD - New Options menu
- ' ============================================================================================
- Dim EnteringOptions
- Dim CurrentOption
- Dim OptionCHS
- Dim MaxOption
- Dim OptionHighScorePosition
- Dim XOpt
- Dim StartingArray
- Dim EndingArray
- StartingArray=Array(0,1,2,30,33,61,89,117,145,173,201,229)
- EndingArray=Array(0,1,29,32,60,88,116,144,172,200,228,256)
- EnteringOptions = 0
- MaxOption = 9
- OptionCHS = 0
- OptionHighScorePosition = 0
- Const OptionLinesToMark="111100011"
- Const OptionLine1="" 'do not use this line
- Const OptionLine2="" 'do not use this line
- Const OptionLine3="" 'do not use this line
- Const OptionLine4="Extra Ball Light Frequency"
- Const OptionLine5=""
- Const OptionLine6=""
- Const OptionLine7=""
- Const OptionLine8="" 'do not use this line
- Const OptionLine9="" 'do not use this line
- Sub OperatorMenuTimer_Timer
- OperatorMenuBackdrop.image = "OperatorMenu"
- EnteringOptions = 1
- OptionCHS = 0
- CurrentOption = 1
- DisplayAllOptions
- OperatorOption1.image = "BluePlus"
- SetHighScoreOption
- End Sub
- Sub DisplayAllOptions
- dim linecounter
- dim tempstring
- For linecounter = 1 to MaxOption
- tempstring=Eval("OptionLine"&linecounter)
- Select Case linecounter
- Case 1:
- tempstring=tempstring + FormatNumber(BallsPerGame,0)
- SetOptLine 1,tempstring
- Case 2:
- if Replay3Table(ReplayLevel)=999000 then
- tempstring = tempstring + FormatNumber(Replay1Table(ReplayLevel),0) + "/" + FormatNumber(Replay2Table(ReplayLevel),0)
- else
- tempstring = tempstring + FormatNumber(Replay1Table(ReplayLevel),0) + "/" + FormatNumber(Replay2Table(ReplayLevel),0) + "/" + FormatNumber(Replay3Table(ReplayLevel),0)
- end if
- SetOptLine 2,tempstring
- Case 3:
- If OptionCHS=0 then
- tempstring = "NO"
- else
- tempstring = "YES"
- end if
- SetOptLine 3,tempstring
- Case 4:
- SetOptLine 4, tempstring
- if ExtraBallFrequency=0 then
- tempstring = "Conservative"
- else
- tempstring = "Liberal"
- end if
- SetOptLine 5, tempstring
- Case 5:
- SetOptLine 6, tempstring
- SetOptLine 7, tempstring
- Case 6:
- SetOptLine 8, tempstring
- SetOptLine 9, tempstring
- Case 7:
- SetOptLine 10, tempstring
- SetOptLine 11, tempstring
- Case 8:
- Case 9:
- End Select
- next
- end sub
- sub MoveArrow
- do
- CurrentOption = CurrentOption + 1
- If CurrentOption>Len(OptionLinesToMark) then
- CurrentOption=1
- end if
- loop until Mid(OptionLinesToMark,CurrentOption,1)="1"
- end sub
- sub CollectOptions(ByVal keycode)
- if Keycode = LeftFlipperKey then
- PlaySound "DropTargetDropped"
- For XOpt = 1 to MaxOption
- Eval("OperatorOption"&XOpt).image = "PostitBL"
- next
- MoveArrow
- if CurrentOption<8 then
- Eval("OperatorOption"&CurrentOption).image = "BluePlus"
- elseif CurrentOption=8 then
- Eval("OperatorOption"&CurrentOption).image = "GreenCheck"
- else
- Eval("OperatorOption"&CurrentOption).image = "RedX"
- end if
- elseif Keycode = RightFlipperKey then
- PlaySound "DropTargetDropped"
- if CurrentOption = 1 then
- If BallsPerGame = 3 then
- BallsPerGame = 5
- else
- BallsPerGame = 3
- end if
- DisplayAllOptions
- elseif CurrentOption = 2 then
- ReplayLevel=ReplayLevel+1
- If ReplayLevel>ReplayTableMax then
- ReplayLevel=1
- end if
- DisplayAllOptions
- elseif CurrentOption = 3 then
- if OptionCHS = 0 then
- OptionCHS = 1
- else
- OptionCHS = 0
- end if
- DisplayAllOptions
- elseif CurrentOption = 4 then
- ExtraBallFrequency=ExtraBallFrequency+1
- if ExtraBallFrequency>1 then
- ExtraBallFrequency=0
- end if
- DisplayAllOptions
- elseif CurrentOption = 8 or CurrentOption = 9 then
- if OptionCHS=1 then
- HSScore(1) = 75000
- HSScore(2) = 70000
- HSScore(3) = 60000
- HSScore(4) = 55000
- HSScore(5) = 50000
- HSName(1) = "AAA"
- HSName(2) = "ZZZ"
- HSName(3) = "XXX"
- HSName(4) = "ABC"
- HSName(5) = "BBB"
- end if
- if CurrentOption = 8 then
- savehs
- else
- loadhs
- end if
- OperatorMenuBackdrop.image = "PostitBL"
- For XOpt = 1 to MaxOption
- Eval("OperatorOption"&XOpt).image = "PostitBL"
- next
- For XOpt = 1 to 256
- Eval("Option"&XOpt).image = "PostItBL"
- next
- RefreshReplayCard
- InstructCard.image="IC"+FormatNumber(BallsPerGame,0)
- EnteringOptions = 0
- end if
- end if
- End Sub
- Sub SetHighScoreOption
- End Sub
- Function GetOptChar(String, Index)
- dim ThisChar
- dim FileName
- ThisChar = Mid(String, Index, 1)
- FileName = "PostIt"
- if ThisChar = " " or ThisChar = "" then
- FileName = FileName & "BL"
- elseif ThisChar = "<" then
- FileName = FileName & "LT"
- elseif ThisChar = "_" then
- FileName = FileName & "SP"
- elseif ThisChar = "/" then
- FileName = FileName & "SL"
- elseif ThisChar = "," then
- FileName = FileName & "CM"
- else
- FileName = FileName & ThisChar
- End If
- GetOptChar = FileName
- End Function
- Sub SetOptLine(LineNo, String)
- dim xfor
- dim Letter
- dim ThisDigit
- dim ThisChar
- dim StrLen
- dim LetterLine
- dim Index
- dim LetterName
- StrLen = len(string)
- Index = 1
- for xfor = StartingArray(LineNo) to EndingArray(LineNo)
- Eval("Option"&xfor).image = GetOptChar(string, Index)
- Index = Index + 1
- next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment