Arngrim

High Hand DOF

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