Arngrim

Jet Spin DOF

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