Outhere

Seven Winner ( jpsalas_Inder 1973)1.0

Nov 19th, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.00 KB | None | 0 0
  1. ' ***********************************************************************
  2. ' VISUAL PINBALL X EM Script by JPSalas
  3. ' Basic EM script up to 4 players
  4. ' uses core.vbs for extra functions
  5. ' Seven Winner / IPD No. 4407 / INDER 1973 / 1 Player
  6. ' ***********************************************************************
  7.  
  8. 'DOF Config
  9. '101 Left Flipper
  10. '102 Right Flipper
  11. '103 Slingshot Left
  12. '104 Slingshot Right
  13. '105 Bumper Center
  14. '106 Bumper Right
  15. '107 Kicker
  16. '108 Knocker
  17. '109
  18. '110 BallRelease
  19. '111 Chime
  20. '112 Chime
  21. '113 Chime
  22.  
  23. Option Explicit
  24. Randomize
  25.  
  26. ' core.vbs constants
  27. Const BallSize = 50 ' 50 is the normal size
  28. Const BallMass = 1.7 ' 1 is the normal ball mass.
  29.  
  30. ' load extra vbs files
  31. LoadCoreFiles
  32.  
  33. Sub LoadCoreFiles
  34. On Error Resume Next
  35. ExecuteGlobal GetTextFile("core.vbs")
  36. If Err Then MsgBox "Can't open core.vbs"
  37. On Error Resume Next
  38. ExecuteGlobal GetTextFile("controller.vbs")
  39. If Err Then MsgBox "Can't open controller.vbs"
  40. End Sub
  41.  
  42. ' Valores Constants
  43. Const cGameName = "sevenwinner" ' B2S name
  44. Const MaxPlayers = 1 ' 1 to 4 can play
  45. Const MaxMultiplier = 2 ' limit bonus multiplier
  46. Const BallsPerGame = 5 ' 3 or 5
  47. Const FreePlay = False ' Free play or coins
  48. Const Special1 = 69000 ' extra ball or credit
  49. Const Special2 = 81000
  50. Const Special3 = 99000
  51.  
  52. ' Global variables
  53. Dim PlayersPlayingGame
  54. Dim CurrentPlayer
  55. Dim Credits
  56. Dim Bonus
  57. Dim BallsRemaining(4)
  58. Dim BonusMultiplier
  59. Dim ExtraBallsAwards(4)
  60. Dim Special1Awarded(4)
  61. Dim Special2Awarded(4)
  62. Dim Special3Awarded(4)
  63. Dim Score(4)
  64. Dim HighScore
  65. Dim Match
  66. Dim Tilt
  67. Dim TiltSensitivity
  68. Dim Tilted
  69. Dim Add10
  70. Dim Add100
  71. Dim Add1000
  72. Dim x
  73.  
  74. ' Control variables
  75. Dim BallsOnPlayfield
  76.  
  77. ' Boolean variables
  78. Dim bAttractMode
  79. Dim bFreePlay
  80. Dim bGameInPlay
  81. Dim bOnTheFirstBall
  82. Dim bExtraBallWonThisBall
  83. Dim bJustStarted
  84. Dim bBallInPlungerLane
  85. Dim bBallSaverActive
  86.  
  87. ' core.vbs variables
  88.  
  89. ' *********************************************************************
  90. ' Common rutines to all the tables
  91. ' *********************************************************************
  92.  
  93. Sub Table1_Init()
  94. Dim x
  95.  
  96. ' Init som objects, like walls, targets
  97. VPObjects_Init
  98. LoadEM
  99.  
  100. ' load highscore
  101. Loadhs
  102. ScoreReel1.SetValue HSScore(1)
  103. If B2SOn then
  104. Controller.B2SSetScorePlayer 1, HSScore(1)
  105. End If
  106. UpdateCredits
  107.  
  108. ' init all the global variables
  109. bFreePlay = FreePlay
  110. bAttractMode = False
  111. bOnTheFirstBall = False
  112. bGameInPlay = False
  113. bBallInPlungerLane = False
  114. BallsOnPlayfield = 0
  115. Tilt = 0
  116. TiltSensitivity = 6
  117. Tilted = False
  118. Match = 0
  119. bJustStarted = True
  120. Add10 = 0
  121. Add100 = 0
  122. Add1000 = 0
  123.  
  124. ' setup table in game over mode
  125. EndOfGame
  126.  
  127. 'turn on GI lights
  128. vpmtimer.addtimer 1000, "GiOn '"
  129.  
  130. ' Remove desktop items in FS mode
  131. If Table1.ShowDT then
  132. For each x in aReels
  133. x.Visible = 1
  134. Next
  135. Else
  136. For each x in aReels
  137. x.Visible = 0
  138. Next
  139. End If
  140.  
  141. ' Start the RealTime timer
  142. RealTime.Enabled = 1
  143.  
  144. ' Load table color
  145. LoadLut
  146. End Sub
  147.  
  148. '******
  149. ' Keys
  150. '******
  151.  
  152. Sub Table1_KeyDown(ByVal Keycode)
  153.  
  154. If keycode = LeftMagnaSave Then bLutActive = True
  155. If keycode = RightMagnaSave Then
  156. If bLutActive Then NextLUT:End If
  157. End If
  158.  
  159. If EnteringInitials then
  160. CollectInitials(keycode)
  161. Exit Sub
  162. End If
  163.  
  164. ' add coins
  165. If Keycode = AddCreditKey Then
  166. If(Tilted = False)Then
  167. AddCredits 1
  168. PlaySound "fx_coin"
  169. End If
  170. End If
  171.  
  172. ' plunger
  173. If keycode = PlungerKey Then
  174. Plunger.Pullback
  175. PlaySoundAt "fx_plungerpull", plunger
  176. End If
  177.  
  178. ' tilt keys
  179. If keycode = LeftTiltKey Then Nudge 90, 8:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt
  180. If keycode = RightTiltKey Then Nudge 270, 8:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt
  181. If keycode = CenterTiltKey Then Nudge 0, 9:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt
  182.  
  183. ' keys during game
  184.  
  185. If bGameInPlay AND NOT Tilted Then
  186. If keycode = LeftFlipperKey Then SolLFlipper 1
  187. If keycode = RightFlipperKey Then SolRFlipper 1
  188.  
  189. If keycode = StartGameKey Then
  190. If((PlayersPlayingGame < MaxPlayers)AND(bOnTheFirstBall = True))Then
  191.  
  192. If(bFreePlay = True)Then
  193. PlayersPlayingGame = PlayersPlayingGame + 1
  194. 'PlayersReel.SetValue, PlayersPlayingGame
  195. 'PlaySound "so_fanfare1"
  196. Else
  197. If(Credits > 0)then
  198. PlayersPlayingGame = PlayersPlayingGame + 1
  199. Credits = Credits - 1
  200. UpdateCredits
  201. UpdateBallInPlay
  202. Else
  203. ' Not Enough Credits to start a game.
  204. 'PlaySound "so_nocredits"
  205. End If
  206. End If
  207. End If
  208. End If
  209. Else
  210.  
  211. If keycode = StartGameKey Then
  212. If(bFreePlay = True)Then
  213. If(BallsOnPlayfield = 0)Then
  214. ResetScores
  215. ResetForNewGame()
  216. End If
  217. Else
  218. If(Credits > 0)Then
  219. If(BallsOnPlayfield = 0)Then
  220. Credits = Credits - 1
  221. UpdateCredits
  222. ResetScores
  223. ResetForNewGame()
  224. End If
  225. Else
  226. ' Not Enough Credits to start a game.
  227. 'PlaySound "so_nocredits"
  228. End If
  229. End If
  230. End If
  231. End If ' If (GameInPlay)
  232. End Sub
  233.  
  234. Sub Table1_KeyUp(ByVal keycode)
  235.  
  236. If keycode = LeftMagnaSave Then bLutActive = False
  237.  
  238. If EnteringInitials then
  239. Exit Sub
  240. End If
  241.  
  242. If bGameInPlay AND NOT Tilted Then
  243. ' teclas de los flipers
  244. If keycode = LeftFlipperKey Then SolLFlipper 0
  245. If keycode = RightFlipperKey Then SolRFlipper 0
  246. End If
  247.  
  248. If keycode = PlungerKey Then
  249. Plunger.Fire
  250. If bBallInPlungerLane Then
  251. PlaySoundAt "fx_plunger", plunger
  252. Else
  253. PlaySoundAt "fx_plunger_empty", plunger
  254. End If
  255. End If
  256. End Sub
  257.  
  258. '******************
  259. ' Table stop/pause
  260. '******************
  261.  
  262. Sub table1_Paused
  263. End Sub
  264.  
  265. Sub table1_unPaused
  266. End Sub
  267.  
  268. Sub table1_Exit
  269. Savehs
  270. 'Controller.Stop
  271. End Sub
  272.  
  273. '********************
  274. ' Flippers
  275. '********************
  276.  
  277. Sub SolLFlipper(Enabled)
  278. If Enabled Then
  279. PlaySoundAt SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), LeftFlipper
  280. LeftFlipper.EOSTorque = 0.75:LeftFlipper.RotateToEnd
  281. Else
  282. PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper
  283. LeftFlipper.EOSTorque = 0.2:LeftFlipper.RotateToStart
  284. End If
  285. End Sub
  286.  
  287. Sub SolRFlipper(Enabled)
  288. If Enabled Then
  289. PlaySoundAt SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), RightFlipper
  290. RightFlipper.EOSTorque = 0.75:RightFlipper.RotateToEnd
  291. Else
  292. PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper
  293. RightFlipper.EOSTorque = 0.2:RightFlipper.RotateToStart
  294. End If
  295. End Sub
  296.  
  297. ' flippers hit Sound
  298.  
  299. Sub LeftFlipper_Collide(parm)
  300. PlaySound "fx_rubber_flipper", 0, parm / 60, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  301. End Sub
  302.  
  303. Sub RightFlipper_Collide(parm)
  304. PlaySound "fx_rubber_flipper", 0, parm / 60, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  305. End Sub
  306.  
  307. '***********
  308. ' GI lights
  309. '***********
  310.  
  311. Sub GiOn 'enciende las luces GI
  312. Dim bulb
  313. For each bulb in aGiLights
  314. bulb.State = 1
  315. Next
  316. End Sub
  317.  
  318. Sub GiOff 'apaga las luces GI
  319. Dim bulb
  320. For each bulb in aGiLights
  321. bulb.State = 0
  322. Next
  323. End Sub
  324.  
  325. '**************
  326. ' TILT
  327. '**************
  328.  
  329. Sub CheckTilt
  330. Tilt = Tilt + TiltSensitivity
  331. TiltDecreaseTimer.Enabled = True
  332. If Tilt > 15 Then
  333. Tilted = True
  334. TiltReel.SetValue 1
  335. If B2SOn then
  336. Controller.B2SSetTilt 1
  337. end if
  338. DisableTable True
  339. ' BallsRemaining(CurrentPlayer) = 0 'player looses the game
  340. TiltRecoveryTimer.Enabled = True 'wait for all the balls to drain
  341. End If
  342. End Sub
  343.  
  344. Sub TiltDecreaseTimer_Timer
  345. If Tilt > 0 Then
  346. Tilt = Tilt - 0.1
  347. Else
  348. TiltDecreaseTimer.Enabled = False
  349. End If
  350. End Sub
  351.  
  352. Sub DisableTable(Enabled)
  353. If Enabled Then
  354. GiOff
  355. LeftFlipper.RotateToStart
  356. RightFlipper.RotateToStart
  357. Bumper001.Force = 0
  358. Bumper002.Force = 0
  359. LeftSlingshot.Disabled = 1
  360. RightSlingshot.Disabled = 1
  361. Else
  362. GiOn
  363. Bumper001.Force = 10
  364. Bumper002.Force = 10
  365. LeftSlingshot.Disabled = 0
  366. RightSlingshot.Disabled = 0
  367. End If
  368. End Sub
  369.  
  370. Sub TiltRecoveryTimer_Timer()
  371. ' all the balls have drained
  372. If(BallsOnPlayfield = 0)Then
  373. EndOfBall()
  374. TiltRecoveryTimer.Enabled = False
  375. End If
  376. ' otherwise repeat
  377. End Sub
  378.  
  379. '***************************************************************
  380. ' Supporting Ball & Sound Functions v3.0
  381. ' includes random pitch in PlaySoundAt and PlaySoundAtBall
  382. '***************************************************************
  383.  
  384. Dim TableWidth, TableHeight
  385.  
  386. TableWidth = Table1.width
  387. TableHeight = Table1.height
  388.  
  389. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  390. Vol = Csng(BallVel(ball) ^2 / 2000)
  391. End Function
  392.  
  393. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  394. Dim tmp
  395. tmp = ball.x * 2 / TableWidth-1
  396. If tmp > 0 Then
  397. Pan = Csng(tmp ^10)
  398. Else
  399. Pan = Csng(-((- tmp) ^10))
  400. End If
  401. End Function
  402.  
  403. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  404. Pitch = BallVel(ball) * 20
  405. End Function
  406.  
  407. Function BallVel(ball) 'Calculates the ball speed
  408. BallVel = (SQR((ball.VelX ^2) + (ball.VelY ^2)))
  409. End Function
  410.  
  411. Function AudioFade(ball) 'only on VPX 10.4 and newer
  412. Dim tmp
  413. tmp = ball.y * 2 / TableHeight-1
  414. If tmp > 0 Then
  415. AudioFade = Csng(tmp ^10)
  416. Else
  417. AudioFade = Csng(-((- tmp) ^10))
  418. End If
  419. End Function
  420.  
  421. Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
  422. PlaySound soundname, 0, 1, Pan(tableobj), 0.1, 0, 0, 0, AudioFade(tableobj)
  423. End Sub
  424.  
  425. Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets, metals, plastics
  426. PlaySound soundname, 0, Vol(ActiveBall), pan(ActiveBall), 0.4, 0, 0, 0, AudioFade(ActiveBall)
  427. End Sub
  428.  
  429. '***********************************************
  430. ' JP's VP10 Rolling Sounds + Ballshadow v3.0
  431. ' uses a collection of shadows, aBallShadow
  432. '***********************************************
  433.  
  434. Const tnob = 19 'total number of balls, 20 balls, from 0 to 19
  435. Const lob = 0 'number of locked balls
  436. Const maxvel = 28 'max ball velocity
  437. ReDim rolling(tnob)
  438. InitRolling
  439.  
  440. Sub InitRolling
  441. Dim i
  442. For i = 0 to tnob
  443. rolling(i) = False
  444. Next
  445. End Sub
  446.  
  447. Sub RollingUpdate()
  448. Dim BOT, b, ballpitch, ballvol, speedfactorx, speedfactory
  449. BOT = GetBalls
  450.  
  451. ' stop the sound of deleted balls and hide the shadow
  452. For b = UBound(BOT) + 1 to tnob
  453. rolling(b) = False
  454. StopSound("fx_ballrolling" & b)
  455. aBallShadow(b).Y = 3000
  456. Next
  457.  
  458. ' exit the sub if no balls on the table
  459. If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table
  460.  
  461. ' play the rolling sound for each ball and draw the shadow
  462. For b = lob to UBound(BOT)
  463. aBallShadow(b).X = BOT(b).X
  464. aBallShadow(b).Y = BOT(b).Y
  465.  
  466. If BallVel(BOT(b)) > 1 Then
  467. If BOT(b).z < 30 Then
  468. ballpitch = Pitch(BOT(b))
  469. ballvol = Vol(BOT(b))
  470. Else
  471. ballpitch = Pitch(BOT(b)) + 25000 'increase the pitch on a ramp
  472. ballvol = Vol(BOT(b)) * 10
  473. End If
  474. rolling(b) = True
  475. PlaySound("fx_ballrolling" & b), -1, ballvol, Pan(BOT(b)), 0, ballpitch, 1, 0, AudioFade(BOT(b))
  476. Else
  477. If rolling(b) = True Then
  478. StopSound("fx_ballrolling" & b)
  479. rolling(b) = False
  480. End If
  481. End If
  482.  
  483. ' rothbauerw's Dropping Sounds
  484. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  485. PlaySound "fx_balldrop", 0, ABS(BOT(b).velz) / 17, Pan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  486. End If
  487.  
  488. ' jps ball speed control
  489. If BOT(b).VelX AND BOT(b).VelY <> 0 Then
  490. speedfactorx = ABS(maxvel / BOT(b).VelX)
  491. speedfactory = ABS(maxvel / BOT(b).VelY)
  492. If speedfactorx < 1 Then
  493. BOT(b).VelX = BOT(b).VelX * speedfactorx
  494. BOT(b).VelY = BOT(b).VelY * speedfactorx
  495. End If
  496. If speedfactory < 1 Then
  497. BOT(b).VelX = BOT(b).VelX * speedfactory
  498. BOT(b).VelY = BOT(b).VelY * speedfactory
  499. End If
  500. End If
  501. Next
  502. End Sub
  503.  
  504. '**********************
  505. ' Ball Collision Sound
  506. '**********************
  507.  
  508. Sub OnBallBallCollision(ball1, ball2, velocity)
  509. PlaySound "fx_collide", 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  510. End Sub
  511.  
  512. '************************************
  513. ' Diverse Collection Hit Sounds v3.0
  514. '************************************
  515.  
  516. Sub aMetals_Hit(idx):PlaySoundAtBall "fx_MetalHit":End Sub
  517. Sub aMetalWires_Hit(idx):PlaySoundAtBall "fx_MetalWire":End Sub
  518. Sub aRubber_Bands_Hit(idx):PlaySoundAtBall "fx_rubber_band":End Sub
  519. Sub aRubber_LongBands_Hit(idx):PlaySoundAtBall "fx_rubber_longband":End Sub
  520. Sub aRubber_Posts_Hit(idx):PlaySoundAtBall "fx_rubber_post":End Sub
  521. Sub aRubber_Pins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub
  522. Sub aRubber_Pegs_Hit(idx):PlaySoundAtBall "fx_rubber_peg":End Sub
  523. Sub aPlastics_Hit(idx):PlaySoundAtBall "fx_PlasticHit":End Sub
  524. Sub aGates_Hit(idx):PlaySoundAtBall "fx_Gate":End Sub
  525. Sub aWoods_Hit(idx):PlaySoundAtBall "fx_Woodhit":End Sub
  526. Sub aTargets_Hit(idx):ActiveBall.VelZ = BallVel(Activeball) * (RND / 2):End Sub
  527.  
  528. '************************************************************************************************************************
  529. ' Only for VPX 10.2 and higher.
  530. ' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  531. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  532. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  533. '************************************************************************************************************************
  534.  
  535. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState)
  536. If TypeName(MyLight) = "Light" Then
  537. If FinalState = 2 Then
  538. FinalState = MyLight.State
  539. End If
  540. MyLight.BlinkInterval = BlinkPeriod
  541. MyLight.Duration 2, TotalPeriod, FinalState
  542. ElseIf TypeName(MyLight) = "Flasher" Then
  543. Dim steps
  544. steps = Int(TotalPeriod / BlinkPeriod + .5)
  545. If FinalState = 2 Then
  546. FinalState = ABS(MyLight.Visible)
  547. End If
  548. MyLight.UserValue = steps * 10 + FinalState
  549. MyLight.TimerInterval = BlinkPeriod
  550. MyLight.TimerEnabled = 0
  551. MyLight.TimerEnabled = 1
  552. ExecuteGlobal "Sub " & MyLight.Name & "_Timer:" & "Dim tmp, steps, fstate:tmp=me.UserValue:fstate = tmp MOD 10:steps= tmp\10 -1:Me.Visible = steps MOD 2:me.UserValue = steps *10 + fstate:If Steps = 0 then Me.Visible = fstate:Me.TimerEnabled=0:End if:End Sub"
  553. End If
  554. End Sub
  555.  
  556. '****************************************
  557. ' Init table for a new game
  558. '****************************************
  559.  
  560. Sub ResetForNewGame()
  561. 'debug.print "ResetForNewGame"
  562. Dim i
  563.  
  564. bGameInPLay = True
  565. bBallSaverActive = False
  566.  
  567. StopAttractMode
  568. If B2SOn then
  569. Controller.B2SSetGameOver 0
  570. end if
  571.  
  572. GiOn
  573.  
  574. CurrentPlayer = 1
  575. PlayersPlayingGame = 1
  576. bOnTheFirstBall = True
  577. For i = 1 To MaxPlayers
  578. Score(i) = 0
  579. ExtraBallsAwards(i) = 0
  580. Special1Awarded(i) = False
  581. Special2Awarded(i) = False
  582. Special3Awarded(i) = False
  583. BallsRemaining(i) = BallsPerGame
  584. Next
  585. BonusMultiplier = 1
  586. Bonus = 0
  587. UpdateBallInPlay
  588.  
  589. Clear_Match
  590.  
  591. ' init other variables
  592. Tilt = 0
  593.  
  594. ' init game variables
  595. Game_Init()
  596.  
  597. ' start a music?
  598. ' first ball
  599. vpmtimer.addtimer 2000, "FirstBall '"
  600. End Sub
  601.  
  602. Sub FirstBall
  603. 'debug.print "FirstBall"
  604. ' reset table for a new ball, rise droptargets ++
  605. ResetForNewPlayerBall()
  606. CreateNewBall()
  607. End Sub
  608.  
  609. ' (Re-)init table for a new ball or player
  610.  
  611. Sub ResetForNewPlayerBall()
  612. 'debug.print "ResetForNewPlayerBall"
  613. AddScore 0
  614.  
  615. ' reset multiplier to 1x
  616.  
  617. ' turn on lights, and variables
  618. bExtraBallWonThisBall = False
  619. ResetNewBallLights
  620. ResetNewBallVariables
  621. End Sub
  622.  
  623. ' Crete new ball
  624.  
  625. Sub CreateNewBall()
  626. BallRelease.CreateSizedBallWithMass BallSize / 2, BallMass
  627. BallsOnPlayfield = BallsOnPlayfield + 1
  628. UpdateBallInPlay
  629. PlaySoundAt SoundFXDOF("fx_Ballrel", 110, DOFPulse, DOFContactors), BallRelease
  630. BallRelease.Kick 90, 4
  631. End Sub
  632.  
  633. ' player lost the ball
  634.  
  635. Sub EndOfBall()
  636. 'debug.print "EndOfBall"
  637. Dim AwardPoints, TotalBonus, ii
  638. AwardPoints = 0
  639. TotalBonus = 0
  640. ' Lost the first ball, now it cannot accept more players
  641. bOnTheFirstBall = False
  642.  
  643. 'No bonus in this table
  644.  
  645. ' add bonus if no tilt
  646. ' tilt system will take care of the next ball
  647.  
  648. 'If NOT Tilted AND LightShootAgain.State Then
  649. 'If NOT Tilted Then
  650. ' Select Case BonusMultiplier
  651. ' Case 1:BonusCountTimer.Interval = 250
  652. ' Case 2:BonusCountTimer.Interval = 400
  653. ' Case 3:BonusCountTimer.Interval = 550
  654. ' End Select
  655. ' BonusCountTimer.Enabled = 1
  656. 'Else
  657. vpmtimer.addtimer 400, "EndOfBall2 '"
  658. 'End If
  659. End Sub
  660.  
  661. Sub BonusCountTimer_Timer
  662. 'debug.print "BonusCount_Timer"
  663. If Bonus > 0 Then
  664. Bonus = Bonus -1
  665. AddScore 1000 * BonusMultiplier
  666. UpdateBonusLights
  667. Else
  668. BonusCountTimer.Enabled = 0
  669. vpmtimer.addtimer 1000, "EndOfBall2 '"
  670. End If
  671. End Sub
  672.  
  673. Sub UpdateBonusLights
  674. Select Case Bonus
  675. Case 0:bl1.State = 1:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  676. Case 1:bl1.State = 0:bl2.State = 10:bl2a.State = 1:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  677. Case 2:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 1:bl3a.State = 1:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  678. Case 3:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 1:bl4a.State = 1:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  679. Case 4:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 1:bl5a.State = 1:bl5k.State = 0:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  680. Case 5:bl1.State = 1:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 1:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  681. Case 6:bl1.State = 0:bl2.State = 1:bl2a.State = 1:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 1:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  682. Case 7:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 1:bl3a.State = 1:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 1:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  683. Case 8:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 1:bl4a.State = 1:bl5.State = 0:bl5a.State = 0:bl5k.State = 1:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  684. Case 9:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 1:bl5a.State = 1:bl5k.State = 1:bl10k.State = 0:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  685. Case 10:bl1.State = 1:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 1:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  686. Case 11:bl1.State = 0:bl2.State = 1:bl2a.State = 1:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 1:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  687. Case 12:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 1:bl3a.State = 1:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 1:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  688. Case 13:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 1:bl4a.State = 1:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 1:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  689. Case 14:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 1:bl5a.State = 1:bl5k.State = 0:bl10k.State = 1:bl15k.State = 0:bl20k.State = 0:SpecialL1.State = 0
  690. Case 15:bl1.State = 1:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 1:bl20k.State = 0:SpecialL1.State = 0
  691. Case 16:bl1.State = 0:bl2.State = 1:bl2a.State = 1:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 1:bl20k.State = 0:SpecialL1.State = 0
  692. Case 17:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 1:bl3a.State = 1:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 1:bl20k.State = 0:SpecialL1.State = 0
  693. Case 18:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 1:bl4a.State = 1:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 1:bl20k.State = 0:SpecialL1.State = 0
  694. Case 19:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 1:bl5a.State = 1:bl5k.State = 0:bl10k.State = 0:bl15k.State = 1:bl20k.State = 0:SpecialL1.State = 0
  695. Case 20:bl1.State = 0:bl2.State = 0:bl2a.State = 0:bl3.State = 0:bl3a.State = 0:bl4.State = 0:bl4a.State = 0:bl5.State = 0:bl5a.State = 0:bl5k.State = 0:bl10k.State = 0:bl15k.State = 0:bl20k.State = 1:SpecialL1.State = 1
  696. End Select
  697. End Sub
  698.  
  699. ' After bonus count go to the next step
  700. '
  701. Sub EndOfBall2()
  702. 'debug.print "EndOfBall2"
  703.  
  704. Tilted = False
  705. Tilt = 0
  706. TiltReel.SetValue 0
  707. If B2SOn then
  708. Controller.B2SSetTilt 0
  709. end if
  710. DisableTable False
  711.  
  712. ' win extra ball?
  713. If(ExtraBallsAwards(CurrentPlayer) > 0)Then
  714. 'debug.print "Extra Ball"
  715.  
  716. ' if so then give it
  717. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer)- 1
  718.  
  719. ' turn off light if no more extra balls
  720. If(ExtraBallsAwards(CurrentPlayer) = 0)Then
  721. 'LightShootAgain.State = 0
  722. 'If B2SOn then
  723. 'Controller.B2SSetShootAgain 0
  724. 'end if
  725. End If
  726.  
  727. ' extra ball sound?
  728.  
  729. ' reset as in a new ball
  730. ResetForNewPlayerBall()
  731. CreateNewBall()
  732. Else ' no extra ball
  733.  
  734. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer)- 1
  735.  
  736. ' last ball?
  737. If(BallsRemaining(CurrentPlayer) <= 0)Then
  738. CheckHighScore()
  739. End If
  740.  
  741. ' this is not the last ball, chack for new player
  742. EndOfBallComplete()
  743. End If
  744. End Sub
  745.  
  746. Sub EndOfBallComplete()
  747. 'debug.print "EndOfBallComplete"
  748. Dim NextPlayer
  749.  
  750. ' other players?
  751. If(PlayersPlayingGame > 1)Then
  752. NextPlayer = CurrentPlayer + 1
  753. ' if it is the last player then go to the first one
  754. If(NextPlayer > PlayersPlayingGame)Then
  755. NextPlayer = 1
  756. End If
  757. Else
  758. NextPlayer = CurrentPlayer
  759. End If
  760.  
  761. 'debug.print "Next Player = " & NextPlayer
  762.  
  763. ' end of game?
  764. If((BallsRemaining(CurrentPlayer) <= 0)AND(BallsRemaining(NextPlayer) <= 0))Then
  765.  
  766. ' match if playing with coins
  767. If bFreePlay = False Then
  768. Verification_Match
  769. End If
  770.  
  771. ' end of game
  772. EndOfGame()
  773. Else
  774. ' next player
  775. CurrentPlayer = NextPlayer
  776.  
  777. ' update score
  778. AddScore 0
  779.  
  780. ' reset table for new player
  781. ResetForNewPlayerBall()
  782. CreateNewBall()
  783. End If
  784. End Sub
  785.  
  786. ' Called at the end of the game
  787.  
  788. Sub EndOfGame()
  789. 'debug.print "EndOfGame"
  790. bGameInPLay = False
  791. bJustStarted = False
  792. UpdateBallInPlay
  793. If B2SOn then
  794. Controller.B2SSetGameOver 1
  795. Controller.B2SSetBallInPlay 0
  796. Controller.B2SSetPlayerUp 0
  797. Controller.B2SSetCanPlay 0
  798. end if
  799. ' turn off flippers
  800. SolLFlipper 0
  801. SolRFlipper 0
  802.  
  803. ' start the attract mode
  804. StartAttractMode
  805. End Sub
  806.  
  807. ' Fuction to calculate the balls left
  808. Function Balls
  809. Dim tmp
  810. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  811. If tmp > BallsPerGame Then
  812. Balls = 0
  813. Else
  814. Balls = tmp
  815. End If
  816. End Function
  817.  
  818. ' check the highscore
  819. Sub CheckHighscore
  820. Dim playertops, si, sj, i, stemp, stempplayers
  821. For i = 1 to 4
  822. sortscores(i) = 0
  823. sortplayers(i) = 0
  824. Next
  825. playertops = 0
  826. For i = 1 to PlayersPlayingGame
  827. sortscores(i) = Score(i)
  828. sortplayers(i) = i
  829. Next
  830. For si = 1 to PlayersPlayingGame
  831. For sj = 1 to PlayersPlayingGame-1
  832. If sortscores(sj) > sortscores(sj + 1)then
  833. stemp = sortscores(sj + 1)
  834. stempplayers = sortplayers(sj + 1)
  835. sortscores(sj + 1) = sortscores(sj)
  836. sortplayers(sj + 1) = sortplayers(sj)
  837. sortscores(sj) = stemp
  838. sortplayers(sj) = stempplayers
  839. End If
  840. Next
  841. Next
  842. HighScoreTimer.interval = 100
  843. HighScoreTimer.enabled = True
  844. ScoreChecker = 4
  845. CheckAllScores = 1
  846. NewHighScore sortscores(ScoreChecker), sortplayers(ScoreChecker)
  847. End Sub
  848.  
  849. '******************
  850. ' Match
  851. '******************
  852.  
  853. Sub Verification_Match()
  854. PlaySound "fx_match"
  855. Match = INT(RND(1) * 10) * 10 ' random between 10 and 90
  856. Display_Match
  857. If(Score(CurrentPlayer)MOD 100) = Match Then
  858. PlaySound SoundFXDOF("fx_knocker", 108, DOFPulse, DOFknocker)
  859. AddCredits 1
  860. End If
  861. End Sub
  862.  
  863. Sub Clear_Match()
  864. MatchReel.SetValue 0
  865. If B2SOn then
  866. Controller.B2SSetMatch 0
  867. end if
  868. End Sub
  869.  
  870. Sub Display_Match()
  871. MatchReel.SetValue(Match \ 10) + 1
  872. If B2SOn then
  873. If Match = 0 then
  874. Controller.B2SSetMatch 100
  875. else
  876. Controller.B2SSetMatch Match
  877. end if
  878. end if
  879. End Sub
  880.  
  881. ' *********************************************************************
  882. ' Drain / Plunger Functions
  883. ' *********************************************************************
  884.  
  885. Sub Drain_Hit()
  886. Drain.DestroyBall
  887. If NOT bGameInPlay Then Exit Sub
  888. BallsOnPlayfield = BallsOnPlayfield - 1
  889. PlaySoundAt "fx_drain", Drain
  890.  
  891. 'tilted?
  892. If Tilted Then
  893. StopEndOfBallMode
  894. End If
  895.  
  896. ' if still playing and not tilted
  897. If(bGameInPLay = True)AND(Tilted = False)Then
  898.  
  899. ' ballsaver?
  900. If(bBallSaverActive = True)Then
  901. CreateNewBall()
  902. Else
  903. ' last ball?
  904. If(BallsOnPlayfield = 0)Then
  905. StopEndOfBallMode
  906. vpmtimer.addtimer 500, "EndOfBall '"
  907. Exit Sub
  908. End If
  909. End If
  910. End If
  911. End Sub
  912.  
  913. Sub swPlungerRest_Hit()
  914. bBallInPlungerLane = True
  915. End Sub
  916.  
  917. Sub swPlungerRest_UnHit()
  918. bBallInPlungerLane = False
  919. End Sub
  920.  
  921. ' ****************************************
  922. ' Score functions
  923. ' ****************************************
  924.  
  925. Sub AddScore(Points)
  926. If Tilted Then Exit Sub
  927. Select Case Points
  928. Case 10, 100, 1000
  929. Score(CurrentPlayer) = Score(CurrentPlayer) + points
  930. UpdateScore points
  931. ' sounds
  932. If Points = 100 AND(Score(CurrentPlayer)MOD 1000) \ 100 = 0 Then 'new reel 1000
  933. PlaySound SoundFXDOF("1000", 111, DOFPulse, DOFChimes)
  934. ElseIf Points = 10 AND(Score(CurrentPlayer)MOD 100) \ 10 = 0 Then 'new reel 100
  935. PlaySound SoundFXDOF("100", 112, DOFPulse, DOFChimes)
  936. Else
  937. PlaySound Points
  938. DOF 113, DOFPulse
  939. End If
  940. Case 50
  941. Add10 = Add10 + 5
  942. AddScore10Timer.Enabled = TRUE
  943. Case 500
  944. Add100 = Add100 + 5
  945. AddScore100Timer.Enabled = TRUE
  946. Case 5000
  947. Add1000 = Add1000 + 5
  948. AddScore1000Timer.Enabled = TRUE
  949. End Select
  950.  
  951. ' check for higher score and specials
  952. If Score(CurrentPlayer) >= Special1 AND Special1Awarded(CurrentPlayer) = False Then
  953. AwardSpecial
  954. Special1Awarded(CurrentPlayer) = True
  955. End If
  956. If Score(CurrentPlayer) >= Special2 AND Special2Awarded(CurrentPlayer) = False Then
  957. AwardSpecial
  958. Special2Awarded(CurrentPlayer) = True
  959. End If
  960. ' If Score(CurrentPlayer) >= Special3 AND Special3Awarded(CurrentPlayer) = False Then
  961. ' AwardSpecial
  962. ' Special3Awarded(CurrentPlayer) = True
  963. ' End If
  964. End Sub
  965.  
  966. '************************************
  967. ' Score sound Timers
  968. '************************************
  969.  
  970. Sub AddScore10Timer_Timer()
  971. if Add10 > 0 then
  972. AddScore 10
  973. Add10 = Add10 - 1
  974. Else
  975. Me.Enabled = FALSE
  976. End If
  977. End Sub
  978.  
  979. Sub AddScore100Timer_Timer()
  980. if Add100 > 0 then
  981. AddScore 100
  982. Add100 = Add100 - 1
  983. Else
  984. Me.Enabled = FALSE
  985. End If
  986. End Sub
  987.  
  988. Sub AddScore1000Timer_Timer()
  989. if Add1000 > 0 then
  990. AddScore 1000
  991. Add1000 = Add1000 - 1
  992. Else
  993. Me.Enabled = FALSE
  994. End If
  995. End Sub
  996.  
  997. '*******************
  998. ' BONUS
  999. '*******************
  1000.  
  1001. Sub AddBonus(bonuspoints)
  1002. If(Tilted = False)Then
  1003. Bonus = Bonus + bonuspoints
  1004. PlaySound "Bell2"
  1005. If Bonus > 20 Then
  1006. Bonus = 20
  1007. End If
  1008. UpdateBonusLights
  1009. End if
  1010. End Sub
  1011.  
  1012. Sub AddBonusMultiplier(multi)
  1013. If(Tilted = False)Then
  1014. BonusMultiplier = BonusMultiplier + multi
  1015. If BonusMultiplier > MaxMultiplier Then
  1016. BonusMultiplier = MaxMultiplier
  1017. End If
  1018. UpdateMultiplierLights
  1019. End if
  1020. End Sub
  1021.  
  1022. Sub UpdateMultiplierLights
  1023. Select Case BonusMultiplier
  1024. 'Case 1:li2.State = 1:li3.State = 0:li4.State = 0
  1025. 'Case 2:li2.State = 0:li3.State = 1:li4.State = 0
  1026. 'Case 3:li2.State = 0:li3.State = 0:li4.State = 1
  1027. End Select
  1028. End Sub
  1029.  
  1030. '**********************************
  1031. ' Score EM reels
  1032. '**********************************
  1033.  
  1034. Sub UpdateScore(playerpoints)
  1035. Select Case CurrentPlayer
  1036. Case 1:ScoreReel1.Addvalue playerpoints
  1037. 'Case 2:ScoreReel2.Addvalue playerpoints
  1038.  
  1039. End Select
  1040. If B2SOn then
  1041. Controller.B2SSetScorePlayer CurrentPlayer, Score(CurrentPlayer)
  1042. If Score(CurrentPlayer) >= 100000 then
  1043. Controller.B2SSetScoreRollover 24 + CurrentPlayer, 1
  1044. end if
  1045. end if
  1046. End Sub
  1047.  
  1048. Sub ResetScores
  1049. ScoreReel1.SetValue 10
  1050. ScoreReel1.ResetToZero
  1051. 'ScoreReel2.ResetToZero
  1052. If B2SOn then
  1053. Controller.B2SSetScorePlayer1 0
  1054. Controller.B2SSetScoreRolloverPlayer1 0
  1055. 'Controller.B2SSetScorePlayer2 0
  1056. 'Controller.B2SSetScoreRolloverPlayer2 0
  1057. end if
  1058. End Sub
  1059.  
  1060. Sub AddCredits(value) 'limit to 15 credits
  1061. If Credits < 15 Then
  1062. Credits = Credits + value
  1063. CreditsReel.SetValue Credits
  1064. UpdateCredits
  1065. end if
  1066. End Sub
  1067.  
  1068. Sub UpdateCredits
  1069. PlaySound "fx_relay"
  1070. CreditsReel.SetValue credits
  1071. If B2SOn then
  1072. Controller.B2SSetCredits Credits
  1073. end if
  1074. End Sub
  1075.  
  1076. Sub UpdateBallInPlay
  1077. Select Case Balls
  1078. Case 0:BallDisplay.ImageA = "Ballnr0"
  1079. Case 1:BallDisplay.ImageA = "Ballnr1"
  1080. Case 2:BallDisplay.ImageA = "Ballnr2"
  1081. Case 3:BallDisplay.ImageA = "Ballnr3"
  1082. Case 4:BallDisplay.ImageA = "Ballnr4"
  1083. Case 5:BallDisplay.ImageA = "Ballnr5"
  1084. End Select
  1085. If B2SOn then
  1086. Controller.B2SSetBallInPlay Balls
  1087. End If
  1088. End Sub
  1089.  
  1090. '*************************
  1091. ' Specials
  1092. '*************************
  1093.  
  1094. Sub AwardExtraBall()
  1095. If NOT bExtraBallWonThisBall Then
  1096. PlaySound SoundFXDOF("fx_knocker", 108, DOFPulse, DOFknocker)
  1097. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  1098. bExtraBallWonThisBall = True
  1099. Else
  1100. Addscore 5000
  1101. END If
  1102. End Sub
  1103.  
  1104. Sub AwardSpecial()
  1105. PlaySound SoundFXDOF("fx_knocker", 108, DOFPulse, DOFknocker)
  1106. AddCredits 1
  1107. End Sub
  1108.  
  1109. Sub AwardAddaBall()
  1110. If BallsRemaining(CurrentPlayer) < 11 Then
  1111. PlaySound SoundFXDOF("fx_knocker", 108, DOFPulse, DOFknocker)
  1112. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer) + 1
  1113. UpdateBallInPlay
  1114. End If
  1115. End Sub
  1116.  
  1117. ' ********************************
  1118. ' Attract Mode
  1119. ' ********************************
  1120. ' use the"Blink Pattern" of each light
  1121.  
  1122. Sub StartAttractMode()
  1123. Dim x
  1124. bAttractMode = True
  1125. For each x in aLights
  1126. x.State = 2
  1127. Next
  1128. GameOverR.SetValue 1
  1129. 'update current player and balls
  1130. End Sub
  1131.  
  1132. Sub StopAttractMode()
  1133. Dim x
  1134. bAttractMode = False
  1135. TurnOffPlayfieldLights
  1136. ResetScores
  1137. GameOverR.SetValue 0
  1138. End Sub
  1139.  
  1140. '*************************************
  1141. ' Highscore Routines
  1142. ' Based og Black's and GNMOD's code
  1143. '*************************************
  1144.  
  1145. Dim EnteringInitials
  1146. EnteringInitials = False
  1147.  
  1148. Dim SelectedChar ' character under the "cursor" when entering initials
  1149. Dim HSTimerCount: HSTimerCount = 0
  1150. Dim InitialString ' the string holding the player's initials as they're entered
  1151. Dim AlphaString: AlphaString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_<"
  1152. Dim AlphaStringPos ' pointer to AlphaString, move Forward and backward with flipper keys
  1153. Dim HSNewHigh ' The new score to be recorded
  1154. Dim HSScore(5) ' High Scores read in from config file
  1155. Dim HSName(5) ' High Score Initials read in from config file
  1156.  
  1157. ' default high scores
  1158. HSScore(1) = 50000
  1159. HSScore(2) = 40000
  1160. HSScore(3) = 30000
  1161. HSScore(4) = 20000
  1162. HSScore(5) = 10000
  1163.  
  1164. HSName(1) = "AAA"
  1165. HSName(2) = "ZZZ"
  1166. HSName(3) = "XXX"
  1167. HSName(4) = "ABC"
  1168. HSName(5) = "BBB"
  1169.  
  1170. ' Load Highscores
  1171.  
  1172. Sub Loadhs
  1173. Dim FileObj
  1174. Dim ScoreFile, TextStr
  1175. Dim check0, x
  1176.  
  1177. Set FileObj = CreateObject("Scripting.FileSystemObject")
  1178. If Not FileObj.FolderExists(UserDirectory)then
  1179. Credits = 0
  1180. Exit Sub
  1181. End If
  1182. If Not FileObj.FileExists(UserDirectory & cGameName& ".txt")then
  1183. Credits = 0
  1184. Exit Sub
  1185. End If
  1186. Set ScoreFile = FileObj.GetFile(UserDirectory & cGameName& ".txt")
  1187. Set TextStr = ScoreFile.OpenAsTextStream(1, 0)
  1188. If(TextStr.AtEndOfStream = True)then
  1189. Exit Sub
  1190. End If
  1191. check0 = Int(textStr.readLine)
  1192. If check0 = 0 then
  1193. 'Credits = Int(textstr.readline)
  1194. For x = 1 to 5
  1195. 'HSScore(x) = Int(textstr.readline)
  1196. Next
  1197. For x = 1 to 5
  1198. HSName(x) = textstr.readline
  1199. Next
  1200. End If
  1201. TextStr.Close
  1202. Set ScoreFile = Nothing
  1203. Set FileObj = Nothing
  1204. SortHighscore 'added to fix a previous error
  1205. End Sub
  1206.  
  1207. ' Save Highscores
  1208.  
  1209. Sub Savehs
  1210. Dim FileObj
  1211. Dim ScoreFile
  1212. Dim x
  1213. Set FileObj = CreateObject("Scripting.FileSystemObject")
  1214. If Not FileObj.FolderExists(UserDirectory)then
  1215. Exit Sub
  1216. End If
  1217. Set ScoreFile = FileObj.CreateTextFile(UserDirectory & cGameName& ".txt", True)
  1218. ScoreFile.WriteLine 0
  1219. ScoreFile.WriteLine Credits
  1220. For x = 1 to 5
  1221. scorefile.writeline HSScore(x)
  1222. Next
  1223. For x = 1 to 5
  1224. scorefile.writeline HSName(x)
  1225. Next
  1226. ScoreFile.Close
  1227. Set ScoreFile = Nothing
  1228. Set FileObj = Nothing
  1229. End Sub
  1230.  
  1231. ' Sort Highscores
  1232.  
  1233. Sub SortHighscore
  1234. Dim tmp, tmp2, i, j
  1235. For i = 1 to 5
  1236. For j = 1 to 4
  1237. If HSScore(j) <HSScore(j + 1)Then
  1238. tmp = HSScore(j + 1)
  1239. tmp2 = HSName(j + 1)
  1240. HSScore(j + 1) = HSScore(j)
  1241. HSName(j + 1) = HSName(j)
  1242. HSScore(j) = tmp
  1243. HSName(j) = tmp2
  1244. End If
  1245. Next
  1246. Next
  1247. End Sub
  1248.  
  1249. ' check for new highscore
  1250.  
  1251. Sub CheckHighscore
  1252. HighScoreTimer.Enabled = 1
  1253. 'If Score(CurrentPlayer)> HSSCore(1)Then
  1254. ' AwardSpecial
  1255. 'End If
  1256. If Score(CurrentPlayer)> HSSCore(5)Then
  1257. NewHighScore Score(CurrentPlayer), CurrentPlayer
  1258. End If
  1259.  
  1260. End Sub
  1261.  
  1262. ' Highscore Timer
  1263.  
  1264. Sub HighScoreTimer_Timer
  1265. If EnteringInitials then
  1266. SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
  1267. ElseIf bGameInPlay then
  1268. SetHSLine 1, "HIGH SCORE"
  1269. SetHSLine 2, HSScore(1)
  1270. SetHSLine 3, HSName(1)
  1271. HighScoreTimer.Enabled = 0
  1272. Else
  1273. ' cycle through high scores
  1274. SetHSLine 1, "HIGH SCORE" & (HSTimerCount + 1)
  1275. SetHSLine 2, HSScore(HSTimerCount + 1)
  1276. SetHSLine 3, HSName(HSTimerCount + 1)
  1277. HSTimerCount = (HSTimerCount + 1)MOD 5
  1278. End If
  1279. End Sub
  1280.  
  1281. ' Enter Highscore initials
  1282.  
  1283. Function GetHSChar(String, Index)
  1284. Dim ThisChar
  1285. Dim FileName
  1286. ThisChar = Mid(String, Index, 1)
  1287. FileName = "PostIt"
  1288. If ThisChar = " " or ThisChar = "" then
  1289. FileName = FileName & "BL"
  1290. ElseIf ThisChar = "<" then
  1291. FileName = FileName & "LT"
  1292. ElseIf ThisChar = "_" then
  1293. FileName = FileName & "SP"
  1294. Else
  1295. FileName = FileName & ThisChar
  1296. End If
  1297. GetHSChar = FileName
  1298. End Function
  1299.  
  1300. Sub SetHsLine(LineNo, String)
  1301. Dim StrLen
  1302. Dim Index
  1303. Dim StartHSArray
  1304. Dim EndHSArray
  1305. Dim xFor
  1306. StartHSArray = array(0, 1, 12, 22)
  1307. EndHSArray = array(0, 11, 21, 31)
  1308. StrLen = len(string)
  1309. Index = 1
  1310. For xFor = StartHSArray(LineNo)to EndHSArray(LineNo)
  1311. Eval("HS" &xFor).imageA = GetHSChar(String, Index)
  1312. Index = Index + 1
  1313. Next
  1314. End Sub
  1315.  
  1316. Sub NewHighScore(NewScore, PlayNum)
  1317. If NewScore> HSScore(5)then
  1318. HighScoreTimer.interval = 500
  1319. AlphaStringPos = 1 ' start with first character "A"
  1320. EnteringInitials = true ' intercept the control keys while entering initials
  1321. InitialString = "" ' initials entered so far, initialize to empty
  1322. SetHSLine 1, "PLAYER " + FormatNumber(PlayNum, 0)
  1323. SetHSLine 2, "ENTER NAME"
  1324. SetHSLine 3, MID(AlphaString, AlphaStringPos, 1)
  1325. HSNewHigh = NewScore
  1326. End If
  1327. End Sub
  1328.  
  1329. Sub CollectInitials(keycode)
  1330. Dim i
  1331. If keycode = LeftFlipperKey Then
  1332. ' back up to previous character
  1333. AlphaStringPos = AlphaStringPos - 1
  1334. If AlphaStringPos <1 then
  1335. AlphaStringPos = len(AlphaString) ' handle wrap from beginning to End
  1336. If InitialString = "" then
  1337. ' Skip the backspace If there are no characters to backspace over
  1338. AlphaStringPos = AlphaStringPos - 1
  1339. End If
  1340. End If
  1341. SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
  1342. PlaySound "fx_Previous"
  1343. ElseIf keycode = RightFlipperKey Then
  1344. ' advance to Next character
  1345. AlphaStringPos = AlphaStringPos + 1
  1346. If AlphaStringPos> len(AlphaString)or(AlphaStringPos = len(AlphaString)and InitialString = "")then
  1347. ' Skip the backspace If there are no characters to backspace over
  1348. AlphaStringPos = 1
  1349. End If
  1350. SetHSLine 3, InitialString & MID(AlphaString, AlphaStringPos, 1)
  1351. PlaySound "fx_Next"
  1352. ElseIf keycode = StartGameKey or keycode = PlungerKey Then
  1353. SelectedChar = MID(AlphaString, AlphaStringPos, 1)
  1354. If SelectedChar = "_" then
  1355. InitialString = InitialString & " "
  1356. PlaySound("fx_Esc")
  1357. ElseIf SelectedChar = "<" then
  1358. InitialString = MID(InitialString, 1, len(InitialString)- 1)
  1359. If len(InitialString) = 0 then
  1360. ' If there are no more characters to back over, don't leave the < displayed
  1361. AlphaStringPos = 1
  1362. End If
  1363. PlaySound("fx_Esc")
  1364. Else
  1365. InitialString = InitialString & SelectedChar
  1366. PlaySound("fx_Enter")
  1367. End If
  1368. If len(InitialString) <3 then
  1369. SetHSLine 3, InitialString & SelectedChar
  1370. End If
  1371. End If
  1372. If len(InitialString) = 3 then
  1373. EnteringInitials = False
  1374. HSScore(5) = HSNewHigh
  1375. HSName(5) = InitialString
  1376. SortHighScore
  1377. HighScoreTimer.interval = 2000
  1378. End If
  1379. End Sub
  1380.  
  1381. '*******************
  1382. ' Realtime updates
  1383. '*******************
  1384.  
  1385. Sub RealTime_Timer
  1386. RollingUpdate
  1387. LeftFlipperTop.RotZ = LeftFlipper.CurrentAngle
  1388. RightFlipperTop.RotZ = RightFlipper.CurrentAngle
  1389. End Sub
  1390.  
  1391. '*********
  1392. ' LUT
  1393. '*********
  1394.  
  1395. Dim bLutActive, LUTImage
  1396. Sub LoadLUT
  1397. bLutActive = False
  1398. x = LoadValue(cGameName, "LUTImage")
  1399. If(x <> "")Then LUTImage = x Else LUTImage = 0
  1400. UpdateLUT
  1401. End Sub
  1402.  
  1403. Sub SaveLUT
  1404. SaveValue cGameName, "LUTImage", LUTImage
  1405. End Sub
  1406.  
  1407. Sub NextLUT:LUTImage = (LUTImage + 1)MOD 9:UpdateLUT:SaveLUT:End Sub
  1408.  
  1409. Sub UpdateLUT
  1410. Select Case LutImage
  1411. Case 0:table1.ColorGradeImage = "LUT0"
  1412. Case 1:table1.ColorGradeImage = "LUT1"
  1413. Case 2:table1.ColorGradeImage = "LUT2"
  1414. Case 3:table1.ColorGradeImage = "LUT3"
  1415. Case 4:table1.ColorGradeImage = "LUT4"
  1416. Case 5:table1.ColorGradeImage = "LUT5"
  1417. Case 6:table1.ColorGradeImage = "LUT6"
  1418. Case 7:table1.ColorGradeImage = "LUT7"
  1419. Case 8:table1.ColorGradeImage = "LUT8"
  1420. End Select
  1421. End Sub
  1422.  
  1423. '***********************************************************************
  1424. ' *********************************************************************
  1425. ' ********* G A M E C O D E S T A R T S H E R E *********
  1426. ' *********************************************************************
  1427. '***********************************************************************
  1428.  
  1429. Sub VPObjects_Init 'init objects
  1430. TurnOffPlayfieldLights()
  1431. kicker001k.IsDropped = 1
  1432. End Sub
  1433.  
  1434. ' Dim all the variables
  1435.  
  1436. Sub Game_Init() 'called at the start of a new game
  1437. 'Start music?
  1438. 'Init variables?
  1439. 'Start or init timers
  1440. TurnOffPlayfieldLights()
  1441. ' turn on white lights
  1442. li027.State = 1
  1443. li029.State = 1
  1444. li030.State = 1
  1445. li031.State = 1
  1446. li032.State = 1
  1447. li033.State = 1
  1448. End Sub
  1449.  
  1450. Sub StopEndOfBallMode() 'called when the last ball is drained
  1451. End Sub
  1452.  
  1453. Sub ResetNewBallVariables() 'init variables new ball/player
  1454. End Sub
  1455.  
  1456. Sub ResetNewBallLights() 'init lights for new ball/player
  1457. ' yellows
  1458. li026.State = 1
  1459. li025.State = 1
  1460. li010.State = 1
  1461. li009.State = 1
  1462. li012.State = 0
  1463. li011.State = 0
  1464. li013.State = 0
  1465. li014.State = 0
  1466. li015.State = 0
  1467. li016.State = 0
  1468. li017.State = 0
  1469. li018.State = 0
  1470.  
  1471. li028.State = 0
  1472. lBumper1a.State = 0:lBumper1b.State = 0:lBumper2a.State = 0:lBumper2b.State = 0
  1473. li006.State=0:li007.State=0:li008.State=0:li001.State=0
  1474. li005.State = 0
  1475. li004.State = 0
  1476. End Sub
  1477.  
  1478. Sub TurnOffPlayfieldLights()
  1479. Dim a
  1480. For each a in aLights
  1481. a.State = 0
  1482. Next
  1483. End Sub
  1484.  
  1485. ' *********************************************************************
  1486. ' Table Object Hit Events
  1487. ' *********************************************************************
  1488. ' Any target hit Sub will do this:
  1489. ' - play a sound
  1490. ' - do some physical movement
  1491. ' - add a score, bonus
  1492. ' - check some variables/modes this trigger is a member of
  1493. ' - set the "LastSwicthHit" variable in case it is needed later
  1494. ' *********************************************************************
  1495.  
  1496. ' Slingshots
  1497. Dim LStep, RStep
  1498.  
  1499. Sub LeftSlingShot_Slingshot
  1500. If Tilted Then Exit Sub
  1501. PlaySoundAt SoundFXDOF("fx_slingshot", 103, DOFPulse, DOFContactors), Lemk
  1502. LeftSling004.Visible = 1
  1503. Lemk.RotX = 26
  1504. LStep = 0
  1505. LeftSlingShot.TimerEnabled = True
  1506. ' add points
  1507. AddScore 10
  1508. ' some effect?
  1509. End Sub
  1510.  
  1511. Sub LeftSlingShot_Timer
  1512. Select Case LStep
  1513. Case 1:LeftSLing004.Visible = 0:LeftSLing003.Visible = 1:Lemk.RotX = 14
  1514. Case 2:LeftSLing003.Visible = 0:LeftSLing002.Visible = 1:Lemk.RotX = 2
  1515. Case 3:LeftSLing002.Visible = 0:Lemk.RotX = -20:LeftSlingShot.TimerEnabled = 0
  1516. End Select
  1517. LStep = LStep + 1
  1518. End Sub
  1519.  
  1520. Sub RightSlingShot_Slingshot
  1521. If Tilted Then Exit Sub
  1522. PlaySoundAt SoundFXDOF("fx_slingshot", 104, DOFPulse, DOFContactors), Remk
  1523. RightSling004.Visible = 1
  1524. Remk.RotX = 26
  1525. RStep = 0
  1526. RightSlingShot.TimerEnabled = True
  1527. ' add points
  1528. AddScore 10
  1529. ' add effect?
  1530. End Sub
  1531.  
  1532. Sub RightSlingShot_Timer
  1533. Select Case RStep
  1534. Case 1:RightSLing004.Visible = 0:RightSLing003.Visible = 1:Remk.RotX = 14
  1535. Case 2:RightSLing003.Visible = 0:RightSLing002.Visible = 1:Remk.RotX = 2
  1536. Case 3:RightSLing002.Visible = 0:Remk.RotX = -20:RightSlingShot.TimerEnabled = 0
  1537. End Select
  1538. RStep = RStep + 1
  1539. End Sub
  1540.  
  1541. '***********************
  1542. ' Rubber animations
  1543. '***********************
  1544.  
  1545. Dim Rub1, Rub2, Rub3
  1546.  
  1547. Sub rlband004_Hit
  1548. Rub1 = 1:rlband004_Timer
  1549. End Sub
  1550.  
  1551. Sub rlband004_Timer
  1552. Select Case Rub1
  1553. Case 1:Rubber008.Visible = 0:Rubber016.Visible = 1:rlband004.TimerEnabled = 1
  1554. Case 2:Rubber016.Visible = 0:Rubber017.Visible = 1
  1555. Case 3:Rubber017.Visible = 0:Rubber008.Visible = 1:rlband004.TimerEnabled = 0
  1556. End Select
  1557. Rub1 = Rub1 + 1
  1558. End Sub
  1559.  
  1560. Sub rlband005_Hit
  1561. Rub2 = 1:rlband005_Timer
  1562. AddScore 10
  1563. End Sub
  1564.  
  1565. Sub rlband005_Timer
  1566. Select Case Rub2
  1567. Case 1:Rubber010.Visible = 0:Rubber018.Visible = 1:rlband005.TimerEnabled = 1
  1568. Case 2:Rubber018.Visible = 0:Rubber019.Visible = 1
  1569. Case 3:Rubber019.Visible = 0:Rubber010.Visible = 1:rlband005.TimerEnabled = 0
  1570. End Select
  1571. Rub2 = Rub2 + 1
  1572. End Sub
  1573.  
  1574. Sub rlband008_Hit
  1575. Rub3 = 1:rlband005_Timer
  1576. Addscore 100
  1577. End Sub
  1578.  
  1579. Sub rlband008_Timer
  1580. Select Case Rub3
  1581. Case 1:Rubber013.Visible = 0:Rubber020.Visible = 1:rlband008.TimerEnabled = 1
  1582. Case 2:Rubber020.Visible = 0:Rubber021.Visible = 1
  1583. Case 3:Rubber021.Visible = 0:Rubber013.Visible = 1:rlband008.TimerEnabled = 0
  1584. End Select
  1585. Rub3 = Rub3 + 1
  1586. End Sub
  1587.  
  1588. Sub rlband003_Hit:Addscore 100:End Sub
  1589. Sub rlband010_Hit:Addscore 100:End Sub
  1590.  
  1591. '*********
  1592. ' Bumpers
  1593. '*********
  1594.  
  1595. Sub Bumper001_Hit
  1596. If Tilted Then Exit Sub
  1597. PlaySoundAt SoundFXDOF("fx_Bumper", 105, DOFPulse, DOFContactors), bumper001
  1598. AddScore 100 + 900 * Lbumper1a.State
  1599. End Sub
  1600.  
  1601. Sub Bumper002_Hit
  1602. If Tilted Then Exit Sub
  1603. PlaySoundAt SoundFXDOF("fx_Bumper", 106, DOFPulse, DOFContactors), bumper002
  1604. AddScore 10 + 90 * Lbumper2a.State
  1605. End Sub
  1606.  
  1607. '*****************
  1608. ' Lanes
  1609. '*****************
  1610.  
  1611. Sub Trigger001_Hit
  1612. PlaySoundAt "fx_sensor", Trigger001
  1613. If Tilted Then Exit Sub
  1614. If li002.State Then
  1615. AwardSpecial
  1616. End If
  1617. AddScore 5000
  1618. End Sub
  1619.  
  1620. Sub Trigger002_Hit
  1621. PlaySoundAt "fx_sensor", Trigger002
  1622. If Tilted Then Exit Sub
  1623. li027.State = 0
  1624. li024.State = 1
  1625. CheckLights
  1626. AddScore 1000
  1627. End Sub
  1628.  
  1629. Sub Trigger003_Hit
  1630. PlaySoundAt "fx_sensor", Trigger003
  1631. If Tilted Then Exit Sub
  1632. AddScore 500
  1633. End Sub
  1634.  
  1635. Sub Trigger004_Hit
  1636. PlaySoundAt "fx_sensor", Trigger004
  1637. If Tilted Then Exit Sub
  1638. AddScore 500 + 4500 * li001.State
  1639. 'li001.State = 1
  1640. li001.State = 0
  1641. End Sub
  1642.  
  1643. Sub Trigger005_Hit
  1644. PlaySoundAt "fx_sensor", Trigger005
  1645. If Tilted Then Exit Sub
  1646. Li029.State = 0
  1647. li021.State = 1
  1648. CheckLights
  1649. AddScore 500 + 4500 * li006.State
  1650. End Sub
  1651.  
  1652. Sub Trigger006_Hit
  1653. PlaySoundAt "fx_sensor", Trigger006
  1654. If Tilted Then Exit Sub
  1655. Li030.State = 0
  1656. li022.State = 1
  1657. CheckLights
  1658. AddScore 500
  1659. End Sub
  1660.  
  1661. Sub Trigger007_Hit
  1662. PlaySoundAt "fx_sensor", Trigger007
  1663. If Tilted Then Exit Sub
  1664. Li031.State = 0
  1665. li020.State = 1
  1666. CheckLights
  1667. AddScore 500 + 4500 * li007.State
  1668. End Sub
  1669.  
  1670. Sub Trigger009_Hit
  1671. PlaySoundAt "fx_sensor", Trigger009
  1672. If Tilted Then Exit Sub
  1673. Li032.State = 0
  1674. li023.State = 1
  1675. CheckLights
  1676. AddScore 500
  1677. End Sub
  1678.  
  1679. Sub Trigger010_Hit
  1680. PlaySoundAt "fx_sensor", Trigger010
  1681. If Tilted Then Exit Sub
  1682. Li033.State = 0
  1683. li019.State = 1
  1684. CheckLights
  1685. AddScore 500 + 4500 * li008.State
  1686. End Sub
  1687.  
  1688. Sub Trigger008_Hit
  1689. PlaySoundAt "fx_sensor", Trigger008
  1690. If Tilted Then Exit Sub
  1691. AddScore 500 + 4500 * li005.State
  1692. If li004.State Then AwardSpecial
  1693. End Sub
  1694.  
  1695. '************************
  1696. ' Targets
  1697. '************************
  1698.  
  1699. Sub Target001_hit
  1700. PlaySoundAtBall "fx_target"
  1701. If Tilted Then Exit Sub
  1702. Li026.State = 0
  1703. li012.State = 1
  1704. li015.State = 1
  1705. CheckLights
  1706. AddScore 100
  1707. End Sub
  1708.  
  1709. Sub Target002_hit
  1710. PlaySoundAtBall "fx_target"
  1711. If Tilted Then Exit Sub
  1712. Li025.State = 0
  1713. li011.State = 1
  1714. li017.State = 1
  1715. CheckLights
  1716. AddScore 100
  1717. End Sub
  1718.  
  1719. Sub Target003_hit
  1720. PlaySoundAtBall "fx_target"
  1721. If Tilted Then Exit Sub
  1722. If li003.State Then AwardSpecial
  1723. AddScore 500
  1724. End Sub
  1725.  
  1726.  
  1727. '*****************
  1728. ' Setas
  1729. '*****************
  1730.  
  1731. Sub Seta1_hit
  1732. PlaySoundAtBall "fx_passive_bumper"
  1733. If Tilted Then Exit Sub
  1734. Li010.State = 0
  1735. li013.State = 1
  1736. li018.State = 1
  1737. CheckLights
  1738. AddScore 500
  1739. setap1.TransY = -3: Me.TimerEnabled = 1
  1740. End Sub
  1741.  
  1742. Sub Seta1_Timer:setap1.TransY = 0: Me.TimerEnabled = 0: End Sub
  1743.  
  1744. Sub Seta2_hit
  1745. PlaySoundAtBall "fx_passive_bumper"
  1746. If Tilted Then Exit Sub
  1747. If li003.State Then AwardSpecial
  1748. AddScore 500
  1749. setap2.TransY = -3: Me.TimerEnabled = 1
  1750. End Sub
  1751.  
  1752. Sub Seta2_Timer:setap2.TransY = 0: Me.TimerEnabled = 0: End Sub
  1753.  
  1754. Sub Seta3_hit
  1755. PlaySoundAtBall "fx_passive_bumper"
  1756. If Tilted Then Exit Sub
  1757. Li009.State = 0
  1758. li014.State = 1
  1759. li016.State = 1
  1760. CheckLights
  1761. AddScore 500
  1762. setap3.TransY = -3: Me.TimerEnabled = 1
  1763. End Sub
  1764.  
  1765. Sub Seta3_Timer:setap3.TransY = 0: Me.TimerEnabled = 0: End Sub
  1766.  
  1767. Sub Seta4_hit
  1768. PlaySoundAtBall "fx_passive_bumper"
  1769. If Tilted Then Exit Sub
  1770. AddScore 500
  1771. setap4.TransY = -3: Me.TimerEnabled = 1
  1772. End Sub
  1773.  
  1774. Sub Seta4_Timer:setap4.TransY = 0: Me.TimerEnabled = 0: End Sub
  1775.  
  1776. '*****************
  1777. ' kickers
  1778. '*****************
  1779.  
  1780. Sub Kicker001_hit
  1781. PlaySoundAtBall "fx_kicker_enter"
  1782. If Tilted Then Exit Sub
  1783. AddScore 500 + 4500 * li028.State
  1784. vpmtimer.addtimer 1000, "kicker001k.TimerEnabled = 1:PlaySoundat""fx_kicker"",kicker001:kicker001.kick 195,10:kicker001k.Isdropped=0 '"
  1785. End Sub
  1786.  
  1787. Sub kicker001k_Timer:PlaySoundAt SoundFXDOF("fx_solenoidoff", 107, DOFPulse, DOFContactors), kicker001:kicker001k.Isdropped = 1:kicker001k.TimerEnabled = 0:End Sub
  1788.  
  1789. '*********************
  1790. ' Check Center Lights
  1791. '*********************
  1792.  
  1793. Dim DivAwarded
  1794. DivAwarded = False
  1795.  
  1796. Dim SpecAwarded
  1797. SpecAwarded = False
  1798.  
  1799. Sub CheckLights
  1800. If li019.State AND li012.State Then li028.State = 1
  1801. If li020.State AND li011.State Then li028.State = 1
  1802. If li021.State AND li013.State Then lBumper1a.State = 1:lBumper1b.State = 1:lBumper2a.State = 1:lBumper2b.State = 1
  1803. If li022.State AND li014.State Then li006.State=1:li007.State=1:li008.State=1:li001.State=1
  1804. If li023.State AND li015.State AND li016.State Then li005.State = 1
  1805. If li023.State AND li017.State AND li018.State Then li005.State = 1
  1806. If li012.State AND li011.State AND li013.State AND li014.State Then li004.State = 1
  1807. If li019.State AND li020.State AND li021.State AND li022.State AND li023.State AND li024.State then li003.State = 1: li002.State = 1
  1808. End Sub
  1809.  
Advertisement
Add Comment
Please, Sign In to add comment