Arngrim

Untitled

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