Outhere

Now (Gottlieb 1971) Loserman76 patch 1.1.0

Mar 11th, 2022
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 73.65 KB | None | 0 0
  1. '*
  2. '* Gottlieb's Now (1971)
  3. '* Table build/scripted by Loserman76
  4. '* Playfield/Plastics by GNance
  5. '*
  6. '* Graphic update (render, lights, shadows...) by Bord
  7.  
  8. option explicit
  9. Randomize
  10. ExecuteGlobal GetTextFile("core.vbs")
  11. '
  12. ' DOF config - leeoneil
  13. '
  14. ' Option for more lights effects with DOF (Undercab effects on bumpers and slingshots)
  15. ' "True" to activate (False by default)
  16. Const Epileptikdof = False
  17. '
  18. ' Flippers L/R - 101/102
  19. ' Kcikers L/R - 103/104
  20. ' Bumpers - 105/106/107
  21. ' Targets L/R - 108/109/110/111
  22. ' Drop target - 112/113
  23. ' Drop target Reset - 115/116
  24. ' Ball release - 114
  25. ' LED backboard
  26. ' Flasher Outside Left - 210/212/216/221/224/226/250/260
  27. ' Flasher left - 207/214/217/222/231/250/260
  28. ' Flasher center - 208/229/250/260
  29. ' Flasher right - 209/215/218/223/231/250/260
  30. ' Flasher Outside - 211/213/219/220/225/228/250/260
  31. '
  32. ' Start Button - 200
  33. ' Undercab - 201/202
  34. ' Strobe - 230
  35. ' Knocker - 300
  36. ' Chimes - 301/302/303
  37.  
  38. On Error Resume Next
  39. ExecuteGlobal GetTextFile("Controller.vbs")
  40. If Err Then MsgBox "Unable to open Controller.vbs. Ensure that it is in the scripts folder."
  41. On Error Goto 0
  42.  
  43. Const cGameName = "Now_1971"
  44.  
  45.  
  46. Const ShadowFlippersOn = true
  47. Const ShadowBallOn = true
  48.  
  49. Const ShadowConfigFile = false
  50.  
  51. Dim Controller ' B2S
  52. Dim B2SScore ' B2S Score Displayed
  53. Dim B2SOn 'True/False if want backglass
  54.  
  55. Const HSFileName="Now_71VPX.txt"
  56. Const B2STableName="Now_1971"
  57. Const LMEMTableConfig="LMEMTables.txt"
  58. Const LMEMShadowConfig="LMEMShadows.txt"
  59. Dim EnableBallShadow
  60. Dim EnableFlipperShadow
  61.  
  62.  
  63. '* this value adjusts score motor behavior - 0 allows you to continue scoring while the score motor is running - 1 sets score motor to behave more like a real EM
  64. Const ScoreMotorAdjustment=1
  65.  
  66. '* this is a debug setting to use an older scoring routine vs a newer score routine - don't change this value
  67. Const ScoreAdditionAdjustment=1
  68.  
  69. '* this controls whether you hear bells (0) or chimes (1) when scoring
  70. Const ChimesOn=1
  71.  
  72. dim ScoreChecker
  73. dim CheckAllScores
  74. dim sortscores(4)
  75. dim sortplayers(4)
  76. Dim TextStr,TextStr2
  77. Dim i,xx,LStep,RStep
  78. Dim obj
  79. Dim bgpos
  80. Dim kgpos
  81. Dim dooralreadyopen
  82. Dim kgdooralreadyopen
  83. Dim TargetSpecialLit
  84. Dim Points210counter
  85. Dim Points500counter
  86. Dim Points1000counter
  87. Dim Points2000counter
  88. Dim BallsPerGame
  89. Dim InProgress
  90. Dim BallInPlay
  91. Dim CreditsPerCoin
  92. Dim Score100K(4)
  93. Dim Score(4)
  94. Dim ScoreDisplay(4)
  95. Dim HighScorePaid(4)
  96. Dim HighScore
  97. Dim HighScoreReward
  98. Dim BonusMultiplier
  99. Dim Credits
  100. Dim Match
  101. Dim Replay1
  102. Dim Replay2
  103. Dim Replay3
  104. Dim Replay1Paid(4)
  105. Dim Replay2Paid(4)
  106. Dim Replay3Paid(4)
  107. Dim TableTilted
  108. Dim TiltCount
  109.  
  110. Dim OperatorMenu
  111.  
  112. Dim BonusBooster
  113. Dim BonusBoosterCounter
  114. Dim BonusCounter
  115. Dim HoleCounter
  116.  
  117. Dim Ones
  118. Dim Tens
  119. Dim Hundreds
  120. Dim Thousands
  121.  
  122. Dim Player
  123. Dim Players
  124.  
  125. Dim rst
  126. Dim bonuscountdown
  127. Dim TempMultiCounter
  128. dim TempPlayerup
  129. dim RotatorTemp
  130.  
  131. Dim bump1
  132. Dim bump2
  133. Dim bump3
  134.  
  135. Dim LastChime10
  136. Dim LastChime100
  137. Dim LastChime1000
  138.  
  139. Dim Score10
  140. Dim Score100
  141.  
  142. Dim targettempscore
  143.  
  144. Dim LeftTargetCounter
  145. Dim RightTargetCounter
  146.  
  147. Dim MotorRunning
  148. Dim Replay1Table(15)
  149. Dim Replay2Table(15)
  150. Dim Replay3Table(15)
  151. Dim ReplayTableSet
  152. Dim ReplayLevel
  153. Dim ReplayTableMax
  154. Dim BonusSpecialThreshold
  155. Dim ZeroToNine
  156.  
  157. Sub Table1_Init()
  158. If Table1.ShowDT = false then
  159. For each obj in DesktopCrap
  160. obj.visible=False
  161. next
  162. End If
  163.  
  164. OperatorMenuBackdrop.image = "PostitBL"
  165. For XOpt = 1 to MaxOption
  166. Eval("OperatorOption"&XOpt).image = "PostitBL"
  167. next
  168.  
  169. For XOpt = 1 to 256
  170. Eval("Option"&XOpt).image = "PostItBL"
  171. next
  172.  
  173. LoadEM
  174. LoadLMEMConfig2
  175.  
  176. HideOptions
  177. SetupReplayTables
  178. PlasticsOn
  179. BumpersOff
  180. OperatorMenu=0
  181. HighScore=0
  182. MotorRunning=0
  183. HighScoreReward=1
  184. Credits=0
  185. BallsPerGame=5
  186. ReplayLevel=1
  187. BonusSpecialThreshold=1
  188. loadhs
  189. if HighScore=0 then HighScore=50000
  190.  
  191.  
  192. TableTilted=false
  193.  
  194. Match=int(Rnd*10)
  195. MatchReel.SetValue((Match)+1)
  196.  
  197. CanPlayReel.SetValue(0)
  198. BallInPlayReel.SetValue(0)
  199.  
  200. For each obj in PlayerHuds
  201. obj.SetValue(0)
  202. next
  203.  
  204. For each obj in PlayerHUDScores
  205. obj.state=0
  206. next
  207.  
  208. For each obj in PlayerScoresOn
  209. obj.ResetToZero
  210. next
  211.  
  212. For each obj in PlayerScores
  213. obj.ResetToZero
  214. next
  215.  
  216. for each obj in bottgate
  217. obj.isdropped=true
  218. next
  219. for each obj in kickgate
  220. obj.isdropped=true
  221. next
  222. for each obj in Bonus
  223. obj.state=0
  224. next
  225. for each obj in StarLights
  226. obj.state=1
  227. next
  228.  
  229. Replay1=Replay1Table(ReplayLevel)
  230. Replay2=Replay2Table(ReplayLevel)
  231. Replay3=Replay3Table(ReplayLevel)
  232. ZeroToNine=9
  233. BonusCounter=0
  234. HoleCounter=0
  235. bgpos=6
  236. kgpos=0
  237.  
  238.  
  239. InstructCard.image="IC"+FormatNumber(BallsPerGame,0)+"0"
  240. RefreshReplayCard
  241. GameOverReel.SetValue(1)
  242. TiltReel.SetValue(1)
  243.  
  244. Bumper1Light.state=0
  245. Bumper2Light.state=0
  246. Bumper3Light.state=0
  247. BumpersOff
  248.  
  249. TargetSpecialLit = 0
  250. Points210counter=0
  251. Points500counter=0
  252. Points1000counter=0
  253. Points2000counter=0
  254.  
  255. BonusBooster=3
  256. BonusBoosterCounter=0
  257. Players=0
  258. RotatorTemp=1
  259. InProgress=false
  260.  
  261.  
  262. ScoreText.text=HighScore
  263.  
  264.  
  265. If B2SOn Then
  266. If Match = 0 then
  267. Controller.B2SSetMatch 10
  268. else
  269. Controller.B2SSetMatch Match
  270. end if
  271.  
  272. Controller.B2SSetScoreRolloverPlayer1 0
  273. Controller.B2SSetScoreRolloverPlayer2 0
  274. Controller.B2SSetScoreRolloverPlayer3 0
  275. Controller.B2SSetScoreRolloverPlayer4 0
  276.  
  277. 'Controller.B2SSetScore 6,HighScore
  278. Controller.B2SSetTilt 1
  279. Controller.B2SSetCredits Credits
  280. Controller.B2SSetGameOver 1
  281. End If
  282.  
  283. for i=1 to 4
  284. player=i
  285. If B2SOn Then
  286. Controller.B2SSetScorePlayer player, 0
  287. End If
  288. next
  289. bump1=1
  290. bump2=1
  291. bump3=1
  292. InitPauser5.enabled=true
  293. If Credits > 0 Then DOF 200, DOfOn
  294. End Sub
  295.  
  296. Sub Table1_exit()
  297. savehs
  298. SaveLMEMConfig
  299. SaveLMEMConfig2
  300. If B2SOn Then Controller.Stop
  301. end sub
  302.  
  303.  
  304. Sub Table1_KeyDown(ByVal keycode)
  305.  
  306. ' GNMOD
  307. if EnteringInitials then
  308. CollectInitials(keycode)
  309. exit sub
  310. end if
  311.  
  312.  
  313. if EnteringOptions then
  314. CollectOptions(keycode)
  315. exit sub
  316. end if
  317.  
  318.  
  319.  
  320. If keycode = PlungerKey Then
  321. Plunger.PullBack
  322. PlungerPulled = 1
  323. End If
  324.  
  325. if keycode = LeftFlipperKey and InProgress = false then
  326. OperatorMenuTimer.Enabled = true
  327. end if
  328. ' END GNMOD
  329.  
  330.  
  331. If keycode = LeftFlipperKey and InProgress=true and TableTilted=false Then
  332. LeftFlipper.RotateToEnd
  333. PlayLoopSoundAtVol "buzzL", LeftFlipper, 1
  334. PlaySoundAtVol SoundFXDOF ("FlipperUp",101,DOFOn,DOFContactors), LeftFlipper, 1
  335. End If
  336.  
  337. If keycode = RightFlipperKey and InProgress=true and TableTilted=false Then
  338. RightFlipper.RotateToEnd
  339.  
  340. PlaySoundAtVol SoundFXDOF ("FlipperUp",102,DOFOn,DOFContactors), RightFlipper, 1
  341. PlayLoopSoundAtVol "buzz", RightFlipper, 1
  342. End If
  343.  
  344. If keycode = LeftTiltKey Then
  345. Nudge 90, 2
  346. TiltIt
  347. End If
  348.  
  349. If keycode = RightTiltKey Then
  350. Nudge 270, 2
  351. TiltIt
  352. End If
  353.  
  354. If keycode = CenterTiltKey Then
  355. Nudge 0, 2
  356. TiltIt
  357. End If
  358.  
  359. If keycode = MechanicalTilt Then
  360. TiltCount=2
  361. TiltIt
  362. End If
  363.  
  364. If keycode = AddCreditKey or keycode = 4 then
  365. If B2SOn Then
  366. 'Controller.B2SSetScorePlayer6 HighScore
  367.  
  368. End If
  369.  
  370. playsound "coinin"
  371. AddSpecial2
  372. end if
  373.  
  374. if keycode = 5 then
  375. playsound "coinin"
  376. AddSpecial2
  377. keycode= StartGameKey
  378. end if
  379.  
  380.  
  381. if keycode = StartGameKey and Credits>0 and InProgress=true and Players>0 and Players<4 and BallInPlay<2 then
  382. Credits=Credits-1
  383. If Credits = 0 Then DOF 200, DOFOff
  384. CreditsReel.SetValue(Credits)
  385. Players=Players+1
  386. CanPlayReel.SetValue(Players)
  387. playsound "click"
  388. If B2SOn Then
  389. Controller.B2SSetCanPlay Players
  390. If Players=2 Then
  391. Controller.B2SSetScoreRolloverPlayer2 0
  392. End If
  393. If Players=3 Then
  394. Controller.B2SSetScoreRolloverPlayer3 0
  395. End If
  396. If Players=4 Then
  397. Controller.B2SSetScoreRolloverPlayer4 0
  398. End If
  399. Controller.B2SSetCredits Credits
  400. End If
  401. end if
  402.  
  403. if keycode=StartGameKey and Credits>0 and InProgress=false and Players=0 AND EnteringOptions=0 then
  404. 'GNMOD
  405. OperatorMenuTimer.Enabled = false
  406. 'END GNMOD
  407. Credits=Credits-1
  408. If Credits = 0 Then DOF 200, DOFOff
  409. CreditsReel.SetValue(Credits)
  410. Players=1
  411. CanPlayReel.SetValue(Players)
  412. MatchReel.SetValue(0)
  413. Player=1
  414. playsound "StartUpSequence"
  415. TempPlayerUp=Player
  416. ' PlayerUpRotator.enabled=true
  417. rst=0
  418. BallInPlay=1
  419. InProgress=true
  420. resettimer.enabled=true
  421. BonusMultiplier=1
  422. GameOverReel.SetValue(0)
  423. If B2SOn Then
  424. Controller.B2SSetTilt 0
  425. Controller.B2SSetGameOver 0
  426. Controller.B2SSetMatch 0
  427. Controller.B2SSetCredits Credits
  428. 'Controller.B2SSetScore 6,HighScore
  429. Controller.B2SSetCanPlay 1
  430. Controller.B2SSetData 81,0
  431. Controller.B2SSetData 82,0
  432. Controller.B2SSetData 83,0
  433. Controller.B2SSetData 84,0
  434. Controller.B2SSetPlayerUp 1
  435. Controller.B2SSetData 81,1
  436. Controller.B2SSetBallInPlay BallInPlay
  437. Controller.B2SSetScoreRolloverPlayer1 0
  438. End If
  439. If Table1.ShowDT = True then
  440. For each obj in PlayerScores
  441. ' obj.ResetToZero
  442. obj.Visible=true
  443. next
  444. For each obj in PlayerScoresOn
  445. ' obj.ResetToZero
  446. obj.Visible=false
  447. next
  448.  
  449. For each obj in PlayerHuds
  450. obj.SetValue(0)
  451. next
  452. For each obj in PlayerHUDScores
  453. obj.state=0
  454. next
  455. PlayerHuds(Player-1).SetValue(1)
  456. PlayerHUDScores(Player-1).state=1
  457. PlayerScores(Player-1).Visible=0
  458. PlayerScoresOn(Player-1).Visible=1
  459. end If
  460.  
  461. end if
  462.  
  463.  
  464.  
  465. End Sub
  466.  
  467. Sub Table1_KeyUp(ByVal keycode)
  468.  
  469. ' GNMOD
  470. if EnteringInitials then
  471. exit sub
  472. end if
  473.  
  474. If keycode = PlungerKey Then
  475.  
  476. if PlungerPulled = 0 then
  477. exit sub
  478. end if
  479.  
  480. PlaySoundAtVol "plungerrelease", Plunger, 1
  481. Plunger.Fire
  482. End If
  483.  
  484. if keycode = LeftFlipperKey then
  485. OperatorMenuTimer.Enabled = false
  486. end if
  487.  
  488. ' END GNMOD
  489.  
  490. If keycode = LeftFlipperKey and InProgress=true and TableTilted=false Then
  491. LeftFlipper.RotateToStart
  492. PlaySoundAtVol SoundFXDOF ("FlipperDown",101,DOFOff,DOFContactors), LeftFlipper, 1
  493. StopSound "buzzL"
  494. End If
  495.  
  496. If keycode = RightFlipperKey and InProgress=true and TableTilted=false Then
  497. RightFlipper.RotateToStart
  498. PlaySoundAtVol SoundFXDOF ("FlipperDown",102,DOFOff,DOFContactors), RightFlipper, 1
  499. StopSound "buzz"
  500. End If
  501.  
  502. End Sub
  503.  
  504.  
  505.  
  506. Sub Drain_Hit()
  507.  
  508. Drain.DestroyBall
  509. PlaySound "fx_drain"
  510. DOF 229, DOFPulse
  511. If Epileptikdof = True Then DOF 231, DOFPulse End If
  512. Pause4Bonustimer.enabled=1
  513.  
  514. End Sub
  515.  
  516. Sub Pause4Bonustimer_timer
  517. Pause4Bonustimer.enabled=0
  518. NextBallDelay.enabled=true
  519.  
  520. End Sub
  521.  
  522. '******************************
  523. ' DOF lights ball entrance
  524. '******************************
  525. '
  526. Sub Trigger001_Hit
  527. DOF 250, DOFPulse
  528. End sub
  529.  
  530. '***********************
  531. ' Flipper Logos
  532. '***********************
  533.  
  534. Sub UpdateFlipperLogos_Timer
  535. LFlip.RotZ = LeftFlipper.CurrentAngle
  536. RFlip.RotZ = RightFlipper.CurrentAngle
  537. PGate.Rotz = (Gate.CurrentAngle*.75) + 25
  538. FlipperLSh.RotZ = LeftFlipper.currentangle
  539. FlipperRSh.RotZ = RightFlipper.currentangle
  540. End Sub
  541.  
  542. '***********************************
  543.  
  544. Sub RubberwallSwitches_Hit(idx)
  545. If TableTilted=false then
  546. if idx > 5 then
  547. AddScore(10)
  548. else
  549. AddScore(1)
  550. end if
  551. End if
  552. End Sub
  553.  
  554. '***********************************
  555.  
  556. Sub Bumper1_Hit
  557. If TableTilted=false then
  558.  
  559. PlaySoundAtVol SoundFXDOF ("bumper1",105,DOFPulse,DOFContactors), ActiveBall, 1
  560. DOF 207, DOFPulse
  561. If Epileptikdof = True Then DOF 202, DOFPulse End If
  562. bump1 = 1
  563. If Bumper1Light.state=1 then
  564. AddScore(10)
  565. Else
  566. AddScore(10)
  567. End If
  568.  
  569. end if
  570.  
  571. End Sub
  572.  
  573.  
  574. Sub Bumper2_Hit
  575. If TableTilted=false then
  576.  
  577. PlaySoundAtVol SoundFXDOF ("bumper1",106,DOFPulse,DOFContactors), ActiveBall, 1
  578. DOF 208, DOFPulse
  579. If Epileptikdof = True Then DOF 202, DOFPulse End If
  580. bump2 = 1
  581. If Bumper2Light.state=1 then
  582. AddScore(10)
  583. Else
  584. AddScore(1)
  585. End If
  586. end if
  587.  
  588. End Sub
  589.  
  590. Sub Bumper3_Hit
  591. If TableTilted=false then
  592.  
  593. PlaySoundAtVol SoundFXDOF ("bumper1",107,DOFPulse,DOFContactors), ActiveBall, 1
  594. DOF 209, DOFPulse
  595. If Epileptikdof = True Then DOF 202, DOFPulse End If
  596. bump3 = 1
  597. If Bumper3Light.state=1 then
  598. AddScore(10)
  599. Else
  600. AddScore(1)
  601. End If
  602.  
  603. end if
  604.  
  605. End Sub
  606.  
  607.  
  608. '***********************************
  609.  
  610. Sub TargetLeft1_Hit()
  611. If TableTilted=false then
  612. DOF 110, DOfPulse
  613. If Epileptikdof = True Then DOF 212, DOFPulse End If
  614. If LeftTargetLight1.state=1 then
  615. SetMotor(300)
  616. else
  617. SetMotor(50)
  618. end if
  619. end if
  620. end Sub
  621.  
  622. Sub TargetLeft2_Hit()
  623. If TableTilted=false then
  624. DOF 108, DOFPulse
  625. If Epileptikdof = True Then DOF 210, DOFPulse End If
  626. If LeftTargetLight2.state=1 then
  627. SetMotor(300)
  628. else
  629. SetMotor(50)
  630. end if
  631. end if
  632. end Sub
  633.  
  634. Sub TargetLeft3_Hit()
  635. If TableTilted=false then
  636. DOF 108, DOFPulse
  637. If Epileptikdof = True Then DOF 210, DOFPulse End If
  638. If LeftTargetLight3.state=1 then
  639. SetMotor(300)
  640. else
  641. SetMotor(50)
  642. end if
  643. end if
  644. end Sub
  645.  
  646. Sub TargetRight1_Hit()
  647. If TableTilted=false then
  648. DOF 111, DOfPulse
  649. If Epileptikdof = True Then DOF 213, DOFPulse End If
  650. If RightTargetLight1.state=1 then
  651. SetMotor(300)
  652. else
  653. SetMotor(50)
  654. end if
  655. end if
  656.  
  657. end Sub
  658.  
  659. Sub TargetRight2_Hit()
  660. If TableTilted=false then
  661. DOF 109, DOFPulse
  662. If Epileptikdof = True Then DOF 211, DOFPulse End If
  663. If RightTargetLight2.state=1 then
  664. SetMotor(300)
  665. else
  666. SetMotor(50)
  667. end if
  668. end if
  669.  
  670. end Sub
  671.  
  672. Sub TargetRight3_Hit()
  673. If TableTilted=false then
  674. DOF 109, DOFPulse
  675. If Epileptikdof = True Then DOF 211, DOFPulse End If
  676. If RightTargetLight3.state=1 then
  677. SetMotor(300)
  678. else
  679. SetMotor(50)
  680. end if
  681. end if
  682.  
  683. end Sub
  684.  
  685. '***********************************
  686.  
  687. Sub TriggerTop1_Hit()
  688. If TableTilted=false then
  689. PlaySoundAtVol "sensor", ActiveBall, 1
  690. DOF 216, DOfPulse
  691. If UpperLight1.state=1 then
  692. SetMotor(300)
  693. else
  694. SetMotor(50)
  695. end if
  696.  
  697. end if
  698. End Sub
  699.  
  700. Sub TriggerTop2_Hit()
  701. If TableTilted=false then
  702. PlaySoundAtVol "sensor", ActiveBall, 1
  703. DOF 217, DOfPulse
  704. If UpperLight2.state=1 then
  705. SetMotor(300)
  706. else
  707. SetMotor(50)
  708. end if
  709.  
  710. end if
  711. End Sub
  712.  
  713.  
  714. Sub TriggerTop3_Hit()
  715. If TableTilted=false then
  716. PlaySoundAtVol "sensor", ActiveBall, 1
  717. DOF 218, DOfPulse
  718. If UpperLight3.state=1 then
  719. SetMotor(300)
  720. else
  721. SetMotor(50)
  722. end if
  723.  
  724. end if
  725. End Sub
  726.  
  727. Sub TriggerTop4_Hit()
  728. If TableTilted=false then
  729. PlaySoundAtVol "sensor", ActiveBall, 1
  730. DOF 219, DOfPulse
  731. If UpperLight4.state=1 then
  732. SetMotor(300)
  733. else
  734. SetMotor(50)
  735. end if
  736.  
  737. end if
  738. End Sub
  739.  
  740.  
  741. Sub TriggerRightRollover_Hit()
  742. If TableTilted=false then
  743. PlaySoundAtVol "sensor", ActiveBall, 1
  744. DOF 220, DOfPulse
  745. If RightBonusLight1.state=1 then
  746.  
  747. SetMotor(100+(100*RightTargetCounter))
  748. ResetRightTimer.enabled=true
  749. End If
  750. End if
  751. End Sub
  752.  
  753. Sub TriggerLeftRollover_Hit()
  754. If TableTilted=false then
  755. PlaySoundAtVol "sensor", ActiveBall, 1
  756. DOF 221, DOfPulse
  757. If LeftBonusLight1.state=1 then
  758.  
  759. SetMotor(100+(100*LeftTargetCounter))
  760. ResetLeftTimer.enabled=true
  761. End If
  762. End If
  763. End Sub
  764.  
  765. Sub TriggerLeftInlane_Hit()
  766. If TableTilted=false then
  767. PlaySoundAtVol "sensor", ActiveBall, 1
  768. DOF 222, DOfPulse
  769. If LeftBonusLight2.state=1 then
  770.  
  771. SetMotor(100+(100*LeftTargetCounter))
  772. ResetLeftTimer.enabled=true
  773. End If
  774. End If
  775. End Sub
  776.  
  777. Sub TriggerRightInlane_Hit()
  778. If TableTilted=false then
  779. PlaySoundAtVol "sensor", ActiveBall, 1
  780. DOF 223, DOfPulse
  781. If RightBonusLight1.state=1 then
  782.  
  783. SetMotor(100+(100*RightTargetCounter))
  784. ResetRightTimer.enabled=true
  785. End If
  786. End If
  787. End Sub
  788.  
  789. Sub Kicker3_Hit()
  790. If TableTilted=false then
  791. PlaySoundAtVol "sensor", ActiveBall, 1
  792. DOF 224, DOfPulse
  793. If LeftBonusLight2.state=1 then
  794.  
  795. SetMotor(100+(100*LeftTargetCounter))
  796. ResetLeftTimer.enabled=true
  797. End If
  798. End If
  799. Kicker3.TimerEnabled=true
  800. End Sub
  801.  
  802. Sub Kicker3_Timer
  803. If MotorRunning<>0 then
  804. Exit Sub
  805. end if
  806. Kicker3.TimerEnabled=false
  807. Kicker3.Kick 0,20
  808. PlaySoundAtVol SoundFXDOF ("saucer",103,DOFPulse,DOFContactors), Kicker3, 1
  809. DOF 230, DOFPulse
  810. DOF 226, DOfPulse
  811.  
  812. end sub
  813.  
  814. Sub Kicker4_Hit()
  815. If TableTilted=false then
  816. PlaySoundAtVol "sensor", ActiveBall, 1
  817. DOF 225, DOfPulse
  818. If RightBonusLight1.state=1 then
  819.  
  820. SetMotor(100+(100*RightTargetCounter))
  821. ResetRightTimer.enabled=true
  822. End If
  823. End If
  824. Kicker4.TimerEnabled=true
  825. End Sub
  826.  
  827. Sub Kicker4_Timer
  828. If MotorRunning<>0 then
  829. Exit Sub
  830. end if
  831. Kicker4.TimerEnabled=false
  832. Kicker4.Kick 0,20
  833. PlaySoundAtVol SoundFXDOF ("saucer",104,DOFPulse,DOFContactors), Kicker4, 1
  834. DOF 230, DOfPulse
  835. DOF 227, DOfPulse
  836.  
  837. end sub
  838.  
  839.  
  840.  
  841. Sub Lefttarget1_Hit()
  842. if TableTilted=false then
  843. DOF 214, DOFPulse
  844. ' DOF 112, DOfPulse
  845. PlaySound SoundFXDOF ("",112,DOFPulse,DOFTargets)
  846. If Epileptikdof = True Then DOF 211, DOFPulse End If
  847. if Lefttarget1.IsDropped=0 then
  848. LeftTargetCounter=LeftTargetCounter+1
  849. Lefttarget1.IsDropped=1
  850. AddScore(100)
  851. CheckAllDrops
  852. end if
  853. end if
  854. end sub
  855.  
  856. Sub Lefttarget2_Hit()
  857. if TableTilted=false then
  858. DOF 214, DOFPulse
  859. ' DOF 112, DOfPulse
  860. PlaySound SoundFXDOF ("",112,DOFPulse,DOFTargets)
  861. if Lefttarget2.IsDropped=0 then
  862. LeftTargetCounter=LeftTargetCounter+1
  863. Lefttarget2.IsDropped=1
  864. AddScore(100)
  865. CheckAllDrops
  866. end if
  867. end if
  868. end sub
  869.  
  870. Sub Lefttarget3_Hit()
  871. if TableTilted=false then
  872. DOF 214, DOFPulse
  873. ' DOF 112, DOfPulse
  874. PlaySound SoundFXDOF ("",112,DOFPulse,DOFTargets)
  875. if Lefttarget3.IsDropped=0 then
  876. LeftTargetCounter=LeftTargetCounter+1
  877. Lefttarget3.IsDropped=1
  878. AddScore(100)
  879. CheckAllDrops
  880. end if
  881. end if
  882. end sub
  883.  
  884. Sub Lefttarget4_Hit()
  885. if TableTilted=false then
  886. DOF 214, DOFPulse
  887. ' DOF 112, DOfPulse
  888. PlaySound SoundFXDOF ("",112,DOFPulse,DOFTargets)
  889. if Lefttarget4.IsDropped=0 then
  890. LeftTargetCounter=LeftTargetCounter+1
  891. Lefttarget4.IsDropped=1
  892. AddScore(100)
  893. CheckAllDrops
  894. end if
  895. end if
  896. end sub
  897.  
  898.  
  899. Sub Righttarget1_Hit()
  900. if TableTilted=false then
  901. DOF 215, DOFPulse
  902. ' DOF 113, DOfPulse
  903. PlaySound SoundFXDOF ("",113,DOFPulse,DOFTargets)
  904. if Righttarget1.IsDropped=0 then
  905. RightTargetCounter=RightTargetCounter+1
  906. Righttarget1.IsDropped=1
  907. AddScore(100)
  908. CheckAllDrops
  909. end if
  910. end if
  911. end sub
  912.  
  913. Sub Righttarget2_Hit()
  914. if TableTilted=false then
  915. DOF 215, DOFPulse
  916. ' DOF 113, DOfPulse
  917. PlaySound SoundFXDOF ("",113,DOFPulse,DOFTargets)
  918. if Righttarget2.IsDropped=0 then
  919. RightTargetCounter=RightTargetCounter+1
  920. Righttarget2.IsDropped=1
  921. AddScore(100)
  922. CheckAllDrops
  923. end if
  924. end if
  925. end sub
  926.  
  927. Sub Righttarget3_Hit()
  928. if TableTilted=false then
  929. DOF 215, DOFPulse
  930. ' DOF 113, DOfPulse
  931. PlaySound SoundFXDOF ("",113,DOFPulse,DOFTargets)
  932. if Righttarget3.IsDropped=0 then
  933. RightTargetCounter=RightTargetCounter+1
  934. Righttarget3.IsDropped=1
  935. AddScore(100)
  936. CheckAllDrops
  937. end if
  938. end if
  939. end sub
  940.  
  941. Sub Righttarget4_Hit()
  942. if TableTilted=false then
  943. DOF 215, DOFPulse
  944. ' DOF 113, DOfPulse
  945. PlaySound SoundFXDOF ("",113,DOFPulse,DOFTargets)
  946. if Righttarget4.IsDropped=0 then
  947. RightTargetCounter=RightTargetCounter+1
  948. Righttarget4.IsDropped=1
  949. AddScore(100)
  950. CheckAllDrops
  951. end if
  952. end if
  953. end sub
  954.  
  955.  
  956. Sub ResetDrops
  957. for each obj in LeftDrops
  958. obj.IsDropped=0
  959. next
  960. DOF 115, DOFPulse
  961. for each obj in RightDrops
  962. obj.IsDropped=0
  963. next
  964. DOF 116, DOFPulse
  965. LeftTargetCounter=0
  966. RightTargetCounter=0
  967. end Sub
  968.  
  969. Sub CheckAllDrops
  970.  
  971.  
  972. end Sub
  973.  
  974. sub ResetDropsTimer_timer
  975. ResetDropsTimer.enabled=0
  976. ResetDrops
  977. end sub
  978.  
  979.  
  980.  
  981. Sub CloseGateTrigger_Hit()
  982. if dooralreadyopen=1 then
  983. closeg.enabled=true
  984. end if
  985. End Sub
  986.  
  987.  
  988. Sub AddSpecial()
  989. PlaySound SoundFXDOF ("knocker",300,DOFPulse,DOFContactors)
  990. DOF 230, DOfPulse
  991. Credits=Credits+1
  992. DOF 200, DOFOn
  993. if Credits>15 then Credits=15
  994. If B2SOn Then
  995. Controller.B2SSetCredits Credits
  996. End If
  997. CreditsReel.SetValue(Credits)
  998. End Sub
  999.  
  1000. Sub AddSpecial2()
  1001. PlaySound "click"
  1002. DOF 200, DOFOn
  1003. Credits=Credits+1
  1004. if Credits>15 then Credits=15
  1005. If B2SOn Then
  1006. Controller.B2SSetCredits Credits
  1007. End If
  1008. CreditsReel.SetValue(Credits)
  1009. End Sub
  1010.  
  1011.  
  1012. Sub ToggleZeroToNine
  1013. ZeroToNine=ZeroToNine+1
  1014. If ZeroToNine>9 then
  1015. ZeroToNine=0
  1016. end if
  1017.  
  1018. UpperLight1.state=0
  1019. UpperLight2.state=0
  1020. UpperLight3.state=0
  1021. UpperLight4.state=0
  1022. Select case ZeroToNine
  1023. case 0,4,8:
  1024. UpperLight1.state=1
  1025. If BallsPerGame=3 then
  1026. UpperLight3.state=1
  1027. end if
  1028. case 1,5:
  1029. UpperLight2.state=1
  1030. If BallsPerGame=3 then
  1031. UpperLight4.state=1
  1032. end if
  1033. case 2,6:
  1034. UpperLight3.state=1
  1035. If BallsPerGame=3 then
  1036. UpperLight1.state=1
  1037. end if
  1038. case 3,7,9:
  1039. UpperLight4.state=1
  1040. If BallsPerGame=3 then
  1041. UpperLight2.state=1
  1042. end if
  1043. end select
  1044. ToggleAlternateRelay
  1045. end sub
  1046.  
  1047. Sub ToggleAlternateRelay
  1048. if Bumper2Light.state=0 then
  1049. Bumper1Light.state=0
  1050. Bumper2Light.state=1
  1051. Bumper3Light.state=0
  1052. LeftTargetLight1.state=1
  1053. LeftTargetLight2.state=0
  1054. LeftTargetLight3.state=1
  1055. RightTargetLight1.state=0
  1056. RightTargetLight2.state=1
  1057. RightTargetLight3.state=0
  1058.  
  1059.  
  1060. else
  1061. Bumper1Light.state=1
  1062. Bumper2Light.state=0
  1063. Bumper3Light.state=1
  1064. LeftTargetLight1.state=0
  1065. LeftTargetLight2.state=1
  1066. LeftTargetLight3.state=0
  1067. RightTargetLight1.state=1
  1068. RightTargetLight2.state=0
  1069. RightTargetLight3.state=1
  1070.  
  1071.  
  1072. end if
  1073. end sub
  1074.  
  1075. Sub ResetLeftTimer_Timer
  1076. If MotorRunning<>0 then
  1077. Exit Sub
  1078. end if
  1079. ResetLeftTimer.enabled=false
  1080. For each obj in LeftDrops
  1081. obj.IsDropped=false
  1082. next
  1083. LeftTargetCounter=0
  1084.  
  1085. end sub
  1086.  
  1087. Sub ResetRightTimer_Timer
  1088. If MotorRunning<>0 then
  1089. Exit Sub
  1090. end if
  1091. ResetRightTimer.enabled=false
  1092. For each obj in RightDrops
  1093. obj.IsDropped=false
  1094. next
  1095. RightTargetCounter=0
  1096.  
  1097. end sub
  1098.  
  1099.  
  1100.  
  1101. Sub ResetBallDrops()
  1102.  
  1103.  
  1104. ResetDrops
  1105. for each obj in Bonus
  1106. obj.state=0
  1107. next
  1108. for each obj in StarLights
  1109. obj.state=1
  1110. next
  1111. BonusCounter=0
  1112. HoleCounter=0
  1113.  
  1114. End Sub
  1115.  
  1116.  
  1117. Sub LightsOut
  1118. for each obj in Bonus
  1119. obj.state=0
  1120. next
  1121. for each obj in StarLights
  1122. obj.state=0
  1123. next
  1124. BonusCounter=0
  1125. HoleCounter=0
  1126. Bumper1Light.state=0
  1127. Bumper2Light.state=0
  1128. Bumper3Light.state=0
  1129.  
  1130. end sub
  1131.  
  1132. Sub ResetBalls()
  1133.  
  1134. TempMultiCounter=BallsPerGame-BallInPlay
  1135.  
  1136. ResetBallDrops
  1137. BonusMultiplier=1
  1138.  
  1139. TableTilted=false
  1140. TiltReel.SetValue(0)
  1141. If B2Son then
  1142. Controller.B2SSetTilt 0
  1143. end if
  1144. PlasticsOn
  1145. 'CreateBallID BallRelease
  1146. Ballrelease.CreateSizedBall 25
  1147. Ballrelease.Kick 40,7
  1148. DOF 114, DOFPulse
  1149. If Epileptikdof = True Then DOF 228, DOFPulse End If
  1150.  
  1151.  
  1152. BallInPlayReel.SetValue(BallInPlay)
  1153. InstructCard.image="IC"+FormatNumber(BallsPerGame,0)+FormatNumber(BallInPlay,0)
  1154. End Sub
  1155.  
  1156. sub resettimer_timer
  1157. rst=rst+1
  1158. If rst=1 then
  1159. PlayerUpRotator.enabled=true
  1160. end if
  1161. if rst=7 then
  1162. PlayerUpRotator.enabled=true
  1163. end if
  1164.  
  1165. if rst>10 and rst<21 then
  1166. ResetReelsToZero(1)
  1167. end if
  1168. if rst>20 and rst<31 then
  1169. ResetReelsToZero(2)
  1170. end if
  1171.  
  1172. if rst=32 then
  1173. playsound "StartBall1"
  1174. end if
  1175. if rst=35 then
  1176. newgame
  1177. resettimer.enabled=false
  1178. end if
  1179. end sub
  1180.  
  1181. Sub ResetReelsToZero(reelzeroflag)
  1182. dim d1(5)
  1183. dim d2(5)
  1184. dim scorestring1, scorestring2
  1185.  
  1186. If reelzeroflag=1 then
  1187. scorestring1=CStr(Score(1))
  1188. scorestring2=CStr(Score(2))
  1189. scorestring1=right("00000" & scorestring1,5)
  1190. scorestring2=right("00000" & scorestring2,5)
  1191. for i=0 to 4
  1192. d1(i)=CInt(mid(scorestring1,i+1,1))
  1193. d2(i)=CInt(mid(scorestring2,i+1,1))
  1194. next
  1195. for i=0 to 4
  1196. if d1(i)>0 then
  1197. d1(i)=d1(i)+1
  1198. if d1(i)>9 then d1(i)=0
  1199. end if
  1200. if d2(i)>0 then
  1201. d2(i)=d2(i)+1
  1202. if d2(i)>9 then d2(i)=0
  1203. end if
  1204.  
  1205. next
  1206. Score(1)=(d1(0)*10000) + (d1(1)*1000) + (d1(2)*100) + (d1(3)*10) + d1(4)
  1207. Score(2)=(d2(0)*10000) + (d2(1)*1000) + (d2(2)*100) + (d2(3)*10) + d2(4)
  1208. If B2SOn Then
  1209. Controller.B2SSetScorePlayer 1, Score(1)
  1210. Controller.B2SSetScorePlayer 2, Score(2)
  1211. End If
  1212. PlayerScores(0).SetValue(Score(1))
  1213. PlayerScoresOn(0).SetValue(Score(1))
  1214. PlayerScores(1).SetValue(Score(2))
  1215. PlayerScoresOn(1).SetValue(Score(2))
  1216.  
  1217. end if
  1218. If reelzeroflag=2 then
  1219. scorestring1=CStr(Score(3))
  1220. scorestring2=CStr(Score(4))
  1221. scorestring1=right("00000" & scorestring1,5)
  1222. scorestring2=right("00000" & scorestring2,5)
  1223. for i=0 to 4
  1224. d1(i)=CInt(mid(scorestring1,i+1,1))
  1225. d2(i)=CInt(mid(scorestring2,i+1,1))
  1226. next
  1227. for i=0 to 4
  1228. if d1(i)>0 then
  1229. d1(i)=d1(i)+1
  1230. if d1(i)>9 then d1(i)=0
  1231. end if
  1232. if d2(i)>0 then
  1233. d2(i)=d2(i)+1
  1234. if d2(i)>9 then d2(i)=0
  1235. end if
  1236.  
  1237. next
  1238. Score(3)=(d1(0)*10000) + (d1(1)*1000) + (d1(2)*100) + (d1(3)*10) + d1(4)
  1239. Score(4)=(d2(0)*10000) + (d2(1)*1000) + (d2(2)*100) + (d2(3)*10) + d2(4)
  1240. If B2SOn Then
  1241. Controller.B2SSetScorePlayer 3, Score(3)
  1242. Controller.B2SSetScorePlayer 4, Score(4)
  1243. End If
  1244. PlayerScores(2).SetValue(Score(3))
  1245. PlayerScoresOn(2).SetValue(Score(3))
  1246. PlayerScores(3).SetValue(Score(4))
  1247. PlayerScoresOn(3).SetValue(Score(4))
  1248.  
  1249. end if
  1250.  
  1251. end sub
  1252.  
  1253.  
  1254.  
  1255.  
  1256. sub NextBallDelay_timer()
  1257. NextBallDelay.enabled=false
  1258. nextball
  1259.  
  1260. end sub
  1261.  
  1262. sub newgame
  1263. InProgress=true
  1264. queuedscore=0
  1265. for i = 1 to 4
  1266. Score(i)=0
  1267. Score100K(1)=0
  1268. HighScorePaid(i)=false
  1269. Replay1Paid(i)=false
  1270. Replay2Paid(i)=false
  1271. Replay3Paid(i)=false
  1272. next
  1273. If B2SOn Then
  1274. Controller.B2SSetTilt 0
  1275. Controller.B2SSetGameOver 0
  1276. Controller.B2SSetMatch 0
  1277. ' Controller.B2SSetScorePlayer1 0
  1278. ' Controller.B2SSetScorePlayer2 0
  1279. ' Controller.B2SSetScorePlayer3 0
  1280. ' Controller.B2SSetScorePlayer4 0
  1281. Controller.B2SSetBallInPlay BallInPlay
  1282. End if
  1283. UpperLight2.state=1
  1284. for each obj in LeftTargetLights
  1285. obj.state=0
  1286. next
  1287. for each obj in RightTargetLights
  1288. obj.state=0
  1289. next
  1290. LeftBonusLight1.state=1
  1291. LeftBonusLight2.state=1
  1292. RightBonusLight1.state=1
  1293. RightBonusLight2.state=1
  1294. 'ToggleAlternateRelay
  1295. ZeroToNine=9
  1296. ToggleZeroToNine
  1297. ResetBalls
  1298. DOF 201, DOFOn
  1299. DOF 260, DOFPulse
  1300. End sub
  1301.  
  1302. sub nextball
  1303. If B2SOn Then
  1304. Controller.B2SSetTilt 0
  1305. End If
  1306. Player=Player+1
  1307. If Player>Players Then
  1308. BallInPlay=BallInPlay+1
  1309. If BallInPlay>BallsPerGame then
  1310. PlaySound("MotorLeer")
  1311. InProgress=false
  1312. GameOverReel.SetValue(1)
  1313. If B2SOn Then
  1314. Controller.B2SSetGameOver 1
  1315. Controller.B2SSetPlayerUp 0
  1316. Controller.B2SSetData 81,0
  1317. Controller.B2SSetData 82,0
  1318. Controller.B2SSetData 83,0
  1319. Controller.B2SSetData 84,0
  1320. Controller.B2SSetBallInPlay 0
  1321. Controller.B2SSetCanPlay 0
  1322. End If
  1323. For each obj in PlayerHuds
  1324. obj.SetValue(0)
  1325. next
  1326. For each obj in PlayerHUDScores
  1327. obj.state=0
  1328. next
  1329. If Table1.ShowDT = True then
  1330. For each obj in PlayerScores
  1331. obj.visible=1
  1332. Next
  1333. For each obj in PlayerScoresOn
  1334. obj.visible=0
  1335. Next
  1336. end If
  1337. BallInPlayReel.SetValue(0)
  1338. InstructCard.image="IC"+FormatNumber(BallsPerGame,0)+"0"
  1339. CanPlayReel.SetValue(0)
  1340. LeftFlipper.RotateToStart
  1341. RightFlipper.RotateToStart
  1342. LightsOut
  1343. BumpersOff
  1344. ' PlasticsOn
  1345. DOF 201, DOFOff
  1346. DOF 260, DOFPulse
  1347. checkmatch
  1348. CheckHighScore
  1349. Players=0
  1350. HighScoreTimer.interval=100
  1351. HighScoreTimer.enabled=True
  1352. Else
  1353. Player=1
  1354. If B2SOn Then
  1355. Controller.B2SSetPlayerUp Player
  1356. Controller.B2SSetData 81,0
  1357. Controller.B2SSetData 82,0
  1358. Controller.B2SSetData 83,0
  1359. Controller.B2SSetData 84,0
  1360. Controller.B2SSetData 80+Player,1
  1361. Controller.B2SSetBallInPlay BallInPlay
  1362.  
  1363. End If
  1364. PlaySound("RotateThruPlayers")
  1365. TempPlayerUp=Player
  1366. PlayerUpRotator.enabled=true
  1367. PlayStartBall.enabled=true
  1368. For each obj in PlayerHuds
  1369. obj.SetValue(0)
  1370. next
  1371. For each obj in PlayerHUDScores
  1372. obj.state=0
  1373. next
  1374. If Table1.ShowDT = True then
  1375. For each obj in PlayerScores
  1376. obj.visible=1
  1377. Next
  1378. For each obj in PlayerScoresOn
  1379. obj.visible=0
  1380. Next
  1381. PlayerHuds(Player-1).SetValue(1)
  1382. PlayerHUDScores(Player-1).state=1
  1383. PlayerScores(Player-1).visible=0
  1384. PlayerScoresOn(Player-1).visible=1
  1385. end If
  1386.  
  1387. ResetBalls
  1388. End If
  1389. Else
  1390. If B2SOn Then
  1391. Controller.B2SSetPlayerUp Player
  1392. Controller.B2SSetData 81,0
  1393. Controller.B2SSetData 82,0
  1394. Controller.B2SSetData 83,0
  1395. Controller.B2SSetData 84,0
  1396. Controller.B2SSetData 80+Player,1
  1397. Controller.B2SSetBallInPlay BallInPlay
  1398. End If
  1399. PlaySound("RotateThruPlayers")
  1400. TempPlayerUp=Player
  1401. ' PlayerUpRotator.enabled=true
  1402. ' PlayStartBall.enabled=true
  1403. For each obj in PlayerHuds
  1404. obj.SetValue(0)
  1405. next
  1406. For each obj in PlayerHUDScores
  1407. obj.state=0
  1408. next
  1409. If Table1.ShowDT = True then
  1410. For each obj in PlayerScores
  1411. obj.visible=1
  1412. Next
  1413. For each obj in PlayerScoresOn
  1414. obj.visible=0
  1415. Next
  1416. PlayerHuds(Player-1).SetValue(1)
  1417. PlayerHUDScores(Player-1).state=1
  1418. PlayerScores(Player-1).visible=0
  1419. PlayerScoresOn(Player-1).visible=1
  1420. end If
  1421. ResetBalls
  1422. End If
  1423.  
  1424. End sub
  1425.  
  1426. sub CheckHighScore
  1427. Dim playertops
  1428. dim si
  1429. dim sj
  1430. dim stemp
  1431. dim stempplayers
  1432. for i=1 to 4
  1433. sortscores(i)=0
  1434. sortplayers(i)=0
  1435. next
  1436. playertops=0
  1437. for i = 1 to Players
  1438. sortscores(i)=Score(i)
  1439. sortplayers(i)=i
  1440. next
  1441.  
  1442. for si = 1 to Players
  1443. for sj = 1 to Players-1
  1444. if sortscores(sj)>sortscores(sj+1) then
  1445. stemp=sortscores(sj+1)
  1446. stempplayers=sortplayers(sj+1)
  1447. sortscores(sj+1)=sortscores(sj)
  1448. sortplayers(sj+1)=sortplayers(sj)
  1449. sortscores(sj)=stemp
  1450. sortplayers(sj)=stempplayers
  1451. end if
  1452. next
  1453. next
  1454. ScoreChecker=4
  1455. CheckAllScores=1
  1456. NewHighScore sortscores(ScoreChecker),sortplayers(ScoreChecker)
  1457. savehs
  1458. end sub
  1459.  
  1460.  
  1461. sub checkmatch
  1462. Dim tempmatch
  1463. tempmatch=Int(Rnd*10)
  1464. Match=tempmatch
  1465. MatchReel.SetValue(tempmatch+1)
  1466.  
  1467. If B2SOn Then
  1468. If Match = 0 Then
  1469. Controller.B2SSetMatch 10
  1470. Else
  1471. Controller.B2SSetMatch Match
  1472. End If
  1473. End if
  1474. for i = 1 to Players
  1475. if Match=(Score(i) mod 10) then
  1476. AddSpecial
  1477. end if
  1478. next
  1479. end sub
  1480.  
  1481. Sub TiltTimer_Timer()
  1482. if TiltCount > 0 then TiltCount = TiltCount - 1
  1483. if TiltCount = 0 then
  1484. TiltTimer.Enabled = False
  1485. end if
  1486. end sub
  1487.  
  1488. Sub TiltIt()
  1489. TiltCount = TiltCount + 1
  1490. if TiltCount = 3 then
  1491. TableTilted=True
  1492. PlasticsOff
  1493. BumpersOff
  1494. LeftFlipper.RotateToStart
  1495. RightFlipper.RotateToStart
  1496. DOF 101, DOFOff
  1497. DOF 102, DOFOff
  1498. StopSound "buzzL"
  1499. StopSound "buzz"
  1500. TiltReel.SetValue(1)
  1501. If B2Son then
  1502. Controller.B2SSetTilt 1
  1503. end if
  1504. else
  1505. TiltTimer.Interval = 500
  1506. TiltTimer.Enabled = True
  1507. end if
  1508.  
  1509. end sub
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Sub PlayStartBall_timer()
  1515.  
  1516. PlayStartBall.enabled=false
  1517. PlaySound("StartBall2-5")
  1518. end sub
  1519.  
  1520. Sub PlayerUpRotator_timer()
  1521. If RotatorTemp<5 then
  1522. TempPlayerUp=TempPlayerUp+1
  1523. If TempPlayerUp>4 then
  1524. TempPlayerUp=1
  1525. end if
  1526. For each obj in PlayerHuds
  1527. obj.SetValue(0)
  1528. next
  1529. For each obj in PlayerHUDScores
  1530. obj.state=0
  1531. next
  1532. If Table1.ShowDT = True then
  1533. For each obj in PlayerScores
  1534. obj.visible=1
  1535. Next
  1536. For each obj in PlayerScoresOn
  1537. obj.visible=0
  1538. Next
  1539. PlayerHuds(TempPlayerUp-1).SetValue(1)
  1540. PlayerHUDScores(TempPlayerUp-1).state=1
  1541. PlayerScores(TempPlayerUp-1).visible=0
  1542. PlayerScoresOn(TempPlayerUp-1).visible=1
  1543. end If
  1544. If B2SOn Then
  1545. Controller.B2SSetPlayerUp TempPlayerUp
  1546. Controller.B2SSetData 81,0
  1547. Controller.B2SSetData 82,0
  1548. Controller.B2SSetData 83,0
  1549. Controller.B2SSetData 84,0
  1550. Controller.B2SSetData 80+TempPlayerUp,1
  1551. End If
  1552.  
  1553. else
  1554. if B2SOn then
  1555. Controller.B2SSetPlayerUp Player
  1556. Controller.B2SSetData 81,0
  1557. Controller.B2SSetData 82,0
  1558. Controller.B2SSetData 83,0
  1559. Controller.B2SSetData 84,0
  1560. Controller.B2SSetData 80+Player,1
  1561. end if
  1562. PlayerUpRotator.enabled=false
  1563. RotatorTemp=1
  1564. For each obj in PlayerHuds
  1565. obj.SetValue(0)
  1566. next
  1567. For each obj in PlayerHUDScores
  1568. obj.state=0
  1569. next
  1570. If Table1.ShowDT = True then
  1571. For each obj in PlayerScores
  1572. obj.visible=1
  1573. Next
  1574. For each obj in PlayerScoresOn
  1575. obj.visible=0
  1576. Next
  1577. PlayerHuds(Player-1).SetValue(1)
  1578. PlayerHUDScores(Player-1).state=1
  1579. PlayerScores(Player-1).visible=0
  1580. PlayerScoresOn(Player-1).visible=1
  1581. end If
  1582. end if
  1583. RotatorTemp=RotatorTemp+1
  1584.  
  1585.  
  1586. end sub
  1587.  
  1588.  
  1589. sub savehs
  1590. ' Based on Black's Highscore routines
  1591. Dim FileObj
  1592. Dim ScoreFile
  1593. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1594. If Not FileObj.FolderExists(UserDirectory) then
  1595. Exit Sub
  1596. End if
  1597. Set ScoreFile=FileObj.CreateTextFile(UserDirectory & HSFileName,True)
  1598. ScoreFile.WriteLine 0
  1599. ScoreFile.WriteLine Credits
  1600. scorefile.writeline BallsPerGame
  1601. scorefile.writeline BonusSpecialThreshold
  1602. scorefile.writeline ReplayLevel
  1603.  
  1604. for xx=1 to 5
  1605. scorefile.writeline HSScore(xx)
  1606. next
  1607. for xx=1 to 5
  1608. scorefile.writeline HSName(xx)
  1609. next
  1610.  
  1611. ScoreFile.Close
  1612. Set ScoreFile=Nothing
  1613. Set FileObj=Nothing
  1614. end sub
  1615.  
  1616. sub loadhs
  1617. ' Based on Black's Highscore routines
  1618. Dim FileObj
  1619. Dim ScoreFile
  1620. dim temp1
  1621. dim temp2
  1622. dim temp3
  1623. dim temp4
  1624. dim temp5
  1625. dim temp6
  1626. dim temp7
  1627. dim temp8
  1628. dim temp9
  1629. dim temp10
  1630. dim temp11
  1631. dim temp12
  1632. dim temp13
  1633. dim temp14
  1634. dim temp15
  1635.  
  1636. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1637. If Not FileObj.FolderExists(UserDirectory) then
  1638. Exit Sub
  1639. End if
  1640. If Not FileObj.FileExists(UserDirectory & HSFileName) then
  1641. Exit Sub
  1642. End if
  1643. Set ScoreFile=FileObj.GetFile(UserDirectory & HSFileName)
  1644. Set TextStr=ScoreFile.OpenAsTextStream(1,0)
  1645. If (TextStr.AtEndOfStream=True) then
  1646. Exit Sub
  1647. End if
  1648. temp1=TextStr.ReadLine
  1649. temp2=textstr.readline
  1650. temp3=textstr.readline
  1651. temp4=textstr.readline
  1652. temp5=textstr.readline
  1653. HighScore=cdbl(temp1)
  1654. if HighScore<1 then
  1655. temp6=textstr.readline
  1656. temp7=textstr.readline
  1657. temp8=textstr.readline
  1658. temp9=textstr.readline
  1659. temp10=textstr.readline
  1660. temp11=textstr.readline
  1661. temp12=textstr.readline
  1662. temp13=textstr.readline
  1663. temp14=textstr.readline
  1664. temp15=textstr.readline
  1665. end if
  1666.  
  1667. TextStr.Close
  1668.  
  1669. Credits=cdbl(temp2)
  1670. BallsPerGame=cdbl(temp3)
  1671. ReplayLevel=cdbl(temp5)
  1672. BonusSpecialThreshold=cdbl(temp4)
  1673.  
  1674.  
  1675. if HighScore<1 then
  1676. HSScore(1) = int(temp6)
  1677. HSScore(2) = int(temp7)
  1678. HSScore(3) = int(temp8)
  1679. HSScore(4) = int(temp9)
  1680. HSScore(5) = int(temp10)
  1681.  
  1682. HSName(1) = temp11
  1683. HSName(2) = temp12
  1684. HSName(3) = temp13
  1685. HSName(4) = temp14
  1686. HSName(5) = temp15
  1687. end if
  1688.  
  1689.  
  1690. Set ScoreFile=Nothing
  1691. Set FileObj=Nothing
  1692. end sub
  1693.  
  1694. sub SaveLMEMConfig
  1695. Dim FileObj
  1696. Dim LMConfig
  1697. dim temp1
  1698. dim tempb2s
  1699. tempb2s=0
  1700. if B2SOn=true then
  1701. tempb2s=1
  1702. else
  1703. tempb2s=0
  1704. end if
  1705. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1706. If Not FileObj.FolderExists(UserDirectory) then
  1707. Exit Sub
  1708. End if
  1709. Set LMConfig=FileObj.CreateTextFile(UserDirectory & LMEMTableConfig,True)
  1710. LMConfig.WriteLine tempb2s
  1711. LMConfig.Close
  1712. Set LMConfig=Nothing
  1713. Set FileObj=Nothing
  1714.  
  1715. end Sub
  1716.  
  1717. sub LoadLMEMConfig
  1718. Dim FileObj
  1719. Dim LMConfig
  1720. dim tempC
  1721. dim tempb2s
  1722.  
  1723. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1724. If Not FileObj.FolderExists(UserDirectory) then
  1725. Exit Sub
  1726. End if
  1727. If Not FileObj.FileExists(UserDirectory & LMEMTableConfig) then
  1728. Exit Sub
  1729. End if
  1730. Set LMConfig=FileObj.GetFile(UserDirectory & LMEMTableConfig)
  1731. Set TextStr2=LMConfig.OpenAsTextStream(1,0)
  1732. If (TextStr2.AtEndOfStream=True) then
  1733. Exit Sub
  1734. End if
  1735. tempC=TextStr2.ReadLine
  1736. TextStr2.Close
  1737. tempb2s=cdbl(tempC)
  1738. if tempb2s=0 then
  1739. B2SOn=false
  1740. else
  1741. B2SOn=true
  1742. end if
  1743. Set LMConfig=Nothing
  1744. Set FileObj=Nothing
  1745. end sub
  1746.  
  1747. sub SaveLMEMConfig2
  1748. If ShadowConfigFile=false then exit sub
  1749. Dim FileObj
  1750. Dim LMConfig2
  1751. dim temp1
  1752. dim temp2
  1753. dim tempBS
  1754. dim tempFS
  1755.  
  1756. if EnableBallShadow=true then
  1757. tempBS=1
  1758. else
  1759. tempBS=0
  1760. end if
  1761. if EnableFlipperShadow=true then
  1762. tempFS=1
  1763. else
  1764. tempFS=0
  1765. end if
  1766.  
  1767. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1768. If Not FileObj.FolderExists(UserDirectory) then
  1769. Exit Sub
  1770. End if
  1771. Set LMConfig2=FileObj.CreateTextFile(UserDirectory & LMEMShadowConfig,True)
  1772. LMConfig2.WriteLine tempBS
  1773. LMConfig2.WriteLine tempFS
  1774. LMConfig2.Close
  1775. Set LMConfig2=Nothing
  1776. Set FileObj=Nothing
  1777.  
  1778. end Sub
  1779.  
  1780. sub LoadLMEMConfig2
  1781. If ShadowConfigFile=false then
  1782. EnableBallShadow = ShadowBallOn
  1783. BallShadowUpdate.enabled = ShadowBallOn
  1784. EnableFlipperShadow = ShadowFlippersOn
  1785. FlipperLSh.visible = ShadowFlippersOn
  1786. FlipperRSh.visible = ShadowFlippersOn
  1787. exit sub
  1788. end if
  1789. Dim FileObj
  1790. Dim LMConfig2
  1791. dim tempC
  1792. dim tempD
  1793. dim tempFS
  1794. dim tempBS
  1795.  
  1796. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1797. If Not FileObj.FolderExists(UserDirectory) then
  1798. Exit Sub
  1799. End if
  1800. If Not FileObj.FileExists(UserDirectory & LMEMShadowConfig) then
  1801. Exit Sub
  1802. End if
  1803. Set LMConfig2=FileObj.GetFile(UserDirectory & LMEMShadowConfig)
  1804. Set TextStr2=LMConfig2.OpenAsTextStream(1,0)
  1805. If (TextStr2.AtEndOfStream=True) then
  1806. Exit Sub
  1807. End if
  1808. tempC=TextStr2.ReadLine
  1809. tempD=TextStr2.Readline
  1810. TextStr2.Close
  1811. tempBS=cdbl(tempC)
  1812. tempFS=cdbl(tempD)
  1813. if tempBS=0 then
  1814. EnableBallShadow=false
  1815. BallShadowUpdate.enabled=false
  1816. else
  1817. EnableBallShadow=true
  1818. end if
  1819. if tempFS=0 then
  1820. EnableFlipperShadow=false
  1821. FlipperLSh.visible=false
  1822. FLipperRSh.visible=false
  1823. else
  1824. EnableFlipperShadow=true
  1825. end if
  1826. Set LMConfig2=Nothing
  1827. Set FileObj=Nothing
  1828.  
  1829. end sub
  1830.  
  1831.  
  1832. Sub DisplayHighScore
  1833.  
  1834.  
  1835. end sub
  1836.  
  1837.  
  1838. sub InitPauser5_timer
  1839. If B2SOn Then
  1840. 'Controller.B2SSetScore 6,HighScore
  1841. End If
  1842. DisplayHighScore
  1843. CreditsReel.SetValue(Credits)
  1844. InitPauser5.enabled=false
  1845. end sub
  1846.  
  1847.  
  1848.  
  1849. sub BumpersOff
  1850. RightBonusLight1.state=0
  1851. RightBonusLight2.state=0
  1852. LeftBonusLight1.state=0
  1853. LeftBonusLight2.state=0
  1854.  
  1855. end sub
  1856.  
  1857. sub BumpersOn
  1858. RightBonusLight1.state=1
  1859. RightBonusLight2.state=1
  1860. LeftBonusLight1.state=1
  1861. LeftBonusLight2.state=1
  1862. end sub
  1863.  
  1864. Sub PlasticsOn
  1865. For each obj in Flashers
  1866. obj.Visible=true
  1867. next
  1868. shadowsoff.visible=0
  1869. shadows.visible=1
  1870. plastics.image="plasticson"
  1871. mesh.image="meshpileon"
  1872. outers.image="outerson"
  1873. end sub
  1874.  
  1875. Sub PlasticsOff
  1876. For each obj in Flashers
  1877. obj.Visible=false
  1878. next
  1879. shadowsoff.visible=1
  1880. shadows.visible=0
  1881. plastics.image="plasticsoff"
  1882. mesh.image="meshpileoff"
  1883. outers.image="outersoff"
  1884. StopSound "buzzL"
  1885. StopSound "buzz"
  1886. end sub
  1887.  
  1888. Sub SetupReplayTables
  1889.  
  1890. Replay1Table(1)=3200
  1891. Replay1Table(2)=3400
  1892. Replay1Table(3)=3600
  1893. Replay1Table(4)=3800
  1894. Replay1Table(5)=4200
  1895. Replay1Table(6)=6500
  1896. Replay1Table(7)=6800
  1897. Replay1Table(8)=7300
  1898. Replay1Table(9)=7700
  1899. Replay1Table(10)=57000
  1900. Replay1Table(11)=60000
  1901. Replay1Table(12)=63000
  1902. Replay1Table(13)=66000
  1903. Replay1Table(14)=69000
  1904. Replay1Table(15)=999000
  1905.  
  1906. Replay2Table(1)=4600
  1907. Replay2Table(2)=4800
  1908. Replay2Table(3)=5000
  1909. Replay2Table(4)=5200
  1910. Replay2Table(5)=5600
  1911. Replay2Table(6)=7900
  1912. Replay2Table(7)=8200
  1913. Replay2Table(8)=8700
  1914. Replay2Table(9)=9100
  1915. Replay2Table(10)=71000
  1916. Replay2Table(11)=74000
  1917. Replay2Table(12)=77000
  1918. Replay2Table(13)=80000
  1919. Replay2Table(14)=83000
  1920. Replay2Table(15)=999000
  1921.  
  1922. Replay3Table(1)=5400
  1923. Replay3Table(2)=5600
  1924. Replay3Table(3)=5800
  1925. Replay3Table(4)=6000
  1926. Replay3Table(5)=6400
  1927. Replay3Table(6)=8700
  1928. Replay3Table(7)=9000
  1929. Replay3Table(8)=9500
  1930. Replay3Table(9)=9900
  1931. Replay3Table(10)=79000
  1932. Replay3Table(11)=82000
  1933. Replay3Table(12)=85000
  1934. Replay3Table(13)=88000
  1935. Replay3Table(14)=91000
  1936. Replay3Table(15)=999000
  1937.  
  1938. ReplayTableMax=9
  1939.  
  1940. end sub
  1941.  
  1942. Sub RefreshReplayCard
  1943. Dim tempst1
  1944. Dim tempst2
  1945.  
  1946. tempst1=FormatNumber(BallsPerGame,0)
  1947. tempst2=FormatNumber(ReplayLevel,0)
  1948.  
  1949. ReplayCard.image = "SC" + tempst2
  1950. Replay1=Replay1Table(ReplayLevel)
  1951. Replay2=Replay2Table(ReplayLevel)
  1952. Replay3=Replay3Table(ReplayLevel)
  1953. end sub
  1954.  
  1955.  
  1956. '****************************************
  1957. ' SCORE MOTOR
  1958. '****************************************
  1959.  
  1960. ScoreMotorTimer.Enabled = 1
  1961. ScoreMotorTimer.Interval = 135 '135
  1962. AddScoreTimer.Enabled = 1
  1963. AddScoreTimer.Interval = 135
  1964.  
  1965. Dim queuedscore
  1966. Dim MotorMode
  1967. Dim MotorPosition
  1968.  
  1969. Sub SetMotor(y)
  1970. Select Case ScoreMotorAdjustment
  1971. Case 0:
  1972. queuedscore=queuedscore+y
  1973. Case 1:
  1974. If MotorRunning<>1 And InProgress=true then
  1975. queuedscore=queuedscore+y
  1976. end if
  1977. end Select
  1978. end sub
  1979.  
  1980. Sub SetMotor2(x)
  1981. If MotorRunning<>1 And InProgress=true then
  1982. MotorRunning=1
  1983.  
  1984. Select Case x
  1985. Case 1:
  1986. AddScore(1)
  1987. MotorRunning=0
  1988. BumpersOn
  1989. Case 2:
  1990. MotorMode=1
  1991. MotorPosition=2
  1992. BumpersOff
  1993. Case 3:
  1994. MotorMode=1
  1995. MotorPosition=3
  1996. BumpersOff
  1997. Case 4:
  1998. MotorMode=1
  1999. MotorPosition=4
  2000. BumpersOff
  2001. Case 5:
  2002. MotorMode=1
  2003. MotorPosition=5
  2004. BumpersOff
  2005. Case 10:
  2006. AddScore(10)
  2007. MotorRunning=0
  2008. BumpersOn
  2009. Case 20:
  2010. MotorMode=10
  2011. MotorPosition=2
  2012. BumpersOff
  2013. Case 30:
  2014. MotorMode=10
  2015. MotorPosition=3
  2016. BumpersOff
  2017. Case 40:
  2018. MotorMode=10
  2019. MotorPosition=4
  2020. BumpersOff
  2021. Case 50:
  2022. MotorMode=10
  2023. MotorPosition=5
  2024. BumpersOff
  2025. Case 100:
  2026. AddScore(100)
  2027. MotorRunning=0
  2028. BumpersOn
  2029. Case 200:
  2030. MotorMode=100
  2031. MotorPosition=2
  2032. BumpersOff
  2033. Case 300:
  2034. MotorMode=100
  2035. MotorPosition=3
  2036. BumpersOff
  2037. Case 400:
  2038. MotorMode=100
  2039. MotorPosition=4
  2040. BumpersOff
  2041. Case 500:
  2042. MotorMode=100
  2043. MotorPosition=5
  2044. BumpersOff
  2045. Case 1000:
  2046. AddScore(1000)
  2047. MotorRunning=0
  2048. BumpersOn
  2049. Case 2000:
  2050. MotorMode=1000
  2051. MotorPosition=2
  2052. BumpersOff
  2053. Case 3000:
  2054. MotorMode=1000
  2055. MotorPosition=3
  2056. BumpersOff
  2057. Case 4000:
  2058. MotorMode=1000
  2059. MotorPosition=4
  2060. BumpersOff
  2061. Case 5000:
  2062. MotorMode=1000
  2063. MotorPosition=5
  2064. BumpersOff
  2065. End Select
  2066. End If
  2067. End Sub
  2068.  
  2069. Sub AddScoreTimer_Timer
  2070. Dim tempscore
  2071.  
  2072.  
  2073. If MotorRunning<>1 And InProgress=true then
  2074. if queuedscore>=5000 then
  2075. tempscore=5000
  2076. queuedscore=queuedscore-5000
  2077. SetMotor2(5000)
  2078. exit sub
  2079. end if
  2080. if queuedscore>=4000 then
  2081. tempscore=4000
  2082. queuedscore=queuedscore-4000
  2083. SetMotor2(4000)
  2084. exit sub
  2085. end if
  2086.  
  2087. if queuedscore>=3000 then
  2088. tempscore=3000
  2089. queuedscore=queuedscore-3000
  2090. SetMotor2(3000)
  2091. exit sub
  2092. end if
  2093.  
  2094. if queuedscore>=2000 then
  2095. tempscore=2000
  2096. queuedscore=queuedscore-2000
  2097. SetMotor2(2000)
  2098. exit sub
  2099. end if
  2100.  
  2101. if queuedscore>=1000 then
  2102. tempscore=1000
  2103. queuedscore=queuedscore-1000
  2104. SetMotor2(1000)
  2105. exit sub
  2106. end if
  2107.  
  2108. if queuedscore>=500 then
  2109. tempscore=500
  2110. queuedscore=queuedscore-500
  2111. SetMotor2(500)
  2112. exit sub
  2113. end if
  2114. if queuedscore>=400 then
  2115. tempscore=400
  2116. queuedscore=queuedscore-400
  2117. SetMotor2(400)
  2118. exit sub
  2119. end if
  2120. if queuedscore>=300 then
  2121. tempscore=300
  2122. queuedscore=queuedscore-300
  2123. SetMotor2(300)
  2124. exit sub
  2125. end if
  2126. if queuedscore>=200 then
  2127. tempscore=200
  2128. queuedscore=queuedscore-200
  2129. SetMotor2(200)
  2130. exit sub
  2131. end if
  2132. if queuedscore>=100 then
  2133. tempscore=100
  2134. queuedscore=queuedscore-100
  2135. SetMotor2(100)
  2136. exit sub
  2137. end if
  2138.  
  2139. if queuedscore>=50 then
  2140. tempscore=50
  2141. queuedscore=queuedscore-50
  2142. SetMotor2(50)
  2143. exit sub
  2144. end if
  2145. if queuedscore>=40 then
  2146. tempscore=40
  2147. queuedscore=queuedscore-40
  2148. SetMotor2(40)
  2149. exit sub
  2150. end if
  2151. if queuedscore>=30 then
  2152. tempscore=30
  2153. queuedscore=queuedscore-30
  2154. SetMotor2(30)
  2155. exit sub
  2156. end if
  2157. if queuedscore>=20 then
  2158. tempscore=20
  2159. queuedscore=queuedscore-20
  2160. SetMotor2(20)
  2161. exit sub
  2162. end if
  2163. if queuedscore>=10 then
  2164. tempscore=10
  2165. queuedscore=queuedscore-10
  2166. SetMotor2(10)
  2167. exit sub
  2168. end if
  2169. if queuedscore>=5 then
  2170. tempscore=5
  2171. queuedscore=queuedscore-5
  2172. SetMotor2(5)
  2173. exit sub
  2174. end if
  2175. if queuedscore>=4 then
  2176. tempscore=4
  2177. queuedscore=queuedscore-4
  2178. SetMotor2(4)
  2179. exit sub
  2180. end if
  2181. if queuedscore>=3 then
  2182. tempscore=3
  2183. queuedscore=queuedscore-3
  2184. SetMotor2(3)
  2185. exit sub
  2186. end if
  2187. if queuedscore>=2 then
  2188. tempscore=2
  2189. queuedscore=queuedscore-2
  2190. SetMotor2(2)
  2191. exit sub
  2192. end if
  2193. if queuedscore>=1 then
  2194. tempscore=1
  2195. queuedscore=queuedscore-1
  2196. SetMotor2(1)
  2197. exit sub
  2198. end if
  2199.  
  2200. End If
  2201.  
  2202.  
  2203. end Sub
  2204.  
  2205. Sub ScoreMotorTimer_Timer
  2206. If MotorPosition > 0 Then
  2207. Select Case MotorPosition
  2208. Case 5,4,3,2:
  2209. If MotorMode=1000 Then
  2210. AddScore(1000)
  2211. end if
  2212. if MotorMode=100 then
  2213. AddScore(100)
  2214. End If
  2215. if MotorMode=10 then
  2216. AddScore(10)
  2217. End if
  2218. if MotorMode=1 then
  2219. AddScore(1)
  2220. End if
  2221. MotorPosition=MotorPosition-1
  2222. Case 1:
  2223. If MotorMode=1000 Then
  2224. AddScore(1000)
  2225. end if
  2226. If MotorMode=100 then
  2227. AddScore(100)
  2228. End If
  2229. if MotorMode=10 then
  2230. AddScore(10)
  2231. End if
  2232. if MotorMode=1 then
  2233. AddScore(1)
  2234. End if
  2235. MotorPosition=0:MotorRunning=0:BumpersOn
  2236. End Select
  2237. End If
  2238.  
  2239. End Sub
  2240.  
  2241.  
  2242. Sub AddScore(x)
  2243. If TableTilted=true then exit sub
  2244. Select Case ScoreAdditionAdjustment
  2245. Case 0:
  2246. AddScore1(x)
  2247. Case 1:
  2248. AddScore2(x)
  2249. end Select
  2250.  
  2251. end sub
  2252.  
  2253.  
  2254. Sub AddScore1(x)
  2255. ' debugtext.text=score
  2256. Select Case x
  2257. Case 1:
  2258. PlayChime(10)
  2259. Score(Player)=Score(Player)+1
  2260.  
  2261. Case 10:
  2262. PlayChime(10)
  2263. Score(Player)=Score(Player)+10
  2264. ' debugscore=debugscore+10
  2265. ToggleAlternatingRelay
  2266. Case 100:
  2267. PlayChime(100)
  2268. Score(Player)=Score(Player)+100
  2269. ' debugscore=debugscore+100
  2270.  
  2271. Case 1000:
  2272. PlayChime(1000)
  2273. Score(Player)=Score(Player)+1000
  2274. ' debugscore=debugscore+1000
  2275. End Select
  2276. PlayerScores(Player-1).AddValue(x)
  2277. PlayerScoresOn(Player-1).AddValue(x)
  2278. If ScoreDisplay(Player)<100000 then
  2279. ScoreDisplay(Player)=Score(Player)
  2280. Else
  2281. Score100K(Player)=Int(Score(Player)/100000)
  2282. ScoreDisplay(Player)=Score(Player)-100000
  2283. End If
  2284. if Score(Player)=>100000 then
  2285. If B2SOn Then
  2286. If Player=1 Then
  2287. Controller.B2SSetScoreRolloverPlayer1 Score100K(Player)
  2288. End If
  2289. If Player=2 Then
  2290. Controller.B2SSetScoreRolloverPlayer2 Score100K(Player)
  2291. End If
  2292.  
  2293. If Player=3 Then
  2294. Controller.B2SSetScoreRolloverPlayer3 Score100K(Player)
  2295. End If
  2296.  
  2297. If Player=4 Then
  2298. Controller.B2SSetScoreRolloverPlayer4 Score100K(Player)
  2299. End If
  2300. End If
  2301. End If
  2302. If B2SOn Then
  2303. Controller.B2SSetScorePlayer Player, ScoreDisplay(Player)
  2304. End If
  2305. If Score(Player)>Replay1 and Replay1Paid(Player)=false then
  2306. Replay1Paid(Player)=True
  2307. AddSpecial
  2308. End If
  2309. If Score(Player)>Replay2 and Replay2Paid(Player)=false then
  2310. Replay2Paid(Player)=True
  2311. AddSpecial
  2312. End If
  2313. If Score(Player)>Replay3 and Replay3Paid(Player)=false then
  2314. Replay3Paid(Player)=True
  2315. AddSpecial
  2316. End If
  2317. ' ScoreText.text=debugscore
  2318. End Sub
  2319.  
  2320. Sub AddScore2(x)
  2321. Dim OldScore, NewScore, OldTestScore, NewTestScore
  2322. OldScore = Score(Player)
  2323.  
  2324. Select Case x
  2325. Case 1:
  2326. Score(Player)=Score(Player)+1
  2327. Case 10:
  2328. Score(Player)=Score(Player)+10
  2329. Case 100:
  2330. Score(Player)=Score(Player)+100
  2331. Case 1000:
  2332. Score(Player)=Score(Player)+1000
  2333. End Select
  2334. NewScore = Score(Player)
  2335. if Score(Player)=>100000 then
  2336. If B2SOn Then
  2337. If Player=1 Then
  2338. Controller.B2SSetScoreRolloverPlayer1 1
  2339. End If
  2340. If Player=2 Then
  2341. Controller.B2SSetScoreRolloverPlayer2 1
  2342. End If
  2343.  
  2344. If Player=3 Then
  2345. Controller.B2SSetScoreRolloverPlayer3 1
  2346. End If
  2347.  
  2348. If Player=4 Then
  2349. Controller.B2SSetScoreRolloverPlayer4 1
  2350. End If
  2351. End If
  2352. End If
  2353.  
  2354. OldTestScore = OldScore
  2355. NewTestScore = NewScore
  2356. Do
  2357. if OldTestScore < Replay1 and NewTestScore >= Replay1 then
  2358. AddSpecial()
  2359. NewTestScore = 0
  2360. Elseif OldTestScore < Replay2 and NewTestScore >= Replay2 then
  2361. AddSpecial()
  2362. NewTestScore = 0
  2363. Elseif OldTestScore < Replay3 and NewTestScore >= Replay3 then
  2364. AddSpecial()
  2365. NewTestScore = 0
  2366. End if
  2367. NewTestScore = NewTestScore - 100000
  2368. OldTestScore = OldTestScore - 100000
  2369. Loop While NewTestScore > 0
  2370.  
  2371. OldScore = int(OldScore / 1) ' divide by 10 for games with fixed 0 in 1s position, by 1 for games with real 1s digits
  2372. NewScore = int(NewScore / 1) ' divide by 10 for games with fixed 0 in 1s position, by 1 for games with real 1s digits
  2373. ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore&", OldScore Mod 10="&OldScore Mod 10 & ", NewScore % 10="&NewScore Mod 10)
  2374.  
  2375. if (OldScore Mod 10 <> NewScore Mod 10) then
  2376. PlayChime(10)
  2377.  
  2378. end if
  2379.  
  2380. OldScore = int(OldScore / 10)
  2381. NewScore = int(NewScore / 10)
  2382. ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore)
  2383. if (OldScore Mod 10 <> NewScore Mod 10) then
  2384. PlayChime(100)
  2385. If BallsPerGame=3 then
  2386. ToggleZeroToNine
  2387. end if
  2388. end if
  2389.  
  2390. OldScore = int(OldScore / 10)
  2391. NewScore = int(NewScore / 10)
  2392. ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore)
  2393. if (OldScore Mod 10 <> NewScore Mod 10) then
  2394. PlayChime(1000)
  2395. If BallsPerGame=5 then
  2396. ToggleZeroToNine
  2397. end if
  2398. end if
  2399.  
  2400. OldScore = int(OldScore / 10)
  2401. NewScore = int(NewScore / 10)
  2402. ' MsgBox("OldScore="&OldScore&", NewScore="&NewScore)
  2403. if (OldScore Mod 10 <> NewScore Mod 10) then
  2404. PlayChime(1000)
  2405. end if
  2406.  
  2407. If B2SOn Then
  2408. Controller.B2SSetScorePlayer Player, Score(Player)
  2409. End If
  2410. ' EMReel1.SetValue Score(Player)
  2411. PlayerScores(Player-1).AddValue(x)
  2412. PlayerScoresOn(Player-1).AddValue(x)
  2413. End Sub
  2414.  
  2415.  
  2416.  
  2417. Sub PlayChime(x)
  2418. if ChimesOn=0 then
  2419. Select Case x
  2420. Case 10
  2421. If LastChime10=1 Then
  2422. PlaySound SoundFXDOF("SpinACard_1_10_Point_Bell",301,DOFPulse,DOFChimes)
  2423. LastChime10=0
  2424. Else
  2425. PlaySound SoundFXDOF("SpinACard_1_10_Point_Bell",301,DOFPulse,DOFChimes)
  2426. LastChime10=1
  2427. End If
  2428. Case 100
  2429. If LastChime100=1 Then
  2430. PlaySound SoundFXDOF("SpinACard_1_100_Point_Bell",302,DOFPulse,DOFChimes)
  2431. LastChime100=0
  2432. Else
  2433. PlaySound SoundFXDOF("SpinACard_1_100_Point_Bell",302,DOFPulse,DOFChimes)
  2434. LastChime100=1
  2435. End If
  2436.  
  2437. End Select
  2438. else
  2439. Select Case x
  2440. Case 10
  2441. If LastChime10=1 Then
  2442. PlaySound SoundFXDOF("SJ_Chime_10a",301,DOFPulse,DOFChimes)
  2443. LastChime10=0
  2444. Else
  2445. PlaySound SoundFXDOF("SJ_Chime_10b",301,DOFPulse,DOFChimes)
  2446. LastChime10=1
  2447. End If
  2448. Case 100
  2449. If LastChime100=1 Then
  2450. PlaySound SoundFXDOF("SJ_Chime_100a",302,DOFPulse,DOFChimes)
  2451. LastChime100=0
  2452. Else
  2453. PlaySound SoundFXDOF("SJ_Chime_100b",302,DOFPulse,DOFChimes)
  2454. LastChime100=1
  2455. End If
  2456. Case 1000
  2457. If LastChime1000=1 Then
  2458. PlaySound SoundFXDOF("SJ_Chime_1000a",303,DOFPulse,DOFChimes)
  2459. LastChime1000=0
  2460. Else
  2461. PlaySound SoundFXDOF("SJ_Chime_1000b",303,DOFPulse,DOFChimes)
  2462. LastChime1000=1
  2463. End If
  2464. End Select
  2465. end if
  2466. End Sub
  2467.  
  2468. Sub HideOptions()
  2469.  
  2470. end sub
  2471.  
  2472. ' *******************************************************************************************************
  2473. ' Positional Sound Playback Functions by DJRobX, Rothbauerw, Thalamus and Herweh
  2474. ' PlaySound sound, 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  2475. ' *******************************************************************************************************
  2476.  
  2477. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  2478. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  2479. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  2480.  
  2481. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  2482. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  2483. End Sub
  2484.  
  2485. ' Set position as table object (Use object or light but NOT wall) and Vol to 1
  2486.  
  2487. Sub PlaySoundAt(soundname, tableobj)
  2488. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  2489. End Sub
  2490.  
  2491. ' set position as table object and Vol + RndPitch manually
  2492.  
  2493. Sub PlaySoundAtVolPitch(sound, tableobj, Vol, RndPitch)
  2494. PlaySound sound, 1, Vol, AudioPan(tableobj), RndPitch, 0, 0, 1, AudioFade(tableobj)
  2495. End Sub
  2496.  
  2497. 'Set all as per ball position & speed.
  2498.  
  2499. Sub PlaySoundAtBall(soundname)
  2500. PlaySoundAt soundname, ActiveBall
  2501. End Sub
  2502.  
  2503. 'Set position as table object and Vol manually.
  2504.  
  2505. Sub PlaySoundAtVol(sound, tableobj, Volume)
  2506. PlaySound sound, 1, Volume, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  2507. End Sub
  2508.  
  2509. 'Set all as per ball position & speed, but Vol Multiplier may be used eg; PlaySoundAtBallVol "sound",3
  2510.  
  2511. Sub PlaySoundAtBallVol(sound, VolMult)
  2512. PlaySound sound, 0, Vol(ActiveBall) * VolMult, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  2513. End Sub
  2514.  
  2515. Sub PlaySoundAtBallAbsVol(sound, VolMult)
  2516. PlaySound sound, 0, VolMult, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  2517. End Sub
  2518.  
  2519. ' requires rampbump1 to 7 in Sound Manager
  2520.  
  2521. Sub RandomBump(voladj, freq)
  2522. Dim BumpSnd:BumpSnd= "rampbump" & CStr(Int(Rnd*7)+1)
  2523. PlaySound BumpSnd, 0, Vol(ActiveBall)*voladj, AudioPan(ActiveBall), 0, freq, 0, 1, AudioFade(ActiveBall)
  2524. End Sub
  2525.  
  2526. ' set position as bumperX and Vol manually. Allows rapid repetition/overlaying sound
  2527.  
  2528. Sub PlaySoundAtBumperVol(sound, tableobj, Vol)
  2529. PlaySound sound, 1, Vol, AudioPan(tableobj), 0,0,1, 1, AudioFade(tableobj)
  2530. End Sub
  2531.  
  2532. Sub PlaySoundAtBOTBallZ(sound, BOT)
  2533. PlaySound sound, 0, ABS(BOT.velz)/17, Pan(BOT), 0, Pitch(BOT), 1, 0, AudioFade(BOT)
  2534. End Sub
  2535.  
  2536. ' play a looping sound at a location with volume
  2537. Sub PlayLoopSoundAtVol(sound, tableobj, Vol)
  2538. PlaySound sound, -1, Vol, AudioPan(tableobj), 0, 0, 1, 0, AudioFade(tableobj)
  2539. End Sub
  2540.  
  2541.  
  2542. '*********************************************************************
  2543. ' Supporting Ball, Sound Functions and Math
  2544. '*********************************************************************
  2545.  
  2546. Function RndNum(min, max)
  2547. RndNum = Int(Rnd() * (max-min + 1) ) + min ' Sets a random number between min and max
  2548. End Function
  2549.  
  2550. Const Pi = 3.1415927
  2551.  
  2552. Function dSin(degrees)
  2553. dsin = sin(degrees * Pi/180)
  2554. End Function
  2555.  
  2556. Function dCos(degrees)
  2557. dcos = cos(degrees * Pi/180)
  2558. End Function
  2559.  
  2560. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  2561. Dim tmp
  2562. On Error Resume Next
  2563. tmp = tableobj.y * 2 / table1.height-1
  2564. If tmp > 0 Then
  2565. AudioFade = Csng(tmp ^10)
  2566. Else
  2567. AudioFade = Csng(-((- tmp) ^10) )
  2568. End If
  2569. End Function
  2570.  
  2571. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  2572. Dim tmp
  2573. On Error Resume Next
  2574. tmp = tableobj.x * 2 / table1.width-1
  2575. If tmp > 0 Then
  2576. AudioPan = Csng(tmp ^10)
  2577. Else
  2578. AudioPan = Csng(-((- tmp) ^10) )
  2579. End If
  2580. End Function
  2581.  
  2582. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  2583. Dim tmp
  2584. On Error Resume Next
  2585. tmp = ball.x * 2 / table1.width-1
  2586. If tmp > 0 Then
  2587. Pan = Csng(tmp ^10)
  2588. Else
  2589. Pan = Csng(-((- tmp) ^10) )
  2590. End If
  2591. End Function
  2592.  
  2593. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  2594. Vol = Csng(BallVel(ball) ^2 / 2000)
  2595. End Function
  2596.  
  2597. Function VolMulti(ball,Multiplier) ' Calculates the Volume of the sound based on the ball speed
  2598. VolMulti = Csng(BallVel(ball) ^2 / 150 ) * Multiplier
  2599. End Function
  2600.  
  2601. Function DVolMulti(ball,Multiplier) ' Calculates the Volume of the sound based on the ball speed
  2602. DVolMulti = Csng(BallVel(ball) ^2 / 150 ) * Multiplier
  2603. debug.print DVolMulti
  2604. End Function
  2605.  
  2606. Function BallRollVol(ball) ' Calculates the Volume of the sound based on the ball speed
  2607. BallRollVol = Csng(BallVel(ball) ^2 / (80000 - (79900 * Log(RollVol) / Log(100))))
  2608. End Function
  2609.  
  2610. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  2611. Pitch = BallVel(ball) * 20
  2612. End Function
  2613.  
  2614. Function BallVel(ball) 'Calculates the ball speed
  2615. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  2616. End Function
  2617.  
  2618. Function BallVelZ(ball) 'Calculates the ball speed in the -Z
  2619. BallVelZ = INT((ball.VelZ) * -1 )
  2620. End Function
  2621.  
  2622. Function VolZ(ball) ' Calculates the Volume of the sound based on the ball speed in the Z
  2623. VolZ = Csng(BallVelZ(ball) ^2 / 200)*1.2
  2624. End Function
  2625.  
  2626. '*** Determines if a Points (px,py) is inside a 4 point polygon A-D in Clockwise/CCW order
  2627.  
  2628. Function InRect(px,py,ax,ay,bx,by,cx,cy,dx,dy)
  2629. Dim AB, BC, CD, DA
  2630. AB = (bx*py) - (by*px) - (ax*py) + (ay*px) + (ax*by) - (ay*bx)
  2631. BC = (cx*py) - (cy*px) - (bx*py) + (by*px) + (bx*cy) - (by*cx)
  2632. CD = (dx*py) - (dy*px) - (cx*py) + (cy*px) + (cx*dy) - (cy*dx)
  2633. DA = (ax*py) - (ay*px) - (dx*py) + (dy*px) + (dx*ay) - (dy*ax)
  2634.  
  2635. If (AB <= 0 AND BC <=0 AND CD <= 0 AND DA <= 0) Or (AB >= 0 AND BC >=0 AND CD >= 0 AND DA >= 0) Then
  2636. InRect = True
  2637. Else
  2638. InRect = False
  2639. End If
  2640. End Function
  2641.  
  2642. '*****************************************
  2643. ' JP's VP10 Rolling Sounds
  2644. '*****************************************
  2645.  
  2646. Const tnob = 5 ' total number of balls
  2647. ReDim rolling(tnob)
  2648. InitRolling
  2649.  
  2650. Sub InitRolling
  2651. Dim i
  2652. For i = 0 to tnob
  2653. rolling(i) = False
  2654. Next
  2655. End Sub
  2656.  
  2657. Sub RollingSoundTimer_Timer()
  2658. Dim BOT, b
  2659. BOT = GetBalls
  2660.  
  2661. ' stop the sound of deleted balls
  2662. For b = UBound(BOT) + 1 to tnob
  2663. rolling(b) = False
  2664. StopSound("fx_ballrolling" & b)
  2665. Next
  2666.  
  2667. ' exit the sub if no balls on the table
  2668. If UBound(BOT) = -1 Then Exit Sub
  2669.  
  2670. ' play the rolling sound for each ball
  2671. For b = 0 to UBound(BOT)
  2672. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  2673. rolling(b) = True
  2674. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  2675. Else
  2676. If rolling(b) = True Then
  2677. StopSound("fx_ballrolling" & b)
  2678. rolling(b) = False
  2679. End If
  2680. End If
  2681. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  2682. PlaySoundAtBOTBallZ "fx_ball_drop" & b, BOT(b)
  2683. End If
  2684. Next
  2685. End Sub
  2686.  
  2687. '**********************
  2688. ' Ball Collision Sound
  2689. '**********************
  2690.  
  2691. Sub OnBallBallCollision(ball1, ball2, velocity)
  2692. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  2693. End Sub
  2694.  
  2695.  
  2696.  
  2697. '*****************************************
  2698. ' ninuzzu's BALL SHADOW
  2699. '*****************************************
  2700. Dim BallShadow
  2701. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  2702.  
  2703. Sub BallShadowUpdate_timer()
  2704. Dim BOT, b
  2705. BOT = GetBalls
  2706. ' hide shadow of deleted balls
  2707. If UBound(BOT)<(tnob-1) Then
  2708. For b = (UBound(BOT) + 1) to (tnob-1)
  2709. BallShadow(b).visible = 0
  2710. Next
  2711. End If
  2712. ' exit the Sub if no balls on the table
  2713. If UBound(BOT) = -1 Then Exit Sub
  2714. ' render the shadow for each ball
  2715. For b = 0 to UBound(BOT)
  2716. If BOT(b).X < Table1.Width/2 Then
  2717. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/21)) + 6
  2718. Else
  2719. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/21)) - 6
  2720. End If
  2721. ballShadow(b).Y = BOT(b).Y + 4
  2722. If BOT(b).Z > 20 Then
  2723. BallShadow(b).visible = 1
  2724. Else
  2725. BallShadow(b).visible = 0
  2726. End If
  2727. Next
  2728. End Sub
  2729.  
  2730. '*****************************************
  2731. ' Object sounds
  2732. '*****************************************
  2733.  
  2734. Sub Plastics_Hit (idx)
  2735. PlaySound "woodhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  2736. End Sub
  2737.  
  2738. Sub Pins_Hit (idx)
  2739. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  2740. End Sub
  2741.  
  2742. Sub Targets_Hit (idx)
  2743. PlaySoundAtBall SoundFX ("target",DOFTargets), 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  2744. End Sub
  2745.  
  2746. Sub Metals_Thin_Hit (idx)
  2747. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2748. End Sub
  2749.  
  2750. Sub Metals_Medium_Hit (idx)
  2751. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2752. End Sub
  2753.  
  2754. Sub Metals2_Hit (idx)
  2755. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2756. End Sub
  2757.  
  2758. Sub Gates_Hit (idx)
  2759. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2760. End Sub
  2761.  
  2762. Sub Spinner_Spin
  2763. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  2764. End Sub
  2765.  
  2766. Sub Rubbers_Hit(idx)
  2767. dim finalspeed
  2768. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  2769. If finalspeed > 20 then
  2770. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2771. End if
  2772. If finalspeed >= 6 AND finalspeed <= 20 then
  2773. RandomSoundRubber()
  2774. End If
  2775. End Sub
  2776.  
  2777. Sub Posts_Hit(idx)
  2778. dim finalspeed
  2779. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  2780. If finalspeed > 16 then
  2781. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2782. End if
  2783. If finalspeed >= 6 AND finalspeed <= 16 then
  2784. RandomSoundRubber()
  2785. End If
  2786. End Sub
  2787.  
  2788. Sub RandomSoundRubber()
  2789. Select Case Int(Rnd*3)+1
  2790. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2791. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2792. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2793. End Select
  2794. End Sub
  2795.  
  2796. Sub LeftFlipper_Collide(parm)
  2797. RandomSoundFlipper()
  2798. End Sub
  2799.  
  2800. Sub RightFlipper_Collide(parm)
  2801. RandomSoundFlipper()
  2802. End Sub
  2803.  
  2804. Sub RandomSoundFlipper()
  2805. Select Case Int(Rnd*3)+1
  2806. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2807. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2808. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  2809. End Select
  2810. End Sub
  2811.  
  2812.  
  2813. ' ============================================================================================
  2814. ' GNMOD - Multiple High Score Display and Collection
  2815. ' ============================================================================================
  2816. Dim EnteringInitials ' Normally zero, set to non-zero to enter initials
  2817. EnteringInitials = 0
  2818.  
  2819. Dim PlungerPulled
  2820. PlungerPulled = 0
  2821.  
  2822. Dim SelectedChar ' character under the "cursor" when entering initials
  2823.  
  2824. Dim HSTimerCount ' Pass counter for HS timer, scores are cycled by the timer
  2825. HSTimerCount = 5 ' Timer is initially enabled, it'll wrap from 5 to 1 when it's displayed
  2826.  
  2827. Dim InitialString ' the string holding the player's initials as they're entered
  2828.  
  2829. Dim AlphaString ' A-Z, 0-9, space (_) and backspace (<)
  2830. Dim AlphaStringPos ' pointer to AlphaString, move forward and backward with flipper keys
  2831. AlphaString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_<"
  2832.  
  2833. Dim HSNewHigh ' The new score to be recorded
  2834.  
  2835. Dim HSScore(5) ' High Scores read in from config file
  2836. Dim HSName(5) ' High Score Initials read in from config file
  2837.  
  2838. ' default high scores, remove this when the scores are available from the config file
  2839. HSScore(1) = 7500
  2840. HSScore(2) = 7000
  2841. HSScore(3) = 6000
  2842. HSScore(4) = 5500
  2843. HSScore(5) = 5000
  2844.  
  2845. HSName(1) = "AAA"
  2846. HSName(2) = "ZZZ"
  2847. HSName(3) = "XXX"
  2848. HSName(4) = "ABC"
  2849. HSName(5) = "BBB"
  2850.  
  2851. Sub HighScoreTimer_Timer
  2852.  
  2853. if EnteringInitials then
  2854. if HSTimerCount = 1 then
  2855. SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
  2856. HSTimerCount = 2
  2857. else
  2858. SetHSLine 3, InitialString
  2859. HSTimerCount = 1
  2860. end if
  2861. elseif InProgress then
  2862. SetHSLine 1, "HIGH SCORE1"
  2863. SetHSLine 2, HSScore(1)
  2864. SetHSLine 3, HSName(1)
  2865. HSTimerCount = 5 ' set so the highest score will show after the game is over
  2866. HighScoreTimer.enabled=false
  2867. elseif CheckAllScores then
  2868. NewHighScore sortscores(ScoreChecker),sortplayers(ScoreChecker)
  2869.  
  2870. else
  2871. ' cycle through high scores
  2872. HighScoreTimer.interval=2000
  2873. HSTimerCount = HSTimerCount + 1
  2874. if HsTimerCount > 5 then
  2875. HSTimerCount = 1
  2876. End If
  2877. SetHSLine 1, "HIGH SCORE"+FormatNumber(HSTimerCount,0)
  2878. SetHSLine 2, HSScore(HSTimerCount)
  2879. SetHSLine 3, HSName(HSTimerCount)
  2880. end if
  2881. End Sub
  2882.  
  2883. Function GetHSChar(String, Index)
  2884. dim ThisChar
  2885. dim FileName
  2886. ThisChar = Mid(String, Index, 1)
  2887. FileName = "PostIt"
  2888. if ThisChar = " " or ThisChar = "" then
  2889. FileName = FileName & "BL"
  2890. elseif ThisChar = "<" then
  2891. FileName = FileName & "LT"
  2892. elseif ThisChar = "_" then
  2893. FileName = FileName & "SP"
  2894. else
  2895. FileName = FileName & ThisChar
  2896. End If
  2897. GetHSChar = FileName
  2898. End Function
  2899.  
  2900. Sub SetHsLine(LineNo, String)
  2901. dim Letter
  2902. dim ThisDigit
  2903. dim ThisChar
  2904. dim StrLen
  2905. dim LetterLine
  2906. dim Index
  2907. dim StartHSArray
  2908. dim EndHSArray
  2909. dim LetterName
  2910. dim xfor
  2911. StartHSArray=array(0,1,12,22)
  2912. EndHSArray=array(0,11,21,31)
  2913. StrLen = len(string)
  2914. Index = 1
  2915.  
  2916. for xfor = StartHSArray(LineNo) to EndHSArray(LineNo)
  2917. Eval("HS"&xfor).image = GetHSChar(String, Index)
  2918. Index = Index + 1
  2919. next
  2920.  
  2921. End Sub
  2922.  
  2923. Sub NewHighScore(NewScore, PlayNum)
  2924. if NewScore > HSScore(5) then
  2925. HighScoreTimer.interval = 500
  2926. HSTimerCount = 1
  2927. AlphaStringPos = 1 ' start with first character "A"
  2928. EnteringInitials = 1 ' intercept the control keys while entering initials
  2929. InitialString = "" ' initials entered so far, initialize to empty
  2930. SetHSLine 1, "PLAYER "+FormatNumber(PlayNum,0)
  2931. SetHSLine 2, "ENTER NAME"
  2932. SetHSLine 3, MID(AlphaString, AlphaStringPos, 1)
  2933. HSNewHigh = NewScore
  2934. For xx=1 to HighScoreReward
  2935. AddSpecial
  2936. next
  2937. End if
  2938. ScoreChecker=ScoreChecker-1
  2939. if ScoreChecker=0 then
  2940. CheckAllScores=0
  2941. end if
  2942. End Sub
  2943.  
  2944. Sub CollectInitials(keycode)
  2945. If keycode = LeftFlipperKey Then
  2946. ' back up to previous character
  2947. AlphaStringPos = AlphaStringPos - 1
  2948. if AlphaStringPos < 1 then
  2949. AlphaStringPos = len(AlphaString) ' handle wrap from beginning to end
  2950. if InitialString = "" then
  2951. ' Skip the backspace if there are no characters to backspace over
  2952. AlphaStringPos = AlphaStringPos - 1
  2953. End if
  2954. end if
  2955. SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
  2956. PlaySoundAtBall "DropTargetDropped"
  2957. elseif keycode = RightFlipperKey Then
  2958. ' advance to next character
  2959. AlphaStringPos = AlphaStringPos + 1
  2960. if AlphaStringPos > len(AlphaString) or (AlphaStringPos = len(AlphaString) and InitialString = "") then
  2961. ' Skip the backspace if there are no characters to backspace over
  2962. AlphaStringPos = 1
  2963. end if
  2964. SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
  2965. PlaySoundAtBall "DropTargetDropped"
  2966. elseif keycode = StartGameKey or keycode = PlungerKey Then
  2967. SelectedChar = MID(AlphaString, AlphaStringPos, 1)
  2968. if SelectedChar = "_" then
  2969. InitialString = InitialString & " "
  2970. PlaySound("Ding10")
  2971. elseif SelectedChar = "<" then
  2972. InitialString = MID(InitialString, 1, len(InitialString) - 1)
  2973. if len(InitialString) = 0 then
  2974. ' If there are no more characters to back over, don't leave the < displayed
  2975. AlphaStringPos = 1
  2976. end if
  2977. PlaySound("Ding100")
  2978. else
  2979. InitialString = InitialString & SelectedChar
  2980. PlaySound("Ding10")
  2981. end if
  2982. if len(InitialString) < 3 then
  2983. SetHSLine 3, InitialString & SelectedChar
  2984. End If
  2985. End If
  2986. if len(InitialString) = 3 then
  2987. ' save the score
  2988. for i = 5 to 1 step -1
  2989. if i = 1 or (HSNewHigh > HSScore(i) and HSNewHigh <= HSScore(i - 1)) then
  2990. ' Replace the score at this location
  2991. if i < 5 then
  2992. ' MsgBox("Moving " & i & " to " & (i + 1))
  2993. HSScore(i + 1) = HSScore(i)
  2994. HSName(i + 1) = HSName(i)
  2995. end if
  2996. ' MsgBox("Saving initials " & InitialString & " to position " & i)
  2997. EnteringInitials = 0
  2998. HSScore(i) = HSNewHigh
  2999. HSName(i) = InitialString
  3000. HSTimerCount = 5
  3001. HighScoreTimer_Timer
  3002. HighScoreTimer.interval = 2000
  3003. PlaySound("Ding1000")
  3004. exit sub
  3005. elseif i < 5 then
  3006. ' move the score in this slot down by 1, it's been exceeded by the new score
  3007. ' MsgBox("Moving " & i & " to " & (i + 1))
  3008. HSScore(i + 1) = HSScore(i)
  3009. HSName(i + 1) = HSName(i)
  3010. end if
  3011. next
  3012. End If
  3013.  
  3014. End Sub
  3015. ' END GNMOD
  3016. ' ============================================================================================
  3017. ' GNMOD - New Options menu
  3018. ' ============================================================================================
  3019. Dim EnteringOptions
  3020. Dim CurrentOption
  3021. Dim OptionCHS
  3022. Dim MaxOption
  3023. Dim OptionHighScorePosition
  3024. Dim XOpt
  3025. Dim StartingArray
  3026. Dim EndingArray
  3027.  
  3028. StartingArray=Array(0,1,2,30,33,61,89,117,145,173,201,229)
  3029. EndingArray=Array(0,1,29,32,60,88,116,144,172,200,228,256)
  3030. EnteringOptions = 0
  3031. MaxOption = 9
  3032. OptionCHS = 0
  3033. OptionHighScorePosition = 0
  3034. Const OptionLinesToMark="111000011"
  3035. Const OptionLine1="" 'do not use this line
  3036. Const OptionLine2="" 'do not use this line
  3037. Const OptionLine3="" 'do not use this line
  3038. Const OptionLine4=""
  3039. Const OptionLine5=""
  3040. Const OptionLine6=""
  3041. Const OptionLine7=""
  3042. Const OptionLine8="" 'do not use this line
  3043. Const OptionLine9="" 'do not use this line
  3044.  
  3045. Sub OperatorMenuTimer_Timer
  3046. EnteringOptions = 1
  3047. OperatorMenuTimer.enabled=false
  3048. ShowOperatorMenu
  3049. end sub
  3050.  
  3051. sub ShowOperatorMenu
  3052. OperatorMenuBackdrop.image = "OperatorMenu"
  3053.  
  3054. OptionCHS = 0
  3055. CurrentOption = 1
  3056. DisplayAllOptions
  3057. OperatorOption1.image = "BluePlus"
  3058. SetHighScoreOption
  3059.  
  3060. End Sub
  3061.  
  3062. Sub DisplayAllOptions
  3063. dim linecounter
  3064. dim tempstring
  3065. For linecounter = 1 to MaxOption
  3066. tempstring=Eval("OptionLine"&linecounter)
  3067. Select Case linecounter
  3068. Case 1:
  3069. tempstring=tempstring + FormatNumber(BallsPerGame,0)
  3070. SetOptLine 1,tempstring
  3071. Case 2:
  3072. if Replay3Table(ReplayLevel)=999000 then
  3073. tempstring = tempstring + FormatNumber(Replay1Table(ReplayLevel),0) + "/" + FormatNumber(Replay2Table(ReplayLevel),0)
  3074. else
  3075. tempstring = tempstring + FormatNumber(Replay1Table(ReplayLevel),0) + "/" + FormatNumber(Replay2Table(ReplayLevel),0) + "/" + FormatNumber(Replay3Table(ReplayLevel),0)
  3076. end if
  3077. SetOptLine 2,tempstring
  3078. Case 3:
  3079. If OptionCHS=0 then
  3080. tempstring = "NO"
  3081. else
  3082. tempstring = "YES"
  3083. end if
  3084. SetOptLine 3,tempstring
  3085. Case 4:
  3086. SetOptLine 4, tempstring
  3087.  
  3088. SetOptLine 5, tempstring
  3089. Case 5:
  3090. SetOptLine 6, tempstring
  3091. SetOptLine 7, tempstring
  3092.  
  3093. Case 6:
  3094. SetOptLine 8, tempstring
  3095. SetOptLine 9, tempstring
  3096.  
  3097. Case 7:
  3098. SetOptLine 10, tempstring
  3099. SetOptLine 11, tempstring
  3100.  
  3101. Case 8:
  3102.  
  3103. Case 9:
  3104.  
  3105.  
  3106. End Select
  3107.  
  3108. next
  3109. end sub
  3110.  
  3111. sub MoveArrow
  3112. do
  3113. CurrentOption = CurrentOption + 1
  3114. If CurrentOption>Len(OptionLinesToMark) then
  3115. CurrentOption=1
  3116. end if
  3117. loop until Mid(OptionLinesToMark,CurrentOption,1)="1"
  3118. end sub
  3119.  
  3120. sub CollectOptions(ByVal keycode)
  3121. if Keycode = LeftFlipperKey then
  3122. PlaySoundAtBall "DropTargetDropped"
  3123. For XOpt = 1 to MaxOption
  3124. Eval("OperatorOption"&XOpt).image = "PostitBL"
  3125. next
  3126. MoveArrow
  3127. if CurrentOption<8 then
  3128. Eval("OperatorOption"&CurrentOption).image = "BluePlus"
  3129. elseif CurrentOption=8 then
  3130. Eval("OperatorOption"&CurrentOption).image = "GreenCheck"
  3131. else
  3132. Eval("OperatorOption"&CurrentOption).image = "RedX"
  3133. end if
  3134.  
  3135. elseif Keycode = RightFlipperKey then
  3136. PlaySoundAtBall "DropTargetDropped"
  3137. if CurrentOption = 1 then
  3138. If BallsPerGame = 3 then
  3139. BallsPerGame = 5
  3140. else
  3141. BallsPerGame = 3
  3142. end if
  3143. DisplayAllOptions
  3144. elseif CurrentOption = 2 then
  3145. ReplayLevel=ReplayLevel+1
  3146. If ReplayLevel>ReplayTableMax then
  3147. ReplayLevel=1
  3148. end if
  3149. DisplayAllOptions
  3150. elseif CurrentOption = 3 then
  3151. if OptionCHS = 0 then
  3152. OptionCHS = 1
  3153.  
  3154. else
  3155. OptionCHS = 0
  3156.  
  3157. end if
  3158. DisplayAllOptions
  3159.  
  3160. elseif CurrentOption = 8 or CurrentOption = 9 then
  3161. if OptionCHS=1 then
  3162. HSScore(1) = 7500
  3163. HSScore(2) = 7000
  3164. HSScore(3) = 6000
  3165. HSScore(4) = 5500
  3166. HSScore(5) = 5000
  3167.  
  3168. HSName(1) = "AAA"
  3169. HSName(2) = "ZZZ"
  3170. HSName(3) = "XXX"
  3171. HSName(4) = "ABC"
  3172. HSName(5) = "BBB"
  3173. end if
  3174.  
  3175. if CurrentOption = 8 then
  3176. savehs
  3177. else
  3178. loadhs
  3179. end if
  3180. OperatorMenuBackdrop.image = "PostitBL"
  3181. For XOpt = 1 to MaxOption
  3182. Eval("OperatorOption"&XOpt).image = "PostitBL"
  3183. next
  3184.  
  3185. For XOpt = 1 to 256
  3186. Eval("Option"&XOpt).image = "PostItBL"
  3187. next
  3188. RefreshReplayCard
  3189. InstructCard.image="IC"+FormatNumber(BallsPerGame,0)+"0"
  3190. EnteringOptions = 0
  3191.  
  3192. end if
  3193. end if
  3194. End Sub
  3195.  
  3196. Sub SetHighScoreOption
  3197.  
  3198. End Sub
  3199.  
  3200. Function GetOptChar(String, Index)
  3201. dim ThisChar
  3202. dim FileName
  3203. ThisChar = Mid(String, Index, 1)
  3204. FileName = "PostIt"
  3205. if ThisChar = " " or ThisChar = "" then
  3206. FileName = FileName & "BL"
  3207. elseif ThisChar = "<" then
  3208. FileName = FileName & "LT"
  3209. elseif ThisChar = "_" then
  3210. FileName = FileName & "SP"
  3211. elseif ThisChar = "/" then
  3212. FileName = FileName & "SL"
  3213. elseif ThisChar = "," then
  3214. FileName = FileName & "CM"
  3215. else
  3216. FileName = FileName & ThisChar
  3217. End If
  3218. GetOptChar = FileName
  3219. End Function
  3220.  
  3221. dim LineLengths(22) ' maximum number of lines
  3222. Sub SetOptLine(LineNo, String)
  3223. Dim DispLen
  3224. Dim StrLen
  3225. dim xfor
  3226. dim Letter
  3227. dim ThisDigit
  3228. dim ThisChar
  3229. dim LetterLine
  3230. dim Index
  3231. dim LetterName
  3232. StrLen = len(string)
  3233. Index = 1
  3234.  
  3235. StrLen = len(String)
  3236. DispLen = StrLen
  3237. if (DispLen < LineLengths(LineNo)) Then
  3238. DispLen = LineLengths(LineNo)
  3239. end If
  3240.  
  3241. for xfor = StartingArray(LineNo) to StartingArray(LineNo) + DispLen
  3242. Eval("Option"&xfor).image = GetOptChar(string, Index)
  3243. Index = Index + 1
  3244. next
  3245. LineLengths(LineNo) = StrLen
  3246.  
  3247. End Sub
  3248.  
  3249.  
Advertisement
Add Comment
Please, Sign In to add comment