Advertisement
Guest User

Untitled

a guest
Jan 12th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.81 KB | None | 0 0
  1. ' Whoa-Nellie (Stern 2015)
  2.  
  3.  
  4. ' leftover code for desktop and 2 player that are not used
  5. ' 1.4 reduce rollover scores to 1pt as per youtube
  6. ' 1.5 add attract mode, reverse top lane lights, initially on then go off as you get them
  7. ' 1.6 - 10pts for top lanes when light is on or off, flash lights when nudged hard
  8. ' - kicker cup +10pts per lit bumper points
  9. ' 1.7 - pf image changes, buzz sounds, BG for sounds, yellow light rules, kicker flashes bumpers, 5pt bumper is a dead bumper - no force.
  10. ' - yellow lane skill shot - 200 when flashing, 50 when not - at start of ball.
  11. ' - lane lights one of the other red rollovers as well, ditto for green rollover
  12. ' - gobble gobble
  13. ' 1.8 - add highscore postit - not great for desktop :-(
  14. ' 1.8d - DOF by arngrim
  15. ' 2.0 - new actual ROM sounds, more corrected rules
  16. Option Explicit
  17. Randomize
  18.  
  19. Const cGameName = "whoa_nellie_em"
  20. Const ballsize = "50"
  21.  
  22. On Error Resume Next
  23. ExecuteGlobal GetTextFile("controller.vbs")
  24. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  25. On Error Goto 0
  26.  
  27. Dim HiScore
  28. Dim GameOn
  29. Dim Players
  30. Dim UpBall
  31. Dim Ball
  32. Dim UpLight(2)
  33. Dim Score(2)
  34. Dim TempScore(2)
  35. Dim Credit
  36. Dim Credit1(2)
  37. Dim Credit2(2)
  38. Dim Tilted
  39. Dim Tilts
  40. Dim Up, pauseloop
  41. Dim x, i, lno
  42. Dim y, attractmodeflag, LFlag, RFlag
  43. Dim BonusLights
  44.  
  45. Dim BallsPerGame, StandardMode, MusicFlag
  46.  
  47. Dim Controller
  48. Dim DOFs
  49. Dim B2SOn
  50. Dim Req(220)
  51. Dim rpos
  52. Dim MusicFile, SVol,CVol,TVol
  53.  
  54. Dim HiSc, Object
  55. Dim Initial(4)
  56. Dim HSInitial0, HSInitial1, HSInitial2
  57. Dim EnableInitialEntry
  58. Dim HSi,HSx, HSArray, HSiArray
  59. Dim RoundHS, RoundHSPlayer
  60. Dim ScoreMil, Score100K, Score10K, ScoreK, Score100, Score10, ScoreUnit
  61. HSArray = Array("HS_0","HS_1","HS_2","HS_3","HS_4","HS_5","HS_6","HS_7","HS_8","HS_9","HS_Space","HS_Comma")
  62. HSiArray = Array("HSi_0","HSi_1","HSi_2","HSi_3","HSi_4","HSi_5","HSi_6","HSi_7","HSi_8","HSi_9","HSi_10","HSi_11","HSi_12","HSi_13","HSi_14","HSi_15","HSi_16","HSi_17","HSi_18","HSi_19","HSi_20","HSi_21","HSi_22","HSi_23","HSi_24","HSi_25","HSi_26")
  63. Dim MatchNumber, Balls, Shift
  64.  
  65. Req(26)="26 27 28 29 1e 2b 2c 2d 2e 2f " ' background music
  66. Req(28)="1f " ' intro
  67. Req(30)="c28" ' major award
  68. Req(31)="cb2" ' take a picture
  69. Req(32)="d52" ' high score
  70. Req(36)="8d58d68dd8f98fe90590690990b91091491b92392593693793994895695995e95f"
  71. Req(38)="8e08e18ec8f78f890a90c90d90f91691791891c92b93a"
  72. Req(39)="8da8dc8de8e28e48e68e78e88e98ea8ee8ef8f28f68fc90090e91292492a92c92d92f93b93c93e940"
  73. Req(40)="8fd90490391e91f920"
  74. '54 bell
  75. '55 cowbell
  76. '56 high bell
  77. Req(62)="9ee9f09f3a44afdb2fc4ec8ec92"
  78. Req(78)="aa1aa4c1bc55c9fd2c"
  79. Req(80)="d1b"
  80. Req(81)="d40"
  81. Req(82)="d2e"
  82. Req(83)="bdf"
  83. Req(84)="c14"
  84. Req(85)="bce"
  85. Req(86)="cb5"
  86. Req(87)="cf5"
  87. Req(88)="d5b"
  88. Req(90)="7f1"
  89. Req(91)="acfac7ac5acdad5ab6ab8ad1ab7ad4ab9acf9d8a43b0ec03c06cf8"
  90. Req(93)="98f9909ba9d7ad2d01"
  91. Req(97)="af2af5aff9c79c8"
  92. Req(100)="b69bb6bd0c1faac"
  93. Req(104)="d1b"
  94. Req(114)="98f990991992993994995996"
  95. Req(117)="9dd9deb09b0a9e69e79e8b87b88c71c72"
  96. Req(120)="83083783e845"
  97. Req(121)="c3fd33d34"
  98. Req(126)="cdeb3eb45"
  99. Req(127)="b5bc49c48"
  100. Req(135)="7b973473b757" 'splat
  101. Req(143)="ae69849879899f1a01a00aa5aa6b54b55b59b5acb0cff"
  102. Req(147)="966abcac2"
  103. Req(154)="7c070a72d75076576c77377a788703"
  104. Req(166)="4d04d74de22722e23523c24a2512a52ac2b32ba2c12c82d62dd2e42eb2f22f930036b3723793803873953f73fe40544444b4524594fa50150850f51651d53254054762f63663d64464b8518ac"
  105. Req(195)="86186886f876"
  106. Req(197)="9ff"
  107. Req(198)="04aa4b"
  108. Req(199)="aeaaec"
  109. Req(200)="ae7ae8"
  110. Req(62)="9ee9f09f3a44a45afdb2fc4ec8ec92"
  111.  
  112. ' Configurable Items
  113. MusicFlag= TRUE ' Set to TRUE to play background music
  114. BallsPerGame = 5 ' 3 balls turns melon lights on for every ball
  115. StandardMode = False ' True means you have to get top rollovers twice -- On-blink-off.
  116. SVol = .8 ' Speech Volume
  117. TVol = .2 ' Background Track Volume
  118. CVol = 1.0 ' Chime Volume
  119.  
  120. Set UpLight(1) = Up1
  121. Set UpLight(2) = Up2
  122.  
  123. Sub table1_init()
  124. LoadEM
  125. Score(1) = 0
  126. Score(2) = 0
  127. Up = 1
  128. lno = 0 ' lamp seq flashing while in trough
  129.  
  130. Hisc =100
  131. Initial(1) = 19: Initial(2) = 5: Initial(3) = 13
  132. LoadHighScore
  133. UpdatePostIt
  134. CreditReel.SetValue Credit
  135.  
  136. If ShowDT = True Then
  137. For each object in backdropstuff
  138. Object.visible = 1
  139. Next
  140. End If
  141.  
  142. If ShowDt = False Then
  143. For each object in backdropstuff
  144. Object.visible = 0
  145. Next
  146. End If
  147.  
  148. If B2SOn Then
  149. Controller.B2SSetCredits Credit
  150. Controller.B2SSetGameOver 35,1
  151. End If
  152.  
  153. TriggerLightsOff()
  154.  
  155. AttractMode.Interval=500
  156. AttractMode.Enabled = True
  157. attractmodeflag=0
  158. AttractModeSounds.Interval=7000
  159. AttractModeSounds.Enabled = True
  160.  
  161. If Credit > 0 Then DOF 121,1
  162. End Sub
  163.  
  164. Sub Table1_KeyDown(ByVal keycode)
  165.  
  166. If EnableInitialEntry = True Then EnterIntitals(keycode)
  167.  
  168. If keycode = PlungerKey Then
  169. Plunger.PullBack:PlaySoundAt "fx_plungerpull",Plunger
  170. End If
  171.  
  172. If keycode = LeftFlipperKey Then
  173. If GameOn = TRUE then
  174. If Tilted = FALSE then
  175. LeftFlipper.RotateToEnd
  176. flipperLtimer.interval=10
  177. flipperLtimer.Enabled = TRUE
  178. PlaySound SoundFX("FlipUpL", DOFFlippers), 0, .3, Pan(LeftFlipper), 0, 2000, 0, 1, AudioFade(LeftFlipper)
  179. DOF 101, 1
  180. End If
  181. End If
  182. End If
  183.  
  184. If keycode = RightFlipperKey Then
  185. If GameOn = TRUE then
  186. If Tilted = FALSE then
  187. RightFlipper.RotateToEnd
  188. flipperLtimer.interval=10
  189. flipperRtimer.Enabled = TRUE
  190. PlaySound SoundFX("FlipUpR", DOFFlippers), 0,.3, Pan(RightFlipper), 0, -2000, 0, 1, AudioFade(RightFlipper)
  191. DOF 102, 1
  192. ' PlayAllReq(117)
  193. End If
  194. End If
  195. End If
  196.  
  197. If keycode = LeftTiltKey Then
  198. Nudge 90, 2
  199. TiltCheck
  200. End If
  201.  
  202. If keycode = RightTiltKey Then
  203. Nudge 270, 2
  204. TiltCheck
  205. End If
  206.  
  207. If keycode = CenterTiltKey Then
  208. Nudge 0, 2
  209. TiltCheck
  210. End If
  211.  
  212. if keycode = 6 then ' Add coin
  213. if Credit < 9 then
  214. Credit = Credit + 1
  215. DOF 121, 1
  216. PlaysoundAt "coin3",Drain
  217. end if
  218. CreditReel.SetValue Credit
  219. If B2SOn Then
  220. Controller.B2SSetCredits Credit
  221. End If
  222. savehs
  223. end if
  224.  
  225. if keycode = 30 then TestHs
  226.  
  227. ' if keycode = 205 then target1c_hit ' test functions right arrow
  228. ' if keycode = 156 then target2c_hit ' test functions left arrow
  229. ' if keycode = 208 then LeftInLaneTrigger_hit ' test functions down arrow
  230. ' if keycode = 200 then RightInLaneTrigger_hit ' test functions up arrow
  231. ' if keycode = 204 then trigger5_hit' test functions enter keypad
  232.  
  233. if keycode = 2 then
  234. If EnableInitialEntry = False Then
  235. ' Do not add players if Credit = 0
  236. if Credit > 0 then
  237. AttractMode.Enabled = FALSE
  238. AttractModeSounds.Enabled=FALSE
  239. StopSound MusicFile
  240. MyLightSeq.StopPlay()
  241. ' Do Reset Sequence if Players = 0
  242. If GameOn = FALSE and Players = 0 then
  243. StartGame
  244. Exit Sub
  245. End If
  246. ' Add Player if Game not started yet
  247. If Players < 1 and Score(1) = 0 then
  248. Players = Players + 1
  249. Credit = Credit - 1
  250. If Credit < 1 Then DOF 121, 0
  251. CreditReel.SetValue Credit
  252. If B2SOn Then
  253. Controller.B2SSetCredits Credit
  254. End If
  255. savehs
  256. End If
  257. End If
  258. end if
  259. End If
  260. End Sub
  261.  
  262. 'Sub flipperLtimer_timer()
  263. ' PlaySound "buzz", 0, .05, -0.2, 0.05,0,0,0,.7
  264. 'End sub
  265. '
  266. 'Sub flipperRtimer_timer()
  267. ' PlaySound "buzz1", 0, .15, 0.2, 0.05,0,0,0,.7
  268. 'End sub
  269.  
  270. Sub BallInLane_timer()
  271. PlayReq(78)
  272. BallInLane.Interval=10000+INT(5000*RND)
  273. End Sub
  274.  
  275. Sub Table1_KeyUp(ByVal keycode)
  276.  
  277. If keycode = PlungerKey Then
  278. Plunger.Fire
  279. PlaySoundAt "Plunger",Plunger
  280. End If
  281.  
  282. If keycode = LeftFlipperKey Then
  283. If GameOn = TRUE then
  284. LeftFlipper.RotateToStart
  285. PlaySoundAtVol SoundFX("FlipDownL", DOFFlippers),LeftFlipper,.3
  286. StopSound "FlipUpL"
  287. DOF 101, 0
  288. flipperLtimer.Enabled = FALSE
  289. End If
  290. End If
  291.  
  292. If keycode = RightFlipperKey Then
  293. If GameOn = TRUE then
  294. RightFlipper.RotateToStart
  295. PlaySoundAtVol SoundFX("FlipDownR", DOFFlippers),RightFlipper,.3
  296. StopSound "FlipUpR"
  297. DOF 102, 0
  298. flipperRtimer.Enabled = FALSE
  299. End If
  300. End If
  301. End Sub
  302.  
  303. Sub TriggerLightsOff
  304. For each i in BumperLights: i.State = LightStateOff: Next
  305. For each i in TableLights: i.State = LightStateOff: Next
  306. End Sub
  307.  
  308. 'GI Lights'
  309. Sub GI_On
  310. For each i in GI: i.State = LightStateOn: Next
  311. End Sub
  312.  
  313. Sub GI_Off
  314. For each i in GI: i.State = LightStateOff: Next
  315. End Sub
  316.  
  317. Sub Bumper1_On
  318. b1=1:b1l1.state = LightStateOn
  319. b1l2.state = LightStateOn
  320. b1l3.state = LightStateOn
  321. End Sub
  322. Sub Bumper1_Off
  323. b1=0:b1l1.state = LightStateOff
  324. b1l2.state = LightStateOff
  325. b1l3.state = LightStateOff
  326. End Sub
  327. Sub Bumper2_On
  328. b2=1:b2l1.state = LightStateOn
  329. b2l2.state = LightStateOn
  330. b2l3.state = LightStateOn
  331. End Sub
  332. Sub Bumper2_Off
  333. b2=0:b2l1.state = LightStateOff
  334. b2l2.state = LightStateOff
  335. b2l3.state = LightStateOff
  336. End Sub
  337. Sub Bumper3_On
  338. b3=1:b3l1.state = LightStateOn
  339. b3l2.state = LightStateOn
  340. b3l3.state = LightStateOn
  341. End Sub
  342. Sub Bumper3_Off
  343. b3=0:b3l1.state = LightStateOff
  344. b3l2.state = LightStateOff
  345. b3l3.state = LightStateOff
  346. End Sub
  347. Sub Bumper4_On
  348. b4=1:b4l1.state = LightStateOn
  349. b4l2.state = LightStateOn
  350. b4l3.state = LightStateOn
  351. End Sub
  352. Sub Bumper4_Off
  353. b4=0:b4l1.state = LightStateOff
  354. b4l2.state = LightStateOff
  355. b4l3.state = LightStateOff
  356. End Sub
  357. Sub Bumper5_On
  358. b5=1:b5l1.state = LightStateOn
  359. b5l2.state = LightStateOn
  360. b5l3.state = LightStateOn
  361. End Sub
  362. Sub Bumper5_Off
  363. b5=0:b5l1.state = LightStateOff
  364. b5l2.state = LightStateOff
  365. b5l3.state = LightStateOff
  366. End Sub
  367.  
  368. ' Tilt Routine
  369. Sub TiltCheck
  370. If Tilted = FALSE then
  371. If Tilts = 0 then
  372. Tilts = Tilts + int(rnd*100)
  373. TiltTimer.Enabled = TRUE
  374. Else
  375. Tilts = Tilts + int(rnd*100)
  376. End If
  377. If Tilts >= 225 and Tilted = FALSE then
  378. LeftFlipper.RotateToStart
  379. RightFlipper.RotateToStart
  380. Bumper1.Force=0
  381. Bumper2.Force=0
  382. Bumper3.Force=0
  383. Bumper4.Force=0
  384. Bumper5.Force=0
  385.  
  386. SkillShotOff()
  387. If LampSplash.enabled=True then ' if you tilt while in plunger lane
  388. l1.state=s1:l2.state=s2:l3.state=s3:l4.state=s4
  389. LampSplash.enabled = False 'Turn off the 4 light attract mode
  390. BallInLane.Enabled=False
  391. End If
  392. Tilted = TRUE
  393. TiltTimer.Enabled = FALSE
  394. TiltBox.Text = "TILT"
  395. TiltBoxa.Text = "TILT"
  396. PlayReq(100)
  397. If B2SOn Then
  398. Controller.B2SSetTilt 33,1
  399. Controller.B2SSetdata 1,0
  400. End If
  401. Else
  402. if Tilts > 80 then 'flash gi
  403. TiltGI.interval=1000
  404. TiltGI.enabled=TRUE
  405. PlayReq(97)
  406. GI_Off()
  407. End if
  408. End If
  409. End If
  410. End Sub
  411.  
  412. Sub TiltGI_timer()
  413. TiltGI.enabled=FALSE
  414. GI_On()
  415. End Sub
  416.  
  417. Sub TiltTimer_Timer()
  418. If Tilts > 0 then
  419. Tilts = Tilts - 1
  420. Else
  421. TiltTimer.Enabled = FALSE
  422. End If
  423. End Sub
  424.  
  425. ' Game Control
  426. Sub StartGame
  427. PlayReq(62) ' Start of Game
  428. Players = 1
  429. Up = 1
  430. UpLight(1).State = LightStateOn
  431. Credit = Credit - 1
  432. If Credit < 1 Then DOF 121, 0
  433. CreditReel.SetValue Credit
  434. If B2SOn Then
  435. Controller.B2SSetCredits Credit
  436. End If
  437. savehs
  438.  
  439. Bumper1.Force=5 ' reset Bumpers after a tilt
  440. Bumper2.Force=5
  441. Bumper3.Force=5
  442. Bumper4.Force=5
  443. Bumper5.Force=0
  444.  
  445. LFlag=0:RFlag=0
  446.  
  447. GI_On
  448. Tilted = FALSE
  449. Tilts = 0
  450. 'TiltBox.Text = ""
  451. 'TiltBoxa.Text = ""
  452. If B2SOn Then
  453. Controller.B2SSetTilt 33,0
  454. Controller.B2SSetdata 1,1
  455. End If
  456. GameOn = TRUE
  457. BallReel.SetValue 1
  458. If B2SOn Then
  459. Controller.B2SSetBallInPlay 32, Ball
  460. End If
  461. For x = 1 to 2
  462. Score(x) = 0
  463. Credit1(x) = FALSE
  464. Credit2(x) = FALSE
  465. If B2SOn Then
  466. Controller.B2SSetGameOver 35,0
  467. End If
  468. NEXT
  469. EMReel1.ResettoZero
  470. 'EMReel2.ResettoZero
  471. PlaySound "initialize"
  472. ResetTimer.Enabled = TRUE
  473. If B2SOn Then
  474. Controller.B2SSetScore 1,score(1)
  475. End If
  476. End Sub
  477.  
  478. Sub ResetTimer_Timer()
  479. ResetTimer.Enabled = FALSE
  480. Ball = 1
  481. Bumper1_Off:Bumper2_Off:Bumper3_Off:Bumper4_Off:Bumper5_On
  482.  
  483. ' turn on Melon lights
  484. L5.State = LightStateOn 'Yellow Light
  485.  
  486. L11.State=LightStateOn:L12.State=LightStateOn:L13.State=LightStateOn:L14.State=LightStateOn 'Upper Lane Lights
  487. If B2SOn Then
  488. Controller.B2SSetBallInPlay 32, Ball
  489. End If
  490.  
  491. PlayReq(36) ' SOB
  492. BallReleaseTimer.Enabled = TRUE
  493. End Sub
  494.  
  495. Sub BallReleaseTimer_Timer()
  496. BallReleaseTimer.Enabled = FALSE
  497.  
  498. MusicFile=PlayTrack(26) ' Background Music
  499. BallRelease.createball
  500. PlaySoundAt SoundFX("ballrelease", DOFContactors),Ballrelease
  501. DOF 119, 2
  502. BallRelease.kick 135,4,0
  503. End Sub
  504.  
  505. Sub Drain_Hit()
  506. Drain.DestroyBall
  507. DOF 133, 2
  508. TriggerLightsOff()
  509. MyLightSeq.StopPlay() ' reset if Tilted lights
  510. Tilts = 0
  511. PlayerDelayTimer.Enabled = TRUE
  512. PlaySoundAt "drain", Drain
  513. End Sub
  514.  
  515. Sub PlayerDelayTimer_Timer()
  516. Tilted = FALSE
  517. PlayerDelayTimer.Enabled = FALSE
  518.  
  519. BonusLights = False
  520. BumperTimersOff()
  521. Bumper5_On()
  522. Bumper1.Force=8 ' reset Bumpers after a tilt
  523. Bumper2.Force=8
  524. Bumper3.Force=8
  525. Bumper4.Force=8
  526. Bumper5.Force=5
  527. StopSound MusicFile
  528.  
  529. Tilts = 0
  530. If B2SOn Then
  531. Controller.B2SSetTilt 33,0
  532. Controller.B2SSetdata 1,1
  533. End If
  534.  
  535. UpLight(Up).State = LightStateOff
  536. Up = Up + 1
  537. IF Up> Players then
  538. Ball = Ball + 1
  539. If B2SOn Then
  540. Controller.B2SSetBallInPlay 32, Ball
  541. End If
  542. Up = 1
  543. End If
  544. If Ball > BallsPerGame then
  545. GameOn = FALSE
  546. EndOfGame()
  547. Else
  548. UpLight(Up).State = LightStateOn
  549. BallReel.SetValue Ball
  550. Bumper1_Off:Bumper2_Off:Bumper3_Off:Bumper4_Off:Bumper5_On
  551. L11.State=LightStateOn:L12.State=LightStateOn:L13.State=LightStateOn:L14.State=LightStateOn 'Upper Lane Lights
  552. LFlag=0:RFlag=0 ' speech you hear on the inlanes
  553. ' turn on Melon lights
  554. L5.State = LightStateOn 'Yellow Light
  555. if ball=2 then PlayReq(38) ' SOB
  556. if ball=3 or ball=4 then PlayReq(39)
  557. if ball=5 then PlayReq(40)
  558. BallReleaseTimer.Enabled = TRUE
  559. If B2SOn Then
  560. Controller.B2SSetBallInPlay 32, Ball
  561. End If
  562. End If
  563. End Sub
  564.  
  565. Sub EndofGame()
  566. LeftFlipper.RotateToStart
  567. RightFlipper.RotateToStart
  568. PlayReq(90) ' boing
  569. If B2SOn Then
  570. Controller.B2SSetBallInPlay 32, 0
  571. End If
  572. RoundHS = Score(1)
  573. If RoundHS > HiSc Then
  574. HiSc = RoundHS
  575. HSi = 1
  576. HSx = 1
  577. y = 1
  578. Initial(1) = 1
  579. For x = 2 to 3
  580. Initial(x) = 0
  581. Next
  582. UpdatePostIt
  583. InitialTimer1.enabled = 1
  584. EnableInitialEntry = True
  585. End If
  586. UpdatePostIt
  587. SaveHS
  588. Players = 0
  589. Bumper1_Off:Bumper2_Off:Bumper3_Off:Bumper4_Off:Bumper5_Off
  590. GI_Off
  591. If B2SOn Then
  592. Controller.B2SSetGameOver 35,1
  593. End If
  594. EndOfGameTimer.Interval=4000
  595. EndOfGameTimer.Enabled=True
  596. End Sub
  597.  
  598. Sub EndOfGameTimer_Timer()
  599. EndOfGameTimer.Enabled=False
  600. PlayReq(91) ' End of Game Talk
  601. AttractMode.Interval=2500
  602. AttractMode.Enabled = True
  603. attractmodeflag=0
  604. AttractModeSounds.Interval= 15000
  605. AttractModeSounds.Enabled = True
  606. End Sub
  607.  
  608. 'flipper primitives'
  609.  
  610. Sub UpdateFlipperLogos
  611. leftflipprim.RotAndTra8 = LeftFlipper.CurrentAngle + 235
  612. rightflipprim.RotAndTra8 = RightFlipper.CurrentAngle + 126
  613. FlipperLSh.RotZ = LeftFlipper.currentangle
  614. FlipperRSh.RotZ = RightFlipper.currentangle
  615. End Sub
  616.  
  617. Sub FlippersTimer_Timer()
  618. UpdateFlipperLogos
  619. End Sub
  620.  
  621. ' Game Logic
  622. Sub TestHS
  623. HSi = 1
  624. HSx = 1
  625. y = 1
  626. Initial(1) = 1
  627. For x = 2 to 3
  628. Initial(x) = 0
  629. Next
  630. UpdatePostIt
  631. InitialTimer1.enabled = 1
  632. EnableInitialEntry = True
  633. End Sub
  634. ' Playfield Star Rollovers
  635.  
  636. Sub Trigger1_Hit()
  637. PlaysoundAt "trigger",Trigger1
  638. DOF 127, 2
  639. If L1.State = LightStateOn and L3.State = LightStateOn then
  640. AddScore (10)
  641. End if
  642. If L1.State = LightStateOn and L3.State = LightStateOn and L2.State = LightStateOn and L4.State = LightStateOn then
  643. AddScore (100)
  644. End if
  645. If L1.State = LightStateOn and L3.State <> LightStateOn then
  646. AddScore(10)
  647. End if
  648. If L1.State = LightStateOff then
  649. L1.State=LightStateOn 'Quick Flash
  650. L1.uservalue=0
  651. L1.timerinterval=50
  652. Me.TimerEnabled = TRUE
  653. AddScore(1)
  654. Else
  655. L1.State=LightStateOff 'Quick Flash
  656. L1.uservalue=1
  657. Me.timerinterval=50
  658. Me.TimerEnabled = TRUE
  659. End if
  660. End Sub
  661.  
  662. Sub Trigger1_Timer()
  663. Me.TimerEnabled = False
  664. if L1.uservalue=0 then
  665. L1.State=LightStateOff
  666. else
  667. if L1.uservalue=1 then
  668. L1.State=LightStateOn
  669. else
  670. L1.State=LightStateBlinking
  671. end if
  672. end if
  673. End Sub
  674.  
  675. Sub Trigger2_Timer()
  676. Me.TimerEnabled = False
  677. if L2.uservalue=0 then
  678. L2.State=LightStateOff
  679. else
  680. if L2.uservalue=1 then
  681. L2.State=LightStateOn
  682. else
  683. L2.State=LightStateBlinking
  684. end if
  685. end if
  686. End Sub
  687.  
  688. Sub Trigger3_Timer()
  689. Me.TimerEnabled = False
  690. if L3.uservalue=0 then
  691. L3.State=LightStateOff
  692. else
  693. if L3.uservalue=1 then
  694. L3.State=LightStateOn
  695. else
  696. L3.State=LightStateBlinking
  697. end if
  698. end if
  699. End Sub
  700.  
  701. Sub Trigger4_Timer()
  702. Me.TimerEnabled = False
  703. if L4.uservalue=0 then
  704. L4.State=LightStateOff
  705. else
  706. if L4.uservalue=1 then
  707. L4.State=LightStateOn
  708. else
  709. L4.State=LightStateBlinking
  710. end if
  711. end if
  712. End Sub
  713.  
  714. Sub Trigger6_Timer()
  715. Me.TimerEnabled = False
  716. if L9.uservalue=0 then
  717. L9.State=LightStateOff
  718. else
  719. if L9.uservalue=1 then
  720. L9.State=LightStateOn
  721. else
  722. L9.State=LightStateBlinking
  723. end if
  724. end if
  725. End Sub
  726.  
  727. Sub Trigger14_Timer()
  728. Me.TimerEnabled = False
  729. if L15.uservalue=0 then
  730. L15.State=LightStateOff
  731. else
  732. if L15.uservalue=1 then
  733. L15.State=LightStateOn
  734. else
  735. L15.State=LightStateBlinking
  736. end if
  737. end if
  738. End Sub
  739.  
  740. Sub Trigger2_Hit()
  741. PlaysoundAt "trigger",Trigger2
  742. DOF 128, 2
  743. If L2.State = LightStateOn and L4.State = LightStateOn then
  744. AddScore (10)
  745. End if
  746. If L2.State = LightStateOn and L4.State = LightStateOn and L1.State = LightStateOn and L3.State = LightStateOn then
  747. AddScore (100)
  748. End if
  749. If L2.State = LightStateOn and L4.State <> LightStateOn then
  750. AddScore(10)
  751. End if
  752. If L2.State = LightStateOff then
  753. L2.State=LightStateOn 'Quick Flash
  754. L2.uservalue=0
  755. Me.timerinterval=50
  756. Me.TimerEnabled = TRUE
  757. AddScore(1)
  758. Else
  759. L2.State=LightStateOff 'Quick Flash
  760. L2.uservalue=1
  761. Me.timerinterval=50
  762. Me.TimerEnabled = TRUE
  763. End if
  764. End Sub
  765.  
  766. Sub Trigger3_Hit()
  767. PlaysoundAt "trigger",Trigger3
  768. DOF 129, 2
  769. If L3.State = LightStateOn and L1.State = LightStateOn then
  770. AddScore (10)
  771. End if
  772. If L1.State = LightStateOn and L3.State = LightStateOn and L2.State = LightStateOn and L4.State = LightStateOn then
  773. AddScore (100)
  774. End if
  775. If L4.State = LightStateOn and L1.State <> LightStateOn then
  776. AddScore(10)
  777. End if
  778. If L3.State = LightStateOff then
  779. L3.State=LightStateOn 'Quick Flash
  780. L3.uservalue=0
  781. Me.timerinterval=50
  782. Me.TimerEnabled = TRUE
  783. AddScore(1)
  784. Else
  785. L3.State=LightStateOff 'Quick Flash
  786. L3.uservalue=1
  787. Me.timerinterval=50
  788. Me.TimerEnabled = TRUE
  789. End if
  790. End Sub
  791.  
  792. Sub Trigger4_Hit()
  793. PlaysoundAt "trigger",Trigger4
  794. DOF 130, 2
  795. If L4.State = LightStateOn and L2.State = LightStateOn then
  796. AddScore (10)
  797. End if
  798. If L1.State = LightStateOn and L2.State = LightStateOn and L3.State = LightStateOn and L4.State = LightStateOn then
  799. AddScore (100)
  800. End if
  801. If L4.State = LightStateOn and L2.State <> LightStateOn then
  802. AddScore(10)
  803. End if
  804. If L4.State = LightStateOff then
  805. L4.State=LightStateOn 'Quick Flash
  806. L4.uservalue=0
  807. Me.timerinterval=50
  808. Me.TimerEnabled = TRUE
  809. AddScore(1)
  810. Else
  811. L4.State=LightStateOff 'Quick Flash
  812. L4.uservalue=1
  813. Me.timerinterval=50
  814. Me.TimerEnabled = TRUE
  815. End if
  816. End Sub
  817.  
  818. Sub Trigger5_Hit()
  819. PlaysoundAt "trigger",Trigger5
  820. PlayReq(154) ' splat
  821. DOF 126, 2
  822. If L8.State = LightStateOn then
  823. L8.State=LightStateOff 'Quick Flash
  824. L8.uservalue=1
  825. Trigger5.timerinterval=50
  826. Trigger5.TimerEnabled = TRUE
  827. AddScore(10)
  828. End if
  829. If L8.State = LightStateOff then
  830. L8.State=LightStateOn 'Quick Flash
  831. L8.uservalue=0
  832. Trigger5.timerinterval=50
  833. Trigger5.TimerEnabled = TRUE
  834. AddScore(1)
  835. End if
  836. End Sub
  837.  
  838. Sub Trigger5_Timer()
  839. Trigger5.TimerEnabled = False
  840. if L8.uservalue=0 then
  841. L8.State=LightStateOff
  842. else
  843. if L8.uservalue=1 then
  844. L8.State=LightStateOn
  845. else
  846. L8.State=LightStateBlinking
  847. end if
  848. end if
  849. End Sub
  850.  
  851. Sub Trigger6_Hit()
  852. If L9.State = LightStateOff then
  853. AddScore(1)
  854. End If
  855. If L9.State = LightStateOn then
  856. L9.State=LightStateOff 'Quick Flash
  857. L9.uservalue=1
  858. Me.timerinterval=50
  859. Me.TimerEnabled = TRUE
  860. AddScore(10)
  861. End if
  862. PlayReq(135)
  863. End Sub
  864.  
  865. Sub Trigger7_Hit()
  866. PlaysoundAt "trigger",Trigger7
  867. PlayReq(154) ' splat
  868. DOF 131, 2
  869. If L10.State = LightStateOff then
  870. L10.State=LightStateOn 'Quick Flash
  871. L10.uservalue=0
  872. L10.timerinterval=50
  873. Me.TimerEnabled = TRUE
  874. AddScore(1)
  875. Exit Sub
  876. End if
  877.  
  878. If L10.State = LightStateOn then
  879. L10.State=LightStateOff 'Quick Flash
  880. L10.uservalue=1
  881. Me.timerinterval=50
  882. Me.TimerEnabled = TRUE
  883. AddScore(10)
  884. End if
  885. End Sub
  886.  
  887. Sub Trigger7_Timer()
  888. Me.TimerEnabled = False
  889. if L10.uservalue=0 then
  890. L10.State=LightStateOff
  891. else
  892. if L10.uservalue=1 then
  893. L10.State=LightStateOn
  894. else
  895. L10.State=LightStateBlinking
  896. end if
  897. end if
  898. End Sub
  899.  
  900. Sub Trigger8_Hit() ' Center Exit lane
  901. If Tilted = FALSE then
  902. PlaySoundAt "rollover", Trigger8
  903. AddScore(10)
  904. End if
  905. End Sub
  906.  
  907. dim b1,b2,b3,b4,b5
  908.  
  909. Sub Bumper1_Hit()
  910. PlaySoundAtVol SoundFX("fx_bumper1", DOFContactors),Bumper1,4
  911. DOF 105, 2
  912. if b1=0 then
  913. AddScore 1
  914. Bumper1_On:b1=0 ' flash
  915. else
  916. AddScore 10
  917. Bumper1_Off:b1=1 ' flash
  918. end if
  919. Me.TimerInterval=200:Me.TimerEnabled=1
  920. End Sub
  921.  
  922. Sub Bumper2_Hit()
  923. PlaySoundAtVol SoundFX("fx_bumper2", DOFContactors),Bumper2,4
  924. DOF 107, 2
  925. if b2=0 then
  926. AddScore 1
  927. Bumper2_On:b2=0 ' flash
  928. else
  929. AddScore 10
  930. Bumper2_Off:b2=1 ' flash
  931. end if
  932. Me.TimerInterval=200:Me.TimerEnabled=1
  933. End Sub
  934.  
  935. Sub Bumper3_Hit()
  936. PlaySoundAtVol SoundFX("fx_bumper3", DOFContactors),Bumper3,4
  937. DOF 106, 2
  938. if b3=0 then
  939. AddScore 1
  940. Bumper3_On:b3=0 ' flash
  941. else
  942. AddScore 10
  943. Bumper3_Off:b3=1 ' flash
  944. end if
  945. Me.TimerInterval=200:Me.TimerEnabled=1
  946. End Sub
  947. Sub Bumper4_Hit()
  948. PlaySoundAtVol SoundFX("fx_bumper4", DOFContactors),Bumper4,4
  949. DOF 108, 2
  950. if b4=0 then
  951. AddScore 1
  952. Bumper4_On:b4=0 ' flash
  953. else
  954. AddScore 10
  955. Bumper4_Off:b4=1 ' flash
  956. end if
  957. Me.TimerInterval=200:Me.TimerEnabled=1
  958. End Sub
  959.  
  960. Sub Bumper5_Hit()
  961. PlaySoundAtVol SoundFX("fx_bumper1", DOFContactors),Bumper5,4
  962. DOF 109, 2
  963. PlayReq(166)
  964. if b5=0 then
  965. AddScore 1
  966. Bumper5_On:b5=0 ' flash
  967. else
  968. AddScore 5
  969. Bumper5_Off:b5=1 ' flash
  970. end if
  971. Me.TimerInterval=200:Me.TimerEnabled=1
  972.  
  973. RotateBonusLight()
  974. End Sub
  975.  
  976. Sub Bumper1_Timer()
  977. Me.TimerEnabled=FALSE
  978. if b1=0 then ' restore light
  979. Bumper1_Off
  980. else
  981. Bumper1_On
  982. end if
  983. End Sub
  984. Sub Bumper2_Timer()
  985. Me.TimerEnabled=FALSE
  986. if b2=0 then
  987. Bumper2_Off
  988. else
  989. Bumper2_On
  990. end if
  991. End Sub
  992. Sub Bumper3_Timer()
  993. Me.TimerEnabled=FALSE
  994. if b3=0 then
  995. Bumper3_Off
  996. else
  997. Bumper3_On
  998. end if
  999. End Sub
  1000. Sub Bumper4_Timer()
  1001. Me.TimerEnabled=FALSE
  1002. if b4=0 then
  1003. Bumper4_Off
  1004. else
  1005. Bumper4_On
  1006. end if
  1007. End Sub
  1008. Sub Bumper5_Timer()
  1009. Me.TimerEnabled=FALSE
  1010. if b5=0 then
  1011. Bumper5_Off
  1012. else
  1013. Bumper5_On
  1014. end if
  1015. End Sub
  1016.  
  1017. Sub t1_hit()
  1018. t1p.transx = -10
  1019. Me.TimerEnabled = 1
  1020. addscore 50
  1021. End sub
  1022. Sub t1_Timer
  1023. t1p.transx = 0
  1024. Me.TimerEnabled = 0
  1025. End Sub
  1026.  
  1027. 'Girls
  1028.  
  1029. Sub target1L_hit()
  1030. target1_hit(5)
  1031. End Sub
  1032. Sub targer1R_hit()
  1033. target1_hit(5)
  1034. End Sub
  1035. Sub target1C_hit()
  1036. target1_hit(50)
  1037. End Sub
  1038.  
  1039. Sub target1_hit(pts)
  1040. target1p.transx = -10
  1041. target1.TimerEnabled = 1
  1042. PlaysoundAt SoundFX("trigger", DOFTargets),Light12
  1043. DOF 124, 2
  1044. ' add some points
  1045. If L6.State = LightStateOff then
  1046. AddScore(pts)
  1047. if pts = 50 then
  1048. L6.State=LightStateBlinking:L6.uservalue=0
  1049. L6.timerinterval=1000:L6.TimerEnabled=True
  1050. PlayReq(143)
  1051. end if
  1052. end if
  1053. If L6.State = LightStateOn then
  1054. AddScore(200)
  1055. L6.State=LightStateBlinking:L6.uservalue=0 ' Turn Off
  1056. L6.timerinterval=1000:L6.TimerEnabled=True
  1057. PlayReq(117)
  1058. L5.State=LightStateOn ' Next Light
  1059. End if
  1060. End sub
  1061.  
  1062. Sub L6_timer()
  1063. L6.TimerEnabled=False
  1064. if L6.uservalue = 0 then L6.State=LightStateOff
  1065. if L6.uservalue = 1 then L6.State=LightStateOn
  1066. End Sub
  1067.  
  1068. Sub target1_Timer
  1069. target1p.transx = 0
  1070. Me.TimerEnabled = 0
  1071. End Sub
  1072.  
  1073. 'Ellen
  1074. Sub target2L_hit()
  1075. target2_hit(5)
  1076. End Sub
  1077. Sub targer2R_hit()
  1078. target2_hit(5)
  1079. End Sub
  1080. Sub target2C_hit()
  1081. target2_hit(50)
  1082. End Sub
  1083.  
  1084. Sub target2_hit(pts)
  1085. target2p.transx = -10
  1086. target2.TimerEnabled = 1
  1087. PlaysoundAt SoundFX("trigger", DOFTargets),Light11
  1088. DOF 125, 2
  1089. ' add some points
  1090. If L5.State = LightStateOff then
  1091. AddScore(pts)
  1092. if pts = 50 then
  1093. L5.State=LightStateBlinking:L5.uservalue=0
  1094. L5.timerinterval=500:L5.TimerEnabled=True
  1095. PlayReq(143)
  1096. end if
  1097. end if
  1098. If L5.State = LightStateOn then
  1099. AddScore(200)
  1100. L5.State=LightStateBlinking:L5.uservalue=0
  1101. L5.timerinterval=500:L5.TimerEnabled=True
  1102. PlayReq(117)
  1103. L7.State=LightStateOn
  1104. End if
  1105. End sub
  1106.  
  1107. Sub target2_Timer
  1108. target2p.transx = 0
  1109. Me.TimerEnabled = 0
  1110. End Sub
  1111.  
  1112. Sub L5_timer()
  1113. L5.TimerEnabled=False
  1114. if L5.uservalue = 0 then L5.State=LightStateOff
  1115. if L5.uservalue = 1 then L5.State=LightStateOn
  1116. End Sub
  1117.  
  1118. 'Meloney
  1119. Sub Kicker1_Hit()
  1120. PlaysoundAt "kicker_enter", Kicker1
  1121. If L7.State = LightStateoff then 'light below cup
  1122. L7.State=LightStateBlinking:L7.uservalue=0
  1123. L7.timerinterval=500:L7.TimerEnabled=True
  1124. AddScore(50)
  1125. End if
  1126. If L7.State = LightStateOn then
  1127. L7.State=LightStateBlinking:L7.uservalue=0
  1128. L7.timerinterval=500:L7.TimerEnabled=True
  1129. AddScore(200)
  1130. L6.State = LightStateOn ' Turn Next Light On
  1131. End if
  1132. pauseloop=0
  1133. PauseTimer.Interval=250
  1134. PauseTimer.Enabled=TRUE
  1135. End Sub
  1136.  
  1137. Sub PauseTimer_Timer()
  1138. pauseloop=pauseloop+1
  1139. if pauseloop=10 then
  1140. PlayReq(195)
  1141. end if
  1142. if pauseloop=1 and (b1+b2+b3+b4)=4 then PlayReq(127)
  1143. if pauseloop=1 and (b1+b2+b3+b4)=3 then PlayReq(126)
  1144.  
  1145. if pauseloop=2 then
  1146. if b1=1 then ' flash lit bumper and award points
  1147. Bumper1_Off:b1=1 ' flash - need to restore the value of b1 here
  1148. Bumper1.PlayHit():DOF 105, 2:PlaySoundAt SoundFX("fx_bumper1", DOFContactors),Bumper1
  1149. Bumper1.TimerInterval=500:Bumper1.TimerEnabled=1
  1150. AddScore(10)
  1151. else
  1152. pauseloop=pauseloop+1 ' skip forward
  1153. end if
  1154. end if
  1155. if pauseloop=4 then
  1156. if b2=1 then
  1157. Bumper2_Off:b2=1 ' flash
  1158. Bumper2.PlayHit():DOF 107, 2:PlaySoundAt SoundFX("fx_bumper2", DOFContactors),Bumper2
  1159. Bumper2.TimerInterval=500:Bumper2.TimerEnabled=1
  1160. AddScore(10)
  1161. else
  1162. pauseloop=pauseloop+1
  1163. end if
  1164. end if
  1165. if pauseloop=6 then
  1166. if b3=1 then
  1167. Bumper3_Off:b3=1 ' flash
  1168. Bumper3.PlayHit():DOF 106, 2:PlaySoundAt SoundFX("fx_bumper3", DOFContactors),Bumper3
  1169. Bumper3.TimerInterval=500:Bumper3.TimerEnabled=1
  1170. AddScore(10)
  1171. else
  1172. pauseloop=pauseloop+1
  1173. end if
  1174. end if
  1175. if pauseloop=8 then
  1176. if b4=1 then
  1177. Bumper4_Off:b4=1 ' flash
  1178. Bumper4.PlayHit():DOF 108, 2:PlaySoundAt SoundFX("fx_bumper4", DOFContactors),Bumper4
  1179. Bumper4.TimerInterval=500:Bumper4.TimerEnabled=1
  1180. AddScore(10)
  1181. else
  1182. pauseloop=pauseloop+1
  1183. end if
  1184. end if
  1185. if pauseloop > 12 then
  1186. PauseTimer.Enabled=FALSE
  1187. Kicker1.TimerInterval = 500
  1188. Kicker1.TimerEnabled = TRUE
  1189. End if
  1190. End Sub
  1191.  
  1192. Sub Kicker1_Timer()
  1193. PlaySoundAt "kicker_release", Kicker1
  1194. kicker1.TimerEnabled = FALSE
  1195. Kicker1.kick 260,15, .1
  1196. DOF 123, 2
  1197. End Sub
  1198.  
  1199. Sub L7_timer()
  1200. L7.TimerEnabled=False
  1201. if L7.uservalue = 0 then L7.State=LightStateOff
  1202. if L7.uservalue = 1 then L7.State=LightStateOn
  1203. End Sub
  1204.  
  1205. Sub RotateBonusLight
  1206. if L5.state = LightStateOn then
  1207. ' Move to L7
  1208. L5.state = LightStateOff
  1209. L7.state=LightStateOn
  1210. else
  1211. if L7.state = LightStateOn then
  1212. ' move to L6
  1213. L7.state = LightStateOff
  1214. L6.state=LightStateOn
  1215. else
  1216. if L6.state = LightStateOn then
  1217. ' move to L5
  1218. L6.state = LightStateOff
  1219. L5.state=LightStateOn
  1220. end if
  1221. end if
  1222. end if
  1223. End Sub
  1224.  
  1225. Sub LeftInLaneTrigger_Hit()
  1226. If Tilted = FALSE then
  1227. PlaySoundAt "rollover", LeftInLaneTrigger
  1228. AddScore(5)
  1229. DOF 116, 2
  1230. ' add some points
  1231. LFlag=LFlag+1
  1232. if LFlag>10 then LFlag=1
  1233.  
  1234. if LFlag = 1 then
  1235. if RFlag=0 or RFlag=3 then
  1236. RFlag=1 ' skip over the intro speech
  1237. end if
  1238. PlayReq(197)
  1239. end if
  1240. if LFlag = 2 then PlayReq(198)
  1241. if LFlag = 3 then PlayReq(199)
  1242. if LFlag > 3 then PlayReq(117)
  1243.  
  1244. RotateBonusLight()
  1245. End if
  1246. End Sub
  1247.  
  1248. Sub RightInLaneTrigger_Hit()
  1249. If Tilted = FALSE then
  1250. PlaySoundAt "rollover", RightInLaneTrigger
  1251. AddScore(5)
  1252. DOF 117, 2
  1253. ' add some points
  1254. RFlag=RFlag+1
  1255. if RFlag>10 then RFlag=1
  1256.  
  1257. if RFlag = 1 then
  1258. if LFlag=0 or LFlag=3 then
  1259. LFlag=1 ' skip over the intro speech
  1260. end if
  1261. PlayReq(197)
  1262. end if
  1263. if RFlag = 2 then PlayReq(200)
  1264. if RFlag = 3 then PlayReq(199)
  1265. if RFlag > 3 then PlayReq(117)
  1266.  
  1267. RotateBonusLight()
  1268. End If
  1269. End Sub
  1270.  
  1271. Sub LeftOutLaneTrigger_Hit()
  1272. If Tilted = FALSE then
  1273. PlaySoundAt "rollover", LeftOutLaneTrigger
  1274. DOF 115, 2
  1275. ' add some points
  1276. AddScore(50)
  1277. PlayReq(117)
  1278. End If
  1279. End Sub
  1280.  
  1281. Sub RightOutLaneTrigger_Hit()
  1282. If Tilted = FALSE then
  1283. PlaySoundAt "rollover", RightOutLaneTrigger
  1284. DOF 118, 2
  1285. ' add some points
  1286. AddScore(50)
  1287. PlayReq(117)
  1288. End If
  1289. End Sub
  1290.  
  1291. Sub RightSlingShot_Slingshot()
  1292. PlaySoundAt SoundFX("sling", DOFContactors),SLING9
  1293. DOF 104, 2
  1294. Addscore(1)
  1295. End Sub
  1296. Sub RSlingshot1R_hit()
  1297. PlaySoundAt "sling",Light36
  1298. Addscore(1)
  1299. End Sub
  1300. Sub RSlingshot2R_hit()
  1301. PlaySoundAt "sling",L15
  1302. Addscore(1)
  1303. End Sub
  1304. Sub RSlingshot3R_hit()
  1305. PlaySoundAt "sling",L15
  1306. Addscore(1)
  1307. End Sub
  1308. Sub LeftSlingShot_Slingshot()
  1309. PlaySoundAt SoundFX("sling", DOFContactors),SLING8
  1310. DOF 103, 2
  1311. Addscore(1)
  1312. End Sub
  1313. Sub LSlingshot1R_hit()
  1314. PlaySoundAt "sling",light1
  1315. Addscore(1)
  1316. End Sub
  1317. Sub LSlingshot2R_hit()
  1318. PlaySoundAt "sling",L10
  1319. Addscore(1)
  1320. End Sub
  1321. Sub LSlingshot3R_hit()
  1322. PlaySoundAt "sling",gi55
  1323. Addscore(1)
  1324. End Sub
  1325. Sub LSlingshot4R_hit()
  1326. PlaySoundAt "sling",gi55
  1327. Addscore(1)
  1328. End Sub
  1329. Sub LSlingshot5R_hit()
  1330. PlaySoundAt "sling",gi55
  1331. Addscore(1)
  1332. End Sub
  1333.  
  1334. Sub t9_Hit() 'lane 1
  1335. If Tilted = FALSE then
  1336. bumper1_on
  1337. PlaysoundAt "rollover",T9
  1338. PlayReq(120) ' top lanes
  1339. DOF 110, 2
  1340. If StandardMode = True then
  1341. If L14.State = LightStateOn then
  1342. AddScore(10)
  1343. L14.State = LightStateBlinking
  1344. Exit Sub
  1345. End if
  1346.  
  1347. If L14.State = LightStateBlinking then ' Upper Left Light
  1348. AddScore(10)
  1349. L14.State = LightStateOff
  1350. L1.State = LightStateOn ' Bottom Rollover Light
  1351. L8.State = LightStateOn ' Right Red Rollover
  1352. End if
  1353. Else
  1354. If L14.State = LightStateOn then ' Upper Left Light
  1355. AddScore(10)
  1356. L14.State = LightStateOff
  1357. L1.State = LightStateOn ' Bottom Rollover Light
  1358. L8.State = LightStateOn ' Right Red Rollover
  1359. Else
  1360. AddScore(1) ' Get 10pts when light is off
  1361. End if
  1362. End if
  1363. If L14.State = LightStateOff and L13.State = LightStateOff and L12.State = LightStateOff and L11.State=LightStateOff then ' all top lights
  1364. Addscore(250)
  1365. PlayReq(121)
  1366. End if
  1367. End if
  1368. End Sub
  1369.  
  1370. Sub t10_Hit() ' lane2 - should light L15
  1371. If Tilted = FALSE then
  1372. bumper2_on
  1373. PlaysoundAt "rollover",T10
  1374. PlayReq(120) ' top lanes
  1375. DOF 111, 2
  1376. If StandardMode = True then
  1377. If L13.State = LightStateOn then
  1378. AddScore(10)
  1379. L13.State = LightStateBlinking
  1380. Exit Sub
  1381. End if
  1382.  
  1383. If L13.State = LightStateBlinking then ' Upper Left Light
  1384. AddScore(10)
  1385. L13.State = LightStateOff
  1386. L2.State = LightStateOn ' Bottom Rollover Light
  1387. L15.State = LightStateOn ' Green Rolloever
  1388. End if
  1389. Else
  1390. If L13.State = LightStateOn then ' Upper Left Light
  1391. AddScore(10)
  1392. L13.State = LightStateOff
  1393. L2.State = LightStateOn ' Bottom Rollover Light
  1394. L15.State = LightStateOn ' Green Rolloever
  1395. Else
  1396. AddScore(1) ' Get 10pts when light is off
  1397. End if
  1398. End if
  1399.  
  1400.  
  1401. If L14.State = LightStateOff and L13.State = LightStateOff and L12.State = LightStateOff and L11.State=LightStateOff then ' all top lights
  1402. Addscore(250)
  1403. PlayReq(121)
  1404. End if
  1405. End if
  1406. End Sub
  1407.  
  1408. Sub t11_Hit()
  1409. If Tilted = FALSE then
  1410. bumper4_on
  1411. PlaysoundAt "rollover",T11
  1412. PlayReq(120) ' top lanes
  1413. DOF 112, 2
  1414. If StandardMode = True then
  1415. If L12.State = LightStateOn then
  1416. AddScore(10)
  1417. L12.State = LightStateBlinking
  1418. Exit Sub
  1419. End if
  1420.  
  1421. If L12.State = LightStateBlinking then '
  1422. AddScore(10)
  1423. L12.State = LightStateOff
  1424. L3.State = LightStateOn '
  1425. L9.State = LightStateOn
  1426. End if
  1427. Else
  1428. If L12.State = LightStateOn then '
  1429. AddScore(10)
  1430. L12.State = LightStateOff
  1431. L3.State = LightStateOn ' Mid Playfield rollovers
  1432. L9.State = LightStateOn ' 2nd rollover
  1433. Else
  1434. AddScore(1) ' Get 10pts when light is off
  1435. End if
  1436. End if
  1437. If L14.State = LightStateOff and L13.State = LightStateOff and L12.State = LightStateOff and L11.State=LightStateOff then ' all top lights
  1438. Addscore(250)
  1439. PlayReq(121)
  1440. End if
  1441. End If
  1442. End Sub
  1443.  
  1444. Sub T12_Hit() ' should light L10
  1445. If Tilted = FALSE then
  1446. bumper3_on
  1447. PlaysoundAt "rollover",T12
  1448. PlayReq(120) ' top lanes
  1449. DOF 113, 2
  1450. If StandardMode = True then
  1451. If L11.State = LightStateOn then
  1452. AddScore(10)
  1453. L11.State = LightStateBlinking
  1454. Exit Sub
  1455. End if
  1456.  
  1457. If L11.State = LightStateBlinking then ' Upper Left Light
  1458. AddScore(10)
  1459. L11.State = LightStateOff
  1460. L4.State = LightStateOn ' Bottom Rollover Light
  1461. L10.State = LightStateOn ' 2nd rollover
  1462. End if
  1463. Else
  1464. If L11.State = LightStateOn then ' Upper Left Light
  1465. AddScore(10)
  1466. L11.State = LightStateOff
  1467. L4.State = LightStateOn ' Bottom Rollover Light
  1468. L10.State = LightStateOn ' 2nd rollover
  1469. Else
  1470. AddScore(1) ' Get 1pts when light is off
  1471. End if
  1472. End if
  1473.  
  1474. If L14.State = LightStateOff and L13.State = LightStateOff and L12.State = LightStateOff and L11.State=LightStateOff then ' all top lights
  1475. Addscore(250)
  1476. PlayReq(121)
  1477. End if
  1478. End If
  1479. End Sub
  1480.  
  1481. Sub T13_Hit()
  1482. If Tilted = FALSE then
  1483. PlaysoundAt "rollover",T13
  1484. DOF 114, 2
  1485.  
  1486. if LampSplash2.enabled then '200 pts for skill shot - gets turned off in addscore routine
  1487. AddScore(200)
  1488. PlayReq(147) ' top lanes
  1489. else
  1490. AddScore(50)
  1491. PlayReq(143)
  1492. End if
  1493. End If
  1494. End Sub
  1495.  
  1496. Sub Trigger14_Hit()
  1497. If Tilted = FALSE then
  1498. DOF 134, 2
  1499. PlayReq(117)
  1500.  
  1501. If L15.State = LightStateOff then
  1502. L15.State=LightStateOn 'Quick Flash
  1503. L15.uservalue=0
  1504. L15.timerinterval=50
  1505. Me.TimerEnabled = TRUE
  1506. AddScore(1)
  1507. Else
  1508. If L15.State = LightStateOn then
  1509. L15.State=LightStateOff 'Quick Flash
  1510. L15.uservalue=1
  1511. L15.timerinterval=50
  1512. Me.TimerEnabled = TRUE
  1513. AddScore(10)
  1514. End if
  1515. End if
  1516. End If
  1517. End Sub
  1518.  
  1519.  
  1520. Sub BumperTimersOff()
  1521. L5.State = LightStateOff
  1522. L6.State = LightStateOff
  1523. L7.State = LightStateOff
  1524. End Sub
  1525.  
  1526. '====================
  1527.  
  1528. Sub Resetaftersuccess()
  1529. BumperTimersOff()
  1530. L5.State = LightStateOn 'reenable the melon lights
  1531. End Sub
  1532.  
  1533. 'Score Handling
  1534.  
  1535. Sub AddScore(val)
  1536. skillshotoff()
  1537. If Tilted = FALSE then
  1538. if int(Score(Up)/1000) <> int((Score(Up)+val)/1000) then
  1539. PlaySound "Sounds-0x32C",0, CVol ' Cow Bell
  1540. else
  1541. if int(Score(Up)/100) <> int((Score(Up)+val)/100) then
  1542. PlaySound "Sounds-0xE9",0, CVol ' bell sounds
  1543. else
  1544. if int(Score(Up)/10) <> int((Score(Up)+val)/10) then
  1545. PlaySound "Sounds-0x1F0",0, CVol ' Simple Bell
  1546. end if
  1547. end if
  1548. end if
  1549. if Score(Up)+val > 1000 and Score(Up)<1000 then
  1550. PlayReq(88)
  1551. end if
  1552. if Score(Up)+val > 1500 and Score(Up)<1500 then
  1553. PlayReq(87)
  1554. end if
  1555. if Score(Up)+val > 3500 and Score(Up)<3500 then
  1556. PlayReq(86)
  1557. end if
  1558. if Score(Up)+val > 4000 and Score(Up)<4000 then
  1559. PlayReq(85)
  1560. end if
  1561. if Score(Up)+val > 5000 and Score(Up)<5000 then
  1562. PlayReq(84)
  1563. end if
  1564. if Score(Up)+val > 6000 and Score(Up)<6000 then
  1565. PlayReq(83)
  1566. end if
  1567. if Score(Up)+val > 7000 and Score(Up)<7000 then
  1568. PlayReq(82)
  1569. end if
  1570. if Score(Up)+val > 8000 and Score(Up)<8000 then
  1571. PlayReq(80)
  1572. end if
  1573. if Score(Up)+val >10000 and Score(Up)<10000 then
  1574. PlayReq(81)
  1575. end if
  1576.  
  1577. Score(Up) = Score(Up) + val
  1578. DisplayScore
  1579. AddReel val
  1580.  
  1581. If B2SOn Then
  1582. Controller.B2SSetScore 1,Score(1)
  1583. End If
  1584. End If
  1585. End Sub
  1586.  
  1587. Sub AddReel(Pts)
  1588. Select Case Up
  1589. Case 1
  1590. EmReel1.AddValue Pts
  1591. Case 2
  1592. EmReel2.AddValue Pts
  1593. End Select
  1594. End Sub
  1595.  
  1596. ' Score Displayer
  1597. Sub DisplayScore()
  1598. If Score(Up) >= 2000 And Credit1(Up)=false Then
  1599. PlayReq(30)
  1600. AwardSpecial
  1601. Credit1(Up)=true
  1602. End If
  1603. If Score(Up) >= 3000 And Credit2(Up)=false Then
  1604. PlayReq(31)
  1605. AwardSpecial
  1606. Credit2(Up)=true
  1607. End If
  1608. End Sub
  1609.  
  1610. Sub AwardSpecial()
  1611. PlaysoundAt SoundFX("knocke", DOFKnocker),L11
  1612. DOF 122, 2
  1613. Credit = Credit + 1
  1614. DOF 121, 1
  1615. CreditReel.SetValue Credit
  1616. If B2SOn Then
  1617. Controller.B2SSetCredits Credit
  1618. End If
  1619. savehs
  1620. End Sub
  1621.  
  1622. '************Save Scores
  1623. Sub SaveHS
  1624. savevalue "nellie", "Credit", Credit
  1625. savevalue "nellie", "HiScore", HiSc
  1626. savevalue "nellie", "Match", MatchNumber
  1627. savevalue "nellie", "Initial1", Initial(1)
  1628. savevalue "nellie", "Initial2", Initial(2)
  1629. savevalue "nellie", "Initial3", Initial(3)
  1630. savevalue "nellie", "Score4", Score(1)
  1631. savevalue "nellie", "Balls", Balls
  1632. End sub
  1633.  
  1634. '*************Load Scores
  1635. Sub LoadHighScore
  1636. dim temp
  1637. temp = LoadValue("nellie", "credit")
  1638. If (temp <> "") then Credit = CDbl(temp)
  1639. temp = LoadValue("nellie", "HiScore")
  1640. If (temp <> "") then HiSc = CDbl(temp)
  1641. temp = LoadValue("nellie", "match")
  1642. If (temp <> "") then MatchNumber = CDbl(temp)
  1643. temp = LoadValue("nellie", "Initial1")
  1644. If (temp <> "") then Initial(1) = CDbl(temp)
  1645. temp = LoadValue("nellie", "Initial2")
  1646. If (temp <> "") then Initial(2) = CDbl(temp)
  1647. temp = LoadValue("nellie", "Initial3")
  1648. If (temp <> "") then Initial(3) = CDbl(temp)
  1649. temp = LoadValue("nellie", "score4")
  1650. If (temp <> "") then score(1) = CDbl(temp)
  1651. temp = LoadValue("nellie", "balls")
  1652. If (temp <> "") then Balls = CDbl(temp)
  1653. End Sub
  1654.  
  1655.  
  1656. Dim s26,s27,s1,s2,s3,s4,s6,s7
  1657.  
  1658. Sub LampSplashOn_Hit
  1659. if Tilted = FALSE then
  1660. PlaySoundAt "rollover", LampSplashOn
  1661. s26=Light26.state:s27=Light27.state:s6=Light6.state:s7=Light7.state
  1662. s1=l1.state:s2=l2.state:s3=l3.state:s4=l4.state
  1663. l1.state=LightStateOff
  1664. l2.state=LightStateOff
  1665. l3.state=LightStateOff
  1666. l4.state=LightStateOff
  1667. LampSplash.interval = 300
  1668. LampSplash2.interval = 300
  1669. LampSplash.enabled = True
  1670. LampSplash2.enabled = True
  1671. BallInLane.Enabled=True
  1672. End if
  1673. End Sub
  1674.  
  1675. Sub LampSplashOn_UnHit
  1676. if Tilted = FALSE then
  1677. DOF 120, 2
  1678. l1.state=s1:l2.state=s2:l3.state=s3:l4.state=s4
  1679. LampSplash.enabled = False 'Turn off the 4 light attract mode
  1680. BallInLane.Enabled=False
  1681. End If
  1682. End Sub
  1683.  
  1684. Sub SkillshotOff 'turn off when points are scored
  1685. if LampSplash2.enabled = True then
  1686. LampSplash2.enabled = False
  1687. Light26.state=s26:Light27.state=s27
  1688. Light6.state=s6:Light7.state=s7
  1689. End if
  1690. End Sub
  1691.  
  1692. Sub LampSplash_Timer() ' These lights no longer flash once the trigger is unhit
  1693. Select Case lno
  1694. Case 1
  1695. l1.state = LightStateOn:l2.state = LightStateOff
  1696. Case 2
  1697. l2.state = LightStateOn:l1.state = LightStateOff
  1698. Case 3
  1699. l3.state = LightStateOn:l2.state = LightStateOff
  1700. Case 4
  1701. l4.state = LightStateOn:l3.state = LightStateOff
  1702. Case 5
  1703. l3.state = LightStateOn:l4.state = LightStateOff
  1704. Case 6
  1705. l2.state = LightStateOn:l3.state = LightStateOff
  1706. End Select
  1707. End Sub
  1708.  
  1709. Sub LampSplash2_Timer() ' flash the lights while ball is in the trough
  1710. lno = lno + 1
  1711. if lno > 6 then lno = 1
  1712. Select Case lno
  1713. Case 1
  1714. Light27.state = LightStateOff:Light26.state = LightStateOff:Light7.state=LightStateOff:Light6.state=LightStateOff
  1715. Case 2
  1716. Light27.state = LightStateOff:Light26.state = LightStateOff:Light7.state=LightStateOff:Light6.state=LightStateOff
  1717. Case 3
  1718. Light27.state = LightStateOff:Light26.state = LightStateOff:Light7.state=LightStateOff:Light6.state=LightStateOff
  1719. Case 4
  1720. Light27.state = LightStateOn:Light26.state = LightStateOn:Light7.state=LightStateOn:Light6.state=LightStateOn
  1721. Case 5
  1722. Light27.state = LightStateOn:Light26.state = LightStateOn:Light7.state=LightStateOn:Light6.state=LightStateOn
  1723. Case 6
  1724. Light27.state = LightStateOn:Light26.state = LightStateOn:Light7.state=LightStateOn:Light6.state=LightStateOn
  1725. End Select
  1726. End Sub
  1727.  
  1728. ' Base Vp10 Routines
  1729. ' *********************************************************************
  1730. ' Supporting Ball & Sound Functions
  1731. ' *********************************************************************
  1732.  
  1733. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1734. Vol = Csng((BallVel(ball)*1 + 4)/10)
  1735. End Function
  1736.  
  1737. Function Vol2(ball1, ball2) ' Calculates the Volume of the sound based on the speed of two balls
  1738. Vol2 = (Vol(ball1) + Vol(ball2) ) / 2
  1739. End Function
  1740.  
  1741. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1742. Dim tmp
  1743. tmp = ball.x * 2 / table1.width-1
  1744. If tmp> 0 Then
  1745. Pan = Csng(tmp ^10)
  1746. Else
  1747. Pan = Csng(-((- tmp) ^10) )
  1748. End If
  1749. End Function
  1750.  
  1751. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1752. Pitch = BallVel(ball) * 20
  1753. End Function
  1754.  
  1755. function AudioFade(ball)
  1756. Dim tmp
  1757. tmp = ball.y * 2 / Table1.height-1
  1758. If tmp > 0 Then
  1759. AudioFade = Csng(tmp ^10)
  1760. Else
  1761. AudioFade = Csng(-((- tmp) ^10) )
  1762. End If
  1763. End Function
  1764.  
  1765. Function BallVel(ball) 'Calculates the ball speed
  1766. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1767. End Function
  1768.  
  1769. '*****************************************
  1770. ' JP's VP10 Collision & Rolling Sounds
  1771. '*****************************************
  1772.  
  1773. Const tnob = 2 ' total number of balls
  1774. ReDim rolling(tnob)
  1775. ReDim collision(tnob)
  1776. Initcollision
  1777.  
  1778. Sub Initcollision
  1779. Dim i
  1780. For i = 0 to tnob
  1781. collision(i) = -1
  1782. rolling(i) = False
  1783. Next
  1784. End Sub
  1785.  
  1786. Sub CollisionTimer_Timer()
  1787. Dim BOT, B, B1, B2, dx, dy, dz, distance, radii
  1788. BOT = GetBalls
  1789.  
  1790. ' rolling
  1791.  
  1792. For B = UBound(BOT) +1 to tnob
  1793. rolling(b) = False
  1794. StopSound("fx_ballrolling" & b)
  1795. Next
  1796. If UBound(BOT) = -1 Then Exit Sub
  1797. For b = 0 to UBound(BOT)
  1798. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1799. rolling(b) = True
  1800. If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
  1801. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0, AudioFade(BOT(b) )
  1802. Else
  1803. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1804. End If
  1805. Else
  1806. If rolling(b) = True Then
  1807. StopSound("fx_ballrolling" & b)
  1808. rolling(b) = False
  1809. End If
  1810. End If
  1811. Next
  1812.  
  1813. 'collision
  1814.  
  1815. If UBound(BOT) < 1 Then Exit Sub
  1816.  
  1817. For B1 = 0 to UBound(BOT)
  1818. For B2 = B1 + 1 to UBound(BOT)
  1819. dz = INT(ABS((BOT(b1).z - BOT(b2).z) ) )
  1820. radii = BOT(b1).radius + BOT(b2).radius
  1821. If dz <= radii Then
  1822.  
  1823. dx = INT(ABS((BOT(b1).x - BOT(b2).x) ) )
  1824. dy = INT(ABS((BOT(b1).y - BOT(b2).y) ) )
  1825. distance = INT(SQR(dx ^2 + dy ^2) )
  1826.  
  1827. If distance <= radii AND (collision(b1) = -1 OR collision(b2) = -1) Then
  1828. collision(b1) = b2
  1829. collision(b2) = b1
  1830. PlaySound("fx_collide"), 0, Vol2(BOT(b1), BOT(b2)), Pan(BOT(b1)), 0, Pitch(BOT(b1)), 0, 0, AudioFade(BOT(b1))
  1831. Else
  1832. If distance > (radii + 10) Then
  1833. If collision(b1) = b2 Then collision(b1) = -1
  1834. If collision(b2) = b1 Then collision(b2) = -1
  1835. End If
  1836. End If
  1837. End If
  1838. Next
  1839. Next
  1840. End Sub
  1841.  
  1842. Sub Posts_Hit(idx)
  1843. If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
  1844. RandomSoundRubber()
  1845. Else
  1846. PlaySound "fx_rubber2", 0, Vol(ActiveBall)*.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1
  1847. End If
  1848. End Sub
  1849.  
  1850.  
  1851. Sub Rubbers_Hit(idx)
  1852. If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
  1853. RandomSoundRubber()
  1854. Else
  1855. PlaySound "fx_rubber2", 0, Vol(ActiveBall)*.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1
  1856. End If
  1857. End Sub
  1858.  
  1859. Sub RandomSoundRubber()
  1860. Select Case Int(Rnd*3)+1
  1861. Case 1 : PlaySoundAtBallVol "rubber_hit_1",.1
  1862. Case 2 : PlaySoundAtBallVol "rubber_hit_2",.1
  1863. Case 3 : PlaySoundAtBallVol "rubber_hit_3",.1
  1864. End Select
  1865. End Sub
  1866.  
  1867. Sub LeftFlipper_Collide(parm)
  1868. RandomSoundFlipper()
  1869. End Sub
  1870.  
  1871. Sub RightFlipper_Collide(parm)
  1872. RandomSoundFlipper()
  1873. End Sub
  1874.  
  1875. Sub RandomSoundFlipper()
  1876. Select Case Int(Rnd*3)+1
  1877. Case 1 : PlaySoundAtBall "flip_hit_1"
  1878. Case 2 : PlaySoundAtBall "flip_hit_2"
  1879. Case 3 : PlaySoundAtBall "flip_hit_3"
  1880. End Select
  1881. End Sub
  1882.  
  1883. Sub Gates_Hit (idx)
  1884. PlaySoundAt "gate4",ActiveBall
  1885. End Sub
  1886.  
  1887.  
  1888. Sub AttractMode_Timer()
  1889. AttractMode.Enabled=False
  1890. MyLightSeq.UpdateInterval=15
  1891. MyLightSeq.Play SeqLeftOn, 30, 3
  1892. MyLightSeq.Play SeqUpOn, 30, 3
  1893. MyLightSeq.Play SeqDownOn, 30, 3
  1894. MyLightSeq.Play SeqRightOn, 30, 3
  1895. MyLightSeq.Play SeqLeftOn, 30, 3
  1896. MyLightSeq.Play SeqUpOn, 30, 3
  1897. MyLightSeq.Play SeqDownOn, 30, 3
  1898. MyLightSeq.Play SeqRightOn, 30, 3
  1899. MyLightSeq.Play SeqLeftOn, 30, 3
  1900. MyLightSeq.Play SeqUpOn, 30, 3
  1901. MyLightSeq.Play SeqDownOn, 30, 3
  1902. MyLightSeq.Play SeqRightOn, 30, 3
  1903. MyLightSeq.Play SeqLeftOn, 30, 3
  1904. MyLightSeq.Play SeqUpOn, 30, 3
  1905. MyLightSeq.Play SeqDownOn, 30, 3
  1906. MyLightSeq.Play SeqRightOn, 30, 3
  1907. End Sub
  1908.  
  1909. Sub MyLightSeq_PlayDone() ' play the lights again until key is pressed
  1910. AttractMode.Interval=100
  1911. AttractMode.Enabled=True
  1912. End Sub
  1913.  
  1914. Sub AttractModeSounds_Timer() ' play random attract speech
  1915. attractmodeflag=attractmodeflag+1
  1916. if attractmodeflag = 5 then
  1917. MusicFile=Playreq(28) ' longer piano entrance
  1918. else
  1919. if attractmodeflag > 15 then
  1920. attractmodeflag=1
  1921. MusicFile=Playreq(93) ' : msgbox "Attract Mode MusicFile=" &MusicFile
  1922. else
  1923. if attractmodeflag <> 6 then ' skip one round
  1924. MusicFile=Playreq(93) ' : msgbox "Attract Mode MusicFile=" &MusicFile
  1925. end if
  1926. end if
  1927. end if
  1928. AttractModeSounds.Interval=7000+(INT(RND*5)*1000)
  1929. End Sub
  1930.  
  1931. Sub LastScoreReels
  1932. HSScorex = LastScore
  1933. HSScore100K=Int (HSScorex/100000)'Calculate the value for the 100,000's digit
  1934. HSScore10K=Int ((HSScorex-(HSScore100k*100000))/10000) 'Calculate the value for the 10,000's digit
  1935. HSScoreK=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000))/1000) 'Calculate the value for the 1000's digit
  1936. HSScore100=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000))/100) 'Calculate the value for the 100's digit
  1937. HSScore10=Int((HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000)-(HSScore100*100))/10) 'Calculate the value for the 10's digit
  1938. HSScore1=Int(HSScorex-(HSScore100k*100000)-(HSScore10K*10000)-(HSScoreK*1000)-(HSScore100*100)-(HSScore10*10)) 'Calculate the value for the 1's digit
  1939.  
  1940. End Sub
  1941.  
  1942. '************Enter Initials
  1943. Sub EnterIntitals(keycode)
  1944. If KeyCode = LeftFlipperKey Then
  1945. HSx = HSx - 1
  1946. if HSx < 0 Then HSx = 26
  1947. If HSi < 4 Then EVAL("Initial" & HSi).image = HSiArray(HSx)
  1948. End If
  1949. If keycode = RightFlipperKey Then
  1950. HSx = HSx + 1
  1951. If HSx > 26 Then HSx = 0
  1952. If HSi < 4 Then EVAL("Initial"& HSi).image = HSiArray(HSx)
  1953. End If
  1954. If keycode = StartGameKey Then
  1955. If HSi < 3 Then
  1956. EVAL("Initial" & HSi).image = HSiArray(HSx)
  1957. Initial(HSi) = HSx
  1958. EVAL("InitialTimer" & HSi).enabled = 0
  1959. EVAL("Initial" & HSi).visible = 1
  1960. Initial(HSi + 1) = HSx
  1961. EVAL("Initial" & HSi +1).image = HSiArray(HSx)
  1962. y = 1
  1963. EVAL("InitialTimer" & HSi + 1).enabled = 1
  1964. HSi = HSi + 1
  1965. Else
  1966. Initial3.visible = 1
  1967. InitialTimer3.enabled = 0
  1968. Initial(3) = HSx
  1969. InitialEntry.enabled = 1
  1970. HSi = HSi + 1
  1971. End If
  1972. End If
  1973. End Sub
  1974.  
  1975. Sub InitialEntry_timer
  1976. SaveHS
  1977. HSi = HSi + 1
  1978. EnableInitialEntry = False
  1979. InitialEntry.enabled = 0
  1980. Players = 0
  1981. End Sub
  1982.  
  1983. '************Flash Initials Timers
  1984. Sub InitialTimer1_Timer
  1985. y = y + 1
  1986. If y > 1 Then y = 0
  1987. If y = 0 Then
  1988. Initial1.visible = 1
  1989. Else
  1990. Initial1.visible = 0
  1991. End If
  1992. End Sub
  1993.  
  1994. Sub InitialTimer2_Timer
  1995. y = y + 1
  1996. If y > 1 Then y = 0
  1997. If y = 0 Then
  1998. Initial2.visible = 1
  1999. Else
  2000. Initial2.visible = 0
  2001. End If
  2002. End Sub
  2003.  
  2004. Sub InitialTimer3_Timer
  2005. y = y + 1
  2006. If y > 1 Then y = 0
  2007. If y = 0 Then
  2008. Initial3.visible = 1
  2009. Else
  2010. Initial3.visible = 0
  2011. End If
  2012. End Sub
  2013.  
  2014. '**************Update Desktop Text
  2015. Sub UpdateText
  2016. BallReel.SetValue Ball
  2017. End Sub
  2018.  
  2019.  
  2020. '***************Post It Note Update
  2021. Sub UpdatePostIt
  2022. ScoreMil = Int(HiSc/1000000)
  2023. Score100K = Int( (HiSc - (ScoreMil*1000000) ) / 100000)
  2024. Score10K = Int( (HiSc - (ScoreMil*1000000) - (Score100K*100000) ) / 10000)
  2025. ScoreK = Int( (HiSc - (ScoreMil*1000000) - (Score100K*100000) - (Score10K*10000) ) / 1000)
  2026. Score100 = Int( (HiSc - (ScoreMil*1000000) - (Score100K*100000) - (Score10K*10000) - (ScoreK*1000) ) / 100)
  2027. Score10 = Int( (HiSc - (ScoreMil*1000000) - (Score100K*100000) - (Score10K*10000) - (ScoreK*1000) - (Score100*100) ) / 10)
  2028. ScoreUnit = (HiSc - (ScoreMil*1000000) - (Score100K*100000) - (Score10K*10000) - (ScoreK*1000) - (Score100*100) - (Score10*10) )
  2029.  
  2030. Pscore6.image = HSArray(ScoreMil):If HiSc < 1000000 Then PScore6.image = HSArray(10)
  2031. Pscore5.image = HSArray(Score100K):If HiSc < 100000 Then PScore5.image = HSArray(10)
  2032. PScore4.image = HSArray(Score10K):If HiSc < 10000 Then PScore4.image = HSArray(10)
  2033. PScore3.image = HSArray(ScoreK):If HiSc < 1000 Then PScore3.image = HSArray(10)
  2034. PScore2.image = HSArray(Score100):If HiSc < 100 Then PScore2.image = HSArray(10)
  2035. PScore1.image = HSArray(Score10):If HiSc < 10 Then PScore1.image = HSArray(10)
  2036. PScore0.image = HSArray(ScoreUnit):If HiSc < 1 Then PScore0.image = HSArray(10)
  2037. If HiSc < 1000 Then
  2038. PComma.image = HSArray(10)
  2039. Else
  2040. PComma.image = HSArray(11)
  2041. End If
  2042. If HiSc < 1000000 Then
  2043. PComma1.image = HSArray(10)
  2044. Else
  2045. PComma1.image = HSArray(11)
  2046. End If
  2047. If HiSc < 1000000 Then Shift = 1:PComma.transx = -10
  2048. If HiSc < 100000 Then Shift = 2:PComma.transx = -20
  2049. If HiSc < 10000 Then Shift = 3:PComma.transx = -30
  2050. For x = 0 to 6
  2051. EVAL("Pscore" & x).transx = (-10 * Shift)
  2052. Next
  2053. Initial1.image = HSiArray(Initial(1))
  2054. Initial2.image = HSiArray(Initial(2))
  2055. Initial3.image = HSiArray(Initial(3))
  2056. End Sub
  2057.  
  2058. Sub table1_Exit
  2059. ' SaveLMEMConfig
  2060. If B2SOn Then Controller.stop
  2061. End Sub
  2062.  
  2063. function PlayReq(num)
  2064. rpos=INT(RND*len(Req(num))/3)
  2065. PlaySound "Sounds-0x" & rtrim(Ucase(mid(Req(num),3*rpos+1,3))),0, SVol
  2066. PlayReq="Sounds-0x" & Ucase(mid(Req(num),3*rpos+1,3))
  2067. End function
  2068.  
  2069. function PlayTrack(num) ' softer and looping
  2070. rpos=INT(RND*len(Req(num))/3)
  2071. PlaySound "Sounds-0x" & rtrim(Ucase(mid(Req(num),3*rpos+1,3))), 5, TVol
  2072. PlayTrack = "Sounds-0x" & rtrim(Ucase(mid(Req(num),3*rpos+1,3)))
  2073. End function
  2074.  
  2075. ' Just used for testing
  2076. Sub PlayallReq(num)
  2077. for i = 1 to len(Req(num))/3
  2078. PlaySound "Sounds-0x" & Ucase(mid(Req(num),3*(i-1)+1,3))
  2079. msgbox num & " playing Sounds-0x" & Ucase(mid(Req(num),3*(i-1)+1,3))
  2080. Next
  2081. End Sub
  2082.  
  2083.  
  2084. '**************************************************************************
  2085. ' Positional Sound Playback Functions by DJRobX
  2086. ' VPX version check only required for 10.3 backwards compatibility.
  2087. ' Version check and Else statement may be removed if table is > 10.4 only.
  2088. '**************************************************************************
  2089.  
  2090. 'Set position as table object (Use object or light but NOT wall) and Vol to 1
  2091.  
  2092. Sub PlaySoundAt(sound, tableobj)
  2093. If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
  2094. PlaySound sound, 1, 1, Pan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  2095. Else
  2096. PlaySound sound, 1, 1, Pan(tableobj)
  2097. End If
  2098. End Sub
  2099.  
  2100.  
  2101. 'Set all as per ball position & speed.
  2102.  
  2103. Sub PlaySoundAtBall(sound)
  2104. If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
  2105. PlaySound sound, 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  2106. Else
  2107. PlaySound sound, 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1
  2108. End If
  2109. End Sub
  2110.  
  2111.  
  2112. 'Set position as table object and Vol manually.
  2113.  
  2114. Sub PlaySoundAtVol(sound, tableobj, Vol)
  2115. If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
  2116. PlaySound sound, 1, Vol, Pan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  2117. Else
  2118. PlaySound sound, 1, Vol, Pan(tableobj)
  2119. End If
  2120. End Sub
  2121.  
  2122.  
  2123. 'Set all as per ball position & speed, but Vol Multiplier may be used eg; PlaySoundAtBallVol "sound",3
  2124.  
  2125. Sub PlaySoundAtBallVol(sound, VolMult)
  2126. If Table1.VersionMinor > 3 OR Table1.VersionMajor > 10 Then
  2127. PlaySound sound, 0, Vol(ActiveBall) * VolMult, Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  2128. Else
  2129. PlaySound sound, 0, Vol(ActiveBall) * VolMult, Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1
  2130. End If
  2131. End Sub
  2132.  
  2133.  
  2134. ' Notes: To be left in script so others can learn & understand new VPX Surround Code
  2135. '
  2136. ' PlaySoundAtBall "sound",ActiveBall
  2137. ' * Sets position as ball and Vol to 1
  2138.  
  2139. ' PlaySoundAtBallVol "sound",x
  2140. ' * Same as PlaySounAtBall but sets x as a volume multiplier (1-10) or partial multiplier (.01-.99)
  2141. '
  2142. ' PlaySound sound, 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  2143. ' * May us used as shown, or with any manual setting, in place of any above Sound Playback Function.
  2144. '
  2145. ' PlaySound sound, 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1
  2146. ' * May us used as shown, or with any manual setting, to maintain 10.3 backwards compatability.
  2147.  
  2148. '**********************************************************************
  2149.  
  2150. '**********************************************************************
  2151.  
  2152.  
  2153. '*****************************************
  2154. ' BALL SHADOW
  2155. '*****************************************
  2156. Dim BallShadow
  2157. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  2158.  
  2159. Sub BallShadowUpdate_timer()
  2160. Dim BOT, b
  2161. BOT = GetBalls
  2162. ' hide shadow of deleted balls
  2163. If UBound(BOT)<(tnob-1) Then
  2164. For b = (UBound(BOT) + 1) to (tnob-1)
  2165. BallShadow(b).visible = 5
  2166. Next
  2167. End If
  2168. ' exit the Sub if no balls on the table
  2169. If UBound(BOT) = -1 Then Exit Sub
  2170. ' render the shadow for each ball
  2171. For b = 0 to UBound(BOT)
  2172. If BOT(b).X < Table1.Width/2 Then
  2173. BallShadow(b).X = ((BOT(b).X) - (Ballsize/16) + ((BOT(b).X - (Table1.Width/2))/7)) + 13
  2174. Else
  2175. BallShadow(b).X = ((BOT(b).X) + (Ballsize/16) + ((BOT(b).X - (Table1.Width/2))/7)) - 13
  2176. End If
  2177. ballShadow(b).Y = BOT(b).Y + 10
  2178. If BOT(b).Z > 20 Then
  2179. BallShadow(b).visible = 1
  2180. Else
  2181. BallShadow(b).visible = 0
  2182. End If
  2183. Next
  2184. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement