Arngrim

Untitled

Oct 26th, 2017
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 74.38 KB | None | 0 0
  1. ' -------------------------------------------------
  2. ' NOBS
  3. ' -------------------------------------------------
  4. '
  5. ' by BorgDog, 2016
  6. '
  7. ' Scoring Rules
  8. '
  9. ' Scoring is by standard cribbage rules... mostly... with a "game" to 121 pegs.
  10. ' Tracks cribbage games won, including skunks and double skunks on 2 player games.
  11. '
  12. ' Clear a hand to count cribbage pegs for that "hand" including "turn" card (roto target).
  13. ' Hands resets after clearing and at end of ball, excpet at end of ball when shoot again is lit.
  14. '
  15. ' Hands are as follows and all include the "turn" card (RotoTarget) in the scoring.:
  16. ' 4 left side drops (6, 5, 5, 4)
  17. ' 3 center drops and right side rollover (A, 2, 2, 3)
  18. ' 2 right drops, right outlane, and left inlane (6, 7, 8, 9)
  19. ' 3 top rollovers and left outlane (K, Q, J, 5)
  20. '
  21. ' Clearing all four hands in a single ball turns on Double pegs. Double pegs lights clear at end of ball always.
  22. '
  23. ' Clear K,Q,J and 7,8 rollovers to light star rollovers. Each lit star "pegs" 1 during "play".
  24. ' Clear any 6 lit wire rollovers to light extra ball (target) and open right outlane gate.
  25. '
  26. ' Clearing the "5" rollover opens left outlane gate, reset if hand 3 is complete or on next ball.
  27. '
  28. ' When a player reaches an end of the cribbage board (>120 pegs) that player scores a game win.
  29. ' If opposing players pegs is less than 90 the player also scores a skunk (another game).
  30. ' If opposing players pegs is less than 60 the player scores a double-skunk (4 games total)
  31. ' New cribbage game, both players game pegs, reset to 0 when a game is won.
  32. '
  33. ' If any rollover or drop target hit during play matches the turn card (roto) a "pair for 2" is pegged.
  34. ' If any rollover or drop target hit during play + turn card = 15, then a "15 for 2" is pegged, face cards count as 10.
  35. ' Hitting roto pegs the displayed card (K,Q,J are worth 10, etc) and spins the roto.
  36. ' Hitting bullseye target pegs 1 and spins the roto.
  37. ' Skill shot pegs 2 for "heels" (well should only be Jack but where is the fun in that)
  38. '
  39. ' This table uses a simplified and modified version of Wizards_Hat's Alphanumeric Display Tutorial table
  40. ' for the system 1 type displays, expanded to include b2s. Thanks!
  41. '
  42. ' DOF config
  43. ' 101 Left Flipper, 102 Right Flipper,
  44. ' 105 right sling, 106 right sling flasher,
  45. ' 107 Bumper1, 108 Bumper1 flasher, 109 bumper2, 110 bumper2 Flasher
  46. ' 115 Roto-gear, 116 left DT reset, 117 mid DT reset, 118 Right DT Reset
  47. ' 134 Drain, 135 Ball Release
  48. ' 136 Shooter Lane/launch ball, 137 credit light, 138 knocker, 139 knocker Flasher
  49. ' 141 Chime1-10s, 142 Chime2-100s, 143 Chime3-1000s
  50. '
  51. ' -------------------------------------------------
  52.  
  53. Option Explicit
  54. Randomize
  55.  
  56. Const cGameName = "Nobs_2016"
  57. Const Ballsize = 50
  58.  
  59. ' ********************** OPTIONS
  60.  
  61. dim chimevol: chimevol=1 'set between 0 and 1 to adjust how loud the chimes are, 0 is off, go below 0.1 for noticeable effect
  62. Dim BallShadows: Ballshadows=1 '******************set to 1 to turn on Ball shadows
  63. Dim FlipperShadows: FlipperShadows=1 '***********set to 1 to turn on Flipper shadows
  64.  
  65. ' **********************
  66.  
  67.  
  68. Dim operatormenu, options
  69. Dim balls, peg, pegstart, attract
  70. Dim Add10, Add100, Add1000
  71. Dim hipg,higm, NewHG, PlungeBall
  72. Dim maxplayers, players, player
  73. Dim credit, decks, freeplay, chimesounds
  74. Dim Count(2),dispcount(2), dispcount2(2)
  75. Dim pegs(2)
  76. Dim games(2)
  77. Dim peglights(2,120)
  78. Dim cplay(2)
  79. Dim Pups(2)
  80. Dim state, skillshot, shot, skillcheck
  81. Dim tilt, tiltsens
  82. Dim target(9)
  83. Dim ballinplay, dtstep, chimetime, chimetime1
  84. dim rstep, lstep, rotospin, rotopos, rotocount, spinit
  85. dim dw1step, dw2step, dw3step, dw4step, dw5step, dw6step
  86. Dim rep(2)
  87. Dim rst
  88. Dim eg
  89. Dim bell, eball
  90. Dim i,j, ii, objekt, light, temp
  91.  
  92. On Error Resume Next
  93. ExecuteGlobal GetTextFile("controller.vbs")
  94. If Err Then MsgBox "Can't open controller.vbs"
  95. On Error Goto 0
  96.  
  97. sub nobs_init
  98. LoadEM
  99. ScoreSetup
  100. maxplayers=2
  101. set Pups(1) = Pup1
  102. set Pups(2) = Pup2
  103. set target(1)=DT5
  104. set target(2)=DT5b
  105. set target(3)=DT6
  106. set target(4)=DT4
  107. set target(5)=DTa
  108. set target(6)=DT2
  109. set target(7)=DT3
  110. set target(8)=DT6A
  111. set target(9)=DT9
  112. HSEnterMode = False
  113. HGEnterMode = False
  114. hideoptions
  115. player=1
  116. skillshot=0
  117. For each light in cardlights:light.State = 0: Next
  118. loadhs
  119. if rotopos="" or rotopos<1 or rotopos>13 then rotopos=1
  120. if rotospin <1 or rotospin>13 then rotospin=1
  121. RotoTarget.roty=-1*(rotopos-1)*(360/13)
  122. if hipg="" then hipg=50
  123. if higm="" then higm=0
  124. ii=0
  125. balls=5
  126. if HSA1="" then HSA1=68
  127. if HSA2="" then HSA2=79
  128. if HSA3="" then HSA3=71
  129. if HGA1="" then HGA1=68
  130. if HGA2="" then HGA2=79
  131. if HGA3="" then HGA3=71
  132. credittxt.setvalue(0)
  133. BipReel.setvalue(0)
  134. if decks="" or decks<1 or decks>4 then decks=4
  135. if freeplay="" or freeplay<0 or freeplay>1 then freeplay=1
  136. if freeplay=1 then credit=-1
  137. if chimesounds="" or chimesounds<0 or chimesounds>1 then chimesounds=1
  138. OptionDeck.image = "OptionsDecks"&decks
  139. OptionFree.image="OptionsYN"&freeplay
  140. OptionChimes.image="OptionsYN"&chimesounds
  141. for each objekt in plastics: objekt.image = "plastics"&decks: Next
  142. If B2SOn then
  143. for each objekt in backdropstuff: objekt.visible = 0 : next
  144. End If
  145.  
  146. if ballshadows=1 then
  147. BallShadowUpdate.enabled=1
  148. else
  149. BallShadowUpdate.enabled=0
  150. end if
  151.  
  152. if flippershadows=1 then
  153. FlipperLSh.visible=1
  154. FlipperRSh.visible=1
  155. else
  156. FlipperLSh.visible=0
  157. FlipperRSh.visible=0
  158. end if
  159.  
  160. for i = 1 to 9
  161. target(i).isdropped=True
  162. Next
  163. tilt=false
  164. Drain.CreateBall
  165. startGame.enabled=true
  166. a1.timerenabled=1
  167. If nightday<=5 then
  168. For each light in lights:light.intensityscale = 5:Next
  169. For each light in InsertLights:light.intensityscale = 3:Next
  170. End If
  171. If nightday>5 then
  172. For each light in lights:light.intensityscale = 2:Next
  173. End If
  174. If nightday>10 then
  175. For each light in lights:light.intensityscale = 1.5:Next
  176. For each light in InsertLights:light.intensityscale = 1:Next
  177. End If
  178. If nightday>30 then
  179. For each light in lights:light.intensityscale = 1:Next
  180. End If
  181. If nightday>80 then
  182. For each light in lights:light.intensityscale = .8:Next
  183. For each light in InsertLights:light.intensityscale = .8:Next
  184. End If
  185. End sub
  186.  
  187. sub attractmode
  188. if state=false then
  189. pegani.enabled=1
  190. LightSeq1.Play SeqUpOn,15,1
  191. LightSeq1.Play SeqDownOn,15,1
  192. LightSeq1.Play SeqRightOn,15,1
  193. LightSeq1.Play SeqLeftOn,15,1
  194. LightSeq1.Play SeqRandom,5,,2000
  195. end if
  196. end Sub
  197.  
  198. Sub LightSeq1_PlayDone()
  199. if state=false then attractmode
  200. End Sub
  201.  
  202. Sub Lgi_timer
  203. attractmode
  204. Lgi.timerenabled=0
  205. end sub
  206.  
  207. sub pegani_timer
  208. if ii>119 Then ii=0
  209. Peg1(ii).duration 1, 500, 0
  210. Peg2(ii).duration 1, 500, 0
  211. ii=ii+1
  212. end sub
  213.  
  214. sub startGame_timer
  215. playsound "poweron"
  216. lightdelay.enabled=true
  217. me.enabled=false
  218. end sub
  219.  
  220. sub lightdelay_timer
  221. For each light in GIlights:light.state=1:Next
  222. For each light in BumperLights:light.state=1:Next
  223. for i = 1 to 9
  224. DTlights(i-1).state=1
  225. Next
  226. credittxt.setvalue(credit+1)
  227. If credit+1>0 or freeplay=1 then DOF 137, DOFOn
  228. attract=1
  229. gamov.text="Game Over"
  230. if B2SOn then
  231. if freeplay <> 1 then
  232. if credit<10 then
  233. Controller.B2ssetreel 30, Credit
  234. Controller.B2Ssetreel 29, 0
  235. else
  236. Controller.B2ssetreel 30, Credit-10
  237. Controller.B2Ssetreel 29, 1
  238. end if
  239. end if
  240. Controller.B2SSetGameOver 35,1
  241. end if
  242. gamov.timerenabled=1
  243. Lgi.timerenabled=1
  244. me.enabled=false
  245. end sub
  246.  
  247. ' Display text, style(1-norm, 2-flash), screen(1-player 1, 2-player 2,3-both), justify (0 left, 1-right,2-full), time, textR
  248.  
  249. sub makedispcount(dis,sty) 'used to add spaces to put scoring in correct position, dis=player, sty=style, pegs in right 4 digits, games in left 2
  250. select case len(games(dis))
  251. case 1: dispcount(dis)=" "&games(dis)
  252. case 2: dispcount(dis)=games(dis)
  253. case 3: dispcount(dis)=99
  254. end Select
  255. Display dispcount(dis),sty,dis,2,0,pegs(dis)
  256. end sub
  257.  
  258. sub makedispcount2(dis,sty) 'used to add spaces to put scoring in correct position, dis=player, sty=style, pegs in right 4 digits, games in left 2
  259. select case len(games(dis))
  260. case 1: dispcount2(dis)=" "&games(dis)
  261. case 2: dispcount2(dis)=games(dis)
  262. case 3: dispcount2(dis)=99
  263. end Select
  264. Display2 dispcount2(dis),sty,dis,2,0,pegs(dis)
  265. end sub
  266.  
  267. sub a1_timer
  268. Select Case (attract)
  269. Case 1:
  270. makedispcount 1,1
  271. makedispcount 2,1
  272. Case 2:
  273. Display "HI PEG",1,1,0,0,""
  274. Display hipg,1,2,2,0,chr(HSA1)&chr(HSA2)&chr(HSA3)
  275. Case 3:
  276. Display "HI GMS",1,1,0,0,""
  277. Display higm,1,2,2,0,chr(HGA1)&chr(HGA2)&chr(HGA3)
  278. End Select
  279. attract=attract+1
  280. if attract>3 then attract=1
  281. end sub
  282.  
  283.  
  284. sub gamov_timer
  285. if state=false then
  286. gtimer.enabled=true
  287. end if
  288. If B2SOn then Controller.B2SSetGameOver 35,0
  289. gamov.text=""
  290. gamov.timerenabled=0
  291. end sub
  292.  
  293. sub gtimer_timer
  294. if state=false then
  295. gamov.text="Game Over"
  296. If B2SOn then Controller.B2SSetGameOver 35,1
  297. gamov.timerenabled=1
  298. gamov.timerinterval= (INT (RND*10)+5)*100
  299. Else
  300. If B2SOn then Controller.B2SSetGameOver 35,0
  301. end if
  302. me.enabled=0
  303. end sub
  304.  
  305.  
  306. Sub nobs_KeyDown(ByVal keycode)
  307.  
  308. 'if keycode=leftmagnasave then
  309. ' chimetime=0
  310. ' ChimeInit.enabled=1
  311. 'end if
  312. '
  313. 'if keycode=rightmagnasave then
  314. ' chimetime1=0
  315. ' ChimeInit1.enabled=1
  316. 'end if
  317.  
  318. if keycode=AddCreditKey then
  319. if freeplay=1 or credit=9 then
  320. PlaySoundAt "coinout", Drain
  321. else
  322. PlaySoundAt "coinin", Drain
  323. addcredit
  324. end if
  325. end if
  326.  
  327. if keycode=StartGameKey and (credit>0 or freeplay=1) and operatormenu=0 And Not (HSEnterMode=true OR HGEnterMode=true) then
  328. if state=false then
  329. tilt=false
  330. state=true
  331. if freeplay=0 then
  332. credit=credit-1
  333. credittxt.setvalue(credit+1)
  334. if credit+1 < 1 then DOF 137, DOFOff
  335. end if
  336. ballinplay=1
  337. for i = 1 to maxplayers
  338. games(i)=0
  339. Count(i)=0
  340. pegs(i)=0
  341. rep(i)=0
  342. pups(i).state=0
  343. next
  344. If B2SOn Then
  345. if freeplay <> 1 then
  346. if credit<10 then
  347. Controller.B2ssetreel 30, Credit
  348. Controller.B2Ssetreel 29, 0
  349. else
  350. Controller.B2ssetreel 30, Credit-10
  351. Controller.B2Ssetreel 29, 1
  352. end if
  353. end if
  354. Controller.B2SSetReel 20, ballinplay
  355. Controller.B2ssetplayerup 30, 1
  356. Controller.B2ssetcanplay 31, 1
  357. Controller.B2SSetGameOver 35, 0
  358. for i = 1 to 4
  359. Controller.B2sSetScorePlayer i, 0
  360. next
  361. End If
  362.  
  363. pups(1).state=1
  364. pup1.timerenabled=1
  365. tilt=false
  366. state=true
  367. if chimesounds=1 Then
  368. chimetime=0
  369. ChimeInit.enabled=1
  370. 'playsound "initialize"
  371. end if
  372. players=1
  373. rst=0
  374. newgame.enabled=true
  375. else if state=true and players < maxplayers and Ballinplay=1 and pup1.timerenabled=0 then
  376. credit=credit-1
  377. players=players+1
  378. makedispcount2 2,1
  379. if freeplay=0 then
  380. credittxt.setvalue(credit+1)
  381. if credit+1 < 1 then DOF 137, DOFOff
  382. end if
  383. If B2SOn then
  384. if credit<10 then
  385. Controller.B2ssetreel 30, Credit
  386. Controller.B2Ssetreel 29, 0
  387. else
  388. Controller.B2ssetreel 30, Credit-10
  389. Controller.B2Ssetreel 29, 1
  390. end if
  391. Controller.B2ssetcanplay 31, players
  392. End If
  393. if chimesounds=1 Then
  394. chimetime1=0
  395. ChimeInit1.enabled=1
  396. end if 'playsound "init2"
  397. end if
  398. end if
  399. end if
  400.  
  401. If keycode = PlungerKey Then
  402. Plunger.PullBack
  403. PlaySoundAt "plungerpull", Plunger
  404. End If
  405.  
  406. If keycode=LeftFlipperKey and State = false and OperatorMenu=0 then
  407. OperatorMenuTimer.Enabled = true
  408. end if
  409.  
  410. If keycode=LeftFlipperKey and State = false and OperatorMenu=1 then
  411. Options=Options+1
  412. If Options=5 then Options=1
  413. playsound "target"
  414. Select Case (Options)
  415. Case 1:
  416. Option1.visible=true
  417. Option4.visible=False
  418. Case 2:
  419. Option2.visible=true
  420. Option1.visible=False
  421. Case 3:
  422. Option3.visible=true
  423. Option2.visible=False
  424. Case 4:
  425. Option4.visible=true
  426. Option3.visible=False
  427. End Select
  428. end if
  429.  
  430. If keycode=RightFlipperKey and State = false and OperatorMenu=1 then
  431. PlaySound "metalhit2"
  432. Select Case (Options)
  433. Case 1:
  434. if freeplay=0 Then
  435. freeplay=1
  436. credit=-1
  437. Else
  438. freeplay=0
  439. credit=0
  440. end if
  441. credittxt.setvalue(credit+1)
  442. OptionFree.image = "OptionsYN"&freeplay
  443. Case 2:
  444. if decks=1 then
  445. decks=2
  446. else if decks=2 Then
  447. decks=3
  448. else if decks=3 Then
  449. decks=4
  450. Else
  451. decks=1
  452. end if
  453. end If
  454. end if
  455. For each objekt in plastics: objekt.image = "plastics"&decks: Next
  456. OptionDeck.image = "OptionsDecks"&decks
  457. Case 3:
  458. if chimesounds=0 Then
  459. chimesounds=1
  460. Else
  461. chimesounds=0
  462. end If
  463. OptionChimes.image = "OptionsYN"&chimesounds
  464. Case 4:
  465. OperatorMenu=0
  466. savehs
  467. HideOptions
  468. End Select
  469. End If
  470.  
  471. If HSEnterMode or HGEnterMode Then HighScoreProcessKey(keycode)
  472.  
  473. if tilt=false and state=true then
  474. If keycode = LeftFlipperKey Then
  475. LeftFlipper.RotateToEnd
  476. PlaySoundAt SoundFXDOF("flipperup",101,DOFOn,DOFContactors), LeftFlipper
  477. End If
  478.  
  479. If keycode = RightFlipperKey Then
  480. RightFlipper.RotateToEnd
  481. PlaySoundAt SoundFXDOF("flipperup",102,DOFOn,DOFContactors), RightFlipper
  482. End If
  483.  
  484. If keycode = LeftTiltKey Then
  485. Nudge 90, 2
  486. checktilt
  487. End If
  488.  
  489. If keycode = RightTiltKey Then
  490. Nudge 270, 2
  491. checktilt
  492. End If
  493.  
  494. If keycode = CenterTiltKey Then
  495. Nudge 0, 2
  496. checktilt
  497. End If
  498.  
  499. If keycode = MechanicalTilt Then
  500. gametilted
  501. End If
  502.  
  503. end if
  504. End Sub
  505.  
  506. sub ChimeInit_timer
  507. Select Case Chimetime
  508. Case 2:
  509. PlaySound SoundFXDOF("100a",142, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  510. Case 40:
  511. PlaySound SoundFXDOF("100a",142, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  512. Case 68:
  513. PlaySound SoundFXDOF("1000a",143, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  514. Case 81:
  515. PlaySound SoundFXDOF("10a",141, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  516. Case 99:
  517. PlaySound SoundFXDOF("1000a",143, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  518. Case 113:
  519. PlaySound SoundFXDOF("10a",141, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  520. Case 126:
  521. PlaySound SoundFXDOF("100a",142, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  522. Case 140:
  523. PlaySound SoundFXDOF("1000a",143, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  524. Case 165:
  525. PlaySound SoundFXDOF("10a",141, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  526. Case 178:
  527. PlaySound SoundFXDOF("1000a",143, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  528. Case 180:
  529. me.enabled=0
  530. end Select
  531. Chimetime=Chimetime+1
  532. End sub
  533.  
  534. sub ChimeInit1_timer
  535. Select Case Chimetime1
  536. Case 3:
  537. PlaySound SoundFXDOF("100a",142, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  538. Case 16:
  539. PlaySound SoundFXDOF("1000a",143, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  540. Case 30:
  541. PlaySound SoundFXDOF("10a",141, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  542. Case 44:
  543. PlaySound SoundFXDOF("100a",142, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  544. Case 68:
  545. PlaySound SoundFXDOF("10a",141, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  546. Case 82:
  547. PlaySound SoundFXDOF("100a",142, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  548. Case 100:
  549. me.enabled=0
  550. end Select
  551. Chimetime1=Chimetime1+1
  552. End sub
  553.  
  554. sub pup1_timer
  555. pup1.timerenabled=0
  556. end sub
  557.  
  558. Sub OperatorMenuTimer_Timer
  559. OperatorMenu=1
  560. Displayoptions
  561. Options=1
  562. End Sub
  563.  
  564. Sub DisplayOptions
  565. OptionsBack.visible = true
  566. OptionFree.visible = true
  567. Option1.visible = True
  568. OptionDeck.visible = True
  569. OptionChimes.visible = True
  570. End Sub
  571.  
  572. Sub HideOptions
  573. for each objekt In OptionMenu
  574. objekt.visible = false
  575. next
  576. End Sub
  577.  
  578.  
  579. Sub nobs_KeyUp(ByVal keycode)
  580.  
  581. If keycode = PlungerKey Then
  582. Plunger.Fire
  583. if PlungeBall=1 then
  584. PlaySoundAt "plunger", Plunger
  585. else
  586. PlaySoundAt "plungerreleasefree", Plunger
  587. end if
  588. End If
  589.  
  590. if keycode = LeftFlipperKey then
  591. OperatorMenuTimer.Enabled = false
  592. end if
  593.  
  594. If tilt=false and state=true then
  595. If keycode = LeftFlipperKey Then
  596. LeftFlipper.RotateToStart
  597. PlaySoundAt SoundFXDOF("flipperdown",101,DOFOff,DOFContactors), LeftFlipper
  598. End If
  599.  
  600. If keycode = RightFlipperKey Then
  601. RightFlipper.RotateToStart
  602. PlaySoundAt SoundFXDOF("flipperdown",102,DOFOff,DOFContactors), RightFlipper
  603. End If
  604. End if
  605. End Sub
  606.  
  607. sub flippertimer_timer()
  608. LFlip.RotY = LeftFlipper.CurrentAngle
  609. RFlip.RotY = RightFlipper.CurrentAngle
  610. Pgate.rotz=(Gate.currentangle*.75)+25
  611. diverter.RotY = DiverterFlipper.CurrentAngle+90
  612. diverterL.RotY = DiverterFlipperL.CurrentAngle+90
  613.  
  614. if FlipperShadows=1 then
  615. FlipperLSh.RotZ = LeftFlipper.currentangle
  616. FlipperRSh.RotZ = RightFlipper.currentangle
  617. end if
  618.  
  619. end sub
  620.  
  621.  
  622. Sub addcredit
  623. if freeplay=0 then
  624. credit=credit+1
  625. DOF 137, DOFOn
  626. if credit>9 then credit=9
  627. credittxt.setvalue(credit+1)
  628. If B2SOn Then
  629. if credit<10 then
  630. Controller.B2ssetreel 30, Credit
  631. Controller.B2Ssetreel 29, 0
  632. else
  633. Controller.B2ssetreel 30, Credit-10
  634. Controller.B2Ssetreel 29, 1
  635. end if
  636. end if
  637. end if
  638. End sub
  639.  
  640. Sub Drain_Hit()
  641. DOF 134, DOFPulse
  642. PlaySoundAt "drain", Drain
  643. b2sflash.uservalue=2 'turn off flash
  644. B2SFlash2.uservalue=2
  645. if shootagain.state=0 then for each light in GIlights: light.state=0: next
  646. me.timerenabled=1
  647. End Sub
  648.  
  649. Sub Drain_timer
  650. makedispcount player,1
  651. if shootagain.state=1 and tilt=false then
  652. if LD1.state+LD2.state+LD3.state+LD4.state=4 then
  653. for each light in doublelights:light.state=0:next
  654. end if
  655. skillcheck=0
  656. skillshot=1
  657. plunger.timerenabled=true
  658. else
  659. if players=1 or player=players then
  660. player=1
  661. pups(players).state=0
  662. pups(player).state=1
  663. Else
  664. player=player+1
  665. pups(player).state=1
  666. pups(player-1).state=0
  667. end if
  668. If B2SOn then Controller.B2ssetplayerup 30, player
  669. nextball
  670. end if
  671. me.timerenabled=0
  672. End Sub
  673.  
  674. sub ballhome_hit
  675. plungeball=1
  676. end sub
  677.  
  678. sub ballhome_unhit
  679. DOF 136, DOFPulse
  680. plungeball=0
  681. end sub
  682.  
  683.  
  684. ' Display text, style(1-norm, 2-flash), screen(1-top, 2-bot,3-both), justify (0 left, 1-right,2-full), time, textR
  685.  
  686. sub newgame_timer
  687. bumper1.hashitevent=True
  688. bumper2.hashitevent=True
  689. RightSlingShot.disabled=False
  690. player=1
  691. pegani.enabled=0
  692. a1.timerenabled=0
  693. makedispcount 1,1
  694. Display "",1,2,0,0,""
  695. LightSeq1.StopPlay()
  696. for each light in BumperLights:light.state=1:Next
  697. for each light in peg1:light.state=0:Next
  698. for each light in peg2:light.state=0:Next
  699. pups(1).state=1
  700. If B2SOn then
  701. Controller.B2SSetGameOver 35,0
  702. Controller.B2SSetTilt 33,0
  703. End If
  704. eg=0
  705. shootagain.state=lightstateoff
  706. tilttxt.text=" "
  707. gamov.text=" "
  708. ballreltimer.enabled=true
  709. newgame.enabled=false
  710. end sub
  711.  
  712. sub resetDT_timer
  713. Select Case DTStep
  714. Case 1:
  715. PlaySoundAt SoundFXDOF("bankreset", 116, DOFPulse, DOFContactors), DT4
  716. for i = 1 to 4
  717. target(i).isdropped=False
  718. DTlights(i-1).state=0
  719. Next
  720. Case 2:
  721. PlaySoundAt SoundFXDOF("bankreset", 117, DOFPulse, DOFContactors), DT3
  722. for i = 5 to 7
  723. target(i).isdropped=False
  724. DTlights(i-1).state=0
  725. Next
  726. Case 3:
  727. PlaySoundAt SoundFXDOF("bankreset", 118, DOFPulse, DOFContactors), DT6A
  728. for i = 8 to 9
  729. target(i).isdropped=False
  730. DTlights(i-1).state=0
  731. Next
  732. Case 4:
  733. newball
  734. resetDT.enabled=False
  735. end Select
  736. DTStep=DTStep+1
  737. end sub
  738.  
  739. sub newball
  740. extraball.state=0
  741. eball=0
  742. for each light in cardlights:light.state=1:next
  743. for each light in doublelights:light.state=0:next
  744. for each light in handlights:light.state=0:next
  745. for each light in starlights:light.state=0:next
  746. for each light in GIlights:light.state=1:next
  747. skillshot=1
  748. skillcheck=0
  749. for each light in skillshotlights:light.state=0:next
  750. Select Case Int(Rnd*3)+1
  751. Case 1 : LK.state=2
  752. Case 2 : LQ.state=2
  753. Case 3 : LJ.state=2
  754. End Select
  755. End Sub
  756.  
  757.  
  758. sub nextball
  759. if tilt=true then
  760. RightSlingShot.disabled=false
  761. bumper1.hashitevent=True
  762. bumper2.hashitevent=True
  763. tilt=false
  764. tilttxt.text=" "
  765. If B2SOn then
  766. Controller.B2SSetTilt 33,0
  767. Controller.B2ssetdata 1, 1
  768. End If
  769. end if
  770. if player=1 then ballinplay=ballinplay+1
  771. if ballinplay>balls then
  772. eg=1
  773. ballreltimer.enabled=true
  774. else
  775. if state=true then
  776. ballreltimer.enabled=true
  777. end if
  778. end if
  779. End Sub
  780.  
  781. sub ballreltimer_timer
  782. if eg=1 then
  783. turnoff
  784. state=false
  785. BipReel.setvalue(0)
  786. gamov.text="GAME OVER"
  787. gamov.timerenabled=1
  788. ii=0
  789. for i=1 to players
  790. pups(i).state=0
  791. next
  792. if pegs(1)>hipg or pegs(2)>hipg then
  793. HStimer.uservalue=0
  794. HStimer.enabled=1
  795. if pegs(2)>pegs(1) then
  796. hipg=pegs(2)
  797. HighPegEntryInit 2
  798. else
  799. hipg=pegs(1)
  800. HighPegEntryInit 1
  801. end if
  802. end if
  803. if games(1)>higm or games(2)>higm then
  804. if HStimer.enabled = 0 then
  805. HStimer.uservalue=0
  806. HStimer.enabled=1
  807. end if
  808. if games(2)>games(1) then
  809. higm=games(2)
  810. NewHG=2
  811. else
  812. higm=games(1)
  813. NEWHG=1
  814. end if
  815. If HSEnterMode <> True then HighGamesEntryInit NewHG
  816. end if
  817. If HSEnterMode = False and HGEnterMode = False then
  818. Lgi.timerenabled=1
  819. a1.timerenabled=1
  820. end if
  821. for each light in GIlights:light.state=1:next
  822. savehs
  823. If B2SOn then
  824. Controller.B2SSetGameOver 35,1
  825. Controller.B2SSetReel 20, 0
  826. Controller.B2ssetcanplay 31, 0
  827. Controller.B2ssetcanplay 30, 0
  828. End If
  829. For each light in LaneLights:light.State = 0: Next
  830. ballreltimer.enabled=false
  831. else
  832. DTstep=1
  833. resetDT.enabled=true
  834. plunger.timerenabled=true
  835. ballreltimer.enabled=false
  836. end if
  837. end sub
  838.  
  839. Sub HStimer_timer
  840. playsoundat SoundFXDOF("knock",138,DOFPulse,DOFKnocker), Plunger
  841. DOF 139,DOFPulse
  842. HStimer.uservalue=HStimer.uservalue+1
  843. if hstimer.uservalue=3 then me.enabled=0
  844. end sub
  845.  
  846. Sub plunger_timer
  847. Drain.kick 60, 11,0
  848. playsoundat SoundFXDOF("kickerkick",135,DOFPulse,DOFContactors), Drain
  849. DOF 135, DOFPulse
  850. BipReel.setvalue(ballinplay+1)
  851. makedispcount player,2
  852. if ShootAgain.state=1 then
  853. extraball.state=0
  854. eball=0
  855. end if
  856. If B2SOn then Controller.B2SSetReel 20, ballinplay
  857. Plunger.timerenabled=false
  858. end sub
  859.  
  860.  
  861. '********** Bumpers
  862.  
  863. Sub Bumper1_Hit
  864. if tilt=false then
  865. PlaySoundAt SoundFXDOF("fx_bumper4",107,DOFPulse,DOFContactors), Bumper1
  866. DOF 108,DOFPulse
  867. FlashBumpers
  868. addscore 100
  869. end if
  870. End Sub
  871.  
  872. Sub Bumper2_Hit
  873. if tilt=false then
  874. PlaySoundAt SoundFXDOF("fx_bumper4",109,DOFPulse,DOFContactors), Bumper2
  875. DOF 110,DOFPulse
  876. FlashBumpers
  877. addscore 100
  878. end if
  879. End Sub
  880.  
  881.  
  882. sub FlashBumpers
  883. if bumperlight1.state = 1 then
  884. for each light in BumperLights: light.duration 0, 200, 1:Next
  885. end If
  886. end sub
  887.  
  888.  
  889. '************** Slings and animated rubbers
  890.  
  891. Sub RightSlingShot_Slingshot
  892. PlaySoundAt SoundFXDOF("slingshot",105,DOFPulse,DOFContactors), slingR
  893. DOF 106,DOFPulse
  894. addscore 10
  895. RSling.Visible = 0
  896. RSling1.Visible = 1
  897. slingR.objroty = -15
  898. RStep = 1
  899. RightSlingShot.TimerEnabled = 1
  900. End Sub
  901.  
  902. Sub RightSlingShot_Timer
  903. Select Case RStep
  904. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:slingR.objroty = -7
  905. Case 4: slingR.objroty = 0:RSLing2.Visible = 0:RSLing.Visible = 1:RightSlingShot.TimerEnabled = 0
  906. End Select
  907. RStep = RStep + 1
  908. End Sub
  909.  
  910. sub Dingwalls_hit(idx)
  911. addscore 10
  912. end sub
  913.  
  914. sub dingwall1_hit
  915. rdw1.visible=0
  916. RDW1a.visible=1
  917. dw1step=1
  918. Me.timerenabled=1
  919. end sub
  920.  
  921. sub dingwall1_timer
  922. select case dw1step
  923. Case 1: RDW1a.visible=0: rdw1.visible=1
  924. case 2: rdw1.visible=0: rdw1b.visible=1
  925. Case 3: rdw1b.visible=0: rdw1.visible=1: Me.timerenabled=0
  926. end Select
  927. dw1step=dw1step+1
  928. end sub
  929.  
  930. sub dingwall2_hit
  931. rdw2.visible=0
  932. RDW2a.visible=1
  933. dw2step=1
  934. Me.timerenabled=1
  935. end sub
  936.  
  937. sub dingwall2_timer
  938. select case dw2step
  939. Case 1: RDW2a.visible=0: rdw2.visible=1
  940. case 2: rdw2.visible=0: rdw2b.visible=1
  941. Case 3: rdw2b.visible=0: rdw2.visible=1: me.timerenabled=0
  942. end Select
  943. dw2step=dw2step+1
  944. end sub
  945.  
  946. sub dingwall3_hit
  947. rdw3.visible=0
  948. RDW3a.visible=1
  949. dw3step=1
  950. Me.timerenabled=1
  951. end sub
  952.  
  953. sub dingwall3_timer
  954. select case dw3step
  955. Case 1: RDW3a.visible=0: rdw3.visible=1
  956. case 2: rdw3.visible=0: rdw3b.visible=1
  957. Case 3: rdw3b.visible=0: rdw3.visible=1: me.timerenabled=0
  958. end Select
  959. dw3step=dw3step+1
  960. end sub
  961.  
  962. sub dingwall4_hit
  963. lsling.visible=0
  964. lsling1.visible=1
  965. dw4step=1
  966. me.timerenabled=1
  967. end sub
  968.  
  969. sub dingwall4_timer
  970. select case dw4step
  971. Case 1: lsling1.visible=0: lsling.visible=1
  972. case 2: lsling.visible=0: lsling2.visible=1
  973. Case 3: lsling2.visible=0: lsling.visible=1: me.timerenabled=0
  974. end Select
  975. dw4step=dw4step+1
  976. end sub
  977.  
  978. sub dingwall5_hit
  979. rdw5.visible=0
  980. RDW5a.visible=1
  981. dw5step=1
  982. Me.timerenabled=1
  983. end sub
  984.  
  985. sub dingwall5_timer
  986. select case dw5step
  987. Case 1: RDW5a.visible=0: rdw5.visible=1
  988. case 2: rdw5.visible=0: rdw5b.visible=1
  989. Case 3: rdw5b.visible=0: rdw5.visible=1: me.timerenabled=0
  990. end Select
  991. dw5step=dw5step+1
  992. end sub
  993.  
  994. sub dingwall6_hit
  995. rdw6.visible=0
  996. RDW6a.visible=1
  997. dw6step=1
  998. Me.timerenabled=1
  999. end sub
  1000.  
  1001. sub dingwall6_timer
  1002. select case dw6step
  1003. Case 1: RDW6a.visible=0: rdw6.visible=1
  1004. case 2: rdw6.visible=0: rdw6b.visible=1
  1005. Case 3: rdw6b.visible=0: rdw6.visible=1: me.timerenabled=0
  1006. end Select
  1007. dw6step=dw6step+1
  1008. end sub
  1009.  
  1010. '********** Triggers
  1011.  
  1012. sub skillshotoff(shot)
  1013. b2sflash.uservalue=2
  1014. makedispcount player,1
  1015. if shootagain.state=1 then
  1016. shootagain.state=0
  1017. else
  1018. DiverterFlipper.RotateToStart
  1019. DiverterFlipperL.RotateToStart
  1020. for each light in skillshotlights
  1021. light.state=1
  1022. Next
  1023. end if
  1024. Select Case shot
  1025. Case 1 : LK.state=0
  1026. Case 2 : LQ.state=0
  1027. Case 3 : LJ.state=0
  1028. ' Case 4 :
  1029. End Select
  1030. skillshot=0
  1031. end Sub
  1032.  
  1033.  
  1034. sub TGK_hit '***** top King rollover
  1035. DOF 128, DOFPulse
  1036. LBH4K.state=1
  1037. Lstar1.state=1
  1038. skillcheck=1
  1039. hand4check rotopos, 13
  1040. if LK.state=1 or LK.state=2 then
  1041. if LK.state=2 then addcount 2
  1042. eball=eball+1
  1043. checkeball
  1044. addscore 1000
  1045. LK.state=0
  1046. else
  1047. addscore 100
  1048. end if
  1049. if skillshot=1 then skillshotoff 1
  1050. end sub
  1051.  
  1052. sub TGQ_hit '***** top Queen rollover
  1053. DOF 129, DOFPulse
  1054. LBH4Q.state=1
  1055. Lstar2.state=1
  1056. skillcheck=1
  1057. hand4check rotopos, 12
  1058. if LQ.state=1 or LQ.state=2 then
  1059. if LQ.state=2 then addcount 2
  1060. eball=eball+1
  1061. checkeball
  1062. addscore 1000
  1063. LQ.state=0
  1064. else
  1065. addscore 100
  1066. end if
  1067. if skillshot=1 then skillshotoff 2
  1068. end sub
  1069.  
  1070. sub TGJ_hit '***** top Jack rollover
  1071. DOF 130, DOFPulse
  1072. LBH4J.state=1
  1073. Lstar3.state=1
  1074. skillcheck=1
  1075. hand4check rotopos, 11
  1076. if LJ.state=1 or LJ.state=2 then
  1077. if LJ.state=2 then addcount 2
  1078. eball=eball+1
  1079. checkeball
  1080. addscore 1000
  1081. LJ.state=0
  1082.  
  1083. else
  1084. addscore 100
  1085. end if
  1086. if skillshot=1 then skillshotoff 3
  1087. end sub
  1088.  
  1089. sub TG2_hit '***** right 2 rollover
  1090. DOF 131, DOFPulse
  1091. LBH22B.state=1
  1092. hand2check rotopos, 2
  1093. if (L2.state)=lightstateon then
  1094. eball=eball+1
  1095. checkeball
  1096. addscore 1000
  1097. L2.state=0
  1098. else
  1099. addscore 100
  1100. end if
  1101. end sub
  1102.  
  1103. sub TG7_hit '***** left 7 rollover
  1104. DOF 121, DOFPulse
  1105. LBh37.state=1
  1106. hand3check rotopos, 7
  1107. if (L7.state)=lightstateon then
  1108. eball=eball+1
  1109. checkeball
  1110. addscore 1000
  1111. L7.state=0
  1112. Lstar4.state=1
  1113. else
  1114. addscore 100
  1115. end if
  1116. end sub
  1117.  
  1118. sub TG8_hit '***** right 8 rollover
  1119. DOF 122, DOFPulse
  1120. LBh38.state=1
  1121. hand3check rotopos, 8
  1122. if (L8.state)=lightstateon then
  1123. eball=eball+1
  1124. checkeball
  1125. addscore 1000
  1126. L8.state=0
  1127. Lstar5.state=1
  1128. else
  1129. addscore 100
  1130. end if
  1131. end sub
  1132.  
  1133. sub checkeball
  1134. if eball>5 and ShootAgain.state=0 Then
  1135. extraball.state=1
  1136. DiverterFlipper.timerenabled=1
  1137. end if
  1138. end Sub
  1139.  
  1140. sub DiverterFlipper_timer
  1141. DiverterFlipper.RotateToEnd
  1142. DiverterFlipper.timerenabled=0
  1143. end Sub
  1144.  
  1145. sub TG5_hit '***** left 5 rollover
  1146. DOF 120, DOFPulse
  1147. hand4check rotopos, 5
  1148. if (L5.state)=lightstateon then
  1149. addscore 1000
  1150. L5.state=0
  1151. else
  1152. addscore 100
  1153. end if
  1154. LBH45.state=1
  1155. DiverterFlipperL.timerenabled=1
  1156. end sub
  1157.  
  1158. sub DiverterFlipperL_timer
  1159. DiverterFlipperL.RotateToEnd
  1160. DiverterFlipperL.timerenabled=0
  1161. end Sub
  1162.  
  1163. sub TGstar1_hit '*****star rollover
  1164. DOF 123, DOFPulse
  1165. if (Lstar1.state)=lightstateon then
  1166. addscore 1000
  1167. addcount(1)
  1168. else
  1169. addscore 100
  1170. end if
  1171. end Sub
  1172.  
  1173. sub TGstar2_hit '*****star rollover
  1174. DOF 124, DOFPulse
  1175. if (Lstar2.state)=lightstateon then
  1176. addscore 1000
  1177. addcount(1)
  1178. else
  1179. addscore 100
  1180. end if
  1181. end Sub
  1182.  
  1183. sub TGstar3_hit '*****star rollover
  1184. DOF 125, DOFPulse
  1185. if (Lstar3.state)=lightstateon then
  1186. addscore 1000
  1187. addcount(1)
  1188. else
  1189. addscore 100
  1190. end if
  1191. end Sub
  1192.  
  1193. sub TGstar4_hit '*****star rollover
  1194. DOF 126, DOFPulse
  1195. if (Lstar4.state)=lightstateon then
  1196. addscore 1000
  1197. addcount(1)
  1198. else
  1199. addscore 100
  1200. end if
  1201. end Sub
  1202.  
  1203. sub TGstar5_hit '*****star rollover
  1204. DOF 127, DOFPulse
  1205. if (Lstar5.state)=lightstateon then
  1206. addscore 1000
  1207. addcount(1)
  1208. else
  1209. addscore 100
  1210. end if
  1211. end Sub
  1212.  
  1213. sub hand1check(pos1, hit1)
  1214. dim hand1, check1
  1215. if pos1>9 then
  1216. check1=10
  1217. else
  1218. check1=pos1
  1219. end if
  1220. hand1=LBH14.state+LBH15b.state+LBH15.state+LBH16.state
  1221. if hand1=4 then
  1222. select case(pos1)
  1223. case 1,3,7,9:
  1224. addcount(14)
  1225. case 2,8:
  1226. addcount(12)
  1227. case 4, 6:
  1228. addcount(24)
  1229. case 5:
  1230. addcount(21)
  1231. case 10,11,12,13:
  1232. addcount(16)
  1233. end Select
  1234. for each light in hand1lights:light.duration 2, 3000, 1:Next
  1235. for each light in hand1Blights:light.duration 2, 3000, 0:Next
  1236. LD1.state=1
  1237. if DT5.timerenabled=false then dt5.timerenabled=True
  1238. else
  1239. IF pos1=hit1 or hit1+check1=15 then addcount 2
  1240. end If
  1241. end Sub
  1242.  
  1243. sub DT5_timer
  1244. for i= 1 to 4:target(i).isdropped=0:Next
  1245. PlaySoundAt SoundFXDOF("bankreset", 116, DOFPulse, DOFContactors), DT4
  1246. for each light in hand1dtlights:light.state=0:Next
  1247. dt5.timerenabled=0
  1248. end sub
  1249.  
  1250. sub hand2check(pos2, hit2)
  1251. dim hand2, check2
  1252. if pos2>9 then
  1253. check2=10
  1254. else
  1255. check2=pos2
  1256. end if
  1257. hand2=LBH23.state+LBH22.state+LBH22B.state+LBH2A.state
  1258. if hand2=4 then
  1259. select case(pos2)
  1260. case 1,3
  1261. addcount(16)
  1262. case 9
  1263. addcount(12)
  1264. case 10,11,12,13:
  1265. addcount(14)
  1266. case 2:
  1267. addcount(15)
  1268. case 4,7,8:
  1269. addcount(10)
  1270. case 5,6:
  1271. addcount(8)
  1272. end Select
  1273. for each light in hand2lights:light.duration 2, 3000, 1:Next
  1274. for each light in hand2Blights:light.duration 2, 3000, 0:Next
  1275. ld2.state=1
  1276. if DTa.timerenabled=false then DTa.timerenabled=True
  1277. else
  1278. IF pos2=hit2 or hit2+check2=15 then addcount 2
  1279. end If
  1280. end Sub
  1281.  
  1282. sub DTa_timer
  1283. for i= 5 to 7:target(i).isdropped=0:Next
  1284. PlaySoundAt SoundFXDOF("bankreset", 117, DOFPulse, DOFContactors), DT3
  1285. for each light in hand2dtlights:light.state=0:Next
  1286. DTa.timerenabled=0
  1287. end sub
  1288.  
  1289.  
  1290. sub hand3check(pos3, hit3)
  1291. dim hand3, check3
  1292. if pos3>9 then
  1293. check3=10
  1294. else
  1295. check3=pos3
  1296. end if
  1297. hand3=LBH39.state+LBH38.state+LBH37.state+LbH36.state
  1298. if hand3=4 Then
  1299. select case(pos3)
  1300. case 1, 2:
  1301. addcount(10)
  1302. case 3,4,11,12,13:
  1303. addcount(8)
  1304. case 5,10:
  1305. addcount(9)
  1306. case 6,7,8,9:
  1307. addcount(16)
  1308. end Select
  1309. for each light in hand3lights:light.duration 2, 3000, 1:Next
  1310. for each light in hand3Blights:light.duration 2, 3000, 0:Next
  1311. LD3.state=1
  1312. if DT6a.timerenabled=false then DT6a.timerenabled=True
  1313. else
  1314. IF pos3=hit3 or hit3+check3=15 then addcount 2
  1315. end if
  1316. end Sub
  1317.  
  1318. sub dt6a_timer
  1319. for i= 8 to 9:target(i).isdropped=0:Next
  1320. PlaySoundAt SoundFXDOF("bankreset", 118, DOFPulse, DOFContactors), DT6A
  1321. for each light in hand3DTlights:light.state=0:Next
  1322. DT6a.timerenabled=0
  1323. end Sub
  1324.  
  1325. sub hand4check(pos4, hit4)
  1326. dim hand4, check4, check4b
  1327. if pos4>9 then
  1328. check4=10
  1329. else
  1330. check4=pos4
  1331. end if
  1332. if hit4>9 then
  1333. check4b=10
  1334. else
  1335. check4b=hit4
  1336. end if
  1337. hand4=LBH4K.state+LBH4Q.state+LBH4J.state+LBH45.state
  1338. if hand4=4 Then
  1339. select Case(pos4)
  1340. case 1,2,3,4,6,7,8,9:
  1341. addcount(9)
  1342. case 5:
  1343. addcount(17)
  1344. case 10:
  1345. addcount(12)
  1346. : case 11,12,13:
  1347. addcount(16)
  1348. end Select
  1349. for each light in hand4lights:light.duration 2, 3000, 1:Next
  1350. for each light in hand4Blights:light.duration 2, 3000, 0:Next
  1351. LD4.state=1
  1352. if LK.timerenabled=false then LK.timerenabled=True
  1353. else
  1354. IF pos4=hit4 or check4b+check4=15 then addcount 2
  1355. end if
  1356. end Sub
  1357.  
  1358. sub lk_timer
  1359. If (LD1.state+LD2.state+LD3.state+LD4.state) <> 4 then DiverterFlipperL.RotateToStart
  1360. LK.timerenabled=0
  1361. end Sub
  1362.  
  1363. '********** Drop Targets
  1364.  
  1365. sub DropTargets_dropped (idx)
  1366. PlaySoundAtBall "drop1"
  1367. end Sub
  1368.  
  1369. sub DTa_dropped
  1370. DOF 112, DOFPulse
  1371. if state=true then
  1372. addscore 1000
  1373. ldta.state=1
  1374. lbh2a.state=1
  1375. hand2check rotopos, 1
  1376. end If
  1377. end sub
  1378.  
  1379. sub DT2_dropped
  1380. DOF 112, DOFPulse
  1381. if state=true then
  1382. addscore 1000
  1383. Ldt2.state=1
  1384. LBh22.state=1
  1385. hand2check rotopos, 2
  1386. end if
  1387. end sub
  1388.  
  1389. sub DT3_dropped
  1390. DOF 112, DOFPulse
  1391. if state=true then
  1392. addscore 1000
  1393. Ldt3.state=1
  1394. Lbh23.state=1
  1395. hand2check rotopos, 3
  1396. end if
  1397. end sub
  1398.  
  1399. sub DT4_dropped
  1400. DOF 111, DOFPulse
  1401. if state=true then
  1402. addscore 1000
  1403. ldt4.state=1
  1404. Lbh14.state=1
  1405. hand1check rotopos, 4
  1406. end if
  1407. end sub
  1408.  
  1409. sub DT5_dropped
  1410. DOF 111, DOFPulse
  1411. if state=true then
  1412. addscore 1000
  1413. ldt5.state=1
  1414. LBH15.state=1
  1415. hand1check rotopos, 5
  1416. end if
  1417. end sub
  1418.  
  1419. sub DT5b_dropped
  1420. DOF 111, DOFPulse
  1421. if state=true then
  1422. addscore 1000
  1423. ldt5b.state=1
  1424. LBH15B.state=1
  1425. hand1check rotopos, 5
  1426. end if
  1427. end sub
  1428.  
  1429. sub DT6_dropped
  1430. DOF 111, DOFPulse
  1431. if state=true then
  1432. addscore 1000
  1433. Ldt6.state=1
  1434. Lbh16.state=1
  1435. hand1check rotopos, 6
  1436. end If
  1437. end sub
  1438.  
  1439. sub DT6A_dropped
  1440. DOF 112, DOFPulse
  1441. if state=true then
  1442. addscore 1000
  1443. ldt6a.state=1
  1444. LBh36.state=1
  1445. hand3check rotopos, 6
  1446. end If
  1447. end sub
  1448.  
  1449. sub DT9_dropped
  1450. DOF 112, DOFPulse
  1451. if state=true then
  1452. addscore 1000
  1453. Ldt9.state=1
  1454. LBH39.state=1
  1455. hand3check rotopos, 9
  1456. end if
  1457. end sub
  1458.  
  1459. '********** Targets
  1460.  
  1461. sub Turn_hit()
  1462. if rotopos>9 Then
  1463. addcount(10)
  1464. Else
  1465. addcount(rotopos)
  1466. end If
  1467. if Turn.timerenabled=false Then Turn.timerenabled=True
  1468. end Sub
  1469.  
  1470. sub TSpin_hit()
  1471. addcount(1)
  1472. if Extraball.state=1 then
  1473. playsound "gong"
  1474. ShootAgain.state=1
  1475. extraball.state=0
  1476. end If
  1477. if Turn.timerenabled=false Then turn.timerenabled=True
  1478. end Sub
  1479.  
  1480. sub Turn_timer()
  1481. if moveroto.timerenabled=false then
  1482. if rotopos>rotospin then
  1483. Rotopos=rotopos-rotospin
  1484. Else
  1485. Rotopos=(13+rotopos)-rotospin
  1486. end if
  1487. if rotopos=11 then addcount(2)
  1488. rotocount=0
  1489. spinit=rotospin
  1490. rotospin=rotospin+1
  1491. if rotospin>13 then rotospin=1
  1492. DOF 115, DOFOn
  1493. PlaySoundAt SoundFX("motor",DOFGear), RotoTarget
  1494. moveroto.timerenabled=1
  1495. Turn.timerenabled=false
  1496. Else
  1497. Turn.timerenabled=false
  1498. end if
  1499. end Sub
  1500.  
  1501. sub moveroto_timer
  1502. RotoLight.state=2
  1503. Lgi8.state=0
  1504. rotocount=rotocount+1
  1505. if rotocount=(spinit*4)+53 then
  1506. rotolight.state=0
  1507. lgi8.state=1
  1508. moveroto.timerenabled=False
  1509. DOF 115, DOFOff
  1510. StopSound "motor"
  1511. Else
  1512. RotoTarget.roty=RotoTarget.roty+(360/52)
  1513. end if
  1514. end sub
  1515.  
  1516.  
  1517. sub addcount(peg)
  1518. If ld1.state+ld2.state+ld3.state+ld4.state=4 then peg=peg*2
  1519. PlaySoundAt "woodpeg", Plunger
  1520. pegstart=Count(player)
  1521. Count(player)=Count(player)+peg
  1522. pegs(player)=pegs(player)+peg
  1523. if Count(player)>120 Then
  1524. playsoundat soundFXDOF("gong", 144, DOFPulse, DOFBell), TG5
  1525. ShootAgain.state=1
  1526. games(player)=games(player)+1
  1527.  
  1528. if players=2 then 'check for skunks 2 player game only
  1529. if player=1 and count(2)<60 Then
  1530. HStimer.uservalue=1
  1531. HStimer.enabled=1
  1532. games(1)=games(1)+3
  1533. else if player=1 and count(2)<90 Then
  1534. PlaySoundAt SoundFXDOF("knock",138,DOFPulse,DOFKnocker), Plunger
  1535. DOF 139, DOFPulse
  1536. games(1)=games(1)+1
  1537. end If
  1538. end If
  1539. if player=2 and Count(1)<60 Then
  1540. HStimer.uservalue=1
  1541. HStimer.enabled=1
  1542. games(2)=games(2)+3
  1543. else if player=2 and count(1)<90 Then
  1544. PlaySoundAt SoundFXDOF("knock",138,DOFPulse,DOFKnocker), Plunger
  1545. DOF 139, DOFPulse
  1546. games(2)=games(2)+1
  1547. end If
  1548. end If
  1549. end if
  1550.  
  1551. for each light in Peg1:light.state=0: Next
  1552. for each light in Peg2:light.state=0:Next
  1553. Count(1)=0
  1554. Count(2)=0
  1555. Else
  1556. for i = pegstart+1 to Count(player)
  1557. if player=1 then Peg1(i-1).duration 2, 3000, 1
  1558. if player=2 then Peg2(i-1).duration 2, 3000, 1
  1559. Next
  1560. end If
  1561.  
  1562. makedispcount player,1
  1563. end Sub
  1564.  
  1565. sub addscore(points)
  1566. if skillcheck=0 then
  1567. skillcheck=1
  1568. skillshotoff 4
  1569. end if
  1570. if tilt=false then
  1571. If Points < 100 and AddScore10Timer.enabled = false Then
  1572. Add10 = Points \ 10
  1573. rotospin=rotospin+1
  1574. if rotospin>13 then rotospin=1
  1575. AddScore10Timer.Enabled = TRUE
  1576. ElseIf Points < 1000 and AddScore100Timer.enabled = false Then
  1577. Add100 = Points \ 100
  1578. AddScore100Timer.Enabled = TRUE
  1579. ElseIf AddScore1000Timer.enabled = false Then
  1580. Add1000 = Points \ 1000
  1581. AddScore1000Timer.Enabled = TRUE
  1582. End If
  1583. end if
  1584. End Sub
  1585.  
  1586. Sub AddScore10Timer_Timer()
  1587. if Add10 > 0 then
  1588. AddPoints 10
  1589. Add10 = Add10 - 1
  1590. Else
  1591. Me.Enabled = FALSE
  1592. End If
  1593. End Sub
  1594.  
  1595. Sub AddScore100Timer_Timer()
  1596. if Add100 > 0 then
  1597. AddPoints 100
  1598. Add100 = Add100 - 1
  1599. Else
  1600. Me.Enabled = FALSE
  1601. End If
  1602. End Sub
  1603.  
  1604. Sub AddScore1000Timer_Timer()
  1605. if Add1000 > 0 then
  1606. AddPoints 1000
  1607. Add1000 = Add1000 - 1
  1608. Else
  1609. Me.Enabled = FALSE
  1610. End If
  1611. End Sub
  1612.  
  1613. Sub AddPoints(Points)
  1614. if chimesounds=1 Then 'if chimesounds on then play sounds
  1615. ' Sounds: there are 3 sounds: tens, hundreds and thousands
  1616. If points = 1000 Then
  1617. PlaySound SoundFXDOF("bell1000",143, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  1618. elseif Points = 100 Then
  1619. PlaySound SoundFXDOF("bell100",142, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  1620.  
  1621. Else
  1622. PlaySound SoundFXDOF("bell10",141, DOFPulse, DOFChimes), 1, chimevol, AudioPan(chimesound), 0,0,0, 1, AudioFade(chimesound)
  1623. End If
  1624. end if
  1625. end sub
  1626.  
  1627. Sub CheckTilt
  1628. If Tilttimer.Enabled = True Then
  1629. TiltSens = TiltSens + 1
  1630. if TiltSens = 3 Then
  1631. GameTilted
  1632. End If
  1633. Else
  1634. TiltSens = 0
  1635. Tilttimer.Enabled = True
  1636. End If
  1637. End Sub
  1638.  
  1639. Sub Tilttimer_Timer()
  1640. Tilttimer.Enabled = False
  1641. End Sub
  1642.  
  1643. Sub GameTilted
  1644. Tilt = True
  1645. tilttxt.text="TILT"
  1646. If B2SOn Then Controller.B2SSetTilt 33,1
  1647. If B2SOn Then Controller.B2ssetdata 1, 0
  1648. PlaySoundAt "tilt", Plunger
  1649. turnoff
  1650. End Sub
  1651.  
  1652. sub turnoff
  1653. RightSlingShot.disabled=true
  1654. bumper1.hashitevent=False
  1655. bumper2.hashitevent=False
  1656. LeftFlipper.RotateToStart
  1657. RightFlipper.RotateToStart
  1658. end sub
  1659.  
  1660. '*********************************************************************
  1661. ' Positional Sound Playback Functions
  1662. '*********************************************************************
  1663.  
  1664. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  1665. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  1666. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  1667. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  1668. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  1669. End Sub
  1670.  
  1671. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  1672. Sub PlaySoundAt(soundname, tableobj)
  1673. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1674. End Sub
  1675.  
  1676. Sub PlaySoundAtBall(soundname)
  1677. PlaySoundAt soundname, ActiveBall
  1678. End Sub
  1679.  
  1680.  
  1681. '*********************************************************************
  1682. ' Supporting Ball & Sound Functions
  1683. '*********************************************************************
  1684.  
  1685. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  1686. Dim tmp
  1687. tmp = tableobj.y * 2 / Nobs.height-1
  1688. If tmp > 0 Then
  1689. AudioFade = Csng(tmp ^10)
  1690. Else
  1691. AudioFade = Csng(-((- tmp) ^10) )
  1692. End If
  1693. End Function
  1694.  
  1695. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  1696. Dim tmp
  1697. tmp = tableobj.x * 2 / Nobs.width-1
  1698. If tmp > 0 Then
  1699. AudioPan = Csng(tmp ^10)
  1700. Else
  1701. AudioPan = Csng(-((- tmp) ^10) )
  1702. End If
  1703. End Function
  1704.  
  1705. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1706. Vol = Csng(BallVel(ball) ^2 / 2000)
  1707. End Function
  1708.  
  1709. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1710. Pitch = BallVel(ball) * 20
  1711. End Function
  1712.  
  1713. Function BallVel(ball) 'Calculates the ball speed
  1714. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1715. End Function
  1716.  
  1717. '*****************************************
  1718. ' JP's VP10 Rolling Sounds
  1719. '*****************************************
  1720.  
  1721. Const tnob = 5 ' total number of balls
  1722. ReDim rolling(tnob)
  1723. InitRolling
  1724.  
  1725. Sub InitRolling
  1726. Dim i
  1727. For i = 0 to tnob
  1728. rolling(i) = False
  1729. Next
  1730. End Sub
  1731.  
  1732. Sub RollingTimer_Timer()
  1733. Dim BOT, b
  1734. BOT = GetBalls
  1735.  
  1736. ' stop the sound of deleted balls
  1737. For b = UBound(BOT) + 1 to tnob
  1738. rolling(b) = False
  1739. StopSound("fx_ballrolling" & b)
  1740. Next
  1741.  
  1742. ' exit the sub if no balls on the table
  1743. If UBound(BOT) = -1 Then Exit Sub
  1744.  
  1745. ' play the rolling sound for each ball
  1746. For b = 0 to UBound(BOT)
  1747. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1748. rolling(b) = True
  1749. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  1750. Else
  1751. If rolling(b) = True Then
  1752. StopSound("fx_ballrolling" & b)
  1753. rolling(b) = False
  1754. End If
  1755. End If
  1756. Next
  1757. End Sub
  1758.  
  1759. '**********************
  1760. ' Ball Collision Sound
  1761. '**********************
  1762.  
  1763. Sub OnBallBallCollision(ball1, ball2, velocity)
  1764. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  1765. End Sub
  1766.  
  1767.  
  1768. '*****************************************
  1769. ' BALL SHADOW
  1770. '*****************************************
  1771. Dim BallShadow
  1772. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  1773.  
  1774. Sub BallShadowUpdate_timer()
  1775. Dim BOT, b
  1776. BOT = GetBalls
  1777. ' hide shadow of deleted balls
  1778. If UBound(BOT)<(tnob-1) Then
  1779. For b = (UBound(BOT) + 1) to (tnob-1)
  1780. BallShadow(b).visible = 0
  1781. Next
  1782. End If
  1783. ' exit the Sub if no balls on the table
  1784. If UBound(BOT) = -1 Then Exit Sub
  1785. ' render the shadow for each ball
  1786. For b = 0 to UBound(BOT)
  1787. If BOT(b).X < Nobs.Width/2 Then
  1788. BallShadow(b).X = ((BOT(b).X) - (Ballsize/16) + ((BOT(b).X - (Nobs.Width/2))/17))' + 13
  1789. Else
  1790. BallShadow(b).X = ((BOT(b).X) + (Ballsize/16) + ((BOT(b).X - (Nobs.Width/2))/17))' - 13
  1791. End If
  1792. ballShadow(b).Y = BOT(b).Y + 10
  1793. If BOT(b).Z > 20 Then
  1794. BallShadow(b).visible = 1
  1795. Else
  1796. BallShadow(b).visible = 0
  1797. End If
  1798. Next
  1799. End Sub
  1800.  
  1801. '************************************
  1802. ' What you need to add to your table
  1803. '************************************
  1804.  
  1805. ' a timer called RollingTimer. With a fast interval, like 10
  1806. ' one collision sound, in this script is called fx_collide
  1807. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  1808. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  1809.  
  1810.  
  1811. '******************************************
  1812. ' Explanation of the rolling sound routine
  1813. '******************************************
  1814.  
  1815. ' sounds are played based on the ball speed and position
  1816.  
  1817. ' the routine checks first for deleted balls and stops the rolling sound.
  1818.  
  1819. ' The For loop goes through all the balls on the table and checks for the ball speed and
  1820. ' if the ball is on the table (height lower than 30) then then it plays the sound
  1821. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  1822.  
  1823. ' The sound is played using the VOL, PAN and PITCH functions, so the volume and pitch of the sound
  1824. ' will change according to the ball speed, and the PAN function will change the stereo position according
  1825. ' to the position of the ball on the table.
  1826.  
  1827.  
  1828. '**************************************
  1829. ' Explanation of the collision routine
  1830. '**************************************
  1831.  
  1832. ' The collision is built in VP.
  1833. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  1834. ' will call this routine. What you add in the sub is up to you. As an example is a simple Playsound with volume and paning
  1835. ' depending of the speed of the collision.
  1836.  
  1837.  
  1838. Sub a_Triggers_Hit (idx)
  1839. playsound "sensor", 0,1,AudioPan(ActiveBall),0,0,0,1,AudioFade(ActiveBall)
  1840. End sub
  1841.  
  1842. Sub a_Pins_Hit (idx)
  1843. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1844. End Sub
  1845.  
  1846. Sub a_Targets_Hit (idx)
  1847. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1848. End Sub
  1849.  
  1850. Sub a_DropTargets_Hit (idx)
  1851. PlaySound "DTDrop", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  1852. End Sub
  1853.  
  1854. Sub a_Metals_Thin_Hit (idx)
  1855. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1856. End Sub
  1857.  
  1858. Sub a_Metals_Medium_Hit (idx)
  1859. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1860. End Sub
  1861.  
  1862. Sub a_Metals2_Hit (idx)
  1863. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1864. End Sub
  1865.  
  1866. Sub a_Gates_Hit (idx)
  1867. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1868. End Sub
  1869.  
  1870. Sub Spinner_Spin
  1871. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  1872. End Sub
  1873.  
  1874. Sub a_Rubbers_Hit(idx)
  1875. dim finalspeed
  1876. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1877. If finalspeed > 20 then
  1878. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1879. End if
  1880. If finalspeed >= 6 AND finalspeed <= 20 then
  1881. RandomSoundRubber()
  1882. End If
  1883. End Sub
  1884.  
  1885. Sub a_Posts_Hit(idx)
  1886. dim finalspeed
  1887. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1888. If finalspeed > 16 then
  1889. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1890. End if
  1891. If finalspeed >= 6 AND finalspeed <= 16 then
  1892. RandomSoundRubber()
  1893. End If
  1894. End Sub
  1895.  
  1896. Sub RandomSoundRubber()
  1897. Select Case Int(Rnd*3)+1
  1898. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1899. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1900. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1901. End Select
  1902. End Sub
  1903.  
  1904. Sub LeftFlipper_Collide(parm)
  1905. RandomSoundFlipper()
  1906. End Sub
  1907.  
  1908.  
  1909. Sub RightFlipper_Collide(parm)
  1910. RandomSoundFlipper()
  1911. End Sub
  1912.  
  1913. Sub RandomSoundFlipper()
  1914. Select Case Int(Rnd*3)+1
  1915. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1916. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1917. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  1918. End Select
  1919. End Sub
  1920.  
  1921. sub savehs
  1922. savevalue "nobs", "credit", credit
  1923. savevalue "nobs", "hipeg", hipg
  1924. savevalue "nobs", "higame", higm
  1925. savevalue "nobs", "count1", pegs(1)
  1926. savevalue "nobs", "count2", pegs(2)
  1927. savevalue "nobs", "games1", games(1)
  1928. savevalue "nobs", "games2", games(2)
  1929. savevalue "nobs", "decks", decks
  1930. savevalue "nobs", "rotopos", rotopos
  1931. savevalue "nobs", "freeplay", freeplay
  1932. savevalue "nobs", "chimesounds", chimesounds
  1933. savevalue "nobs", "hsa1", HSA1
  1934. savevalue "nobs", "hsa2", HSA2
  1935. savevalue "nobs", "hsa3", HSA3
  1936. savevalue "nobs", "hga1", HGA1
  1937. savevalue "nobs", "hga2", HGA2
  1938. savevalue "nobs", "hga3", HGA3
  1939. end sub
  1940.  
  1941. sub loadhs
  1942. temp = LoadValue("nobs", "credit")
  1943. If (temp <> "") then credit = CDbl(temp)
  1944. temp = LoadValue("nobs", "hipeg")
  1945. If (temp <> "") then hipg = CDbl(temp)
  1946. temp = LoadValue("nobs", "higame")
  1947. If (temp <> "") then higm = CDbl(temp)
  1948. temp = LoadValue("nobs", "count1")
  1949. If (temp <> "") then pegs(1) = CDbl(temp)
  1950. temp = LoadValue("nobs", "count2")
  1951. If (temp <> "") then pegs(2) = CDbl(temp)
  1952. temp = LoadValue("nobs", "games1")
  1953. If (temp <> "") then games(1) = CDbl(temp)
  1954. temp = LoadValue("nobs", "games2")
  1955. If (temp <> "") then games(2) = CDbl(temp)
  1956. temp = LoadValue("nobs", "decks")
  1957. If (temp <> "") then decks = CDbl(temp)
  1958. temp = LoadValue("nobs", "rotopos")
  1959. If (temp <> "") then rotopos = CDbl(temp)
  1960. temp = LoadValue("nobs", "freeplay")
  1961. If (temp <> "") then freeplay = CDbl(temp)
  1962. temp = LoadValue("nobs", "chimesounds")
  1963. If (temp <> "") then chimesounds = CDbl(temp)
  1964. temp = LoadValue("nobs", "hsa1")
  1965. If (temp <> "") then HSA1 = CDbl(temp)
  1966. temp = LoadValue("nobs", "hsa2")
  1967. If (temp <> "") then HSA2 = CDbl(temp)
  1968. temp = LoadValue("nobs", "hsa3")
  1969. If (temp <> "") then HSA3 = CDbl(temp)
  1970. temp = LoadValue("nobs", "hga1")
  1971. If (temp <> "") then HGA1 = CDbl(temp)
  1972. temp = LoadValue("nobs", "hga2")
  1973. If (temp <> "") then HGA2 = CDbl(temp)
  1974. temp = LoadValue("nobs", "hga3")
  1975. If (temp <> "") then HGA3 = CDbl(temp)
  1976. end sub
  1977.  
  1978. Sub nobs_Exit()
  1979. Savehs
  1980. turnoff
  1981. If B2SOn Then Controller.stop
  1982. End Sub
  1983.  
  1984. '==========================================================================================================================================
  1985. '============================================================= START OF 6-DIGIT GOTTLIEB DISPLAY =============================================================
  1986. '==========================================================================================================================================
  1987. '
  1988. ' Segmented score display originally developed by Wizards Hat, modified to Gottlieb 6 digit display and simplified by BorgDog
  1989. '
  1990. '
  1991. 'Command as follows:
  1992. '1) Display = simply displays a message
  1993.  
  1994. 'Each command is then followed by text, style, screen, full, time, text2 - where text is a string. Style, screen, full & time are numbers
  1995. ' - style: 1-2 1=Still text
  1996. ' 2=Flashing Text
  1997. '
  1998. ' - screen: 1-3 1=Player 1 display
  1999. ' 2=Player 2 display
  2000. ' 3=both
  2001.  
  2002. ' - full: 0 or 1 0=Left justify
  2003. ' 1=Right Justify
  2004. ' 2=Full Justify (text to left, text2 to right)
  2005. '
  2006. ' - time: 0+ Time in seconds for display to show before screen (1-3) is cleared to blank. O=permanent (until next Display call)
  2007. '
  2008.  
  2009. 'As a more advanced example: To display the same message but have "WIZARDS" scroll in from the left then stop, and "HAT" scroll in from the right and then stop and flash
  2010. 'You would use the following 2 commands:
  2011. ' Display " WIZARDS ",6,1,0,5
  2012. ' Display2 " HAT ",5,2,0,5
  2013. '
  2014. '
  2015. 'the allowed characters are A-Z 0-9 and + - * " ' ( ) / < = > [ \ ] _ `
  2016. 'lower case is converted to upper case
  2017. 'invalid characters are converted to spaces !@#$%^&{}|;:?., - in fact any ASCII character not listed in allowed characters
  2018. '
  2019. '
  2020. '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2021. '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2022. '++++++++++++++++++++++++ You do not need to change or understand anything below this line in order to now be able to use the display system +++++++++++++++++++++++++++++++++++++
  2023. '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2024. '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2025.  
  2026. 'All variables have had "HAT" prefixed to them to ensure that they are unique if this part of the script is copied directly to another table - it looks confusing to me, but at least
  2027. 'it should avoid any duplication of variable names! (thanks to Bob5453 for this suggestion)
  2028.  
  2029. 'Variables used to count, or keep track
  2030. Dim HATn,HATi,HATj,HATV,HATW,HATA,HATB,HATC,HATD,HATE,HATF,HATG,HATV2,HATW2,HATA2,HATB2,HATC2,HATD2,HATE2,HATF2,HATG2
  2031. 'Variables used to track pre-stated values
  2032. Dim HATCurrent,HATPosition,HATCharacter,HATText,HATStyle,HATScreen,HATFull,HATTime,HATtextR
  2033. Dim HATCurrent2,HATPosition2,HATCharacter2,HATText2,HATStyle2,HATScreen2,HATFull2,HATTime2,HATtextR2
  2034. 'Arrays and flags
  2035.  
  2036. Dim HATGasSeg(12,8),HATRom(255) ' HATGasSeq is 12 digits, 8 segments per digit, HATRom is ascii table
  2037.  
  2038. 'Initilise Settings For The Display - this is done using the initialization of the first light in the display
  2039. Sub ScoreSetup()
  2040.  
  2041. For HATA=1 To 12 'Set the lights to an array
  2042. For HATB=1 To 8
  2043. Set HATGasSeg(HATA,HATB)=Eval("a"& HATB+((HATA-1)*8))
  2044. Next
  2045. Next
  2046. For HATA=1 To 96 'Set all display lights to off (again!)
  2047. Eval("a"& HATA).State=0
  2048. Next
  2049.  
  2050. 'the allowed characters are A-Z 0-9 and + - * " ' ( ) / < = > [ \ ] _ `
  2051.  
  2052. For HATA=0 To 255:HATRom(HATA)="00000000":Next 'Set all the possbile characters as spaces (blank)
  2053. HATRom(32)="00000000":HATRom(34)="01000100":HATRom(39)="01000000" 'Settings for each character to be displayed
  2054. HATRom(40)="01100000":HATRom(41)="00001100":HATRom(42)="00000011"
  2055. HATRom(43)="00000011":HATRom(44)="00001000":HATRom(45)="00000010"
  2056. HATRom(47)="01001010"
  2057. HATRom(48)="11111100":HATRom(49)="00000001":HATRom(50)="11011010"
  2058. HATRom(51)="11110010":HATRom(52)="01100110":HATRom(53)="10110110"
  2059. HATRom(54)="10111110":HATRom(55)="11100000":HATRom(56)="11111110"
  2060. HATRom(57)="11110110":HATRom(60)="01100010":HATRom(61)="00010010"
  2061. HATRom(62)="00001110":HATRom(65)="11101110":HATRom(66)="11110011"
  2062. HATRom(67)="10011100":HATRom(68)="11110001":HATRom(69)="10011110"
  2063. HATRom(70)="10001110":HATRom(71)="10111100":HATRom(72)="01101110"
  2064. HATRom(73)="00000001":HATRom(74)="01111000":HATRom(75)="00001111"
  2065. HATRom(76)="00011100":HATRom(77)="11101101":HATRom(78)="11101100"
  2066. HATRom(79)="11111100":HATRom(80)="11001110":HATRom(81)="11100110"
  2067. HATRom(82)="11001100":HATRom(83)="10110110":HATRom(84)="10000001"
  2068. HATRom(85)="01111100":HATRom(86)="01010110":HATRom(87)="01111101"
  2069. HATRom(88)="00100111":HATRom(89)="01100110":HATRom(90)="11011010"
  2070. HATRom(91)="01100000":HATRom(92)="00100110":HATRom(93)="00001100"
  2071. HATRom(95)="00010000":HATRom(96)="00000100"
  2072.  
  2073. HATRom(163)="11111111" 'Test all on (ASCII 163 = £)
  2074.  
  2075. End Sub
  2076.  
  2077. ''''''
  2078. ' B2S ******************************************** Adapted from JPs ScarFace for 10 segment display
  2079. Sub B2SDisplayChar(achar, adigit)
  2080. dim ledvalue, ascchar
  2081. ledvalue = 0
  2082. If achar = "" Then achar = " "
  2083. ascchar = ASC(achar)
  2084. Select Case ascchar
  2085. Case 34: ledvalue = 2+32 'double quote
  2086. Case 39: ledvalue = 2 'single quote
  2087. Case 40: ledvalue = 2+4 '(
  2088. Case 41: ledvalue = 16+32 ')
  2089. Case 42: ledvalue = 64+256+512 '*
  2090.  
  2091. Case 43: ledvalue = 64+256+512 '+
  2092. Case 44: ledvalue = 16 ',
  2093. Case 45: ledvalue = 8 '-
  2094. Case 47: ledvalue = 2+16+64 '/
  2095.  
  2096. Case 48: ledvalue = 1+2+4+8+16+32 '0
  2097. Case 49: ledvalue = 256+512 '1
  2098. Case 50: ledvalue = 1+2+8+16+64 '2
  2099. Case 51: ledvalue = 1+2+4+8+64 '3
  2100. Case 52: ledvalue = 2+4+32+64 '4
  2101.  
  2102. Case 53: ledvalue = 1+4+8+32+64 '5
  2103. Case 54: ledvalue = 1+4+8+16+32+64 '6
  2104. Case 55: ledvalue = 1+2+4 '7
  2105. Case 56: ledvalue = 1+2+4+8+16+32+64 '8
  2106. Case 57: ledvalue = 1+2+4+8+32+64 '9
  2107.  
  2108. Case 60: ledvalue = 2+4+64 '<
  2109. Case 61: ledvalue = 8+64 '=
  2110. Case 62: ledvalue = 16+32+64 '>
  2111.  
  2112. Case 65: ledvalue = 1+2+4+16+32+64 'A
  2113. Case 66: ledvalue = 1+2+4+8+64+256+512 'B
  2114. Case 67: ledvalue = 1+8+16+32 'C
  2115. Case 68: ledvalue = 1+2+4+8+256+512 'D
  2116. Case 69: ledvalue = 1+8+16+32+64 'E
  2117.  
  2118. Case 70: ledvalue = 1+16+32+64 'F
  2119. Case 71: ledvalue = 1+4+8+16+32 'G
  2120. Case 72: ledvalue = 2+4+16+32+64 'H
  2121. Case 73: ledvalue = 1+8+256+512 'I
  2122. Case 74: ledvalue = 2+4+8+16 'J
  2123.  
  2124. Case 75: ledvalue = 16+32+64+256+512 'K
  2125. Case 76: ledvalue = 8+16+32 'L
  2126. Case 77: ledvalue = 1+2+4+16+32+256+512 'M
  2127. Case 78: ledvalue = 1+2+4+16+32 'N
  2128. Case 79: ledvalue = 1+2+4+8+16+32 'O
  2129.  
  2130. Case 80: ledvalue = 1+2+16+32+64 'P
  2131. Case 81: ledvalue = 1+2+4+32+64 'Q
  2132. Case 82: ledvalue = 1+2+16+32 'R
  2133. Case 83: ledvalue = 1+4+8+32+64 'S
  2134. Case 84: ledvalue = 1+256+512 'T
  2135.  
  2136. Case 85: ledvalue = 2+4+8+16+32 'U
  2137. Case 86: ledvalue = 2+8+32+64 'V
  2138. Case 87: ledvalue = 2+4+8+16+32+256+512 'W
  2139. Case 88: ledvalue = 4+32+64+256+512 'X
  2140. Case 89: ledvalue = 2+4+32+64 'Y
  2141.  
  2142. Case 90: ledvalue = 1+2+8+16+64 'Z
  2143. Case 91: ledvalue = 2+4 '[
  2144. Case 92: ledvalue = 4+32+64 '\
  2145. Case 93: ledvalue = 16+32 ']
  2146. Case 95: ledvalue = 8 '_
  2147. Case 96: ledvalue = 32 ' 'accent
  2148.  
  2149. Case Else: ledvalue = 0
  2150. End Select
  2151. Controller.B2SSetLED adigit, ledvalue
  2152. End Sub
  2153.  
  2154.  
  2155. Dim DOGtx, DOGst, DOGsc
  2156.  
  2157. Sub DisplayOne(tx,st,sc) 'this routine will hopefully change just one character in the displays.tx is one character to display, st is style, sc is position
  2158. DOGtx=tx: DOGst=st: DOGsc=sc 'set to global variables
  2159. If b2son then
  2160. if st=2 then
  2161. B2SDisplayChar DOGtx, DOGsc
  2162. FlashOne.uservalue=1
  2163. Flashone.enabled=1
  2164. else
  2165. B2SDisplayChar DOGtx, DOGsc
  2166. end if
  2167. else
  2168. For i=1 to 8
  2169. if st=2 then
  2170. HATGasSeg(sc,i).duration (Mid(HATRom(Asc(tx)),i,1)),300,(Mid(HATRom(Asc(tx)),i,1)*st)
  2171. Else
  2172. HATGasSeg(sc,i).State=(Mid(HATRom(Asc(tx)),i,1)*st)
  2173. end If
  2174. Next
  2175. end if
  2176. End Sub
  2177.  
  2178. Sub FlashOne_timer ' flash single character on the B2S
  2179.  
  2180. Select Case Flashone.uservalue
  2181. Case 0:
  2182. B2SDisplayChar "", DOGsc
  2183. if Flashone.uservalue<>2 then Flashone.uservalue=1
  2184. Case 1:
  2185. B2SDisplayChar DOGtx, DOGsc
  2186. if Flashone.uservalue<>2 then Flashone.uservalue=0
  2187. Case 2:
  2188. B2SDisplayChar DOGtx, DOGsc
  2189. Flashone.enabled=0
  2190. end Select
  2191. End sub
  2192.  
  2193. Sub Display(tx,st,sc,fl,tm,txr) 'This routine is followed whenever a message is to be displayed using the command Display
  2194. On error resume next
  2195. HATtext=tx:HATstyle=st:HATscreen=sc:HATfull=fl:HATTime=tm:HATtextR=txr 'Set global variables from numbers passed to this routine
  2196.  
  2197. 'step 1 - clear screen(s)
  2198. Clear
  2199.  
  2200. 'step 2 - Add space if needed to right or full justify (1=right justify, 0=left justify, 2=full justify tx and txr)
  2201. If HATFull=1 and (HATStyle=1 or HATStyle=2) then
  2202. If HATScreen=3 then :FullLengthText HATText:Else:HalfLengthText HATText:End If
  2203. End If
  2204.  
  2205. If HATFull=2 and (HATStyle=1 or HATStyle=2) then
  2206. If HATScreen=3 then :FullJustify HATText,HATtextR:Else:FullJustify HATText,HATtextR:End If
  2207. End If
  2208.  
  2209. 'step 3 - set variables for 1st & last position
  2210. If HATScreen=3 or HATScreen=1 then HATC=1:HATE=0 Else HATC=7:HATE=6
  2211. If HATScreen=1 then HATD=6 Else HATD=12
  2212.  
  2213. 'step 4 - put display into action
  2214. If HATStyle=1 then 'Still
  2215. For HATPosition=HATC to HATD
  2216. If HATPosition-HATE<=Len(HATText) then
  2217. HATCharacter=Ucase(Mid(HATText,HATPosition-HATE,1))
  2218. if b2son then
  2219. B2SDisplayChar HATCharacter, HATPosition
  2220. else
  2221. For HATA=1 to 8
  2222. HATGasSeg(HATPosition,HATA).State=(Mid(HATRom(Asc(HATCharacter)),HATA,1)*HATStyle)
  2223. Next
  2224. end if
  2225. End If
  2226. Next
  2227. End If
  2228.  
  2229. If HATStyle=2 then 'Flashing
  2230. if b2son then
  2231. B2SFlash.uservalue = 1
  2232. B2SFlash.enabled= true
  2233. else
  2234. For HATPosition=HATC to HATD
  2235. If HATPosition-HATE<=Len(HATText) then
  2236. HATCharacter=Ucase(Mid(HATText,HATPosition-HATE,1))
  2237. For HATA=1 to 8
  2238. HATGasSeg(HATPosition,HATA).State=(Mid(HATRom(Asc(HATCharacter)),HATA,1)*HATStyle)
  2239. Next
  2240. End If
  2241. Next
  2242. end if
  2243. End If
  2244.  
  2245. End Sub
  2246.  
  2247. Sub FullJustify(Tx,TxR) 'Used to right justify for style 1,2
  2248. Select Case 6-Len(Tx)-Len(TxR)
  2249. Case -1:Tx="999"&TxR
  2250. Case 0:Tx=Tx&TxR
  2251. Case 1:Tx=Tx&" "&TxR
  2252. Case 2:Tx=Tx&" "&TxR
  2253. Case 3:Tx=Tx&" "&TxR
  2254. Case 4:Tx=Tx&" "&TxR
  2255. Case 5:Tx=Tx&" "&TxR
  2256. Case 6:Tx=Tx&" "&TxR
  2257. End Select
  2258. End Sub
  2259.  
  2260. Sub FullLengthText(Tx) 'Used to right justify for style 1,2
  2261. Select Case Len(Tx)
  2262. Case 1:Tx=" "&Tx
  2263. Case 2:Tx=" "&Tx
  2264. Case 3:Tx=" "&Tx
  2265. Case 4:Tx=" "&Tx
  2266. Case 5:Tx=" "&Tx
  2267. Case 6:Tx=" "&Tx
  2268. Case 7:Tx=" "&Tx
  2269. Case 8:Tx=" "&Tx
  2270. Case 9:Tx=" "&Tx
  2271. Case 10:Tx=" "&Tx
  2272. Case 11:Tx=" "&Tx
  2273. End Select
  2274. End Sub
  2275.  
  2276.  
  2277. Sub HalfLengthText(Tx) 'Used to right justify for style 1,2
  2278. Select Case Len(Tx)
  2279. Case 1:Tx=" "&Tx
  2280. Case 2:Tx=" "&Tx
  2281. Case 3:Tx=" "&Tx
  2282. Case 4:Tx=" "&Tx
  2283. Case 5:Tx=" "&Tx
  2284. End Select
  2285. End Sub
  2286.  
  2287.  
  2288. Sub Clear 'Used to clear screen (top, bottom, or both)
  2289. dim dogb, dogg
  2290. if b2son then
  2291. If HATScreen=1 then dogb=6 Else dogb=12
  2292. If HATScreen=2 then dogg=7 Else dogg=1
  2293. For HATA=dogg to dogb
  2294. B2SDisplayChar "", HATA
  2295. Next
  2296. else
  2297. If HATScreen=1 then HATB=48 Else HATB=96
  2298. If HATScreen=2 then HATG=49 Else HATG=1
  2299. For HATA=HATG To HATB
  2300. Eval("a"& HATA).State=0
  2301. Next
  2302. end if
  2303. End Sub
  2304.  
  2305. sub B2SFlash_timer
  2306. Select Case b2sflash.uservalue
  2307. Case 0:
  2308. For HATPosition=HATC to HATD
  2309. If HATPosition-HATE<=Len(HATText) then
  2310. HATCharacter=Ucase(Mid(HATText,HATPosition-HATE,1))
  2311. B2SDisplayChar "", HATPosition
  2312. End If
  2313. Next
  2314. if b2sflash.uservalue<>2 then B2SFlash.uservalue=1
  2315. Case 1:
  2316. For HATPosition=HATC to HATD
  2317. If HATPosition-HATE<=Len(HATText) then
  2318. HATCharacter=Ucase(Mid(HATText,HATPosition-HATE,1))
  2319. B2SDisplayChar HATCharacter, HATPosition
  2320. End If
  2321. Next
  2322. if b2sflash.uservalue<>2 then B2SFlash.uservalue=0
  2323. Case 2: 'turn b2s display to on and turn off flashing
  2324. For HATPosition=HATC to HATD
  2325. If HATPosition-HATE<=Len(HATText) then
  2326. HATCharacter=Ucase(Mid(HATText,HATPosition-HATE,1))
  2327. B2SDisplayChar HATCharacter, HATPosition
  2328. End If
  2329. Next
  2330. b2sflash.enabled=0
  2331. end Select
  2332. end Sub
  2333.  
  2334. '------------------------------------
  2335. 'Basically all the same again, so that the 2 halves of the screen can be treated separately simultaneously
  2336. '------------------------------------
  2337. Sub Display2(tx,st,sc,fl,tm,txr) 'This routine is followed whenever a message is to be displayed using the command Display
  2338. On error resume next
  2339. HATtext2=tx:HATstyle2=st:HATscreen2=sc:HATfull2=fl:HATTime2=tm:HATtextR2=txr 'Set global variables from numbers passed to this routine
  2340.  
  2341. 'step 1 - clear screen(s)
  2342. Clear2
  2343.  
  2344. 'step 2 - Add space if needed to right or full justify (1=right justify, 0=left justify, 2=full justify)
  2345. If HATFull2=1 and (HATStyle2=1 or HATStyle2=2) then
  2346. If HATScreen2=3 then :FullLengthText2 HATText2:Else:HalfLengthText2 HATText2:End If
  2347. End If
  2348.  
  2349. If HATFull2=2 and (HATStyle2=1 or HATStyle2=2) then
  2350. If HATScreen2=3 then :FullJustify2 HATText2,HATtextR2:Else:FullJustify2 HATText2,HATtextR2:End If
  2351. End If
  2352.  
  2353.  
  2354. 'step 3 - set variables for 1st & last position
  2355. If HATScreen2=3 or HATScreen2=1 then HATC2=1:HATE2=0 Else HATC2=7:HATE2=6
  2356. If HATScreen2=1 then HATD2=6 Else HATD2=12
  2357.  
  2358. 'step 4 - put display into action
  2359. If HATStyle2=1 then 'Still
  2360. For HATPosition2=HATC2 to HATD2
  2361. If HATPosition2-HATE2<=Len(HATText2) then
  2362. HATCharacter2=Ucase(Mid(HATText2,HATPosition2-HATE2,1))
  2363. if b2son then
  2364. B2SDisplayChar HATCharacter2, HATPosition2
  2365. else
  2366. For HATA2=1 to 8
  2367. HATGasSeg(HATPosition2,HATA2).State=(Mid(HATRom(Asc(HATCharacter2)),HATA,1)*HATStyle2)
  2368. Next
  2369. end if
  2370. End If
  2371. Next
  2372. End If
  2373.  
  2374. If HATStyle=2 then 'Flashing
  2375. if b2son then
  2376. B2SFlash.uservalue = 1
  2377. B2SFlash.enabled= true
  2378. else
  2379. For HATPosition2=HATC2 to HATD2
  2380. If HATPosition2-HATE2<=Len(HATText2) then
  2381. HATCharacter2=Ucase(Mid(HATText2,HATPosition2-HATE2,1))
  2382. For HATA2=1 to 8
  2383. HATGasSeg(HATPosition2,HATA2).State=(Mid(HATRom(Asc(HATCharacter2)),HATA2,1)*HATStyle2)
  2384. Next
  2385. End If
  2386. Next
  2387. end if
  2388. End If
  2389.  
  2390. End Sub
  2391.  
  2392. Sub FullJustify2(Tx,TxR)
  2393. Select Case 6-Len(Tx)-Len(TxR)
  2394. Case -1:Tx="999"&TxR
  2395. Case 0:Tx=Tx&TxR
  2396. Case 1:Tx=Tx&" "&TxR
  2397. Case 2:Tx=Tx&" "&TxR
  2398. Case 3:Tx=Tx&" "&TxR
  2399. Case 4:Tx=Tx&" "&TxR
  2400. Case 5:Tx=Tx&" "&TxR
  2401. Case 6:Tx=Tx&" "&TxR
  2402. End Select
  2403. End Sub
  2404.  
  2405. Sub FullLengthText2(Tx) 'Used to right justify for style 1,2
  2406. Select Case Len(Tx)
  2407. Case 1:Tx=" "&Tx
  2408. Case 2:Tx=" "&Tx
  2409. Case 3:Tx=" "&Tx
  2410. Case 4:Tx=" "&Tx
  2411. Case 5:Tx=" "&Tx
  2412. Case 6:Tx=" "&Tx
  2413. Case 7:Tx=" "&Tx
  2414. Case 8:Tx=" "&Tx
  2415. Case 9:Tx=" "&Tx
  2416. Case 10:Tx=" "&Tx
  2417. Case 11:Tx=" "&Tx
  2418. End Select
  2419. End Sub
  2420.  
  2421.  
  2422. Sub HalfLengthText2(Tx) 'Used to right justify for style 1,2
  2423. Select Case Len(Tx)
  2424. Case 1:Tx=" "&Tx
  2425. Case 2:Tx=" "&Tx
  2426. Case 3:Tx=" "&Tx
  2427. Case 4:Tx=" "&Tx
  2428. Case 5:Tx=" "&Tx
  2429. End Select
  2430. End Sub
  2431.  
  2432.  
  2433. Sub Clear2 'Used to clear screen (top, bottom, or both)
  2434. dim dogb2, dogg2
  2435. if b2son then
  2436. If HATScreen2=1 then dogb2=6 Else dogb2=12
  2437. If HATScreen2=2 then dogg2=7 Else dogg2=1
  2438. For HATA2=dogg2 to dogb2
  2439. B2SDisplayChar "", HATA2
  2440. Next
  2441. else
  2442. If HATScreen2=1 then HATB2=48 Else HATB2=96
  2443. If HATScreen2=2 then HATG2=49 Else HATG2=1
  2444. For HATA2=HATG2 To HATB2
  2445. Eval("a"& HATA2).State=0
  2446. Next
  2447. end if
  2448. End Sub
  2449.  
  2450.  
  2451. sub B2SFlash2_timer
  2452.  
  2453. Select Case B2SFlash2.uservalue
  2454. Case 0:
  2455. For HATPosition2=HATC2 to HATD2
  2456. If HATPosition2-HATE2<=Len(HATText2) then
  2457. HATCharacter2=Ucase(Mid(HATText2,HATPosition2-HATE2,1))
  2458. B2SDisplayChar "", HATPosition2
  2459. End If
  2460. Next
  2461. if B2sFlash2.uservalue<>2 then B2SFlash2.uservalue=1
  2462. Case 1:
  2463. For HATPosition2=HATC2 to HATD2
  2464. If HATPosition2-HATE2<=Len(HATText2) then
  2465. HATCharacter2=Ucase(Mid(HATText2,HATPosition2-HATE2,1))
  2466. B2SDisplayChar HATCharacter2, HATPosition2
  2467. End If
  2468. Next
  2469. if B2sFlash2.uservalue<>2 then B2SFlash2.uservalue=0
  2470. Case 2:
  2471. For HATPosition2=HATC2 to HATD2
  2472. If HATPosition2-HATE2<=Len(HATText2) then
  2473. HATCharacter2=Ucase(Mid(HATText2,HATPosition2-HATE2,1))
  2474. B2SDisplayChar HATCharacter2, HATPosition2
  2475. End If
  2476. Next
  2477. B2sFlash2.enabled=0
  2478. End Select
  2479. end Sub
  2480.  
  2481.  
  2482.  
  2483. '==========================================================================================================================================
  2484. '============================================================= END OF 6-DIGIT Gottlieb Display =============================================================
  2485. '==========================================================================================================================================
  2486.  
  2487. '==========================================================================================================================================
  2488. '============================================================= START OF HIGH SCORES ROUTINES =============================================================
  2489. '==========================================================================================================================================
  2490. '
  2491. 'ADD LINE TO TABLE_KEYDOWN SUB WITH THE FOLLOWING: If HSEnterMode Then HighScoreProcessKey(keycode) AFTER THE STARTGAME ENTRY
  2492. 'ADD And Not HSEnterMode=true TO IF KEYCODE=STARTGAMEKEY
  2493. 'TO SHOW THE SCORE ON POST-IT ADD LINE AT RELEVENT LOCATION THAT HAS: UpdatePostIt
  2494. 'TO INITIATE ADDING INITIALS ADD LINE AT RELEVENT LOCATION THAT HAS: HighScoreEntryInit()
  2495. 'ADD THE FOLLOWING LINES TO TABLE_INIT TO SETUP POSTIT
  2496. ' if HSA1="" then HSA1=25
  2497. ' if HSA2="" then HSA2=25
  2498. ' if HSA3="" then HSA3=25
  2499. ' UpdatePostIt
  2500. 'ADD HSA1, HSA2 AND HSA3 TO SAVE AND LOAD VALUES FOR TABLE
  2501. 'ADD A TIMER NAMED HighScoreFlashTimer WITH INTERVAL 100 TO TABLE
  2502. 'SET HSSSCOREX BELOW TO WHATEVER VARIABLE YOU USE FOR HIGH SCORE.
  2503. 'IMPORT POST-IT IMAGES
  2504. '
  2505. Dim HSA1, HSA2, HSA3, HGA1, HGA2, HGA3
  2506. Dim HSEnterMode, HGEnterMode, hsEnteredDigits(3), hsCurrentDigit, hsCurrentLetter
  2507. 'Dim HSArray
  2508. 'Dim HSScoreM,HSScore100k, HSScore10k, HSScoreK, HSScore100, HSScore10, HSScore1, HSScorex 'Define 6 different score values for each reel to use
  2509.  
  2510. ' ***********************************************************
  2511. ' HiPeg Record
  2512. ' ***********************************************************
  2513.  
  2514. 'Each Display command is then followed by text, style, screen, full, time, text2
  2515.  
  2516. Sub HighPegEntryInit(pl)
  2517. HSA1=0:HSA2=0:HSA3=0
  2518. Display "Hi Peg",2,1,0,0,""
  2519. Display2 "P"&pl,1,2,0,0,""
  2520. DisplayOne " ",0,10
  2521. DisplayOne " ",0,11
  2522. DisplayOne " ",0,12
  2523. HSEnterMode = True
  2524. hsCurrentLetter = 1:HSA1=65
  2525. DisplayOne Chr(HSA1),2,10
  2526. End Sub
  2527.  
  2528.  
  2529. ' ***********************************************************
  2530. ' HiGames Record
  2531. ' ***********************************************************
  2532.  
  2533. 'Each Display command is then followed by text, style, screen, full, time, text2
  2534.  
  2535.  
  2536. Sub HighGamesEntryInit(pg)
  2537. HGA1=0:HGA2=0:HGA3=0
  2538. Display "Hi Gms",2,1,0,0,""
  2539. Display2 "P"&pg,1,2,0,0,""
  2540. DisplayOne " ",0,10
  2541. DisplayOne " ",0,11
  2542. DisplayOne " ",0,12
  2543. HGEnterMode = True
  2544. hsCurrentLetter = 1:HGA1=65
  2545. DisplayOne Chr(HGA1),2,10
  2546. End Sub
  2547.  
  2548. ' ***********************************************************
  2549. ' HiPeg ENTER INITIALS
  2550. ' ***********************************************************
  2551.  
  2552. Sub HighScoreProcessKey(keycode)
  2553. if HSEnterMode=True then
  2554. If keycode = LeftFlipperKey Then
  2555. Select Case hsCurrentLetter
  2556. Case 1:
  2557. HSA1=HSA1-1:If HSA1=64 Then HSA1=90 'no backspace on 1st digit
  2558. DisplayOne Chr(HSA1),2,10
  2559. Case 2:
  2560. HSA2=HSA2-1:If HSA2=64 Then HSA2=60: If HSA2=59 Then HSA2=90
  2561. DisplayOne Chr(HSA2),2,11
  2562. Case 3:
  2563. HSA3=HSA3-1:If HSA3=64 Then HSA3=60: If HSA3=59 then HSA3=90
  2564. DisplayOne Chr(HSA3),2,12
  2565. End Select
  2566. End If
  2567.  
  2568. If keycode = RightFlipperKey Then
  2569. Select Case hsCurrentLetter
  2570. Case 1:
  2571. HSA1=HSA1+1:If HSA1>90 Then HSA1=65
  2572. DisplayOne Chr(HSA1),2,10
  2573. Case 2:
  2574. HSA2=HSA2+1:If HSA2>90 Then HSA2=60: If HSA2=61 then HSA2=65
  2575. DisplayOne Chr(HSA2),2,11
  2576. Case 3:
  2577. HSA3=HSA3+1:If HSA3>90 Then HSA3=60: If HSA3=61 then HSA3=65
  2578. DisplayOne Chr(HSA3),2,12
  2579. End Select
  2580. End If
  2581.  
  2582. If keycode = StartGameKey Then
  2583. Select Case hsCurrentLetter
  2584. Case 1:
  2585. hsCurrentLetter=2 'ok to advance
  2586. DisplayOne Chr(HSA1),1,10
  2587. HSA2=HSA1 'start at same alphabet spot
  2588. DisplayOne Chr(HSA2),2,11
  2589. Case 2:
  2590. If HSA2=60 Then 'bksp
  2591. DisplayOne " ",0,11
  2592. hsCurrentLetter=1
  2593. DisplayOne Chr(HSA1),2,10
  2594. Else
  2595. hsCurrentLetter=3 'enter it
  2596. DisplayOne Chr(HSA2),1,11
  2597. HSA3=HSA2 'start at same alphabet spot
  2598. DisplayOne Chr(HSA3),2,12
  2599. End If
  2600. Case 3:
  2601. If HSA3=60 Then 'bksp
  2602. DisplayOne " ",0,12
  2603. hsCurrentLetter=2
  2604. DisplayOne Chr(HSA2),2,11
  2605. Else
  2606. DisplayOne Chr(HSA3),1,12
  2607. savehs 'enter it
  2608. HSEnterMode = False
  2609. b2sflash.uservalue=2
  2610. FlashOne.uservalue=2 'turn off flash
  2611. If NewHG>0 then
  2612. HighGamesEntryInit NewHG
  2613. else
  2614. Lgi.timerenabled=1
  2615. a1.timerenabled=1
  2616. End If
  2617. End If
  2618. End Select
  2619. End If
  2620. ' End If
  2621.  
  2622. ' ***********************************************************
  2623. ' HiGames ENTER INITIALS
  2624. ' ***********************************************************
  2625.  
  2626. elseif HGEnterMode=True then
  2627. If keycode = LeftFlipperKey Then
  2628. Select Case hsCurrentLetter
  2629. Case 1:
  2630. HGA1=HGA1-1:If HGA1=64 Then HGA1=90 'no backspace on 1st digit
  2631. DisplayOne Chr(HGA1),2,10
  2632. Case 2:
  2633. HGA2=HGA2-1:If HGA2=64 Then HGA2=60: If HGA2=59 Then HGA2=90
  2634. DisplayOne Chr(HGA2),2,11
  2635. Case 3:
  2636. HGA3=HGA3-1:If HGA3=64 Then HGA3=60: If HGA3=59 then HGA3=90
  2637. 'DisplayOne "",0,12
  2638. DisplayOne Chr(HGA3),2,12
  2639. End Select
  2640. End If
  2641.  
  2642. If keycode = RightFlipperKey Then
  2643. Select Case hsCurrentLetter
  2644. Case 1:
  2645. HGA1=HGA1+1:If HGA1>90 Then HGA1=65
  2646. DisplayOne Chr(HGA1),2,10
  2647. Case 2:
  2648. HGA2=HGA2+1:If HGA2>90 Then HGA2=60: If HGA2=61 then HGA2=65
  2649. DisplayOne Chr(HGA2),2,11
  2650. Case 3:
  2651. HGA3=HGA3+1:If HGA3>90 Then HGA3=60: If HGA3=61 then HGA3=65
  2652. DisplayOne Chr(HGA3),2,12
  2653. End Select
  2654. End If
  2655.  
  2656. If keycode = StartGameKey Then
  2657. Select Case hsCurrentLetter
  2658. Case 1:
  2659. hsCurrentLetter=2 'ok to advance
  2660. DisplayOne Chr(HGA1),1,10
  2661. HGA2=HGA1 'start at same alphabet spot
  2662. DisplayOne Chr(HGA2),2,11
  2663. Case 2:
  2664. If HGA2=60 Then 'bksp
  2665. DisplayOne " ",0,11
  2666. hsCurrentLetter=1
  2667. DisplayOne Chr(HGA1),2,10
  2668. Else
  2669. hsCurrentLetter=3 'enter it
  2670. DisplayOne Chr(HGA2),1,11
  2671. HGA3=HGA2 'start at same alphabet spot
  2672. DisplayOne Chr(HGA3),2,12
  2673. End If
  2674. Case 3:
  2675. If HGA3=60 Then 'bksp
  2676. DisplayOne " ",0,12
  2677. hsCurrentLetter=2
  2678. DisplayOne Chr(HGA2),2,11
  2679. Else
  2680. DisplayOne Chr(HGA3),1,12
  2681. savehs 'enter it
  2682. HGEnterMode = False
  2683. b2sflash.uservalue=2
  2684. FlashOne.uservalue=2
  2685. Lgi.timerenabled=1
  2686. a1.timerenabled=1
  2687. End If
  2688. End Select
  2689. End If
  2690. End If
  2691.  
  2692. End Sub
Advertisement
Add Comment
Please, Sign In to add comment