Arngrim

Untitled

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