Outhere

JUNGLE QUEEN (Gottlieb 1977 [4Player version] 1.1.0

Apr 27th, 2021
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 68.91 KB | None | 0 0
  1. '----------------------------
  2. 'JUNGLE QUEEN (Gottlieb 1977)
  3. '----------------------------
  4. 'VP 9,15^ - FS, B2S script
  5. 'a starman recreation - November 2013 - V 1.0.0
  6. '----------------------------------------------
  7.  
  8. '+ analog plunger support (Thanks to koadic!)
  9.  
  10. Option Explicit
  11. Randomize
  12.  
  13.  
  14. Const BallSize = 50
  15. Const BallMass = 1.7
  16.  
  17. ExecuteGlobal GetTextFile("core.vbs")
  18. ExecuteGlobal GetTextFile("b2s.vbs")
  19.  
  20. On Error Resume Next
  21. ExecuteGlobal GetTextFile("Controller.vbs")
  22. If Err Then MsgBox "Unable to open Controller.vbs. Ensure that it is in the scripts folder."
  23. On Error Goto 0
  24.  
  25. Const cGameName = "JungleQueen"
  26. Dim Controller
  27. Set Controller = CreateObject("B2S.Server")
  28. Controller.B2SName = "Jungle_Queen"
  29. Controller.Run
  30. Dim B2SOn
  31.  
  32. ResetB2SData 0, 49, 0
  33.  
  34. Dim Tablename
  35. Dim GameOver, GameInProgress, Started, Tilt, OldTilt, NewTilt, TiltSwing
  36. Dim i,x,y,z
  37. Dim RingAni(2)
  38. Dim PCount, PTime, plungerIM
  39. Dim Score(4), Players, Currentplayer, PU, Points, sTsd, sHdd, sHdd2
  40. Dim BIP, Balls, aBall, maxBalls, LastBall
  41. Dim Bonus, DoubleBonus, BonusCounted, Credits
  42. Dim FirstGame, GameCount
  43. Dim EB, EBReady, SpecialReady, Rep1(4), Rep2(4), Rep3(4)
  44. Dim HighScore3, HighScore5, PreScore1, PreScore2, PreScore3, PreScore4
  45. Dim Score1000K, Score100K, Score10K, ScoreK, Score100, Score10, ScoreUnit
  46. Dim Matchnumber
  47. Dim h3s, h3s1000K, h3s100K, h3s10k, h3sK, h3s100, h3s10, h3sUnit
  48. Dim h5s, h5s1000K, h5s100K, h5s10k, h5sK, h5s100, h5s10, h5sUnit
  49. Dim PreScore1000K, PreScore100K, PreScore10K, PreScoreK, PreScore100, PreScore10, PreScoreUnit
  50. Dim Cup, mHole, mKickL, mKickR, BOn, Blink
  51. Dim BRoll, KVar, BallSpeed, Speedx, Speedy, FinalSpeed
  52. Dim ScoreDT(4), ScoreReel
  53.  
  54.  
  55. Const FiveBalls = False'True'False'True'False '(select True for 5-balls or False for 3-balls per game)
  56. Const IMPowerSetting = 48
  57. Const IMTime = 0.8
  58.  
  59. Sub Table_Init()
  60. TableName = "JungleQueen"
  61. LoadEM
  62. LoadData()
  63. On Error Resume Next
  64.  
  65. ' Impulse Plunger
  66. Set plungerIM = New cvpmImpulseP
  67. With plungerIM
  68. .InitImpulseP swplunger, IMPowerSetting, IMTime
  69. .Random 0.0
  70. .InitExitSnd "", "PRelease"
  71. .CreateEvents "plungerIM"
  72. End With
  73.  
  74. Set mKickL = New cvpmMagnet
  75. With mKickL
  76. .InitMagnet GrabL, 3.5
  77. .GrabCenter = 0
  78. .MagnetOn = 1
  79. .CreateEvents "mKickL"
  80. End With
  81.  
  82. Set mKickR = New cvpmMagnet
  83. With mKickR
  84. .InitMagnet GrabR, 3.5
  85. .GrabCenter = 0
  86. .MagnetOn = 1
  87. .CreateEvents "mKickR"
  88. End With
  89. TextGC.Text = GameCount
  90. GameOver = True : Controller.B2SSetGameover 1 : dtgameover.state=1
  91. Started = False
  92. For i = 1 To 4 : Score(i) = 0 : Next
  93. Players = 0 : CurrentPlayer = 1 : PU = 0 : Controller.B2SSetPlayerUp PU : Setpup : Controller.B2SSetCanPlay Players
  94. BIP = 0 : maxBalls = True
  95. EB = False : SpecialReady = True : EBReady = True
  96. DropOff()
  97. Bonus = 0 : BonusCounted = True : BonusText.Text = Bonus
  98. Blink = 0
  99. If FiveBalls = True Then
  100. LightBalls1.State = 1 : LightBalls2.State = 1 : Balls = 5 : updatehs
  101. Else
  102. LightBalls1.State = 0 : LightBalls2.State = 0 : Balls = 3 : updatehs
  103. End If
  104. BOn = False
  105. LastBall = False
  106. Tilt = False : NewTilt = 0 : OldTilt = 0 : TiltSwing = 0 : Controller.B2SSetTilt 0
  107. BumperAttTimer.Enabled = True
  108. TimerFade.Enabled = True
  109. AllLampsOff
  110. UpdatePreScore : UpdateMatch : UpdateCredits
  111. FirstGame = True
  112. BallsText.Text = fiveballs
  113. SetB2SData 31,0
  114. Controller.B2SSetCredits Credits
  115. CoinReel.SetValue Credits
  116.  
  117. If table.showDT=True Then
  118. dim dtobj
  119. dim fsobj
  120. for each dtobj in DTHS : dtobj.visible = 1 : next
  121. for each fsobj in FSHS : fsobj.visible = 0 : next
  122.  
  123. else
  124.  
  125. for each dtobj in DTHS : dtobj.visible = 0 : next
  126. for each fsobj in FSHS : fsobj.visible = 1 : next
  127. End If
  128.  
  129. End Sub
  130.  
  131. Sub Table_KeyDown(ByVal keycode)
  132.  
  133. If Keycode = StartGameKey And Players <4 And Credits > 0 And maxBalls = True Then
  134.  
  135. If TimerPUP.Enabled = False Then
  136. Players = Players + 1 : Playsound"Added" : Controller.B2SSetCanPlay Players : SetPlayers
  137. Credits = Credits - 1 : UpdateCredits : CoinReel.SetValue Credits
  138. Else
  139. Playsound"Tilt"
  140. End If
  141. If Started = False And GameOver = True Then
  142. Started = True
  143. AllLampsOn
  144. GameOver = False : Controller.B2SSetGameover 0 : dtgameover.state=0
  145. If Players > 1 Then PU = PU + 1 : Controller.B2SSetPlayerUp PU : TimerPUP.Enabled = False : Else TimerPUP.Enabled = True:PU = 1 : SetPup
  146. Controller.B2SSetScoreRolloverPlayer1 0 : P1ScoreRoll.state=0
  147. Controller.B2SSetScoreRolloverPlayer2 0 : P2ScoreRoll.state=0
  148. Controller.B2SSetScoreRolloverPlayer3 0 : P3ScoreRoll.state=0
  149. Controller.B2SSetScoreRolloverPlayer4 0 : P4ScoreRoll.state=0
  150. For i = 1 To 4
  151. Score(i) = 0
  152. Controller.B2SSetScorePlayer i, 0
  153. Next
  154. For i = 1 To 4 : Rep1(i) = False : Next
  155. For i = 1 To 4 : Rep2(i) = False : Next
  156. For i = 1 To 4 : Rep3(i) = False : Next
  157. ScoreDT1.ResetToZero
  158. ScoreDT2.ResetToZero
  159. ScoreDT3.ResetToZero
  160. ScoreDT4.ResetToZero
  161.  
  162.  
  163. StepB2SData 0, 23, 0, 2, 180,"reels"
  164. SetB2SData 33,11
  165. SetB2SData 24,0 : SetB2SData 25,0 : SetB2SData 26,0 : SetB2SData 27,0
  166. Bonus = 0 : BonusCounted = True : DoubleBonus = False
  167. BIP = 0' : UpdateBIP
  168. MatchNumber = 11 : UpdateMatch
  169. EB = False : SpecialReady = True : EBReady = True
  170. LastBall = False
  171. FirstGame = False
  172. GameCount = GameCount + 1 : TextGC.Text = GameCount
  173. TimerFade.Enabled = True
  174. LightReset() : TargetReset()
  175. KickerRelease.TimerInterval = 6500 : KickerRelease.TimerEnabled = True
  176. TimerBall.Enabled = True : TimerBall.Interval = 6500
  177. If FiveBalls = False Then Playsound"initialize" : DOF 113, 2 Else Playsound"initialize"
  178. BallsText.Text = Balls
  179. End If
  180. End If
  181.  
  182. If Keycode = AddCreditKey And Credits < 15 And TimerCoin.Enabled = False Then Playsound"Coin" : TimerCoin.Enabled = True
  183.  
  184. If keycode = PlungerKey Then
  185. Plunger.Pullback
  186. PlaysoundAt "PlungerPull", plunger
  187. End If
  188.  
  189. If keycode = LeftFlipperKey And GameOver = False Then
  190. If Tilt = False Then
  191. DOF 101, 1
  192. PlaySoundAt SoundFX("FLLUp", DOFFlippers), LeftFlipper
  193. LeftFlipper.EOSTorque = 0.75:LeftFlipper.RotateToEnd
  194. LeftFlipper1.EOSTorque = 0.75:LeftFlipper1.RotateToEnd
  195. Stopsound"Fliptric"
  196. Playsound"Fliptric",-1
  197. End If
  198. End If
  199.  
  200. If keycode = RightFlipperKey And GameOver = False Then
  201. If Tilt = False Then
  202. DOF 102, 1
  203. PlaySoundAt SoundFX("FLRUp", DOFFlippers), RightFlipper
  204. RightFlipper.EOSTorque = 0.75:RightFlipper.RotateToEnd
  205. RightFlipper1.EOSTorque = 0.75:RightFlipper1.RotateToEnd
  206. Stopsound"Fliptric"
  207. Playsound"Fliptric",-1
  208. End If
  209. End If
  210.  
  211. If keycode = LeftTiltKey Then Nudge 90, 1.4 : TiltCheck()
  212. If keycode = RightTiltKey Then Nudge 270, 1.4 : TiltCheck()
  213. If keycode = CenterTiltKey Then Nudge 0, 1.8 : TiltCheck()
  214.  
  215. End Sub
  216.  
  217. Sub Table_KeyUp(ByVal keycode)
  218.  
  219. If keycode = PlungerKey Then
  220. Plunger.Fire
  221. PlaysoundAt "Plunger", Plunger
  222. End If
  223.  
  224. If keycode = LeftFlipperKey Then
  225. DOF 101, 0
  226. PlaySoundAt SoundFX("FLLDown", DOFFlippers), LeftFlipper
  227. LeftFlipper.EOSTorque = 0.1:LeftFlipper.RotateToStart
  228. LeftFlipper1.EOSTorque = 0.1:LeftFlipper1.RotateToStart
  229. Stopsound"Fliptric"
  230. End If
  231.  
  232. If keycode = RightFlipperKey Then
  233. DOF 102, 0
  234. PlaySoundAt SoundFX("FLLDown", DOFFlippers), RightFlipper
  235. RightFlipper.EOSTorque = 0.1:RightFlipper.RotateToStart
  236. RightFlipper1.EOSTorque = 0.1:RightFlipper1.RotateToStart
  237. Stopsound"Fliptric"
  238. End If
  239.  
  240. End Sub
  241.  
  242. Sub TimerPUP_Timer
  243. PU = PU + 1
  244. If PU = 5 Then PU = 1 : Me.Enabled = False : If Players > 1 Then PU = PU + 1 : Controller.B2SSetPlayerUp PU : Else PU = 1 : Controller.B2SSetPlayerUp PU : SetPup
  245. Select Case PU
  246. Case 1: Controller.B2SSetPlayerUp PU : SetPup
  247. Case 2: Controller.B2SSetPlayerUp PU : SetPup
  248. Case 3: Controller.B2SSetPlayerUp PU : SetPup
  249. Case 4: Controller.B2SSetPlayerUp PU : SetPup
  250. Case 5: PU = 1 : If Players > 1 Then PU = PU + 1 : Controller.B2SSetPlayerUp PU : : SetPup : Else PU = 1 : Controller.B2SSetPlayerUp PU : SetPup
  251. End Select
  252. TextPU.Text = PU
  253. End Sub
  254.  
  255. Sub TimerFlRot_Timer
  256. LFP.RotAndTra2=LeftFlipper.CurrentAngle
  257. RFP.RotAndTra2=RightFlipper.CurrentAngle
  258. End Sub
  259.  
  260. Sub TimerCoin_Timer
  261. Credits = Credits + 1 : UpdateCredits
  262. Playsound"AddCredit"
  263. Me.Enabled = False
  264. End Sub
  265.  
  266. '---------------- Plunger animation + analog support ------------------
  267. '-------------------- Thanks to jpsalas + koadic ----------------------
  268.  
  269. Dim PTop, PBottom, PTopY, PBottomY, PBottom2, PBottomY2, PBottom3, PBottomY3
  270.  
  271. ' Set PTop = P1.CreatesizedBall (26) : PTop.Image = "plA" : PTopY = PTop.Y
  272. ' Set PBottom = P2.CreatesizedBall (26) : PBottom.Image = "plB" : PBottomY = PBottom.Y
  273. ' Set PBottom2 = P3.CreatesizedBall (26) : PBottom2.Image = "plC" : PBottomY2 = PBottom2.Y
  274. ' Set PBottom3 = P4.CreatesizedBall (26) : PBottom3.Image = "plD" : PBottomY3 = PBottom3.Y
  275.  
  276. ' Sub PTimer_Timer
  277. ' If Pcount < 14 Then
  278. ' Pcount = Pcount + 1
  279. ' PTop.Y = PTop.Y + Pcount
  280. ' PBottom.Y = PBottom.Y + Pcount
  281. ' PBottom2.Y = PBottom2.Y + Pcount
  282. ' PBottom3.Y = PBottom3.Y + Pcount
  283. ' Else
  284. ' Me.Enabled = 0
  285. ' End If
  286. ' End Sub
  287. '
  288. ' Sub PTimer2_Timer
  289. ' Select Case Pcount
  290. ' Case 0:PTop.Y = PTopY : PBottom.Y = PBottomY : PBottom2.Y = PBottomY2 : PBottom3.Y = PBottomY3
  291. ' Case 1:PTop.Y = PTop.Y + 6 : PBottom.Y = PBottom.Y + 6 : PBottom2.Y = PBottom2.Y + 6
  292. ' Case 2:PTop.Y = PTop.Y + 6 : PBottom.Y = PBottom.Y + 6 : PBottom2.Y = PBottom2.Y + 6 : PBottom3.Y = PBottom3.Y + 6
  293. ' Case 3:PTop.Y = PTopY : PBottom.Y = PBottomY : PBottom3.Y = PBottomY3
  294. ' Case 4:Me.Enabled = 0 : Pcount = 0
  295. ' End Select
  296. '
  297. ' Pcount = Pcount + 1
  298. ' End Sub
  299. '
  300. 'Dim PlungerPos,oPlungerPos,PlungerPos2,PlungerPos3,PowerSetting,plcount
  301. '
  302. 'Sub Plunger_Timer()
  303. ' PlungerPos=INT(Plunger.Position)
  304. ' If Plunger.Position < 2 and PlungerPos3 > 5 Then
  305. ' PowerSetting = PlungerIM.Strength
  306. ' PlungerIM.Strength = (PlungerPos3/25*PlungerIM.Strength)
  307. ' PlungerIM.AutoFire
  308. ' PlungerIM.Strength = PowerSetting
  309. ' PlungerPos2 = 0
  310. ' PTimer2.Enabled = 1
  311. ' plcount = 1
  312. ' End If
  313. ' PTop.Y = PTopY+INT(PlungerPos)*3
  314. ' PBottom.Y = PBottomY+INT(PlungerPos)*3
  315. ' If plcount mod 5 = 0 Then PlungerPos2=Plunger.Position : plcount = 0
  316. ' oPlungerPos=PlungerPos:PlungerPos3=PlungerPos2:plcount = plcount + 1
  317. 'End Sub
  318.  
  319. '-----------------------------------------------------------------------
  320.  
  321. Sub TimerTilt_Timer()
  322. Tiltswing = (Tiltswing / 6) * 5
  323. If Tiltswing < 0.001 Then Tiltswing = 0 : TimerTilt.Enabled = False
  324. End Sub
  325.  
  326. Sub Tiltcheck()
  327. TimerTilt.Enabled = True
  328. If Newtilt = Oldtilt Then
  329. Tiltswing = Tiltswing + 0.40 : Playsound"NudgeA"
  330. Else
  331. Tiltswing = Tiltswing + 0.25 : Playsound"NudgeB"
  332. End If
  333. Oldtilt = Newtilt
  334. If Tiltswing > 1 And GameOver = False And Tilt = False Then
  335. Tilt = True : BumperOff() : Controller.B2SSetTilt 1 : AllLampsOff
  336. LeftFlipper.RotateToStart : RightFlipper.RotateToStart : Playsound"FLLDown"
  337. LeftFlipper1.RotateToStart : RightFlipper1.RotateToStart : Playsound"FLRDown"
  338. Playsound"Tilt"
  339. End If
  340. End Sub
  341.  
  342. Sub CheckSpeed
  343. SpeedX = BallSpeed.velx: SpeedY = BallSpeed.vely
  344. FinalSpeed = SQR(BallSpeed.velx * BallSpeed.velx + BallSpeed.vely * BallSpeed.vely)
  345. End Sub
  346.  
  347. Sub DropOff
  348. BR1On.WidthBottom = 0 : BR1On.WidthTop = 0 : Abs(LightAniBR1.State -1)
  349. BR2On.WidthBottom = 0 : BR2On.WidthTop = 0 : Abs(LightAniBR2.State -1)
  350. BBOn.WidthBottom = 0 : BBOn.WidthTop = 0 : Abs(LightAniBB.State -1)
  351. BR1Ring1.IsDropped = True : BR1Ring2.IsDropped = True : BR1Ring3.IsDropped = True
  352. BR2Ring1.IsDropped = True : BR2Ring2.IsDropped = True : BR2Ring3.IsDropped = True
  353. BBRing1.IsDropped = True : BBRing2.IsDropped = True : BBRing3.IsDropped = True
  354. End Sub
  355.  
  356. Sub Drain_Hit()
  357. ' DOF 112, 2
  358. Drain.DestroyBall
  359. BonusCount
  360. PlaySound "Drain"
  361. Controller.B2SSetBallInPlay 0 : BallInPlay.state=0
  362. End Sub
  363.  
  364. Sub TimerNewBall_Timer
  365. GameInProgress = False
  366. Tilt = False : Controller.B2SSetTilt 0
  367. If Balls = 1 And CurrentPlayer = Players And EB = False Then
  368. GameOver = True : Playsound"Reset" : TimernClose.Enabled = True : AllLampsOff
  369. P1ScoreRoll.state=0
  370. P2ScoreRoll.state=0
  371. P3ScoreRoll.state=0
  372. P4ScoreRoll.state=0
  373.  
  374. Else
  375. If EB = True Then KickerRelease.TimerInterval = 1000 : KickerRelease.TimerEnabled = True
  376. If EB = False Then
  377. KickerRelease.TimerInterval = 1000 : KickerRelease.TimerEnabled = True
  378. If CurrentPlayer = Players Then
  379. PU = PU - CurrentPlayer : Controller.B2SSetPlayerUp PU : SetPup
  380. UpdateScore
  381. CurrentPlayer = 1 : Balls = Balls - 1 : maxBalls = False
  382. TimerBall.Enabled = True
  383. Else
  384. UpdateScore
  385. CurrentPlayer = CurrentPlayer + 1 : UpdateBIP
  386. End If
  387. PU = PU + 1 : Controller.B2SSetPlayerUp PU : SetPup
  388. TargetReset()
  389. BumperReset()
  390. LightReset()
  391. BOn = False
  392. Bonus = 0 : BonusCounted = True : DoubleBonus = False
  393. End If
  394. End If
  395. UpdateBIP
  396. Me.Enabled = False
  397. End Sub
  398.  
  399. Sub TimerBall_Timer
  400. If EB = False Then BIP = BIP + 1 : BallsText.Text = Balls
  401. UpdateBIP
  402. Me.Enabled = False : Me.Interval = 1000
  403. End Sub
  404.  
  405. Sub KickerRelease_Timer
  406. Set BallSpeed = KickerRelease.Createsizedball(29.2)
  407. CheckSpeed
  408. BumperAttTimer.Enabled = True
  409. If EB = True Then
  410. SetLamp 32,1 : SetB2SData 35, 1
  411. TargetReset()
  412. BumperReset()
  413. LightReset()
  414. BOn = False
  415. Bonus = 0 : BonusCounted = True : DoubleBonus = False
  416. UpdateBIP
  417. End If
  418. CenterOut.Enabled = True
  419. 'KickerRelease.Kick 90,8 : Playsound"BallRel" : DOF 112, 2 : GameInProgress = True
  420. KickerRelease.Kick 90,8 : PlaySound SoundFX("BallRel", DOFContactors) : DOF 112, 2 : GameInProgress = True
  421. Me.TimerEnabled = False
  422. End Sub
  423.  
  424. Sub AddScore(Points)
  425. If GameInProgress = False Or Tilt = True Then Exit Sub
  426. Score(CurrentPlayer) = Score(CurrentPlayer) + Points
  427. if Score(CurrentPlayer)=>99000 then
  428. If PU=1 Then
  429. Controller.B2SSetScoreRolloverPlayer1 1 : P1ScoreRoll.state=1
  430. End If
  431. If PU=2 Then
  432. Controller.B2SSetScoreRolloverPlayer2 1 : P2ScoreRoll.state=1
  433. End If
  434.  
  435. If PU=3 Then
  436. Controller.B2SSetScoreRolloverPlayer3 1 : P3ScoreRoll.state=1
  437. End If
  438.  
  439. If PU=4 Then
  440. Controller.B2SSetScoreRolloverPlayer4 1 : P4ScoreRoll.state=1
  441. End If
  442. End If
  443. Controller.B2SSetScorePlayer PU, Score(CurrentPlayer)
  444.  
  445. If PU=1 then ScoreDT1.AddValue(Points)
  446. If PU=2 then ScoreDT2.AddValue(Points)
  447. If PU=3 then ScoreDT3.AddValue(Points)
  448. If PU=4 then ScoreDT4.AddValue(Points)
  449.  
  450. UpdateScore
  451. CheckReplay()
  452.  
  453. End Sub
  454.  
  455. Sub TimerScoreTsd_Timer
  456. If GameInProgress = False Or Tilt = True Then Exit Sub
  457. Me.Interval = 75
  458. Score(CurrentPlayer) = Score(CurrentPlayer) + Points
  459. UpdateScore
  460. If PU=1 then ScoreDT1.AddValue(Points)
  461. If PU=2 then ScoreDT2.AddValue(Points)
  462. If PU=3 then ScoreDT3.AddValue(Points)
  463. If PU=4 then ScoreDT4.AddValue(Points)
  464. sTsd = sTsd+1
  465. If sTsd >5 Then sTsd = 0 : Me.Enabled = False
  466. Select Case sTsd
  467. Case 1: AddScore 1000 : UpdateScore : Playsound SoundFX("1000A", DOFChimes) : DOF 131, 2 : Me.Interval = 100 : BumperReset() : BumperAttTimer.Interval = 150 : BumperAttTimer.Enabled = True : Playsound"Switch4"
  468. Case 2: AddScore 1000 : UpdateScore : Playsound SoundFX("1000B", DOFChimes) : DOF 131, 2 : Me.Interval = 75
  469. Case 3: AddScore 1000 : UpdateScore : Playsound SoundFX("1000A", DOFChimes) : DOF 131, 2' : Me.Interval = 75
  470. Case 4: AddScore 1000 : UpdateScore : Playsound SoundFX("1000B", DOFChimes) : DOF 131, 2 : Me.Interval = 75
  471. Case 5: AddScore 1000 : UpdateScore : Playsound SoundFX("1000A", DOFChimes) : DOF 131, 2 : Me.Interval = 75 : BumperReset2()
  472. End Select
  473. CheckReplay()
  474. End Sub
  475.  
  476. Sub TimerScoreHdd_Timer
  477. If GameInProgress = False Or Tilt = True Then Exit Sub
  478. Me.Interval = 75
  479. Score(CurrentPlayer) = Score(CurrentPlayer) + Points
  480. UpdateScore
  481. If PU=1 then ScoreDT1.AddValue(Points)
  482. If PU=2 then ScoreDT2.AddValue(Points)
  483. If PU=3 then ScoreDT3.AddValue(Points)
  484. If PU=4 then ScoreDT4.AddValue(Points)
  485. sHdd = sHdd+1
  486. If sHdd >5 Then sHdd = 0 : Me.Enabled = False
  487. Select Case sHdd
  488. Case 1: AddScore 100 : UpdateScore : Playsound SoundFX("100A", DOFChimes) : DOF 130, 2 : Me.Interval = 100 : BumperReset() : Playsound"Switch4"
  489. Case 2: AddScore 100 : UpdateScore : Playsound SoundFX("100B", DOFChimes) : DOF 130, 2 : Me.Interval = 75
  490. Case 3: AddScore 100 : UpdateScore : Playsound SoundFX("100A", DOFChimes) : DOF 130, 2' : Me.Interval = 75
  491. Case 4: AddScore 100 : UpdateScore : Playsound SoundFX("100B", DOFChimes) : DOF 130, 2 : Me.Interval = 75
  492. Case 5: AddScore 100 : UpdateScore : Playsound SoundFX("100A", DOFChimes) : DOF 130, 2 : Me.Interval = 75 : BumperReset2()
  493. End Select
  494. CheckReplay()
  495. End Sub
  496.  
  497. Sub TimerScoreHdd2_Timer
  498. If GameInProgress = False Or Tilt = True Then Exit Sub
  499. Me.Interval = 75
  500. Score(CurrentPlayer) = Score(CurrentPlayer) + Points
  501. UpdateScore
  502. If PU=1 then ScoreDT1.AddValue(Points)
  503. If PU=2 then ScoreDT2.AddValue(Points)
  504. If PU=3 then ScoreDT3.AddValue(Points)
  505. If PU=4 then ScoreDT4.AddValue(Points)
  506.  
  507. sHdd2 = sHdd2+1
  508. If sHdd2 >5 Then sHdd2 = 0 : Me.Enabled = False
  509. Select Case sHdd2
  510. Case 1: AddScore 100 : UpdateScore : Playsound SoundFX("100A", DOFChimes) : DOF 130, 2 : Me.Interval = 100 : BumperReset() : Playsound"Switch4"
  511. Case 2: AddScore 100 : UpdateScore : Playsound SoundFX("100B", DOFChimes) : DOF 130, 2 : Me.Interval = 75
  512. Case 3: AddScore 100 : UpdateScore : Playsound SoundFX("100A", DOFChimes) : DOF 130, 2' : Me.Interval = 75
  513. Case 4: AddScore 100 : UpdateScore : Playsound SoundFX("100B", DOFChimes) : DOF 130, 2 : Me.Interval = 75
  514. Case 5: AddScore 100 : UpdateScore : Playsound SoundFX("100A", DOFChimes) : DOF 130, 2 : Me.Interval = 75 : BumperReset2()
  515. End Select
  516. CheckReplay()
  517. End Sub
  518.  
  519. Sub CheckReplay()
  520. If FiveBalls = True Then
  521. If Score(CurrentPlayer) + Points => 100000 And Rep1(CurrentPlayer) = False Then Special() : Rep1(CurrentPlayer) = True
  522. If Score(CurrentPlayer) + Points => 140000 And Rep2(CurrentPlayer) = False Then Special() : Rep2(CurrentPlayer) = True
  523. If Score(CurrentPlayer) + Points => 180000 And Rep3(CurrentPlayer) = False Then Special() : Rep3(CurrentPlayer) = True
  524. Else
  525. If Score(CurrentPlayer) + Points => 70000 And Rep1(CurrentPlayer) = False Then Special() : Rep1(CurrentPlayer) = True
  526. If Score(CurrentPlayer) + Points => 100000 And Rep2(CurrentPlayer) = False Then Special() : Rep2(CurrentPlayer) = True
  527. If Score(CurrentPlayer) + Points => 140000 And Rep3(CurrentPlayer) = False Then Special() : Rep3(CurrentPlayer) = True
  528. End If
  529. If CurrentPlayer = 1 Then
  530. If Score(1) + Points =>100000 And Score(1) + Points <200000 Then Controller.B2SSetScoreRolloverPlayer1 1 : P1ScoreRoll.state=1
  531. If Score(1) + Points =>200000 And Score(1) + Points <300000 Then SetB2SData 24,2
  532. If Score(1) + Points =>300000 And Score(1) + Points <400000 Then SetB2SData 24,3
  533. If Score(1) + Points =>400000 And Score(1) + Points <500000 Then SetB2SData 24,4
  534. If Score(1) + Points =>500000 Then SetB2SData 24,5
  535. End If
  536. If CurrentPlayer = 2 Then
  537. If Score(2) + Points =>100000 And Score(2) + Points <200000 Then Controller.B2SSetScoreRolloverPlayer2 1 : P2ScoreRoll.state=1
  538. If Score(2) + Points =>200000 And Score(2) + Points <300000 Then SetB2SData 25,2
  539. If Score(2) + Points =>300000 And Score(2) + Points <400000 Then SetB2SData 25,3
  540. If Score(2) + Points =>400000 And Score(2) + Points <500000 Then SetB2SData 25,4
  541. If Score(2) + Points =>500000 Then SetB2SData 25,5
  542. End If
  543. If CurrentPlayer = 3 Then
  544. If Score(3) + Points =>100000 And Score(3) + Points <200000 Then Controller.B2SSetScoreRolloverPlayer3 1 : P3ScoreRoll.state=1
  545. If Score(3) + Points =>200000 And Score(3) + Points <300000 Then SetB2SData 26,2
  546. If Score(3) + Points =>300000 And Score(3) + Points <400000 Then SetB2SData 26,3
  547. If Score(3) + Points =>400000 And Score(3) + Points <500000 Then SetB2SData 26,4
  548. If Score(3) + Points =>500000 Then SetB2SData 26,5
  549. End If
  550. If CurrentPlayer = 4 Then
  551. If Score(4) + Points =>100000 And Score(4) + Points <200000 Then Controller.B2SSetScoreRolloverPlayer4 1 : P4ScoreRoll.state=1
  552. If Score(4) + Points =>200000 And Score(4) + Points <300000 Then SetB2SData 27,2
  553. If Score(4) + Points =>300000 And Score(4) + Points <400000 Then SetB2SData 27,3
  554. If Score(4) + Points =>400000 And Score(4) + Points <500000 Then SetB2SData 27,4
  555. If Score(4) + Points =>500000 Then SetB2SData 27,5
  556. End If
  557. End Sub
  558.  
  559. Sub UpdateScore
  560. Score(Currentplayer) = Score(Currentplayer) + Points
  561. If PU=1 then ScoreDT1.AddValue(Points)
  562. If PU=2 then ScoreDT2.AddValue(Points)
  563. If PU=3 then ScoreDT3.AddValue(Points)
  564. If PU=4 then ScoreDT4.AddValue(Points)
  565. Score1000K=Int (Score(Currentplayer)/1000000)
  566. Score100K=Int ((Score(Currentplayer)/100000))
  567. Score10K=Int ((Score(Currentplayer)/10000))
  568. ScoreK=Int (((Score(Currentplayer)-(Score10K*10000)))/1000)
  569. Score100=Int (((Score(Currentplayer)-(Score10K*10000)-(ScoreK*1000)))/100)
  570. Score10=Int (((Score(Currentplayer)-(Score10K*10000)-(ScoreK*1000)-(Score100*100)))/10)
  571. ScoreUnit=Int ((Score(Currentplayer)-(Score10K*10000)-(ScoreK*1000)-(Score100*100))-(Score10*10))
  572. b2sSplitScore CurrentPlayer, Score(CurrentPlayer)
  573. End Sub
  574.  
  575. Sub b2sSplitScore (Byval b2splayer, Byval b2sscorevalue)
  576. Dim B2Ssplit
  577. b2splayer=(b2splayer-1)*6
  578. B2Ssplit= Int(b2sscorevalue/1000000):B2SData(b2splayer)=Chr(B2Ssplit+1):b2sscorevalue=b2sscorevalue-Int(B2Ssplit*1000000)
  579. B2Ssplit= Int(b2sscorevalue/100000):B2SData(b2splayer)=Chr(B2Ssplit+1):b2sscorevalue=b2sscorevalue-Int(B2Ssplit*100000)
  580. B2Ssplit= Int(b2sscorevalue/10000):B2SData(b2splayer+1)=Chr(B2Ssplit+1):b2sscorevalue=b2sscorevalue-Int(B2Ssplit*10000)
  581. B2Ssplit= Int(b2sscorevalue/1000):B2SData(b2splayer+2)=Chr(B2Ssplit+1):b2sscorevalue=b2sscorevalue-Int(B2Ssplit*1000)
  582. B2Ssplit= Int(b2sscorevalue/100):B2SData(b2splayer+3)=Chr(B2Ssplit+1):b2sscorevalue=b2sscorevalue-Int(B2Ssplit*100)
  583. B2Ssplit= Int(b2sscorevalue/10):B2SData(b2splayer+4)=Chr(B2Ssplit+1):b2sscorevalue=b2sscorevalue-Int(B2Ssplit*10)
  584. SetB2SData b2splayer+5,b2sscorevalue
  585. End Sub
  586.  
  587. Sub UpdatePreScore
  588. ' Score1.SetValue(PreScore)
  589. PreScore100K=Int (PreScore1/100000)
  590. PreScore10K=Int (PreScore1/10000)
  591. PreScoreK=Int((PreScore1-(PreScore10K*10000))/1000)
  592. PreScore100=Int((PreScore1-(PreScore10K*10000)-(PreScoreK*1000))/100)
  593. PreScore10=Int((PreScore1-(PreScore10K*10000)-(PreScoreK*1000)-(PreScore100*100))/10)
  594. PreScoreUnit=Int(PreScore1-(PreScore10K*10000)-(PreScoreK*1000)-(PreScore100*100)-(PreScore10*10))
  595. ' ScoreReel01.SetValue(PreScore100K)
  596. ' ScoreReel02.SetValue(PreScore10K)
  597. ' ScoreReel03.SetValue(PreScoreK)
  598. ' ScoreReel04.SetValue(PreScore100)
  599. ' ScoreReel05.SetValue(PreScore10)
  600. ' ScoreReel06.SetValue(PreScoreUnit)
  601. b2sSplitScore 1, PreScore1
  602. b2sSplitScore 2, PreScore2
  603. b2sSplitScore 3, PreScore3
  604. b2sSplitScore 4, PreScore4
  605.  
  606. If Prescore1 =>100000 And Prescore1 <200000 Then Controller.B2SSetScoreRolloverPlayer1 1 : P1ScoreRoll.state=1
  607. If Prescore1 =>200000 And Prescore1 <300000 Then SetB2SData 24,2
  608. If Prescore1 =>300000 And Prescore1 <400000 Then SetB2SData 24,3
  609. If Prescore1 =>400000 And Prescore1 <500000 Then SetB2SData 24,4
  610. If Prescore1 =>500000 Then SetB2SData 24,5
  611.  
  612. If Prescore2 =>100000 And Prescore2 <200000 Then Controller.B2SSetScoreRolloverPlayer2 1 : P2ScoreRoll.state=1
  613. If Prescore2 =>200000 And Prescore2 <300000 Then SetB2SData 25,2
  614. If Prescore2 =>300000 And Prescore2 <400000 Then SetB2SData 25,3
  615. If Prescore2 =>400000 And Prescore2 <500000 Then SetB2SData 25,4
  616. If Prescore2 =>500000 Then SetB2SData 25,5
  617.  
  618. If Prescore3 =>100000 And Prescore3 <200000 Then Controller.B2SSetScoreRolloverPlayer3 1 : P3ScoreRoll.state=1
  619. If Prescore3 =>200000 And Prescore3 <300000 Then SetB2SData 26,2
  620. If Prescore3 =>300000 And Prescore3 <400000 Then SetB2SData 26,3
  621. If Prescore3 =>400000 And Prescore3 <500000 Then SetB2SData 26,4
  622. If Prescore3 =>500000 Then SetB2SData 26,5
  623.  
  624. If Prescore4 =>100000 And Prescore4 <200000 Then Controller.B2SSetScoreRolloverPlayer4 1 : P4ScoreRoll.state=1
  625. If Prescore4 =>200000 And Prescore4 <300000 Then SetB2SData 27,2
  626. If Prescore4 =>300000 And Prescore4 <400000 Then SetB2SData 27,3
  627. If Prescore4 =>400000 And Prescore4 <500000 Then SetB2SData 27,4
  628. If Prescore4 =>500000 Then SetB2SData 27,5
  629.  
  630. If Prescore1 => 0 Then SetB2SData 36,1 Else SetB2SData 36,0
  631. If Prescore2 => 0 Then SetB2SData 37,1 Else SetB2SData 37,0
  632. If Prescore3 => 0 Then SetB2SData 38,1 Else SetB2SData 38,0
  633. If Prescore4 => 0 Then SetB2SData 39,1 Else SetB2SData 39,0
  634. End Sub
  635.  
  636. Sub Updatehs
  637. h3s = HighScore3
  638. h5s = HighScore5
  639.  
  640. h3s1000K=Int (h3s/1000000)
  641. h3s100K=Int (h3s/100000)
  642. h3s10K=Int (h3s/10000)
  643. h3sK=Int((h3s-(h3s10K*10000))/1000)
  644. h3s100=Int((h3s-(h3s10K*10000)-(h3sK*1000))/100)
  645. h3s10=Int((h3s-(h3s10K*10000)-(h3sK*1000)-(h3s100*100))/10)
  646. h3sUnit=Int(h3s-(h3s10K*10000)-(h3sK*1000)-(h3s100*100)-(h3s10*10))
  647.  
  648. h5s1000K=Int (h5s/1000000)
  649. h5s100K=Int (h5s/100000)
  650. h5s10K=Int (h5s/10000)
  651. h5sK=Int((h5s-(h5s10K*10000))/1000)
  652. h5s100=Int((h5s-(h5s10K*10000)-(h5sK*1000))/100)
  653. h5s10=Int((h5s-(h5s10K*10000)-(h5sK*1000)-(h5s100*100))/10)
  654. h5sUnit=Int(h5s-(h5s10K*10000)-(h5sK*1000)-(h5s100*100)-(h5s10*10))
  655.  
  656. If FiveBalls = False Then
  657. hsg.SetValue(h3s1000K)
  658. hsa.SetValue(h3s100K)
  659. hsb.SetValue(h3s10K)
  660. hsc.SetValue(h3sK)
  661. hsd.SetValue(h3s100)
  662. hse.SetValue(h3s10)
  663. hsf.SetValue(h3sUnit)
  664.  
  665. hsg001.SetValue(h3s1000K)
  666. hsa001.SetValue(h3s100K)
  667. hsb001.SetValue(h3s10K)
  668. hsc001.SetValue(h3sK)
  669. hsd001.SetValue(h3s100)
  670. hse001.SetValue(h3s10)
  671. hsf001.SetValue(h3sUnit)
  672. Else
  673. hsg.SetValue(h5s1000K)
  674. hsa.SetValue(h5s100K)
  675. hsb.SetValue(h5s10K)
  676. hsc.SetValue(h5sK)
  677. hsd.SetValue(h5s100)
  678. hse.SetValue(h5s10)
  679. hsf.SetValue(h5sUnit)
  680.  
  681. hsg001.SetValue(h5s1000K)
  682. hsa001.SetValue(h5s100K)
  683. hsb001.SetValue(h5s10K)
  684. hsc001.SetValue(h5sK)
  685. hsd001.SetValue(h5s100)
  686. hse001.SetValue(h5s10)
  687. hsf001.SetValue(h5sUnit)
  688. End If
  689. End Sub
  690.  
  691. Sub UpdateCredits
  692. Controller.B2SSetCredits Credits
  693. CoinReel.SetValue Credits
  694. End Sub
  695.  
  696. Sub UpdateBIP
  697. If FiveBalls = True Then
  698. If BIP = 5 Then LastBall = True
  699. Else
  700. If BIP = 3 Then LastBall = True
  701. End If
  702. Controller.B2SSetCredits BIP : CoinReel.SetValue BIP
  703. If LastBall = True Then DoubleBonus = True : SetLamp 0, 1
  704. End Sub
  705.  
  706. Sub UpdateMatch
  707. If Matchnumber = 00 Then SetB2SData 33, 0' : MatchReel.SetValue (1)
  708. If Matchnumber = 10 Then SetB2SData 33, 1' : MatchReel.SetValue (2)
  709. If Matchnumber = 20 Then SetB2SData 33, 2' : MatchReel.SetValue (3)
  710. If Matchnumber = 30 Then SetB2SData 33, 3' : MatchReel.SetValue (4)
  711. If Matchnumber = 40 Then SetB2SData 33, 4' : MatchReel.SetValue (5)
  712. If Matchnumber = 50 Then SetB2SData 33, 5' : MatchReel.SetValue (6)
  713. If Matchnumber = 60 Then SetB2SData 33, 6' : MatchReel.SetValue (7)
  714. If Matchnumber = 70 Then SetB2SData 33, 7' : MatchReel.SetValue (8)
  715. If Matchnumber = 80 Then SetB2SData 33, 8' : MatchReel.SetValue (9)
  716. If Matchnumber = 90 Then SetB2SData 33, 9' : MatchReel.SetValue (10)
  717. End Sub
  718.  
  719. Sub MatchDisplay()
  720. If y = 00 Then SetB2SData 33, 0' : MatchReel.SetValue (1)
  721. If y = 10 Then SetB2SData 33, 1' : MatchReel.SetValue (2)
  722. If y = 20 Then SetB2SData 33, 2' : MatchReel.SetValue (3)
  723. If y = 30 Then SetB2SData 33, 3' : MatchReel.SetValue (4)
  724. If y = 40 Then SetB2SData 33, 4' : MatchReel.SetValue (5)
  725. If y = 50 Then SetB2SData 33, 5' : MatchReel.SetValue (6)
  726. If y = 60 Then SetB2SData 33, 6' : MatchReel.SetValue (7)
  727. If y = 70 Then SetB2SData 33, 7' : MatchReel.SetValue (8)
  728. If y = 80 Then SetB2SData 33, 8' : MatchReel.SetValue (9)
  729. If y = 90 Then SetB2SData 33, 9' : MatchReel.SetValue (10)
  730. Playsound"Switch4"
  731. End Sub
  732.  
  733. Sub Match()
  734. Randomize
  735. y = Int(Rnd(10) * 10) * 10
  736. MatchNumber = y
  737. For i = 1 To Players
  738. If Int(Score(i)/10)-Int(Score(i)/100)*10 = y/10 Then
  739. If Credits < 15 Then Call Credit() Else Playsound"Knocker" : DOF 107, 2
  740. End If
  741. Next
  742. Call Matchdisplay()
  743. End Sub
  744.  
  745. Sub TimernClose_Timer
  746. Match() : nClose() : Playsound"Close"
  747. Me.Enabled = False
  748. End Sub
  749.  
  750. Sub nClose()
  751. SaveData()
  752. UpdatePreScore
  753. TimerInit.Enabled = True : Playsound"MotorEmpty" : DOF 113, 2
  754. End Sub
  755.  
  756. Sub SaveData()
  757. If FiveBalls = True Then
  758. For i = 1 To Players
  759. If Score(i) > HighScore5 Then
  760. HighScore5 = Score(i)
  761. Updatehs
  762. SaveValue TableName, "HighScore5", HighScore5
  763. End If
  764. Next
  765. Else
  766. For i = 1 To Players
  767. If Score(i) > HighScore3 Then
  768. HighScore3 = Score(i)
  769. Updatehs
  770. SaveValue TableName, "HighScore3", HighScore3
  771. End If
  772. Next
  773. End If
  774.  
  775. PreScore1 = Score(1)
  776. SaveValue TableName, "PreScore1", PreScore1
  777. PreScore2 = Score(2)
  778. SaveValue TableName, "PreScore2", PreScore2
  779. PreScore3 = Score(3)
  780. SaveValue TableName, "PreScore3", PreScore3
  781. PreScore4 = Score(4)
  782. SaveValue TableName, "PreScore4", PreScore4
  783. SaveValue TableName, "Credits", Credits
  784. SaveValue TableName, "MatchNumber", MatchNumber
  785. SaveValue TableName, "GameCount", GameCount
  786. End Sub
  787.  
  788. Sub TimerInit_Timer
  789. Table_Init : TargetReset()
  790. Me.Enabled = False
  791. End Sub
  792.  
  793. Sub LoadData()
  794. Dim Value
  795. Highscore3 = h3s
  796. Highscore5 = h5s
  797. Value = (LoadValue(TableName,"PreScore1"))
  798. If (Value <> "") Then PreScore1 = CDbl(Value) End If
  799. Value = (LoadValue(TableName,"PreScore2"))
  800. If (Value <> "") Then PreScore2 = CDbl(Value) End If
  801. Value = (LoadValue(TableName,"PreScore3"))
  802. If (Value <> "") Then PreScore3 = CDbl(Value) End If
  803. Value = (LoadValue(TableName,"PreScore4"))
  804. If (Value <> "") Then PreScore4 = CDbl(Value) End If
  805. Value = (LoadValue(TableName,"HighScore3"))
  806. If (Value <> "") Then HighScore3 = CDbl(Value) End If
  807. Value = (LoadValue(TableName,"HighScore5"))
  808. If (Value <> "") Then HighScore5 = CDbl(Value) End If
  809. Value = (LoadValue(TableName,"Credits"))
  810. If (Value <> "") Then Credits = CDbl(Value) End If
  811. Value = (LoadValue(TableName,"MatchNumber"))
  812. If (Value <> "") Then MatchNumber = CDbl(Value) End If
  813. Value = (LoadValue(TableName,"GameCount"))
  814. If (Value <> "") Then GameCount = CDbl(Value) End If
  815. If Credits > 15 Then Credits = 15
  816. End Sub
  817.  
  818. Sub Special()
  819. Call Credit()
  820. End Sub
  821.  
  822. Sub Credit()
  823. If Credits < 15 Then
  824. Credits = Credits + 1 : Playsound"Knocker" :DOF 107, 2: UpdateCredits
  825. Else
  826. Playsound"Knocker"
  827. DOF 107, 2
  828. End If
  829. End Sub
  830.  
  831. Sub BonusCount
  832. If Tilt = False Then
  833. If Bonus > 10 Then
  834. BonusCounted = False
  835. TimerBonus10.Enabled = True
  836. Else
  837. If Bonus <1 Then
  838. Bonuscounted = True : TimerTemp.Enabled = True
  839. Else
  840. BonusCounted = False : TimerBonus.Enabled = True
  841. End If
  842. End If
  843. Else
  844. TimerNewBall.Enabled = True
  845. End If
  846. End Sub
  847.  
  848. Sub TimerDouble_Timer
  849. If GameInProgress = False Or Tilt = True Then Exit Sub
  850. Me.Interval = 60
  851. Score(CurrentPlayer) = Score(CurrentPlayer) + Points
  852. UpdateScore
  853. If PU=1 then ScoreDT1.AddValue(Points)
  854. If PU=2 then ScoreDT2.AddValue(Points)
  855. If PU=3 then ScoreDT3.AddValue(Points)
  856. If PU=4 then ScoreDT4.AddValue(Points)
  857. TimerBonus.Interval = 150 : TimerBonus10.Interval = 150
  858. sTsd = sTsd+1
  859. If sTsd >2 Then sTsd = 0 : Me.Enabled = False
  860. Select Case sTsd
  861. Case 1: AddScore 1000 : UpdateScore : Playsound"1000A"
  862. Case 2: AddScore 1000 : UpdateScore : Playsound"1000B"
  863. End Select
  864. CheckReplay()
  865. End Sub
  866.  
  867. Sub TimerBonus_Timer()
  868. If Tilt = True Then Exit Sub
  869. If DoubleBonus = True Then
  870. TimerDouble.Enabled = True
  871. Else
  872. AddScore 1000 : Playsound"1000"
  873. End If
  874. Bonus = Bonus - 1
  875. AdvanceLights()
  876.  
  877. If Bonus => 10 Then SetLamp 10,1 : Else SetLamp 10,0
  878. If Bonus = 9 Or Bonus = 19 Then SetLamp 9,1 : Else SetLamp 9,0
  879. If Bonus = 8 Or Bonus = 18 Then SetLamp 8,1 : Else SetLamp 8,0
  880. If Bonus = 7 Or Bonus = 17 Then SetLamp 7,1 : Else SetLamp 7,0
  881. If Bonus = 6 Or Bonus = 16 Then SetLamp 6,1 : Else SetLamp 6,0
  882. If Bonus = 5 Or Bonus = 15 Then SetLamp 5,1 : Else SetLamp 5,0
  883. If Bonus = 4 Or Bonus = 14 Then SetLamp 4,1 : Else SetLamp 4,0
  884. If Bonus = 3 Or Bonus = 13 Then SetLamp 3,1 : Else SetLamp 3,0
  885. If Bonus = 2 Or Bonus = 12 Then SetLamp 2,1 : Else SetLamp 2,0
  886. If Bonus = 1 Or Bonus = 11 Then SetLamp 1,1 : Else SetLamp 1,0
  887.  
  888. If Bonus <1 Then Me.Enabled = False : TimerTemp.Enabled = True
  889. BonusText.Text = Bonus
  890. End Sub
  891.  
  892. Sub TimerTemp_Timer
  893. BonusCounted = True : Playsound "Switch2"
  894. TimerNewBall.Enabled = True
  895. TimerBonus.Interval = 250 : TimerBonus.Enabled = False
  896. Me.Enabled = False
  897. End Sub
  898.  
  899. Sub TimerBonus10_Timer()
  900. If Tilt = True Then Exit Sub
  901. If DoubleBonus = True Then
  902. TimerDouble.Enabled = True : Me.Interval = 175
  903. Else
  904. AddScore 1000 : Playsound"1000"
  905. End If
  906. Bonus = Bonus - 1
  907. AdvanceLights()
  908.  
  909. If Bonus = 19 Then SetLamp 9,1 : Else SetLamp 9,0
  910. If Bonus = 18 Then SetLamp 8,1 : Else SetLamp 8,0
  911. If Bonus = 17 Then SetLamp 7,1 : Else SetLamp 7,0
  912. If Bonus = 16 Then SetLamp 6,1 : Else SetLamp 6,0
  913. If Bonus = 15 Then SetLamp 5,1 : Else SetLamp 5,0
  914. If Bonus = 14 Then SetLamp 4,1 : Else SetLamp 4,0
  915. If Bonus = 13 Then SetLamp 3,1 : Else SetLamp 3,0
  916. If Bonus = 12 Then SetLamp 2,1 : Else SetLamp 2,0
  917. If Bonus = 11 Then SetLamp 1,1 : Else SetLamp 1,0
  918. If Bonus < 11 Then
  919. TimerBonus.Enabled = True
  920. TimerBonus10.Interval = 250 : Me.Enabled = False
  921. End If
  922. BonusText.Text = Bonus
  923. End Sub
  924.  
  925. Sub Advance()
  926. If Tilt = True Then Exit Sub
  927. Bonus = Bonus + 1
  928. If Bonus => 19 Then
  929. Bonus = 19
  930. End If
  931. AdvanceLights()
  932. UpdateScore
  933. BonusText.Text = Bonus
  934. End Sub
  935.  
  936. Sub AdvanceLights()
  937. If Bonus >10 Then SetLamp 10,1 : AdvanceLights10()
  938. If Bonus = 10 Then SetLamp 10,1 : SetLamp 9,0
  939. If Bonus = 9 Then SetLamp 9,1 : SetLamp 8,0
  940. If Bonus = 8 Then SetLamp 8,1 : SetLamp 7,0
  941. If Bonus = 7 Then SetLamp 7,1 : SetLamp 6,0
  942. If Bonus = 6 Then SetLamp 6,1 : SetLamp 5,0
  943. If Bonus = 5 Then SetLamp 5,1 : SetLamp 4,0
  944. If Bonus = 4 Then SetLamp 4,1 : SetLamp 3,0
  945. If Bonus = 3 Then SetLamp 3,1 : SetLamp 2,0
  946. If Bonus = 2 Then SetLamp 2,1 : SetLamp 1,0
  947. If Bonus = 1 Then SetLamp 1,1
  948. BonusText.Text = Bonus
  949. End Sub
  950.  
  951. Sub AdvanceLights10()
  952. If Bonus = 19 Then SetLamp 10,1 : SetLamp 9,1 : SetLamp 8,0
  953. If Bonus = 18 Then SetLamp 10,1 : SetLamp 8,1 : SetLamp 7,0
  954. If Bonus = 17 Then SetLamp 10,1 : SetLamp 7,1 : SetLamp 6,0
  955. If Bonus = 16 Then SetLamp 10,1 : SetLamp 6,1 : SetLamp 5,0
  956. If Bonus = 15 Then SetLamp 10,1 : SetLamp 5,1 : SetLamp 4,0
  957. If Bonus = 14 Then SetLamp 10,1 : SetLamp 4,1 : SetLamp 3,0
  958. If Bonus = 13 Then SetLamp 10,1 : SetLamp 3,1 : SetLamp 2,0
  959. If Bonus = 12 Then SetLamp 10,1 : SetLamp 2,1 : SetLamp 1,0
  960. If Bonus = 11 Then SetLamp 10,1 : SetLamp 1,1
  961. BonusText.Text = Bonus
  962. End Sub
  963.  
  964. Sub targetsR_Hit(Index)
  965. BRollOff : If Tilt = False Then Playsound"tdown"
  966. Advance()
  967. End Sub
  968.  
  969. Sub targetsL_Hit(Index)
  970. BRollOff : If Tilt = False Then Playsound"tdown"
  971. Advance()
  972. End Sub
  973.  
  974. Sub TL1_Hit()
  975. If Tilt = False Then
  976. TL1.IsDropped = True : TL1a.IsDropped = True : TLshad1.State = 1 : TimerCheck.Enabled = True
  977. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  978. End If
  979. End Sub
  980.  
  981. Sub TL2_Hit()
  982. If Tilt = False Then
  983. TL2.IsDropped = True : TL2a.IsDropped = True : TLshad2.State = 1 : TimerCheck.Enabled = True
  984. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  985. End If
  986. End Sub
  987.  
  988. Sub TL3_Hit()
  989. If Tilt = False Then
  990. TL3.IsDropped = True : TL3a.IsDropped = True : TLshad3.State = 1 : TimerCheck.Enabled = True
  991. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  992. End If
  993. End Sub
  994.  
  995. Sub TL4_Hit()
  996. If Tilt = False Then
  997. TL4.IsDropped = True : TL4a.IsDropped = True : TLshad4.State = 1 : TimerCheck.Enabled = True
  998. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  999. End If
  1000. End Sub
  1001.  
  1002. Sub TL5_Hit()
  1003. If Tilt = False Then
  1004. TL5.IsDropped = True : TL5a.IsDropped = True : TLshad5.State = 1 : TimerCheck.Enabled = True
  1005. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1006. End If
  1007. End Sub
  1008.  
  1009. Sub TR1_Hit()
  1010. If Tilt = False Then
  1011. TR1.IsDropped = True : TR1a.IsDropped = True : TRshad1.State = 1 : TimerCheck.Enabled = True
  1012. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1013. End If
  1014. End Sub
  1015.  
  1016. Sub TR2_Hit()
  1017. If Tilt = False Then
  1018. TR2.IsDropped = True : TR2a.IsDropped = True : TRshad2.State = 1 : TimerCheck.Enabled = True
  1019. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1020. End If
  1021. End Sub
  1022.  
  1023. Sub TR3_Hit()
  1024. If Tilt = False Then
  1025. TR3.IsDropped = True : TR3a.IsDropped = True : TRshad3.State = 1 : TimerCheck.Enabled = True
  1026. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1027. End If
  1028. End Sub
  1029.  
  1030. Sub TR4_Hit()
  1031. If Tilt = False Then
  1032. TR4.IsDropped = True : TR4a.IsDropped = True : TRshad4.State = 1 : TimerCheck.Enabled = True
  1033. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1034. End If
  1035. End Sub
  1036.  
  1037. Sub TR5_Hit()
  1038. If Tilt = False Then
  1039. TR5.IsDropped = True : TR5a.IsDropped = True : TRshad5.State = 1 : TimerCheck.Enabled = True
  1040. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1041. End If
  1042. End Sub
  1043.  
  1044. Sub TargetReset()
  1045. For Each x In Targets : x.IsDropped = False : Next
  1046. For Each x In Tshad : x.State = 0 : Next
  1047. 'Playsound"treset"
  1048. PlaySound SoundFX("treset", DOFContactors)
  1049. DOF 106, 2
  1050. End Sub
  1051.  
  1052. Sub BumperReset()
  1053. BumperR1.Force = 9 : BumperR2.Force = 9 : BumperB.Force = 9
  1054. SetLamp 29,0 : SetLamp 26,0 : LightBR1Ref.State = 0 : LightGR1.State = 0
  1055. SetLamp 30,0 : SetLamp 27,0 : LightBR2Ref.State = 0 : LightGR2.State = 0
  1056. SetLamp 31,0 : SetLamp 28,0 : LightBBRef.State = 0 : LightGB.State = 0
  1057. BR1Off.WidthBottom = 60 : BR1Off.WidthTop = 65 : BR1On.WidthBottom = 0 : BR1On.WidthTop = 0 : Abs(LightAniBR1.State -1)
  1058. BR2Off.WidthBottom = 60 : BR2Off.WidthTop = 65 : BR2On.WidthBottom = 0 : BR2On.WidthTop = 0 : Abs(LightAniBR2.State -1)
  1059. BBOff.WidthBottom = 60 : BBOff.WidthTop = 65 : BBOn.WidthBottom = 0 : BBOn.WidthTop = 0 : Abs(LightAniBB.State -1)
  1060. End Sub
  1061.  
  1062. Sub BumperOff()
  1063. BumperR1.Force = 0 : BumperR2.Force = 0 : BumperB.Force = 0
  1064. SetLamp 29,0 : SetLamp 26,0 : LightBR1Ref.State = 0 : LightGR1.State = 0
  1065. SetLamp 30,0 : SetLamp 27,0 : LightBR2Ref.State = 0 : LightGR2.State = 0
  1066. SetLamp 31,0 : SetLamp 28,0 : LightBBRef.State = 0 : LightGB.State = 0
  1067. BR1Off.WidthBottom = 60 : BR1Off.WidthTop = 65 : BR1On.WidthBottom = 0 : BR1On.WidthTop = 0 : Abs(LightAniBR1.State -1)
  1068. BR2Off.WidthBottom = 60 : BR2Off.WidthTop = 65 : BR2On.WidthBottom = 0 : BR2On.WidthTop = 0 : Abs(LightAniBR2.State -1)
  1069. BBOff.WidthBottom = 60 : BBOff.WidthTop = 65 : BBOn.WidthBottom = 0 : BBOn.WidthTop = 0 : Abs(LightAniBB.State -1)
  1070. End Sub
  1071.  
  1072. Sub BumperReset2()
  1073. TimerBumperReset2.Enabled = True
  1074. End Sub
  1075.  
  1076. Sub TimerBumperReset2_Timer
  1077. BumperAttTimer.Enabled = False : BumperTopLightOn() : Blink = 0
  1078. If BOn = True Then BumperBLightOn()
  1079. Me.Enabled = False
  1080. End Sub
  1081.  
  1082. Sub BumperTopLightOn()
  1083. If GameInProgress = False Or Tilt = True Then Exit Sub
  1084. SetLamp 29,1 : SetLamp 26,1 : LightBR1Ref.State = 1 : LightGR1.State = 1
  1085. SetLamp 30,1 : SetLamp 27,1 : LightBR2Ref.State = 1 : LightGR2.State = 1
  1086. BR1Off.WidthBottom = 0 : BR1Off.WidthTop = 0 : BR1On.WidthBottom = 60 : BR1On.WidthTop = 65 : Abs(LightAniBR1.State -1)
  1087. BR2Off.WidthBottom = 0 : BR2Off.WidthTop = 0 : BR2On.WidthBottom = 60 : BR2On.WidthTop = 65 : Abs(LightAniBR2.State -1)
  1088. End Sub
  1089.  
  1090. Sub BumperBLightOn()
  1091. If GameInProgress = False Or Tilt = True Then Exit Sub
  1092. BOn = True
  1093. SetLamp 31,1 : : SetLamp 28,1 : LightBBRef.State = 1 : LightGB.State = 1
  1094. BBOff.WidthBottom = 0 : BBOff.WidthTop = 0 : BBOn.WidthBottom = 60 : BBOn.WidthTop = 65 : Abs(LightAniBB.State -1)
  1095. End Sub
  1096.  
  1097. Sub LeftInlane_Hit()
  1098. ROWireLI.WidthBottom = 0 : ROWireLI.WidthTop = 0 : LightAniLI.State = Abs(LightAniLI.State -1)
  1099. Me.TimerEnabled = True
  1100. If GameInProgress = False Or Tilt = True Then Exit Sub
  1101. AlternateEBReady
  1102. If LampState (11) = 1 Or LampState (14) = 1 Then SetLamp 11, 0 : SetLamp 14, 0
  1103. Advance()
  1104. TimerCheck.Enabled = True
  1105. TimerScoreHdd.Enabled = True
  1106. End Sub
  1107.  
  1108. Sub LeftInlane_Timer()
  1109. ROWireLI.WidthBottom = 5 : ROWireLI.WidthTop = 5 : LightAniLI.State = Abs(LightAniLI.State -1)
  1110. Me.TimerEnabled = False
  1111. End Sub
  1112.  
  1113. Sub RightInlane_Hit()
  1114. ROWireRI.WidthBottom = 0 : ROWireRI.WidthTop = 0 : LightAniRI.State = Abs(LightAniRI.State -1)
  1115. Me.TimerEnabled = True
  1116. If GameInProgress = False Or Tilt = True Then Exit Sub
  1117. AlternateEBReady
  1118. If LampState (13) = 1 Or LampState (15) = 1 Then SetLamp 13, 0 : SetLamp 15, 0
  1119. Advance()
  1120. TimerCheck.Enabled = True
  1121. TimerScoreHdd.Enabled = True
  1122. End Sub
  1123.  
  1124. Sub RightInlane_Timer()
  1125. ROWireRI.WidthBottom = 5 : ROWireRI.WidthTop = 5 : LightAniRI.State = Abs(LightAniRI.State -1)
  1126. Me.TimerEnabled = False
  1127. End Sub
  1128.  
  1129. Sub LeftOutlane_Hit()
  1130. ROWireLO.WidthBottom = 0 : ROWireLO.WidthTop = 0 : LightAniLO.State = Abs(LightAniLO.State -1)
  1131. Me.TimerEnabled = True
  1132. If GameInProgress = False Or Tilt = True Then Exit Sub
  1133. If LampState (20) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1134. If LampState (24) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1135. TimerScoreTsd.Enabled = True
  1136. End Sub
  1137.  
  1138. Sub LeftOutlane_Timer()
  1139. ROWireLO.WidthBottom = 5 : ROWireLO.WidthTop = 5 : LightAniLO.State = Abs(LightAniLO.State -1)
  1140. Me.TimerEnabled = False
  1141. End Sub
  1142.  
  1143. Sub RightOutlane_Hit()
  1144. ROWireRO.WidthBottom = 0 : ROWireRO.WidthTop = 0 : LightAniRO.State = Abs(LightAniRO.State -1)
  1145. Me.TimerEnabled = True
  1146. If GameInProgress = False Or Tilt = True Then Exit Sub
  1147. If LampState (21) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1148. If LampState (23) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1149. TimerScoreTsd.Enabled = True
  1150. End Sub
  1151.  
  1152. Sub RightOutlane_Timer()
  1153. ROWireRO.WidthBottom = 5 : ROWireRO.WidthTop = 5 : LightAniRO.State = Abs(LightAniRO.State -1)
  1154. Me.TimerEnabled = False
  1155. End Sub
  1156.  
  1157. Sub RightMidLane_Hit()
  1158. ROWireMR.WidthBottom = 0 : ROWireMR.WidthTop = 0 : LightAniMR.State = Abs(LightAniMR.State -1)
  1159. Me.TimerEnabled = True
  1160. If GameInProgress = False Or Tilt = True Then Exit Sub
  1161. AlternateEBReady
  1162. If LampState (17) = 1 Then
  1163. TimerScoreTsd.Enabled = True
  1164. Else
  1165. TimerScoreHdd.Enabled = True
  1166. End If
  1167. TimerCheck.Enabled = True
  1168. End Sub
  1169.  
  1170. Sub RightMidLane_Timer()
  1171. ROWireMR.WidthBottom = 5 : ROWireMR.WidthTop = 5 : LightAniMR.State = Abs(LightAniMR.State -1)
  1172. Me.TimerEnabled = False
  1173. End Sub
  1174.  
  1175. Sub LeftMidLane_Hit()
  1176. ROWireML.WidthBottom = 0 : ROWireML.WidthTop = 0 : LightAniML.State = Abs(LightAniML.State -1)
  1177. Me.TimerEnabled = True
  1178. If GameInProgress = False Or Tilt = True Then Exit Sub
  1179. AlternateEBReady
  1180. If LampState (16) = 1 Then
  1181. TimerScoreTsd.Enabled = True
  1182. Else
  1183. TimerScoreHdd.Enabled = True
  1184. End If
  1185. TimerCheck.Enabled = True
  1186. End Sub
  1187.  
  1188. Sub LeftMidLane_Timer()
  1189. ROWireML.WidthBottom = 5 : ROWireML.WidthTop = 5 : LightAniML.State = Abs(LightAniML.State -1)
  1190. Me.TimerEnabled = False
  1191. End Sub
  1192.  
  1193. Sub TopA_Hit()
  1194. ROWireTA.WidthBottom = 0 : ROWireTA.WidthTop = 0 : LightAniTA.State = Abs(LightAniTA.State -1)
  1195. Me.TimerEnabled = True
  1196. If GameInProgress = False Or Tilt = True Then Exit Sub
  1197. If LampState (11) = 1 Or LampState (14) = 1 Then SetLamp 11, 0 : SetLamp 14, 0
  1198. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1199. If LampState (25) = 1 Then SetLamp 22, 1 : SetLamp 24, 1 : SetLamp 23, 0 : SetLamp 25, 0
  1200. If LampState (24) = 1 Then SetLamp 22, 0 : SetLamp 24, 0 : SetLamp 23, 1 : SetLamp 25, 1
  1201. TimerCheck.Enabled = True
  1202. End Sub
  1203.  
  1204. Sub TopB_Hit()
  1205. ROWireTB.WidthBottom = 0 : ROWireTB.WidthTop = 0 : LightAniTB.State = Abs(LightAniTB.State -1)
  1206. Me.TimerEnabled = True
  1207. If GameInProgress = False Or Tilt = True Then Exit Sub
  1208. If LampState (12) = 1 Then SetLamp 12, 0
  1209. BumperBLightOn()
  1210. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1211. If LampState (25) = 1 Then SetLamp 22, 1 : SetLamp 24, 1 : SetLamp 23, 0 : SetLamp 25, 0
  1212. If LampState (24) = 1 Then SetLamp 22, 0 : SetLamp 24, 0 : SetLamp 23, 1 : SetLamp 25, 1
  1213. TimerCheck.Enabled = True
  1214. End Sub
  1215.  
  1216. Sub TopC_Hit()
  1217. ROWireTC.WidthBottom = 0 : ROWireTC.WidthTop = 0 : LightAniTC.State = Abs(LightAniTC.State -1)
  1218. Me.TimerEnabled = True
  1219. If GameInProgress = False Or Tilt = True Then Exit Sub
  1220. If LampState (13) = 1 Or LampState (15) = 1 Then SetLamp 13, 0 : SetLamp 15, 0
  1221. If TimerScoreHdd.Enabled = False Then TimerScoreHdd.Enabled = True : Else TimerScoreHdd2.Enabled = True
  1222. If LampState (25) = 1 Then SetLamp 22, 1 : SetLamp 24, 1 : SetLamp 23, 0 : SetLamp 25, 0
  1223. If LampState (24) = 1 Then SetLamp 22, 0 : SetLamp 24, 0 : SetLamp 23, 1 : SetLamp 25, 1
  1224. TimerCheck.Enabled = True
  1225. End Sub
  1226.  
  1227. Sub TopA_Timer()
  1228. ROWireTA.WidthBottom = 5 : ROWireTA.WidthTop = 5 : LightAniTA.State = Abs(LightAniTA.State -1)
  1229. Advance()
  1230. Me.TimerEnabled = False
  1231. End Sub
  1232.  
  1233. Sub TopB_Timer()
  1234. ROWireTB.WidthBottom = 5 : ROWireTB.WidthTop = 5 : LightAniTB.State = Abs(LightAniTB.State -1)
  1235. Advance()
  1236. Me.TimerEnabled = False
  1237. End Sub
  1238.  
  1239. Sub TopC_Timer()
  1240. ROWireTC.WidthBottom = 5 : ROWireTC.WidthTop = 5 : LightAniTC.State = Abs(LightAniTC.State -1)
  1241. Advance()
  1242. Me.TimerEnabled = False
  1243. End Sub
  1244.  
  1245. Sub TriggersBroll_Hit(Index)
  1246. CheckSpeed
  1247. If FinalSpeed < 10 Then BRollOnQ
  1248. If FinalSpeed => 10 Then BRollOnL
  1249. TimerCheck.Enabled = True
  1250. End Sub
  1251.  
  1252. Sub TimerCheck_Timer
  1253. If Tilt = False Then CheckABCBanks
  1254. Me.Enabled = False
  1255. End Sub
  1256.  
  1257. Sub CheckABCBanks
  1258. If Tilt = False Then
  1259. If LampState (16) = 0 Then
  1260. If TL1.IsDropped = True And TL2.IsDropped = True And TL3.IsDropped = True And TL4.IsDropped = True And TL5.IsDropped = True Then SetLamp 16, 1
  1261. End If
  1262. If LampState (17) = 0 Then
  1263. If TR1.IsDropped = True And TR2.IsDropped = True And TR3.IsDropped = True And TR4.IsDropped = True And TR5.IsDropped = True Then SetLamp 17, 1
  1264. End If
  1265. If EBReady = True Then
  1266. If LampState (16) = 1 And LampState (17) = 1 Then SetLamp 18,1 : SetLamp 20, 1 : EBReady = False
  1267. End If
  1268. If LampState (11) = 0 And LampState (12) = 0 And LampState (13) = 0 Then DoubleBonus = True : SetLamp 0, 1
  1269. If LampState (16) = 1 And LampState (17) = 1 And LampState (11) = 0 And LampState (12) = 0 And LampState (13) = 0 And SpecialReady = True Then
  1270. SpecialReady = False : If EB = False Then SetLamp 23,1 : SetLamp 25, 1
  1271. End If
  1272. End If
  1273. End Sub
  1274.  
  1275. Sub AlternateEBReady
  1276. If Tilt = False Then
  1277. If LampState (18) = 1 Then SetLamp 18, 0 : SetLamp 20, 0 : SetLamp 19, 1 : SetLamp 21, 1
  1278. If LampState (19) = 1 Then SetLamp 18, 1 : SetLamp 20, 1 : SetLamp 19, 0 : SetLamp 21, 0
  1279.  
  1280. If LampState (25) = 1 Then SetLamp 22, 1 : SetLamp 24, 1 : SetLamp 23, 0 : SetLamp 25, 0
  1281. If LampState (24) = 1 Then SetLamp 22, 0 : SetLamp 24, 0 : SetLamp 23, 1 : SetLamp 25, 1
  1282. End If
  1283. End Sub
  1284.  
  1285. Sub BumperR1_Hit()
  1286. DOF 103,DOFPulse
  1287. BRollOff
  1288. If GameInProgress = False Or Tilt = True Then Exit Sub
  1289. RingAni(1) = 0 : For Each x In BRings : x.IsDropped = True : Next
  1290. RingAni(2) = 0 : For Each x In BRings : x.IsDropped = True : Next
  1291. TimerScoreTsd.Enabled = True
  1292. Me.TimerEnabled = True
  1293. AddScore 1000
  1294. Playsound SoundFX("1000a", DOFChimes)
  1295. 'Playsound"1000a"
  1296. 'PlaySoundAt "fx_bumpers1", BumperR1
  1297. PlaySoundAt SoundFX("fx_bumpers1", DOFContactors), BumperR1
  1298. End Sub
  1299.  
  1300. Sub BumperR2_Hit()
  1301. DOF 104,DOFPulse
  1302. BRollOff
  1303. If GameInProgress = False Or Tilt = True Then Exit Sub
  1304. RingAni(1) = 0 : For Each x In BRings : x.IsDropped = True : Next
  1305. RingAni(2) = 0 : For Each x In BRings : x.IsDropped = True : Next
  1306. TimerScoreTsd.Enabled = True
  1307. BumperR1.TimerEnabled = True
  1308. AddScore 1000
  1309. Playsound SoundFX("1000b", DOFChimes)
  1310. 'Playsound"1000b"
  1311. 'PlaySoundAt "fx_bumpers2", BumperR2
  1312. PlaySoundAt SoundFX("fx_bumpers2", DOFContactors), BumperR2
  1313. End Sub
  1314.  
  1315. Sub BumperB_Hit()
  1316. DOF 105,DOFPulse
  1317. 'PlaySoundAt "fx_bumpers3", BumperB
  1318. PlaySoundAt SoundFX("fx_bumpers3", DOFContactors), BumperB
  1319. BRollOff
  1320. If GameInProgress = False Or Tilt = True Then Exit Sub
  1321. RingAni(2) = 0 : For Each x In BRings : x.IsDropped = True : Next
  1322. TimerScoreTsd.Enabled = True
  1323. Me.TimerEnabled = True
  1324. If LightBotB.State = 1 Then AddScore 1000 : Playsound SoundFX("1000a", DOFChimes) : Else AddScore 100 : Playsound SoundFX("100a", DOFChimes)
  1325. End Sub
  1326.  
  1327. Sub BumperR1_Timer()
  1328. RingAni(1) = RingAni(1)+1
  1329. Select Case RingAni(1)
  1330. Case 1: BR1Ring3.IsDropped = False : BR2Ring3.IsDropped = False
  1331. Case 2: BR1Ring3.IsDropped = True : BR1Ring2.IsDropped = False : BR2Ring3.IsDropped = True : BR2Ring2.IsDropped = False
  1332. Case 3: BR1Ring2.IsDropped = True : BR1Ring1.IsDropped = False : BR2Ring2.IsDropped = True : BR2Ring1.IsDropped = False
  1333. Case 4: BR1Ring1.IsDropped = True : BR1Ring2.IsDropped = False : BR2Ring1.IsDropped = True : BR2Ring2.IsDropped = False
  1334. Case 5: BR1Ring2.IsDropped = True : BR1Ring3.IsDropped = False : BR2Ring2.IsDropped = True : BR2Ring3.IsDropped = False
  1335. Case 6: BR1Ring3.IsDropped = True : BR2Ring3.IsDropped = True : Me.TimerEnabled = False
  1336. End Select
  1337. End Sub
  1338.  
  1339. Sub BumperB_Timer()
  1340. RingAni(2) = RingAni(2)+1
  1341. Select Case RingAni(2)
  1342. Case 1: BBRing3.IsDropped = False
  1343. Case 2: BBRing3.IsDropped = True : BBRing2.IsDropped = False
  1344. Case 3: BBRing2.IsDropped = True : BBRing1.IsDropped = False
  1345. Case 4: BBRing1.IsDropped = True : BBRing2.IsDropped = False
  1346. Case 5: BBRing2.IsDropped = True : BBRing3.IsDropped = False
  1347. Case 6: BBRing3.IsDropped = True : Me.TimerEnabled = False
  1348. End Select
  1349. End Sub
  1350.  
  1351. Sub BumperAttTimer_Timer()
  1352. Blink = Blink + 1
  1353. If Blink = 3 Then Blink = 1
  1354. Select Case Blink
  1355. Case 1: BumperTopLightOn()
  1356. If BOn = True Then BumperBLightOn()
  1357. Case 2: BumperReset()
  1358. End Select
  1359. BumperAttTimer.Interval = 500
  1360. ' Me.Enabled = False
  1361. End Sub
  1362.  
  1363. Sub BumperAttTimerB_Timer()
  1364. Me.Enabled = False
  1365. End Sub
  1366.  
  1367. Sub KickerL_Hit()
  1368. BRollOff : Stopsound"cuphit" : Playsound"kicker_enter_center"
  1369. mKickL.MagnetOn = 0
  1370. If Tilt = True Then KickerL.TimerInterval = 200 : Exit Sub
  1371. If LampState (18) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1372. If LampState (22) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1373. KickerL.TimerInterval = 1100
  1374. TimerScoreTsd.Enabled = True
  1375. Me.TimerEnabled = True
  1376. End Sub
  1377.  
  1378. Sub KickerL_Timer()
  1379. DOF 110, 2
  1380. KickerL.Kick 147, 10 : LightKickerL.State = 1 : LightKickerL.TimerEnabled = True
  1381. KVar = CInt(Rnd*2)
  1382. Select Case KVar
  1383. ' Case 0: Playsound"popper"
  1384. ' Case 1: Playsound"popper"
  1385. ' Case 2: Playsound"popper"
  1386. Case 0: PlaySound SoundFX("popper", DOFContactors)
  1387. Case 1: PlaySound SoundFX("popper", DOFContactors)
  1388. Case 2: PlaySound SoundFX("popper", DOFContactors)
  1389. End Select
  1390. 'Playsound"Kick"
  1391. PlaySound SoundFX("Kick", DOFContactors)
  1392. Me.TimerEnabled = False
  1393. End Sub
  1394.  
  1395. Sub KickerR_Hit()
  1396. BRollOff : Stopsound"cuphit" : Playsound"kicker_enter_center"
  1397. mKickR.MagnetOn = 0
  1398. If Tilt = True Then KickerR.TimerInterval = 200 : Exit Sub
  1399. If LampState (19) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1400. If LampState (23) = 1 And EB = False Then EB = True : SetLamp 32, 1 : SetLamp 18, 0 : SetLamp 19, 0 : SetLamp 20, 0 : SetLamp 21, 0 : SetLamp 22, 0 : SetLamp 23, 0 : SetLamp 24, 0 : SetLamp 25, 0 : SetB2SData 35, 1
  1401. KickerR.TimerInterval = 1100
  1402. TimerScoreTsd.Enabled = True
  1403. Me.TimerEnabled = True
  1404. End Sub
  1405.  
  1406. Sub KickerR_Timer()
  1407. DOF 109, 2
  1408. KickerR.Kick 212, 10 : LightKickerR.State = 1 : LightKickerR.TimerEnabled = True
  1409. KVar = CInt(Rnd*2)
  1410. Select Case KVar
  1411. ' Case 0: Playsound"popper"
  1412. ' Case 1: Playsound"popper"
  1413. ' Case 2: Playsound"popper"
  1414. Case 0: PlaySound SoundFX("popper", DOFContactors)
  1415. Case 1: PlaySound SoundFX("popper", DOFContactors)
  1416. Case 2: PlaySound SoundFX("popper", DOFContactors)
  1417. End Select
  1418. 'Playsound"Kick"
  1419. PlaySound SoundFX("Kick", DOFContactors)
  1420. Me.TimerEnabled = False
  1421. End Sub
  1422.  
  1423. Sub LightKickerL_Timer
  1424. LightKickerL.State = 0
  1425. Me.TimerEnabled = False
  1426. End Sub
  1427.  
  1428. Sub LightKickerR_Timer
  1429. LightKickerR.State = 0
  1430. Me.TimerEnabled = False
  1431. End Sub
  1432.  
  1433. 'Kickersimulation
  1434. Sub GrabLOn : KickerL.Enabled = False : mKickL.MagnetOn = 1 : End Sub
  1435. Sub GrabLOff : KickerL.Enabled = True : mKickL.MagnetOn = 0 : End Sub
  1436. Sub GrabROn : KickerR.Enabled = False : mKickR.MagnetOn = 1 : End Sub
  1437. Sub GrabROff : KickerR.Enabled = True : mKickR.MagnetOn = 0 : End Sub
  1438. Sub MCenterL_Hit : TimerGrabL.Enabled = True : BRollOff : End Sub
  1439. Sub MCenterR_Hit : TimerGrabR.Enabled = True : BRollOff : End Sub
  1440. Sub TriggerZL_Hit : BRollOff : Playsound"cuphit" : End Sub
  1441. Sub TriggerZR_Hit : BRollOff : Playsound"cuphit" : End Sub
  1442. Sub TriggerZL_Unhit : GrabLOn : End Sub
  1443. Sub TriggerZR_Unhit : GrabROn : End Sub
  1444. Sub TimerGrabL_Timer : GrabLOff : Me.Enabled = False : End Sub
  1445. Sub TimerGrabR_Timer : GrabROff : Me.Enabled = False : End Sub
  1446. '-------------------------------------------------------------
  1447.  
  1448. Sub TriggerLaunch_Hit() : Playsound"" : TriggerLaunch2.Enabled = False : End Sub
  1449. Sub TriggerLaunch2_Hit() : Playsound"" : End Sub
  1450. Sub TriggerGIP_Hit()
  1451. EB = False : EBReady = True : SpecialReady = True : SetLamp 32, 0 : SetB2SData 35, 0 : TriggerLaunch2.Enabled = True
  1452. DummyG.IsDropped = True : DummyG.TimerEnabled = True
  1453. End Sub
  1454.  
  1455. Sub DummyG_Timer
  1456. DummyG.IsDropped = False
  1457. Me.TimerEnabled = False
  1458. End Sub
  1459. 'sounds------------------------------
  1460. Sub BRollOnQ
  1461. ' BRollOff
  1462. ' BRoll = CInt(Rnd*6)
  1463. ' Select Case BRoll
  1464. ' Case 0: Playsound"BrollA"
  1465. ' Case 1: Playsound"BrollB"
  1466. ' Case 2: Playsound"BrollC"
  1467. ' Case 3: Playsound"BrollD"
  1468. ' Case 4: Playsound"BrollE"
  1469. ' Case 5: Playsound"BrollF"
  1470. ' Case 6: Playsound"BrollG"
  1471. ' End Select
  1472. End Sub
  1473.  
  1474. Sub BRollOnL
  1475. ' BRollOff
  1476. ' BRoll = CInt(Rnd*6)
  1477. ' Select Case BRoll
  1478. ' Case 0: Playsound"BrollAL"
  1479. ' Case 1: Playsound"BrollBL"
  1480. ' Case 2: Playsound"BrollCL"
  1481. ' Case 3: Playsound"BrollDL"
  1482. ' Case 4: Playsound"BrollEL"
  1483. ' Case 5: Playsound"BrollFL"
  1484. ' Case 6: Playsound"BrollGL"
  1485. ' End Select
  1486. End Sub
  1487.  
  1488. Sub BRollOff
  1489. ' Stopsound"Brollback"
  1490. ' Stopsound"BrollA" : Stopsound"BrollB" : Stopsound"BrollC" : Stopsound"BrollD" : Stopsound"BrollE" : Stopsound"BrollF" : Stopsound"BrollG" : Stopsound"Launch"
  1491. ' Stopsound"BrollAL" : Stopsound"BrollBL" : Stopsound"BrollCL" : Stopsound"BrollDL" : Stopsound"BrollEL" : Stopsound"BrollFL" : Stopsound"BrollGL"
  1492. End Sub
  1493.  
  1494. Sub CollOff
  1495. Stopsound"rub1" : Stopsound"rub2" : Stopsound"rub3" : Stopsound"rub4" : Stopsound"rub5"
  1496. Stopsound"rubstring1" : Stopsound"rubstring2" : Stopsound"rubstring3" : Stopsound"rubstring4" : Stopsound"rubstring5"
  1497. Stopsound"FLCOLL1" : Stopsound"FLCOLL12" : Stopsound"FLCOLL21" : Stopsound"FLCOLL22" : Stopsound"FLCOLL3"
  1498. Stopsound"FLCOLL32" : Stopsound"FLCOLL4" : Stopsound"FLCOLL42" : Stopsound"FLCOLL5" : Stopsound"FLCOLL52"
  1499. Stopsound"wall1" : Stopsound"wall2" : Stopsound"wall3" : Stopsound"wall4" : Stopsound"wall5"
  1500. Stopsound"metal1" : Stopsound"metal2" : Stopsound"metal3" : Stopsound"metal4" : Stopsound"metal5"
  1501. Stopsound"metal21" : Stopsound"metal22" : Stopsound"metal23" : Stopsound"metal24" : Stopsound"metal25"
  1502. Stopsound"pla1" : Stopsound"pla2" : Stopsound"pla3" : Stopsound"pla4" : Stopsound"pla5"
  1503. Stopsound"blech1" : Stopsound"blech2" : Stopsound"blech3" : Stopsound"blech4" : Stopsound"blech5"
  1504. End Sub
  1505.  
  1506. Sub SRub_Slingshot(Index)
  1507. 'AddScore 10 : Playsound"10A" : DOF 129, 2
  1508. AddScore 10 : Playsound SoundFX("10A", DOFChimes) : DOF 129, 2
  1509. AlternateEBReady
  1510. End Sub
  1511.  
  1512. Sub SRub_Hit(Index)
  1513. BRollOff : CollOff
  1514. CheckSpeed
  1515. If FinalSpeed < 3 Then Playsound"rubstring1"
  1516. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"rubstring2"
  1517. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"rubstring3"
  1518. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"rubstring4"
  1519. If FinalSpeed > 14 Then Playsound"rubstring5"
  1520. End Sub
  1521.  
  1522. Sub walls_Hit(Index)
  1523. BRollOff : CollOff
  1524. CheckSpeed
  1525. If FinalSpeed < 3 Then Playsound"wall1"
  1526. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"wall2"
  1527. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"wall3"
  1528. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"wall4"
  1529. If FinalSpeed > 14 Then Playsound"wall5"
  1530. End Sub
  1531.  
  1532. Sub rails_Hit(Index)
  1533. BRollOff : CollOff
  1534. CheckSpeed
  1535. If FinalSpeed < 3 Then Playsound"metal21"
  1536. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"metal22"
  1537. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"metal23"
  1538. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"metal24"
  1539. If FinalSpeed > 14 Then Playsound"metal25"
  1540. End Sub
  1541.  
  1542. Sub metals_Hit(Index)
  1543. BRollOff : CollOff
  1544. CheckSpeed
  1545. If FinalSpeed < 3 Then Playsound"metal1"
  1546. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"metal2"
  1547. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"metal3"
  1548. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"metal4"
  1549. If FinalSpeed > 14 Then Playsound"metal5"
  1550. End Sub
  1551.  
  1552. Sub posts_Hit(Index)
  1553. BRollOff : CollOff
  1554. CheckSpeed
  1555. If FinalSpeed < 3 Then Playsound"rub1"
  1556. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"rub2"
  1557. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"rub3"
  1558. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"rub4"
  1559. If FinalSpeed > 14 Then Playsound"rub5"
  1560. End Sub
  1561.  
  1562. Sub plastics_Hit(Index)
  1563. BRollOff : CollOff
  1564. CheckSpeed
  1565. If FinalSpeed < 3 Then Playsound"pla1"
  1566. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"pla2"
  1567. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"pla3"
  1568. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"pla4"
  1569. If FinalSpeed > 14 Then Playsound"pla5"
  1570. End Sub
  1571.  
  1572. Sub blech_Hit(Index)
  1573. BRollOff : CollOff
  1574. CheckSpeed
  1575. If FinalSpeed < 3 Then Playsound"blech1"
  1576. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"blech2"
  1577. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"blech3"
  1578. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"blech4"
  1579. If FinalSpeed > 14 Then Playsound"blech5"
  1580. End Sub
  1581.  
  1582. Sub LeftFlipper_Collide(parm)
  1583. BRollOff : CollOff
  1584. CheckSpeed
  1585. If FinalSpeed < 3 Then Playsound"FLCOLL1"
  1586. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"FLCOLL22"
  1587. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"FLCOLL3"
  1588. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"FLCOLL4"
  1589. If FinalSpeed > 14 Then Playsound"FLCOLL5"
  1590. End Sub
  1591.  
  1592. Sub RightFlipper_Collide(parm)
  1593. BRollOff : CollOff
  1594. CheckSpeed
  1595. If FinalSpeed < 3 Then Playsound"FLCOLL12"
  1596. If FinalSpeed > 2 And FinalSpeed <7 Then Playsound"FLCOLL21"
  1597. If FinalSpeed > 6 And FinalSpeed <11 Then Playsound"FLCOLL32"
  1598. If FinalSpeed > 10 And FinalSpeed <15 Then Playsound"FLCOLL42"
  1599. If FinalSpeed > 14 Then Playsound"FLCOLL52"
  1600. End Sub
  1601.  
  1602. Sub LeftFlipper1_Collide(parm)
  1603. BRollOff : CollOff
  1604. CheckSpeed
  1605. If FinalSpeed < 3 Then Playsound"FLCOLL1"
  1606. If FinalSpeed > 2 And FinalSpeed <9 Then Playsound"FLCOLL22"
  1607. If FinalSpeed > 6 And FinalSpeed <13 Then Playsound"FLCOLL3"
  1608. If FinalSpeed > 10 And FinalSpeed <17 Then Playsound"FLCOLL4"
  1609. If FinalSpeed > 14 Then Playsound"FLCOLL5"
  1610. End Sub
  1611.  
  1612. Sub RightFlipper1_Collide(parm)
  1613. BRollOff : CollOff
  1614. CheckSpeed
  1615. If FinalSpeed < 3 Then Playsound"FLCOLL12"
  1616. If FinalSpeed > 2 And FinalSpeed <9 Then Playsound"FLCOLL21"
  1617. If FinalSpeed > 6 And FinalSpeed <13 Then Playsound"FLCOLL32"
  1618. If FinalSpeed > 10 And FinalSpeed <17 Then Playsound"FLCOLL42"
  1619. If FinalSpeed > 14 Then Playsound"FLCOLL52"
  1620. End Sub
  1621.  
  1622. Sub LeftOut_Hit() : CenterOut.Enabled = False : Stopsound"LostSide" : Playsound"LostSide" : End Sub
  1623. Sub RightOut_Hit() : CenterOut.Enabled = False : Stopsound"LostSide" : Playsound"LostSide" : End Sub
  1624. Sub CenterOut_Hit() : Stopsound"LostCenter" : Playsound"LostCenter" : End Sub
  1625. Sub TriggerROs_Hit(Index) : Playsound"Switch3" : End Sub
  1626. Sub Gate1_Hit() : Playsound"Gate" : Controller.B2SSetBallInPlay 1 : BallInPlay.state=1 : End Sub
  1627. Sub Gate_Hit() : Playsound"Gate" : End Sub
  1628. Sub DummyG_Hit() : Playsound"GateL" : End Sub
  1629. '---------------------------------------------------------------------------------------------------
  1630.  
  1631. Sub triggerstop_Hit(Index)
  1632. BumperAttTimer.Enabled = False : Blink = 0
  1633. SetLamp 29,1 : SetLamp 26,1 : LightBR1Ref.State = 1 : LightGR1.State = 1
  1634. BR1Off.WidthBottom = 0 : BR1Off.WidthTop = 0 : BR1On.WidthBottom = 60 : BR1On.WidthTop = 65 : Abs(LightAniBR1.State -1)
  1635. SetLamp 30,1 : SetLamp 27,1 : LightBR2Ref.State = 1 : LightGR2.State = 1
  1636. BR2Off.WidthBottom = 0 : BR2Off.WidthTop = 0 : BR2On.WidthBottom = 60 : BR2On.WidthTop = 65 : Abs(LightAniBR2.State -1)
  1637. End Sub
  1638.  
  1639. '----------------------------------------
  1640. ' JP's Fading Lamps v4.1 VP9 Fading only
  1641. ' Based on PD's Fading Lights
  1642. ' SetLamp 0 is Off
  1643. ' SetLamp 1 is On
  1644. ' LampState(x) current state
  1645. '----------------------------------------
  1646.  
  1647. Dim LampState(33)
  1648. TimerFade.Interval = 25
  1649.  
  1650. Sub TimerFade_Timer() : UpdateLamps : End Sub
  1651.  
  1652. Sub UpdateLamps
  1653.  
  1654. FadeL 0, LightDB, LightDB1
  1655. FadeL 1, LightBonus1, LightBonus11
  1656. FadeL 2, LightBonus2, LightBonus21
  1657. FadeL 3, LightBonus3, LightBonus31
  1658. FadeL 4, LightBonus4, LightBonus41
  1659. FadeL 5, LightBonus5, LightBonus51
  1660. FadeL 6, LightBonus6, LightBonus61
  1661. FadeL 7, LightBonus7, LightBonus71
  1662. FadeL 8, LightBonus8, LightBonus81
  1663. FadeL 9, LightBonus9, LightBonus91
  1664. FadeL 10, LightBonus10, LightBonus101
  1665. FadeL 11, LightTopROA, LightTopROA1
  1666. FadeL 12, LightTopROB, LightTopROB1
  1667. FadeL 13, LightTopROC, LightTopROC1
  1668. FadeL 14, LightBotROA, LightBotROA1
  1669. FadeL 15, LightBotROC, LightBotROC1
  1670. FadeL 16, LightBankL, LightBankL1
  1671. FadeL 17, LightBankR, LightBankR1
  1672. FadeL 18, LightTopEBL, LightTopEBL1
  1673. FadeL 19, LightTopEBR, LightTopEBR1
  1674. FadeL 20, LightBotEBL, LightBotEBL1
  1675. FadeL 21, LightBotEBR, LightBotEBR1
  1676. FadeL 22, LightTopSpecL, LightTopSpecL1
  1677. FadeL 23, LightTopSpecR, LightTopSpecR1
  1678. FadeL 24, LightBotSpecL, LightBotSpecL1
  1679. FadeL 25, LightBotSpecR, LightBotSpecR1
  1680. FadeL 26, LightTopR1, LightTopR11
  1681. FadeL 27, LightTopR2, LightTopR21
  1682. FadeL 28, LightTopB, LightTopB1
  1683. FadeL 29, LightBotR1, LightBotR11
  1684. FadeL 30, LightBotR2, LightBotR21
  1685. FadeL 31, LightBotB, LightBotB1
  1686. FadeL 32, LightSPSA, LightSPSA1
  1687. End Sub
  1688.  
  1689. Sub SetLamp(nr, value)
  1690. If value = 0 And LampState(nr) = 0 Then Exit Sub
  1691. If value = 1 And LampState(nr) = 1 Then Exit Sub
  1692. LampState(nr) = Abs(value) + 4
  1693. End Sub
  1694.  
  1695. Sub FadeL(nr, a, b)
  1696. Select Case LampState(nr)
  1697. Case 2:b.state = 0:LampState(nr) = 0
  1698. Case 3:b.state = 1:LampState(nr) = 2
  1699. Case 4:a.state = 0:LampState(nr) = 3
  1700. Case 5:b.state = 1:LampState(nr) = 6
  1701. Case 6:a.state = 1:LampState(nr) = 1
  1702. End Select
  1703. End Sub
  1704.  
  1705. Sub FadeR(nr, a)
  1706. Select Case LampState(nr)
  1707. Case 2:a.SetValue 3:LampState(nr) = 0
  1708. Case 3:a.SetValue 2:LampState(nr) = 2
  1709. Case 4:a.SetValue 1:LampState(nr) = 3
  1710. Case 5:a.SetValue 1:LampState(nr) = 6
  1711. Case 6:a.SetValue 0:LampState(nr) = 1
  1712. End Select
  1713. End Sub
  1714.  
  1715. Sub AllLampsOff
  1716. Dim g
  1717. For x = 0 to 33
  1718. LampState(x) = 4
  1719. Next
  1720. for each g in GILights
  1721. g.state=0
  1722. next
  1723. Bumper1.State = 0 : Bumper2.State = 0 : Bumper3.State = 0 : Bumper4.State = 0
  1724. UpdateLamps
  1725. End Sub
  1726.  
  1727. Sub AllLampsOn
  1728. dim g
  1729. For x = 0 to 33
  1730. LampState(x) = 1
  1731. Next
  1732. UpdateLamps
  1733. Bumper1.State = 1 : Bumper2.State = 1 : Bumper3.State = 1 : Bumper4.State = 1
  1734. for each g in GILights
  1735. g.state=1
  1736. next
  1737. End Sub
  1738.  
  1739. Sub LightReset()
  1740. SetLamp 16,0 : SetLamp 17,0 : SetLamp 18,0 : SetLamp 19,0 : SetLamp 20,0
  1741. SetLamp 21,0 : SetLamp 22,0 : SetLamp 23,0 : SetLamp 24,0 : SetLamp 25,0
  1742. SetLamp 11,1 : SetLamp 12,1 : SetLamp 13,1 : SetLamp 14,1 : SetLamp 15,1
  1743. SetLamp 0,0
  1744. End Sub
  1745.  
  1746.  
  1747. ' ************ Additional Code ***************
  1748.  
  1749. '***************************************************************
  1750. ' Supporting Ball & Sound Functions v3.0
  1751. ' includes random pitch in PlaySoundAt and PlaySoundAtBall
  1752. '***************************************************************
  1753.  
  1754. Dim TableWidth, TableHeight
  1755.  
  1756. TableWidth = Table.width
  1757. TableHeight = Table.height
  1758.  
  1759. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1760. Vol = Csng(BallVel(ball) ^2 / 2000)
  1761. End Function
  1762.  
  1763. Function AudioPan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1764. Dim tmp
  1765. tmp = ball.x * 2 / TableWidth-1
  1766. If tmp > 0 Then
  1767. AudioPan = Csng(tmp ^10)
  1768. Else
  1769. AudioPan = Csng(-((- tmp) ^10))
  1770. End If
  1771. End Function
  1772.  
  1773. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1774. Pitch = BallVel(ball) * 20
  1775. End Function
  1776.  
  1777. Function BallVel(ball) 'Calculates the ball speed
  1778. BallVel = (SQR((ball.VelX ^2) + (ball.VelY ^2)))
  1779. End Function
  1780.  
  1781. Function AudioFade(ball) 'only on VPX 10.4 and newer
  1782. Dim tmp
  1783. tmp = ball.y * 2 / TableHeight-1
  1784. If tmp > 0 Then
  1785. AudioFade = Csng(tmp ^10)
  1786. Else
  1787. AudioFade = Csng(-((- tmp) ^10))
  1788. End If
  1789. End Function
  1790.  
  1791. Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of a fast object, like bumpers, flippers and other solenoids
  1792. PlaySound soundname, 0, 1, AudioPan(tableobj), 0.1, 0, 0, 0, AudioFade(tableobj)
  1793. End Sub
  1794.  
  1795. Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets, metals, plastics
  1796. PlaySound soundname, 0, Vol(ActiveBall), AudioPan(ActiveBall), 0.4, 0, 0, 0, AudioFade(ActiveBall)
  1797. End Sub
  1798.  
  1799.  
  1800. '***********************************************
  1801. ' JP's VP10 Rolling Sounds + Ballshadow v3.0
  1802. ' uses a collection of shadows, aBallShadow
  1803. '***********************************************
  1804.  
  1805. Sub RollingTimer_timer
  1806. RollingUpdate
  1807. End Sub
  1808.  
  1809. Const tnob = 4 'total number of balls, 20 balls, from 0 to 19
  1810. Const lob = 0 'number of locked balls
  1811. Const maxvel = 25 'max ball velocity
  1812. ReDim rolling(tnob)
  1813. InitRolling
  1814.  
  1815. Sub InitRolling
  1816. Dim i
  1817. For i = 0 to tnob
  1818. rolling(i) = False
  1819. Next
  1820. End Sub
  1821.  
  1822. Sub RollingUpdate()
  1823. Dim BOT, b, ballpitch, ballvol, speedfactorx, speedfactory
  1824. BOT = GetBalls
  1825.  
  1826. ' stop the sound of deleted balls and hide the shadow
  1827. For b = UBound(BOT) + 1 to tnob
  1828. rolling(b) = False
  1829. StopSound("fx_ballrolling" & b)
  1830. aBallShadow(b).Y = 3000
  1831. Next
  1832.  
  1833. ' exit the sub if no balls on the table
  1834. If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table
  1835.  
  1836. ' play the rolling sound for each ball and draw the shadow
  1837. For b = lob to UBound(BOT)
  1838. aBallShadow(b).X = BOT(b).X
  1839. aBallShadow(b).Y = BOT(b).Y
  1840.  
  1841. If BallVel(BOT(b))> 1 Then
  1842. If BOT(b).z <30 Then
  1843. ballpitch = Pitch(BOT(b))
  1844. ballvol = Vol(BOT(b))
  1845. Else
  1846. ballpitch = Pitch(BOT(b)) + 25000 'increase the pitch on a ramp
  1847. ballvol = Vol(BOT(b)) * 10
  1848. End If
  1849. rolling(b) = True
  1850. PlaySound("fx_ballrolling" & b), -1, ballvol, AudioPan(BOT(b)), 0, ballpitch, 1, 0, AudioFade(BOT(b))
  1851. Else
  1852. If rolling(b) = True Then
  1853. StopSound("fx_ballrolling" & b)
  1854. rolling(b) = False
  1855. End If
  1856. End If
  1857.  
  1858. ' rothbauerw's Dropping Sounds
  1859. If BOT(b).VelZ <-1 and BOT(b).z <55 and BOT(b).z> 27 Then 'height adjust for ball drop sounds
  1860. PlaySound "fx_balldrop", 0, ABS(BOT(b).velz) / 17, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  1861. End If
  1862.  
  1863. ' jps ball speed control
  1864. If BOT(b).VelX AND BOT(b).VelY <> 0 Then
  1865. speedfactorx = ABS(maxvel / BOT(b).VelX)
  1866. speedfactory = ABS(maxvel / BOT(b).VelY)
  1867. If speedfactorx <1 Then
  1868. BOT(b).VelX = BOT(b).VelX * speedfactorx
  1869. BOT(b).VelY = BOT(b).VelY * speedfactorx
  1870. End If
  1871. If speedfactory <1 Then
  1872. BOT(b).VelX = BOT(b).VelX * speedfactory
  1873. BOT(b).VelY = BOT(b).VelY * speedfactory
  1874. End If
  1875. End If
  1876. Next
  1877. End Sub
  1878.  
  1879. ' **** Hit Sounds *****
  1880. Sub aWireHit_Hit(idx)
  1881. Select Case Int(Rnd*3)+1
  1882. Case 1: PlaySoundAtBall "WireHit1"
  1883. Case 2: PlaySoundAtBall "WireHit2"
  1884. Case 3: PlaySoundAtBall "WireHit3"
  1885. End Select
  1886. End Sub
  1887.  
  1888.  
  1889. Sub SetPlayers
  1890. If Players=1 Then
  1891. Players1.state=1
  1892. Else
  1893. Players1.state=0
  1894. End If
  1895.  
  1896. If Players=2 Then
  1897. Players2.state=1
  1898. Else
  1899. Players2.state=0
  1900. End If
  1901.  
  1902. If Players=3 Then
  1903. Players3.state=1
  1904. Else
  1905. Players3.state=0
  1906. End If
  1907.  
  1908. If Players=4 Then
  1909. Players4.state=1
  1910. Else
  1911. Players4.state=0
  1912. End If
  1913. End Sub
  1914.  
  1915. Sub SetPUP
  1916. If pu=1 Then
  1917. playerUP1.state=1
  1918. Else
  1919. playerUP1.state=0
  1920. End If
  1921.  
  1922. If pu=2 Then
  1923. playerUP2.state=1
  1924. Else
  1925. playerUP2.state=0
  1926. End If
  1927.  
  1928. If pu=3 Then
  1929. playerUP3.state=1
  1930. Else
  1931. playerUP3.state=0
  1932. End If
  1933.  
  1934. If pu=4 Then
  1935. playerUP4.state=1
  1936. Else
  1937. playerUP4.state=0
  1938. End If
  1939. End Sub
  1940.  
  1941. Sub table_exit
  1942. controller.stop
  1943. end sub
Advertisement
Add Comment
Please, Sign In to add comment