Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '############################################################################################
- '############################################################################################
- '####### ########
- '####### Quijote ########
- '####### (Juegos Populares 1987) ########
- '####### ########
- '############################################################################################
- '############################################################################################
- ' Version 1.0 FS mfuegemann 2016
- '
- ' Thanks to:
- ' Akiles for the playfield and plastics images
- ' Zany for the flipper and clear tube models and textures
- ' Fuzzel for providing the images for the playfield lights
- option Explicit
- 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
- '-----------------------------------
- '------ Global Cofigurations ------
- '-----------------------------------
- Const cGameName="pimbal" 'name of ROM file to be used, Quijote was re-release under the name Pimball or Pinball3000
- Const DimGI=20 'set between -100 and 105 to dim or brighten GI lights (minus is darker)
- Const OutlanePostsHard = True 'switch between the Hard and Easy Outlane Post setting
- Const ApronMatch = True 'show Match animation on Apron
- Const FreePlay = True 'add a coin on StartGame
- P_Apron.image = "Apron_Quijote_ESP" 'enable the apron version, You want
- 'P_Apron.image = "Apron_Quijote_EN"
- 'P_Apron.image = "Apron_Pimball_ESP"
- 'P_Apron.image = "Apron_Pimball_EN"
- Const UseSolenoids=1,UseLamps=1,SSolenoidOn="SolOn",SSolenoidOff="SolOff",SCoin="coin3",SFlipperOn="",SFlipperOff=""
- LoadVPM "01560000","juegos.vbs",3.2
- '-----------------------------------
- '------ Solenoid Assignment ------
- '-----------------------------------
- SolCallback(7) ="Sol7"
- SolCallback(8) ="Sol8"
- 'SolCallback(10)="Sol10" 'Drop Target Bank2 - some of the solenoids are not working as intended
- 'SolCallback(13)="Sol13" 'Drop Target Bank
- 'SolCallback(14)="Sol14" 'Left Hole VUK
- SolCallback(15)="vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
- 'SolCallback(16)="bsTrough.SolOut"
- 'SolCallback(sLLFlipper)="vpmSolFlipper LeftFlipper,Nothing,"
- 'SolCallback(sLRFlipper)="vpmSolFlipper RightFlipper,Nothing,"
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFXDOF("FlipperUp",101,DOFOn,DOFFlippers):LeftFlipper.RotateToEnd
- Else
- PlaySound SoundFXDOF("FlipperDown",101,DOFOff,DOFFlippers):LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFXDOF("FlipperUp",102,DOFOn,DOFFlippers):RightFlipper.RotateToEnd
- Else
- PlaySound SoundFXDOF("FlipperDown",102,DOFOff,DOFFlippers):RightFlipper.RotateToStart
- End If
- End Sub
- Sub Sol7(enabled)
- FlipperActive = Enabled
- End Sub
- Sub Sol8(enabled)
- LampSol8.state = abs(enabled)
- LampSol8a.state = abs(enabled)
- End Sub
- 'Handled via correponding lights
- '
- 'Sub Sol10(enabled)
- ' if enabled then
- ' DTBank2Timer.enabled = False
- ' DropTargetBank2.DropSol_On
- ' end if
- 'End Sub
- 'Sub Sol13(enabled)
- ' if enabled then
- ' DTBank1Timer.enabled = False
- ' DropTargetBank.DropSol_On
- ' end if
- 'End Sub
- 'Sub Sol14(enabled)
- ' if enabled then
- ' LHole.destroyball
- ' Controller.Switch(23)=0
- ' LHoleUp.createball
- ' LHoleUp.kick 180,10
- ' end if
- 'End Sub
- '--------------------------
- '------ Table Init ------
- '--------------------------
- Dim bsTrough,obj,bsRightHole,bsLeftHole,DropTargetBank,DropTargetBank2,Flipperactive,cCaptive,MultiBall
- Sub Quijote_Init
- if not ApronMatch then
- For each obj in MatchObjects
- obj.TransZ = -10
- Next
- end if
- if OutlanePostsHard then
- RightPost_Hard.isdropped = False
- RightPost_Easy.isdropped = True
- P_RightPost.TransY = -30
- LeftPost_Hard.isdropped = False
- LeftPost_Easy.isdropped = True
- P_LeftPost.TransY = -27
- else
- RightPost_Hard.isdropped = True
- RightPost_Easy.isdropped = False
- P_RightPost.TransY = 0
- LeftPost_Hard.isdropped = True
- LeftPost_Easy.isdropped = False
- P_LeftPost.TransY = 0
- end if
- LSling_1.WidthTop = 0
- LSling_1.WidthBottom = 0
- LSling_2.WidthTop = 0
- LSling_2.WidthBottom = 0
- LSling_3.WidthTop = 0
- LSling_3.WidthBottom = 0
- Sling1.isdropped = True
- Sling2.isdropped = True
- Sling3.isdropped = True
- RSling_1.WidthTop = 0
- RSling_1.WidthBottom = 0
- RSling_2.WidthTop = 0
- RSling_2.WidthBottom = 0
- RSling_3.WidthTop = 0
- RSling_3.WidthBottom = 0
- RSling1.isdropped = True
- RSling2.isdropped = True
- RSling3.isdropped = True
- Sling1.isdropped = True
- Sling2.isdropped = True
- Sling3.isdropped = True
- vpminit me
- Controller.GameName=cGameName
- Controller.SplashInfoLine="Quijote" & vbNewLine & "created by mfuegemann"
- Controller.HandleKeyboard=False
- Controller.ShowTitle=0
- Controller.ShowFrame=0
- Controller.ShowDMDOnly=1
- 'Controller.Hidden = 1 'enable to hide DMD if You use a B2S backglass
- ' 'DMD position for 3 Monitor Setup
- ' 'Controller.Games(cGameName).Settings.Value("dmd_pos_x")=3850 'set this to 0 if You cannot find the DMD
- ' 'Controller.Games(cGameName).Settings.Value("dmd_pos_y")=300 'set this to 0 if You cannot find the DMD
- ' 'Controller.Games(cGameName).Settings.Value("dmd_width")=505
- ' 'Controller.Games(cGameName).Settings.Value("dmd_height")=155
- ' 'Controller.Games(cGameName).Settings.Value("rol")=0
- '
- ' 'Controller.Games(cGameName).Settings.Value("ddraw") = 0 'set to 0 if You have problems with DMD showing or table stutter
- Controller.HandleMechanics=0
- Controller.Run
- If Err Then MsgBox Err.Description
- On Error Goto 0
- PinMAMETimer.Interval=PinMAMEInterval
- PinMAMETimer.Enabled = true
- Multiball = False
- vpmNudge.TiltSwitch=30
- vpmNudge.Sensitivity=5
- vpmNudge.TiltObj = Array(LeftFlipper,RightFlipper)
- vpmMapLights AllLights
- Set bsTrough=New cvpmBallStack
- bsTrough.InitSw 0,24,0,0,0,0,0,0 '0.1 = Switch 0
- bsTrough.InitKick BallRelease,90,5
- bsTrough.InitExitSnd SoundFX("BallRel",DOFContactors),SoundFX("Solenoid",DOFContactors)
- bsTrough.Balls=1
- 'add 2nd Ball
- Kicker1.createball
- Kicker1.kick 120,1
- set DropTargetBank = new cvpmDropTarget
- DropTargetBank.InitDrop Array(DT1,DT2,DT3), Array(6,7,8)
- DropTargetBank.InitSnd SoundFX("Targetdrop1",DOFContactors),SoundFX("TargetBankreset1",DOFContactors)
- DropTargetBank.CreateEvents "DropTargetBank"
- set DropTargetBank2 = new cvpmDropTarget
- DropTargetBank2.InitDrop Array(DT4,DT5,DT6), Array(3,4,5)
- DropTargetBank2.InitSnd SoundFX("Targetdrop1",DOFContactors),SoundFX("TargetBankreset1",DOFContactors)
- DropTargetBank2.CreateEvents "DropTargetBank2"
- Set cCaptive=New cvpmCaptiveBall
- cCaptive.InitCaptive CaptiveTrigger,CaptiveWall,CaptiveKicker,2
- cCaptive.Start
- cCaptive.ForceTrans = 1
- cCaptive.MinForce = 3
- cCaptive.CreateEvents "cCaptive"
- For each obj in GIFlashers
- obj.Alpha = obj.Alpha + DimGI
- Next
- GIStartTimer.enabled = True
- End Sub
- Sub Quijote_Exit()
- Controller.Pause = False
- Controller.Stop
- End Sub
- '------------------------------
- '------ Trough Handler ------
- '------------------------------
- Sub DrainEnter_Hit
- Controller.Switch(25)=1
- End Sub
- Sub DrainEnter_UnHit
- Controller.Switch(25)=0
- End Sub
- Sub Drain_Hit()
- SoundTimer.enabled = False
- StopAllSounds
- Multiball = False
- Wall.isdropped = False
- bsTrough.AddBall Me
- playsound "Drain5"
- End Sub
- '-------------------------------
- '------ Keybord Handler ------
- '-------------------------------
- Sub Quijote_KeyDown(ByVal keycode)
- If keycode = PlungerKey Then
- Plunger.PullBack
- End If
- if FlipperActive then
- If keycode = LeftFlipperKey Then
- controller.switch(84) = 1
- PlaySound SoundFX("FlipperUp_Akiles",DOFContactors),0,0.7,-0.1,0.25
- End If
- If keycode = RightFlipperKey Then
- controller.switch(82) = 1
- PlaySound SoundFX("FlipperUp_Akiles",DOFContactors),0,0.7,0.1,0.25
- End If
- end if
- if FreePlay and keycode = Startgamekey then
- vpmtimer.pulsesw 28
- end if
- If vpmKeyDown(KeyCode) Then Exit Sub
- End Sub
- Sub Quijote_KeyUp(ByVal keycode)
- If keycode = PlungerKey Then
- Plunger.Fire
- End If
- If keycode = LeftFlipperKey Then
- controller.switch(84) = 0
- if FlipperActive then
- PlaySound SoundFX("FlipperDown_Akiles",DOFContactors),0,0.7,-0.1,0.25
- end if
- End If
- If keycode = RightFlipperKey Then
- controller.switch(82) = 0
- if FlipperActive then
- PlaySound SoundFX("FlipperDown_Akiles",DOFContactors),0,0.7,0.1,0.25
- end if
- End If
- If vpmKeyUp(KeyCode) Then Exit Sub
- End Sub
- '------------------------------
- '------ Switch Handler ------
- '------------------------------
- Sub RHole_Hit:Controller.Switch(22)=1:SoundTimer.enabled = False:StopAllSounds:Playsound "soloff",0,1,0,0.1:End Sub
- Sub LHole_Hit:Controller.Switch(23)=1:SoundTimer.enabled = False:StopAllSounds:Playsound "soloff",0,1,-0.15,0.1:End Sub
- Sub LeftSlingshot_Slingshot:LeftSlingshot.timerenabled = True:vpmTimer.PulseSw 12:PlaySound SoundFX("Slingshot_Akiles",DOFContactors),0,0.7,-0.3,0.1:End Sub
- Sub RightSlingshot_Slingshot:RightSlingshot.timerenabled = True:vpmTimer.PulseSw 13:PlaySound SoundFX("Slingshot_Akiles",DOFContactors),0,0.7,0.3,0.1:End Sub
- Dim Bumper1_Dir,Bumper2_Dir,Bumper3_Dir
- Sub Bumper1_Hit
- vpmTimer.PulseSw 14
- Playsound SoundFX("Bumper",DOFContactors),0,1,0,0.25
- Bumper1_Dir = -1
- Bumper1.Timerenabled = False
- Bumper1.Timerenabled = True
- End Sub
- Sub Bumper2_Hit
- vpmTimer.PulseSw 15
- Playsound SoundFX("Bumper",DOFContactors),0,1,0.03,0.25
- Bumper2_Dir = -1
- Bumper2.Timerenabled = False
- Bumper2.Timerenabled = True
- End Sub
- Sub Bumper3_Hit
- vpmTimer.PulseSw 16
- Playsound SoundFX("Bumper",DOFContactors),0,1,0.03,0.25
- Bumper3_Dir = -1
- Bumper3.Timerenabled = False
- Bumper3.Timerenabled = True
- End Sub
- Sub Spinner_Spin:vpmTimer.PulseSw 17:Playsound "soloff",0,0.2,-0.08,0.1:End Sub
- sub LOutlane_hit:Controller.Switch(1)=1:P_LOutlane.TransZ=-8:End Sub
- sub LOutlane_unhit:Controller.Switch(1)=0:LOutlane.timerenabled=True:End Sub
- sub LInlane_hit:Controller.Switch(1)=1:P_LInlane.TransZ=-8:End Sub
- sub LInlane_unhit:Controller.Switch(1)=0:LInlane.timerenabled=True:End Sub
- sub ROutlane_hit:Controller.Switch(2)=1:P_ROutlane.TransZ=-8:End Sub
- sub ROutlane_unhit:Controller.Switch(2)=0:ROutlane.timerenabled=True:End Sub
- sub RInlane_hit:Controller.Switch(2)=1:P_RInlane.TransZ=-8:End Sub
- sub RInlane_unhit:Controller.Switch(2)=0:RInlane.timerenabled=True:End Sub
- sub RInlane_unhit:Controller.Switch(2)=0:RInlane.timerenabled=True:End Sub
- Sub RightTarget_hit:vpmTimer.PulseSw 20:MoveRightTarget:Playsound SoundFX("Target1",DOFTargets),0,1,0.15,0.1:End Sub
- Sub CenterTarget_hit:vpmTimer.PulseSw 19:MoveCenterTarget:Playsound SoundFX("Target1",DOFTargets),0,1,0,0.1:End Sub
- Sub LeftTarget_hit:vpmTimer.PulseSw 21:MoveLeftTarget:Playsound SoundFX("Target1",DOFTargets),0,1,-0.18,0.1:End Sub
- Sub CaptiveTarget_hit:vpmTimer.PulseSw 33:MoveCaptiveTarget:Playsound SoundFX("Target1",DOFTargets),0,1,0.15,0.1:End Sub
- 'Top Rollover
- sub TopRollover_Left_hit:Controller.Switch(11)=1:P_T1.TransZ=-8:End Sub
- sub TopRollover_Left_unhit:Controller.Switch(11)=0:TopRollover_Left.timerenabled=True:End Sub
- sub TopRollover_Center_hit:Controller.Switch(10)=1:P_T2.TransZ=-8:End Sub
- sub TopRollover_Center_unhit:Controller.Switch(10)=0:TopRollover_Center.timerenabled=True:End Sub
- sub TopRollover_Right_hit:Controller.Switch(9)=1:P_T3.TransZ=-8:End Sub
- sub TopRollover_Right_unhit:Controller.Switch(9)=0:TopRollover_Right.timerenabled=True:End Sub
- Sub Rubber1_hit:vpmTimer.PulseSw 18:playsound "bump",0,0.5,-0.18,0.25:End Sub
- Sub Rubber2_hit:vpmTimer.PulseSw 18:playsound "bump",0,0.5,-0.1,0.25:End Sub
- Sub Rubber3_hit:vpmTimer.PulseSw 18:playsound "bump",0,0.5,0.15,0.25:End Sub
- '--------------------------------
- '------ Helper Functions ------
- '--------------------------------
- Sub RampTrigger_Hit
- if MultiBall and (RHole.BallCntOver>0) then
- Controller.Switch(22)=0
- RHole.Timerenabled = True
- RHole.kick 280,15
- End If
- End Sub
- 'Bumper Rings
- Sub Bumper1_Timer
- P_BumperRing1.TransZ = P_BumperRing1.TransZ + Bumper1_Dir * 2.5
- if P_BumperRing1.TransZ <= -30 then Bumper1_Dir = 1
- if P_BumperRing1.TransZ >= 0 then
- Bumper1.Timerenabled = False
- Bumper1_Dir = 0
- end if
- End Sub
- Sub Bumper2_Timer
- P_BumperRing2.TransZ = P_BumperRing2.TransZ + Bumper2_Dir * 2.5
- if P_BumperRing2.TransZ <= -30 then Bumper2_Dir = 1
- if P_BumperRing2.TransZ >= 0 then
- Bumper2.Timerenabled = False
- Bumper2_Dir = 0
- end if
- End Sub
- Sub Bumper3_Timer
- P_BumperRing3.TransZ = P_BumperRing3.TransZ + Bumper3_Dir * 2.5
- if P_BumperRing3.TransZ <= -30 then Bumper3_Dir = 1
- if P_BumperRing3.TransZ >= 0 then
- Bumper3.Timerenabled = False
- Bumper3_Dir = 0
- end if
- End Sub
- 'Slingshot animation
- Dim LCount,RCount
- Sub LeftSlingshot_Timer
- LCount = Lcount + 1
- select case LCount
- case 1:
- LSling_1.WidthTop = 0
- LSling_1.WidthBottom = 0
- LSling_2.WidthTop = 0
- LSling_2.WidthBottom = 0
- LSling_3.WidthTop = 9
- LSling_3.WidthBottom = 9
- case 2:
- LSling_1.WidthTop = 0
- LSling_1.WidthBottom = 0
- LSling_2.WidthTop = 9
- LSling_2.WidthBottom = 9
- LSling_3.WidthTop = 0
- LSling_3.WidthBottom = 0
- case 3:
- LSling_1.WidthTop = 9
- LSling_1.WidthBottom = 9
- LSling_2.WidthTop = 0
- LSling_2.WidthBottom = 0
- LSling_3.WidthTop = 0
- LSling_3.WidthBottom = 0
- case 4:
- LeftSlingshot.timerenabled = False
- LCount = 0
- LSling_1.WidthTop = 0
- LSling_1.WidthBottom = 0
- LSling_2.WidthTop = 0
- LSling_2.WidthBottom = 0
- LSling_3.WidthTop = 0
- LSling_3.WidthBottom = 0
- end select
- Sling0.isdropped = (LCount <> 0)
- Sling1.isdropped = (LCount <> 3)
- Sling2.isdropped = (LCount <> 2)
- Sling3.isdropped = (LCount <> 1)
- End Sub
- Sub RightSlingshot_Timer
- RCount = RCount + 1
- select case RCount
- case 1:
- RSling_1.WidthTop = 0
- RSling_1.WidthBottom = 0
- RSling_2.WidthTop = 0
- RSling_2.WidthBottom = 0
- RSling_3.WidthTop = 9
- RSling_3.WidthBottom = 9
- case 2:
- RSling_1.WidthTop = 0
- RSling_1.WidthBottom = 0
- RSling_2.WidthTop = 9
- RSling_2.WidthBottom = 9
- RSling_3.WidthTop = 0
- RSling_3.WidthBottom = 0
- case 3:
- RSling_1.WidthTop = 9
- RSling_1.WidthBottom = 9
- RSling_2.WidthTop = 0
- RSling_2.WidthBottom = 0
- RSling_3.WidthTop = 0
- RSling_3.WidthBottom = 0
- case 4:
- RightSlingshot.timerenabled = False
- RCount = 0
- RSling_1.WidthTop = 0
- RSling_1.WidthBottom = 0
- RSling_2.WidthTop = 0
- RSling_2.WidthBottom = 0
- RSling_3.WidthTop = 0
- RSling_3.WidthBottom = 0
- end select
- RSling0.isdropped = (RCount <> 0)
- RSling1.isdropped = (RCount <> 3)
- RSling2.isdropped = (RCount <> 2)
- RSling3.isdropped = (RCount <> 1)
- End Sub
- ' Gates
- Sub Gate_Hit:PlaySound "Gate5",0,1,0.1,0.1:End Sub
- Sub Gate8_Hit:PlaySound "Gate5",0,1,-0.05,0.1:End Sub
- Sub RGate_Hit:PlaySound "Gate1",0,0.2,0.15,0.1:MoveRGate:End Sub
- Sub LGate_Hit:PlaySound "Gate1",0,0.2,-0.15,0.1:MoveLGate:End Sub
- Sub CGate_Hit:PlaySound "Gate1",0,0.2,0,0.1:MoveCGate:End Sub
- Sub MoveRGate
- P_RGate.Rotx = -90
- RGate.timerenabled = True
- End Sub
- Sub RGate_Timer
- P_RGate.Rotx = P_RGate.Rotx + 5
- if P_RGate.Rotx > -5 then
- P_RGate.Rotx = 0
- RGate.timerenabled = False
- end if
- end Sub
- Sub MoveLGate
- P_LGate.Rotx = -90
- LGate.timerenabled = True
- End Sub
- Sub LGate_Timer
- P_LGate.Rotx = P_LGate.Rotx + 5
- if P_LGate.Rotx > -5 then
- P_LGate.Rotx = 0
- LGate.timerenabled = False
- end if
- end Sub
- Sub MoveCGate
- P_CGate.Rotx = -90
- CGate.timerenabled = True
- End Sub
- Sub CGate_Timer
- P_CGate.Rotx = P_CGate.Rotx + 5
- if P_CGate.Rotx > -5 then
- P_CGate.Rotx = 0
- CGate.timerenabled = False
- end if
- end Sub
- 'additional Lamp Callback
- Sub LampTimer_Timer
- MLight.state = abs(Multiball)
- 'DT1 Reset FallBack
- if Controller.lamp(2) then
- if not DTBank2GraceTimer.enabled then
- DTBank2Timer.enabled = True
- end if
- end if
- 'DT2 Reset FallBack
- if Controller.lamp(18) then
- if not DTBank1GraceTimer.enabled then
- DTBank1Timer.enabled = True
- End If
- end if
- if Controller.lamp(38) and not controller.lamp(25) then
- Lamp38.state = Lightstateon
- Lamp38a.state = Lightstateon
- else
- Lamp38.state = Lightstateoff
- Lamp38a.state = Lightstateoff
- end if
- if Controller.lamp(89) or Multiball then
- Lamp89.state = Lightstateon
- else
- Lamp89.state = Lightstateoff
- end if
- 'Right Hole
- if Controller.lamp(97) and (RHole.BallCntOver>0) then
- if not RHole.Timerenabled then
- Controller.Switch(22)=0
- RHole.Timerenabled = True
- RHole.kick 280,15
- Playsound SoundFX("Popper",DOFContactors),0,1,0,0.2
- end if
- end if
- 'Left Hole VUK
- if Controller.lamp(19) and (LHole.BallCntOver>0) then
- if not LHole.Timerenabled then
- Controller.Switch(23)=0
- LHole.Timerenabled = True
- LHole.destroyball
- Playsound SoundFX("Popper",DOFContactors),0,1,-0.15,0.2
- LHoleUp.createball
- LHoleUp.kick 180,7
- end if
- end if
- 'Ball Release
- if Controller.lamp(50) then
- if not BallRelease.Timerenabled then
- Wall.Timerenabled = False
- Wall.isdropped = True
- BallRelease.Timerenabled = True
- if RHole.BallCntOver>0 then
- if not Multiball then
- Multiball = True
- Wall.Timerenabled = False
- Wall.isdropped = True
- end if
- end if
- bsTrough.ExitSol_On
- DOF 105, DOFPulse
- end if
- end if
- 'Multiball
- if Controller.lamp(89) and (RHole.BallCntOver>0) then
- if not Multiball then
- Multiball = True
- Wall.Timerenabled = False
- Wall.isdropped = True
- bsTrough.ExitSol_On
- end if
- end if
- if controller.lamp(44) then
- L44Flasher.isvisible = True
- L44bFlasher.isvisible = True
- else
- L44Flasher.isvisible = False
- L44bFlasher.isvisible = False
- end if
- 'Match Lights
- if controller.lamp(113) then
- P_L113.image = "JP_Bulb_lit"
- else
- P_L113.image = "JP_Bulb"
- end if
- if controller.lamp(114) then
- P_L114.image = "JP_Bulb_lit"
- else
- P_L114.image = "JP_Bulb"
- end if
- if controller.lamp(115) then
- P_L115.image = "JP_Bulb_lit"
- else
- P_L115.image = "JP_Bulb"
- end if
- if controller.lamp(116) then
- P_L116.image = "JP_Bulb_lit"
- else
- P_L116.image = "JP_Bulb"
- end if
- if controller.lamp(117) then
- P_L117.image = "JP_Bulb_lit"
- else
- P_L117.image = "JP_Bulb"
- end if
- if controller.lamp(118) then
- P_L118.image = "JP_Bulb_lit"
- else
- P_L118.image = "JP_Bulb"
- end if
- if controller.lamp(119) then
- P_L119.image = "JP_Bulb_lit"
- else
- P_L119.image = "JP_Bulb"
- end if
- if controller.lamp(120) then
- P_L120.image = "JP_Bulb_lit"
- else
- P_L120.image = "JP_Bulb"
- end if
- if controller.lamp(121) then '00
- P_L121.image = "JP_Bulb_lit"
- else
- P_L121.image = "JP_Bulb"
- end if
- if controller.lamp(122) then
- P_L122.image = "JP_Bulb_lit"
- else
- P_L122.image = "JP_Bulb"
- end if
- 'GI Lights
- if controller.lamp(65) then
- P_L65.image = "JP_Bulb_lit"
- L65Flasher.isvisible = True
- else
- P_L65.image = "JP_Bulb"
- L65Flasher.isvisible = False
- end if
- if controller.lamp(66) then
- P_L66.image = "JP_Bulb_lit"
- L66Flasher.isvisible = True
- else
- P_L66.image = "JP_Bulb"
- L66Flasher.isvisible = False
- end if
- if controller.lamp(67) then
- P_L67.image = "JP_Bulb_lit"
- L67Flasher.isvisible = True
- else
- P_L67.image = "JP_Bulb"
- L67Flasher.isvisible = False
- end if
- if controller.lamp(68) then
- P_L68.image = "JP_Bulb_lit"
- L68Flasher.isvisible = True
- else
- P_L68.image = "JP_Bulb"
- L68Flasher.isvisible = False
- end if
- if controller.lamp(69) then
- P_L69.image = "JP_Bulb_lit"
- L69Flasher.isvisible = True
- else
- P_L69.image = "JP_Bulb"
- L69Flasher.isvisible = False
- end if
- if controller.lamp(70) then
- P_L70.image = "JP_Bulb_lit"
- L70Flasher.isvisible = True
- else
- P_L70.image = "JP_Bulb"
- L70Flasher.isvisible = False
- end if
- if controller.lamp(71) then
- P_L71.image = "JP_Bulb_lit"
- L71Flasher.isvisible = True
- else
- P_L71.image = "JP_Bulb"
- L71Flasher.isvisible = False
- end if
- if controller.lamp(72) then
- P_L72.image = "JP_Bulb_lit"
- L72Flasher.isvisible = True
- else
- P_L72.image = "JP_Bulb"
- L72Flasher.isvisible = False
- end if
- if Controller.lamp(74) or FlipperActive then
- P_Bumpercap1.image = "JP_Bumper_lit"
- P_Bumper1.image = "Bumper_Yellow"
- BumperFlasher1.isvisible = True
- BumperFlasher1b.isvisible = True
- else
- P_Bumpercap1.image = "JP_Bumper"
- P_Bumper1.image = "Bumper_Yellow_dark"
- BumperFlasher1.isvisible = False
- BumperFlasher1b.isvisible = False
- end if
- if Controller.lamp(75) or FlipperActive then
- P_Bumpercap2.image = "JP_Bumper_lit"
- P_Bumper2.image = "Bumper_Yellow"
- BumperFlasher2.isvisible = True
- BumperFlasher2b.isvisible = True
- else
- P_Bumpercap2.image = "JP_Bumper"
- P_Bumper2.image = "Bumper_Yellow_dark"
- BumperFlasher2.isvisible = False
- BumperFlasher2b.isvisible = False
- end if
- if Controller.lamp(76) or FlipperActive then
- P_Bumpercap3.image = "JP_Bumper_lit"
- P_Bumper3.image = "Bumper_Yellow"
- BumperFlasher3.isvisible = True
- BumperFlasher3b.isvisible = True
- else
- P_Bumpercap3.image = "JP_Bumper"
- P_Bumper3.image = "Bumper_Yellow_dark"
- BumperFlasher3.isvisible = False
- BumperFlasher3b.isvisible = False
- end if
- if Controller.lamp(78) or FlipperActive then
- LeftSlingFlasher1.isvisible = True
- LeftSlingFlasher2.isvisible = True
- LeftSlingFlasher3.isvisible = True
- else
- LeftSlingFlasher1.isvisible = False
- LeftSlingFlasher2.isvisible = False
- LeftSlingFlasher3.isvisible = False
- end if
- if Controller.lamp(79) or FlipperActive then
- RightSlingFlasher1.isvisible = True
- RightSlingFlasher2.isvisible = True
- RightSlingFlasher3.isvisible = True
- else
- RightSlingFlasher1.isvisible = False
- RightSlingFlasher2.isvisible = False
- RightSlingFlasher3.isvisible = False
- end if
- End sub
- Sub DTBank1Timer_Timer
- DTBank1Timer.enabled = False
- DTBank1GraceTimer.enabled = True
- DropTargetBank.DropSol_On
- DOF 104, DOFPulse
- End Sub
- Sub DTBank1GraceTimer_Timer
- DTBank1GraceTimer.enabled = False
- End Sub
- Sub DTBank2Timer_Timer
- DTBank2Timer.enabled = False
- DTBank2GraceTimer.enabled = True
- DropTargetBank2.DropSol_On
- DOF 103, DOFPulse
- End Sub
- Sub DTBank2GraceTimer_Timer
- DTBank2GraceTimer.enabled = False
- End Sub
- Sub BallRelease_Timer
- BallRelease.Timerenabled = False
- End Sub
- Sub LHole_Timer
- LHole.Timerenabled = False
- End Sub
- Sub RHole_Timer
- RHole.Timerenabled = False
- End Sub
- Sub Wall_Timer
- Wall.Timerenabled = False
- Wall.isdropped = False
- End Sub
- 'Rollover Switches
- sub TopRollover_Left_Timer
- TopRollover_Left.timerenabled = False
- P_T1.TransZ = 0
- End Sub
- sub TopRollover_Center_Timer
- TopRollover_Center.timerenabled = False
- P_T2.TransZ = 0
- End Sub
- sub TopRollover_Right_Timer
- TopRollover_Right.timerenabled = False
- P_T3.TransZ = 0
- End Sub
- sub LOutlane_Timer
- LOutlane.timerenabled = False
- P_LOutlane.TransZ = 0
- End Sub
- sub LInlane_Timer
- LInlane.timerenabled = False
- P_LInlane.TransZ = 0
- End Sub
- sub ROutlane_Timer
- ROutlane.timerenabled = False
- P_ROutlane.TransZ = 0
- End Sub
- sub RInlane_Timer
- RInlane.timerenabled = False
- P_RInlane.TransZ = 0
- End Sub
- 'Targets
- Sub MoveLeftTarget
- P_LeftTarget.Transy = 5
- LeftTarget.Timerenabled = False
- LeftTarget.Timerenabled = True
- End Sub
- Sub LeftTarget_Timer
- LeftTarget.Timerenabled = False
- P_LeftTarget.Transy = 0
- End Sub
- Sub MoveCenterTarget
- P_CenterTarget.Transy = 5
- CenterTarget.Timerenabled = False
- CenterTarget.Timerenabled = True
- End Sub
- Sub CenterTarget_Timer
- CenterTarget.Timerenabled = False
- P_CenterTarget.Transy = 0
- End Sub
- Sub MoveRightTarget
- P_RightTarget.Transy = 5
- RightTarget.Timerenabled = False
- RightTarget.Timerenabled = True
- End Sub
- Sub RightTarget_Timer
- RightTarget.Timerenabled = False
- P_RightTarget.Transy = 0
- End Sub
- Sub MoveCaptiveTarget
- P_CaptiveTarget.Transy = 5
- CaptiveTarget.Timerenabled = False
- CaptiveTarget.Timerenabled = True
- End Sub
- Sub CaptiveTarget_Timer
- CaptiveTarget.Timerenabled = False
- P_CaptiveTarget.Transy = 0
- End Sub
- 'Start GI
- Sub GIStartTimer_Timer
- GIStartTimer.enabled = False
- For each obj in GIFlashers
- obj.isvisible = True
- Next
- End Sub
- 'Flipper Primitives and Drop Targets
- sub FlipperTimer_Timer()
- pleftFlipper.objrotz=leftFlipper.CurrentAngle
- prightFlipper.objrotz=rightFlipper.CurrentAngle
- if DT1.isdropped then
- P_DT1.TransY = -60
- else
- P_DT1.TransY = 0
- end if
- if DT2.isdropped then
- P_DT2.TransY = -60
- else
- P_DT2.TransY = 0
- end if
- if DT3.isdropped then
- P_DT3.TransY = -60
- else
- P_DT3.TransY = 0
- end if
- if DT4.isdropped then
- P_DT4.TransY = -60
- else
- P_DT4.TransY = 0
- end if
- if DT5.isdropped then
- P_DT5.TransY = -60
- else
- P_DT5.TransY = 0
- end if
- if DT6.isdropped then
- P_DT6.TransY = -60
- else
- P_DT6.TransY = 0
- end if
- end sub
- ' DIP switch menu
- Sub editDips
- Dim vpmDips:Set vpmDips=New cvpmDips
- With vpmDips
- .AddForm 200,280,"Quijote DIP switches"
- .AddFrame 0, 0,270,"Balls per game",&H00000400,Array("3 balls",0,"5 balls",&H00000400)
- .AddChk 5,50,270,Array("Match feature",32768)
- .AddFrame 0,75,270,"Replay threshold (Credit/extra ball/credit)",&H00000300,Array("2.0M/5.6M/7.0M points",&H00000300,"2.0M/3.2M/4.8M points",&H00000200,"2.0M/2.8M/3.6M points",0,"2.0M/2.6M/3.8M points",&H00000100)
- .AddChk 5,155,270,Array("Enable replay extra ball",&H00000008)
- .AddLabel 0,180,280,20,"After hitting OK, press F3 to reset game with new settings."
- .ViewDips
- End With
- End Sub
- Set vpmShowDips=GetRef("editDips")
- '-----------------------------
- '------ Sound Handler ------
- '-----------------------------
- Dim SoundActive,BallVel,Flying,SoundBall,OnRamp,WireRamp,Panning,BallXPos
- Const TableWidth = 965 'used for sound panning, enter the value specified in table options "Table Width"
- Const PanningFactor = 0.7 'panning factor 0..1, 1 = left speaker off, if ball is rightmost and vice versa, 0 = no panning
- Const SoundVel = 10 'sound is played if ball velocity is above this threshold
- Sub SoundTimer_Timer
- BallXPos = SoundBall.X
- if BallXPos < 0 then BallXPos = 0 'boundary check
- if BallXPos > TableWidth then BallXPos = Tablewidth
- Panning = ((2 * BallXPos / TableWidth) - 1) * PanningFactor 'scale the X position of the ball to the interval [-1,1]
- BallVel = SQR((SoundBall.velx^2) + (SoundBall.vely^2)) 'calculating the speed vector within the X/Y plane only once per timer call
- if SoundActive = 0 then 'play new sounds only after the current sound has ended
- if BallVel > SoundVel then 'if velocity exceeds the threshold a sound will be played
- SoundActive = 1
- if OnRamp = 1 then
- if WireRamp = 1 then 'Ball is on a wire ramp
- PlaySound "WireRamp1",1,1,Panning,0.25
- else 'Ball is on a normal ramp
- PlaySound "Ballroll3",1,1,Panning,0.25
- end if
- else 'Ball is on the playfield, sound will be played as a loop
- PlaySound "roll1",-1,1,Panning,0.35
- end if
- end if
- Exit Sub
- else
- if BallVel < SoundVel then 'Sound is active and ball velocity drops below the threshold --> stop any sound active
- StopAllSounds 'sound stopped so a new sound can be started
- end if
- end if
- End Sub
- Sub LeaveTubeVUK_Hit
- StopAllSounds
- WireRamp = True
- OnRamp = True
- Set SoundBall = Activeball 'Ball-assignment
- SoundTimer.enabled = True
- Playsound "WireRamp1",0,1,0,0.2
- End Sub
- Sub RampEnter_Hit
- StopAllSounds
- WireRamp = True
- OnRamp = True
- End Sub
- Sub LeaveCenterHole_Hit
- StopAllSounds
- Set SoundBall = Activeball 'Ball-assignment
- SoundTimer.enabled = True
- End Sub
- Sub RampEnd_Hit
- StopAllSounds
- End Sub
- Sub RampEnd2_Hit
- StopAllSounds
- End Sub
- Sub StopAllSounds()
- WireRamp = False
- OnRamp = False
- SoundActive = 0
- StopSound "roll1"
- StopSound "WireRamp1"
- StopSound "Ballroll3"
- StopSound "Ballroll2"
- End Sub
- Sub ShooterLaneLaunch_Hit
- if ActiveBall.vely < -6 then playsound SoundFX("Launch",DOFContactors),0,1,0.25,0.25
- Set SoundBall = Activeball 'Ball-assignment
- SoundTimer.enabled = True
- End Sub
- ' *********************************************************************
- ' Supporting Ball & Sound Functions
- ' *********************************************************************
- Sub Rubber_Walls_hit (idx)
- if soundtimer.enabled then
- playsound "bump",0,Vol(SoundBall),Pan(SoundBall),0.25
- end if
- End Sub
- Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
- Vol = Csng(BallVel ^2 / 500)
- if Vol > 1 then
- Vol = 1
- end if
- if Vol < 0.2 then
- Vol = 0.2
- end if
- End Function
- Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "JunkYard" is the name of the table
- Dim tmp
- tmp = (ball.x * 2 / Quijote.width)-1
- If tmp> 0 Then
- Pan = Csng(tmp ^10)
- Else
- Pan = Csng(-((- tmp) ^10) )
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment