Arngrim

Untitled

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