Arngrim

whoa nellie controller.vbs

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