Arngrim

Untitled

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