Outhere

Drop-A-Card (Gottlieb 1971) 1.0.0f DOF

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