Outhere

Seven Winner ( jpsalas_Inder 1973)1.0.1

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