Arngrim

blue note

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