Arngrim

Untitled

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