Outhere

Big Indian jpsalas_(Gottlieb 1974) 3.0.2

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