Arngrim

Robo war controller.vbs

Jan 19th, 2017
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.70 KB | None | 0 0
  1. ' Robo-War (Gottlieb 1988)
  2. ' =======================================================
  3. ' VP9 Version by Kevin Lee Drum
  4. ' B2B Collision thanks to jimmyfingers
  5. ' Thanks to the VP8 authors TAB, Destruk, MNPG
  6. ' Much was also inspired by JPSalas and unclewilly
  7.  
  8. Option Explicit
  9.  
  10. On Error Resume Next
  11. ExecuteGlobal GetTextFile("controller.vbs")
  12. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  13. On Error Goto 0
  14.  
  15. Dim DesktopMode:DesktopMode = Table1.ShowDT
  16.  
  17. 'GRAPHICS OPTIONS
  18. Const BallFlare =1 'Render a lense flare effect above the ball when certain flashers are active.
  19. Const Playfield_Dimples = 1 ' Render a texture over the playfield to give it some depth.
  20. '------------------------------------
  21.  
  22. LoadVPM "01210000", "sys80.vbs", 3.1
  23.  
  24. ' Variables
  25. ' ==================================================================
  26. Const cGameName = "robowars"
  27. Const UseSolenoids = 1
  28. Const UseLamps = 0
  29. Const UseGI = 0
  30. Const UseSync = 0
  31. Const HandleMech = 0
  32. Dim bsTop, bsTrough, dtAlpha1, dtAlpha2, dtAlpha3, dtBeta,gion
  33. Dim QRelay, OldQRelay, TRelay, OldTRelay, SRelay,OldSRelay, ARelay, OldARelay, BallRel, OldBallRel, BallLaunched, StargateRelay, OldStargateRelay
  34. Dim AuxLightsStep, BlinkGIStep, LeftSlingStep, RightSlingStep, UpOrDown, PlungeWidth, PlungeStep, PlungeRamps, PDirection
  35. ' Standard Sounds
  36. ' ==================================================================
  37. ' All the sounds in this table are tweaked versions of sounds from the VPForums sound library.
  38. Const SSolenoidOn = "Solenoid"
  39. Const SSolenoidOff = ""
  40. Const SFlipperOn = "FlipperUp"
  41. Const SFlipperOff = "FlipperDown"
  42. Const SCoin = "Coin"
  43.  
  44. ' Table Init
  45. ' ==================================================================
  46. Sub Table1_Init
  47. vpmInit Me 'new
  48. With Controller
  49. .GameName = cGameName
  50. .Games(cGameName).Settings.Value("rol") = 0
  51. .Games(cGameName).Settings.Value("dmd_red") = 0
  52. .Games(cGameName).Settings.Value("dmd_green") = 223
  53. .Games(cGameName).Settings.Value("dmd_blue") = 223
  54. .SplashInfoLine = "Robo-War (Gottlieb 1988)" & vbNewLine & "VPM table by Kevin Lee Drum"
  55. .HandleMechanics = 0
  56. .HandleKeyboard = 0
  57. .ShowTitle = 0
  58. .ShowDMDOnly = 1
  59. .ShowFrame = 0
  60. If DesktopMode AND B2SOn then
  61. .Hidden = 0
  62. Else
  63. If B2SOn then
  64. .Hidden = 1
  65. Else
  66. .Hidden = 0
  67. End If
  68. End If
  69. If Err Then MsgBox Err.Description
  70. On Error Resume Next
  71. End With
  72.  
  73. On Error Goto 0
  74. Controller.SolMask(0) = 0
  75. vpmTimer.AddTimer 2000, "Controller.SolMask(0) = &Hffffffff'" 'ignore all solenoids - then add the Timer to renable all the solenoids after 2 seconds
  76. Controller.Run GetPlayerHWnd
  77.  
  78. ' Timers
  79. PinMAMETimer.Interval = PinMAMEInterval
  80. PinMAMETimer.Enabled = 1
  81.  
  82. ' Nudging
  83. vpmNudge.TiltSwitch = 57
  84. vpmNudge.Sensitivity = 1
  85. vpmNudge.TiltObj = Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
  86.  
  87. ' Ball Stacks
  88. Set bsTop = New cvpmBallStack
  89. With bsTop
  90. .InitSaucer Kicker,76,140,5
  91. .InitExitSnd SoundFX("Popper_Ball",DOFContactors), SoundFX(SSolenoidOn,DOFContactors)
  92. End With
  93.  
  94. Set bsTrough = New cvpmBallStack
  95. With bsTrough
  96. .InitNoTrough BallRelease,66,45,10
  97. .InitSw 66,0,56,0,0,0,0,0
  98. .InitKick BallRelease,45,10
  99. .InitExitSnd SoundFX("BallRelease",DOFContactors), SoundFX(SSolenoidOn,DOFContactors)
  100. '.BallImage = "BallDark"
  101. .Balls = 2
  102. End With
  103.  
  104. ' Drop Targets
  105. Set dtAlpha1 = New cvpmDropTarget
  106. dtAlpha1.InitDrop Alpha1,43
  107. dtAlpha1.InitSnd SoundFX("TargetDrop",DOFDropTargets), SoundFX(SSolenoidOn,DOFDropTargets)
  108. dtAlpha1.CreateEvents "dtAlpha1"
  109.  
  110. Set dtAlpha2 = New cvpmDropTarget
  111. dtAlpha2.InitDrop Array(Alpha2A,Alpha2B), Array(42,52)
  112. dtAlpha2.InitSnd SoundFX("TargetDrop",DOFDropTargets), SoundFX(SSolenoidOn,DOFDropTargets)
  113. dtAlpha2.CreateEvents "dtAlpha2"
  114.  
  115. Set dtAlpha3 = New cvpmDropTarget
  116. dtAlpha3.InitDrop Array(Alpha3A,Alpha3B,Alpha3C), Array(41,51,61)
  117. dtAlpha3.InitSnd SoundFX("TargetDrop",DOFDropTargets), SoundFX(SSolenoidOn,DOFDropTargets)
  118. dtAlpha3.CreateEvents "dtAlpha3"
  119.  
  120. Set dtBeta = New cvpmDropTarget
  121. dtBeta.InitDrop Array(BetaB,BetaE,BetaT,BetaA), Array(40,50,60,70)
  122. dtBeta.InitSnd SoundFX("TargetDrop",DOFDropTargets), SoundFX(SSolenoidOn,DOFDropTargets)
  123. dtBeta.CreateEvents "dtBeta"
  124.  
  125. ' GI Option
  126. ' DOF 150,1
  127. twos = 0
  128. gion = 1
  129. End Sub
  130.  
  131. If Table1.ShowDT = true then
  132.  
  133. Ramp16.visible = 1
  134. Ramp15.visible = 1
  135. else
  136.  
  137. Ramp16.visible = 0
  138. Ramp15.visible = 0
  139. End If
  140.  
  141. If Playfield_Dimples = 1 Then
  142. LTFDim.Visible = 1
  143. RTFDim.Visible = 1
  144. PFDim.Visible = 1
  145. else
  146. LTFDim.Visible = 0
  147. RTFDim.Visible = 0
  148. PFDim.Visible = 0
  149. End If
  150.  
  151. ' Keys, etc.
  152. ' ==================================================================
  153. Sub Table1_Paused:Controller.Pause = True:End Sub
  154. Sub Table1_unPaused:Controller.Pause = False:End Sub
  155. Sub Table1_KeyDown(ByVal keycode)
  156. If KeyCode = RightFlipperKey Then Controller.Switch(46)=1
  157. 'If keycode = 3 Then Msgbox Activeball.Y
  158. If KeyCode = PlungerKey Then
  159. Plunger.Pullback
  160. 'PDirection = 1:Plunge.Interval = 40:Plunge.Enabled = 1 ' Plunger pull-back animation
  161. End If
  162. If vpmKeyDown(KeyCode) Then Exit Sub
  163. If KeyCode = KeyRules then Rules
  164. End Sub
  165. Sub Table1_KeyUp(ByVal keycode)
  166. If KeyCode = RightFlipperKey Then Controller.Switch(46)=0
  167. If KeyCode = PlungerKey Then
  168. Plunger.Fire:PlaySound "Plunger"
  169. 'PDirection = -1:Plunge.Interval = 6:Plunge.Enabled = 1 ' Plunger release animation
  170. End If
  171. If vpmKeyUp(KeyCode) Then Exit Sub
  172. End Sub
  173.  
  174. ' Switches
  175. ' ==================================================================
  176. ' Slingshots
  177.  
  178. Dim RStep, Lstep
  179.  
  180. Sub RightSlingShot_Slingshot
  181. PlaySound SoundFXDOF("right_slingshot",102,DOFPulse,DOFContactors), 0, 1, 0.05, 0.05
  182. RSling.Visible = 0
  183. RSling1.Visible = 1
  184. sling1.TransZ = -20
  185. RStep = 0
  186. RightSlingShot.TimerEnabled = 1
  187. RightSlingShot.TimerInterval = 10
  188. vpmTimer.PulseSw 33
  189. DOF 111,DOFPulse
  190. RSS.opacity = 60
  191. End Sub
  192.  
  193. Sub RightSlingShot_Timer
  194. Select Case RStep
  195. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  196. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
  197. End Select
  198. RStep = RStep + 1
  199. RSS.opacity = 0
  200. End Sub
  201.  
  202. Sub LeftSlingShot_Slingshot
  203. PlaySound SoundFXDOF("left_slingshot",101,DOFPulse,DOFContactors),0,1,-0.05,0.05
  204. LSling.Visible = 0
  205. LSling1.Visible = 1
  206. sling2.TransZ = -20
  207. LStep = 0
  208. LeftSlingShot.TimerEnabled = 1
  209. LeftSlingShot.TimerInterval = 10
  210. vpmTimer.PulseSw 33
  211. LSS.opacity = 60
  212. DOF 110, DOFPulse
  213. End Sub
  214.  
  215. Sub LeftSlingShot_Timer
  216. Select Case LStep
  217. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  218. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
  219. End Select
  220. LStep = LStep + 1
  221. LSS.opacity = 0
  222. End Sub
  223.  
  224. ' Bumpers
  225. Sub Bumper1_Hit:PlaySound SoundFX("Bumper",DOFContactors):vpmTimer.PulseSw 53:End Sub
  226. Sub Bumper2_Hit:PlaySound SoundFX("Bumper",DOFContactors):vpmTimer.PulseSw 63:End Sub
  227. Sub Bumper3_Hit:PlaySound SoundFX("Bumper",DOFContactors):vpmTimer.PulseSw 73:End Sub
  228. ' Drain
  229. Sub Drain_Hit:PlaySound "Drain":bsTrough.AddBall Me:End Sub
  230. ' Rollovers
  231. Sub LaneR_Hit:Controller.Switch(44) = 1: End Sub
  232. Sub LaneR_UnHit:Controller.Switch(44) = 0: End Sub
  233. Sub LaneO_Hit:Controller.Switch(54) = 1: End Sub
  234. Sub LaneO_UnHit:Controller.Switch(54) = 0: End Sub
  235. Sub LaneB_Hit:Controller.Switch(64) = 1: End Sub
  236. Sub LaneB_UnHit:Controller.Switch(64) = 0: End Sub
  237. Sub LaneO2_Hit:Controller.Switch(74) = 1: End Sub
  238. Sub LaneO2_UnHit:Controller.Switch(74) = 0: End Sub
  239. Sub LeftOutlane_Hit:Controller.Switch(45) = 1: End Sub
  240. Sub LeftOutlane_UnHit:Controller.Switch(45) = 0: End Sub
  241. Sub LeftInlane_Hit:Controller.Switch(55) = 1: End Sub
  242. Sub LeftInlane_UnHit:Controller.Switch(55) = 0: End Sub
  243. Sub RightInlane_Hit:Controller.Switch(65) = 1: End Sub
  244. Sub RightInlane_UnHit:Controller.Switch(65) = 0: End Sub
  245. Sub RightOutlane_Hit:Controller.Switch(75) = 1: End Sub
  246. Sub RightOutlane_UnHit:Controller.Switch(75) = 0: End Sub
  247. Sub RightLane_Hit:Controller.Switch(35) = 1: End Sub
  248. Sub RightLane_UnHit:Controller.Switch(35) = 0: End Sub
  249. Sub ShooterLane_Hit:Controller.Switch(36) = 1: End Sub
  250. Sub ShooterLane_UnHit:Controller.Switch(36) = 0: End Sub
  251. Sub TopRightRollover_Hit:Controller.Switch(31) = 1: End Sub
  252. Sub TopRightRollover_UnHit:Controller.Switch(31) = 0: End Sub
  253. Sub StargateRollover_Hit:Controller.Switch(71) = 1: End Sub
  254. Sub StargateRollover_UnHit:Controller.Switch(71) = 0: End Sub
  255. ' Spinner
  256. Sub Spinner_Spin:vpmTimer.PulseSw 30:Playsound "fx_spinner":End Sub
  257. ' Drop Targets
  258. Sub Alpha1_Hit:dtAlpha1.hit 1:End Sub
  259. Sub Alpha2A_Hit:dtAlpha2.hit 1:End Sub
  260. Sub Alpha2B_Hit:dtAlpha2.hit 2:End Sub
  261. Sub Alpha3A_Hit:dtAlpha3.hit 1:End Sub
  262. Sub Alpha3B_Hit:dtAlpha3.hit 2:End Sub
  263. Sub Alpha3C_Hit:dtAlpha3.hit 3:End Sub
  264. Sub BetaB_Hit:dtBeta.hit 1:End Sub
  265. Sub BetaE_Hit:dtBeta.hit 2:End Sub
  266. Sub BetaT_Hit:dtBeta.hit 3:End Sub
  267. Sub BetaA_Hit:dtBeta.hit 4:End Sub
  268. ' Top Saucer
  269. Sub Kicker_Hit:bsTop.AddBall 0:PlaySound "kicker_enter":End Sub
  270. Sub Kicker_Unhit:DOF 113, DOFPulse:End Sub
  271. Sub Kicker1_Hit():PlaySound "Ball_Bounce":End Sub
  272. Sub Trigger1_hit():PlaySound "Launch":End Sub
  273. ' Targets
  274. Sub StargateTarget_Hit:vpmTimer.PulseSw 72:PlaySound "Bounce":End Sub
  275. Sub LeftTarget_Hit:vpmTimer.PulseSw 62:PlaySound "Bounce":End Sub
  276. ' Trapped Ball Untrapper
  277. 'Sub Untrapper1_Hit:Me.DestroyBall:Untrapper2.Enabled=1:Untrapper2.CreateBall:Untrapper2.Kick 90,10:Controller.B2SSetData 114,1:Controller.B2SSetData 114,0:End Sub
  278. ' Ball Image Changers
  279. 'Sub BallChanger_Hit:ActiveBall.Image = "Ball":End Sub
  280. 'Sub BallChangerRed_Hit:ActiveBall.Image = "BallRed":End Sub
  281. 'Sub BallChangerRed_UnHit:ActiveBall.Image = "Ball":End Sub
  282. ' Sound Effects Only
  283. 'Sub Bounce_Hit(parm):PlaySound "Bounce":End Sub
  284. 'Sub LeftFlipper_Collide(parm):PlaySound "Bounce":End Sub
  285. 'Sub RightFlipper_Collide(parm):PlaySound "Bounce":End Sub
  286. 'Sub GateTopLeft_Hit:PlaySound "Gate":End Sub
  287. 'Sub GateTopRight_Hit:PlaySound "Gate":End Sub
  288. 'Sub GateRightFlipper_Hit:PlaySound "Gate":End Sub
  289. 'Sub BallRollSound_Hit:PlaySound "BallRoll3":End Sub
  290. 'Sub DrainSound_Hit:PlaySound "BallRoll1":End Sub
  291. ' Ball Launched (Used for GI Control)
  292. 'Sub GateLane_Hit:BallLaunched = 1:End Sub
  293.  
  294. ' Solenoids
  295. ' ==================================================================
  296. SolCallback(1) = "SolOne" ' 1 Reset Alpha I / Top Left Flasher 3
  297. SolCallback(2) = "SolTwo" ' 2 Reset Alpha II / Top Left Flasher 2
  298. SolCallback(3) = "SolThree" ' 3 Top Kicker / Stargate Flashers
  299. SolCallback(4) = "SolFour" ' 4 Right Under-Plastic Flasher
  300. SolCallback(5) = "SolFive" ' 5 Reset Alpha III / Top Left Flasher 1
  301. SolCallback(6) = "SolSix" ' 6 Reset Beta / Top Right Flasher
  302. SolCallback(7) = "SolSeven" ' 7 Left Under-Plastic Flasher
  303. SolCallback(8) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  304. SolCallback(9) = "bsTrough.SolIn"
  305. 'SolCallback(sLLFlipper) = "vpmSolFlipper LeftFlipper,nothing,"
  306. 'SolCallback(sLRFlipper) = "vpmSolFlipper RightFlipper,nothing,"
  307.  
  308. SolCallback(sLRFlipper) = "SolRFlipper"
  309. SolCallback(sLLFlipper) = "SolLFlipper"
  310.  
  311. Sub SolLFlipper(Enabled)
  312. If Enabled Then
  313. PlaySound SoundFX("FlipperUp",DOFFlippers):LeftFlipper.RotateToEnd
  314. Else
  315. PlaySound SoundFX("FlipperDown",DOFFlippers):LeftFlipper.RotateToStart
  316. End If
  317. End Sub
  318.  
  319. Sub SolRFlipper(Enabled)
  320. If Enabled Then
  321. PlaySound SoundFX("FlipperUp",DOFFlippers):RightFlipper.RotateToEnd
  322. Else
  323. PlaySound SoundFX("FlipperDown",DOFFlippers):RightFlipper.RotateToStart
  324. End If
  325. End Sub
  326.  
  327. Dim ltxx
  328. Sub SolOne(Enabled)
  329. If Enabled Then
  330. If SRelay = 0 Then
  331. dtAlpha1.DropSol_On
  332. DOF 115, DOFPulse
  333. Else
  334. For each ltxx in LTFlash:ltxx.state=1:Next
  335. SetLamp 163,1
  336. End If
  337. Else
  338. 'If SRelay = 1 Then
  339. SetLamp 163,0
  340. For each ltxx in LTFlash:ltxx.state=0:Next
  341. 'End If
  342. End If
  343. End Sub
  344.  
  345. Dim lmxx, twos
  346. Sub SolTwo(Enabled)
  347. If Enabled Then
  348. If SRelay = 0 Then
  349. dtAlpha2.DropSol_On
  350. DOF 116, DOFPulse
  351. Else
  352. SetLamp 162,1:twos = 1
  353. For each lmxx in LMFlash:lmxx.state=1:Next
  354. If LampState(1) = 1 Then
  355. LSL.state = 1
  356. End If
  357. End If
  358. Else
  359. 'If SRelay = 1 Then
  360. SetLamp 162,0:twos = twos = 0
  361. For each lmxx in LMFlash:lmxx.state=0:Next
  362. LSL.State = 0
  363. 'End If
  364. End If
  365. End Sub
  366.  
  367. Sub SolThree(Enabled)
  368. If Enabled Then
  369. If SRelay = 0 Then
  370. bsTop.ExitSol_On
  371. Else
  372. SGP.state = 1
  373. SGP1.state = 1
  374. SGP2.state = 1
  375. End If
  376. Else
  377. SGP.state = 0
  378. SGP1.state = 0
  379. SGP2.state = 0
  380. If SRelay = 0 Then
  381. End If
  382. End If
  383. End Sub
  384.  
  385. Sub SolFour(Enabled)
  386. If Enabled Then
  387. RPF.state = 1
  388. RPF1.state = 1
  389. RPF2.state = 1
  390. Else
  391. RPF.state = 0
  392. RPF1.state = 0
  393. RPF2.state = 0
  394. End If
  395. End Sub
  396.  
  397. Sub SolSeven(Enabled)
  398. If Enabled Then
  399. LPF.state = 1
  400. LPF1.state = 1
  401. LPF2.state = 1
  402. Else
  403. LPF.state = 0
  404. LPF1.state = 0
  405. LPF2.state = 0
  406. End If
  407. End Sub
  408.  
  409. Dim lbxx
  410.  
  411. Sub SolFive(Enabled)
  412. If Enabled Then
  413. If SRelay = 0 Then
  414. dtAlpha3.DropSol_On
  415. DOF 117, DOFPulse
  416. Else
  417. For each lbxx in LBFlash:lbxx.state=1:Next
  418. SetLamp 161,1
  419. End If
  420. Else
  421. 'If SRelay = 1 Then
  422. SetLamp 161,0
  423. For each lbxx in LBFlash:lbxx.state=0:Next
  424. 'End If
  425. End If
  426. End Sub
  427.  
  428. Dim rtxx
  429.  
  430. Sub SolSix(Enabled)
  431. If Enabled Then
  432. If SRelay = 0 Then
  433. dtBeta.DropSol_On
  434. DOF 118, DOFPulse
  435. Else
  436. SetLamp 164,1:twos = 1
  437. For each rtxx in RTFlash:rtxx.state=1:Next
  438. If LampState(1) = 1 Then
  439. RSL.state = 1
  440. End If
  441. End If
  442. Else
  443. 'If SRelay = 1 Then
  444. SetLamp 164,0:twos = 0
  445. For each rtxx in RTFlash:rtxx.state=0:Next
  446. RSL.State = 0
  447. End If
  448. End Sub
  449.  
  450. ' Relays/Lamp Events
  451. ' ==================================================================
  452. OldQRelay = 0:OldTRelay = 0:OldARelay = 0:OldBallRel = 0:OldSRelay = 1:OldStargateRelay = 1:UpOrDown = 1
  453. Set LampCallback = GetRef("UpdateRelays")
  454. Sub UpdateRelays
  455. SRelay = LampState(12) ' Used for solenoid multiplexing.
  456. If SRelay <> OldSRelay Then OldSRelay = SRelay
  457.  
  458. 'If GIAlwaysOn = 0 Then
  459. QRelay = LampState(0)
  460. If QRelay <> OldQRelay Then
  461. If QRelay = 0 Then
  462. 'SetLamp 101, 0 ' Turn off the GI when not playing ('Q' Relay is off).
  463. End If
  464. 'BallLaunched = 0
  465. OldQRelay = QRelay
  466. 'End If
  467.  
  468. TRelay = LampState(1)
  469. If TRelay <> OldTRelay Then
  470. If QRelay = 1 Then
  471. If TRelay = 0 Then
  472. If SRelay = 1 Then
  473. SetLamp 101, 1 ' Turn on the GI when the 'T' Relay is off during play.
  474. End If
  475. Else
  476. SetLamp 101, 0
  477. End If
  478. End If
  479. OldTRelay = TRelay
  480. End If
  481. End If
  482.  
  483. ARelay = LampState(13)
  484. If ARelay <> OldARelay Then
  485. If ARelay = 1 Then
  486. AuxLights.Enabled = 1 ' Turn on aux light sequence when 'A' Relay is on.
  487. Else
  488. AuxLights.Enabled = 0
  489. Dim x, y
  490. For x = 71 To 100 ' Turn off all aux lights when 'A' Relay is off.
  491. SetLamp x, 0
  492. Next
  493. End If
  494. End If
  495. OldARelay = ARelay
  496.  
  497. BallRel = LampState(2)
  498. If BallRel <> OldBallRel Then
  499. If BallRel = 0 Then
  500. If bsTrough.Balls Then bsTrough.ExitSol_On ' Release ball when relay 2 is on.
  501. End If
  502. End If
  503. OldBallRel = BallRel
  504.  
  505. StargateRelay = LampState(14)
  506. If StargateRelay <> OldStargateRelay Then
  507. If StargateRelay = 0 Then ' Ramp is down when relay 14 is off.
  508. UpOrDown = -1
  509. If StargateRamp.HeightBottom <> 0 Then RampMove.Enabled = 1
  510. StargateInvisible.Collidable = 1
  511. Untrapper1.Enabled = 1
  512. End If
  513. If StargateRelay = 1 Then ' Ramp is up when relay 14 is on.
  514. UpOrDown = 1
  515. If StargateRamp.HeightBottom <> 60 Then PlaySound SoundFX("RampUp",DOFcontactors)
  516. If StargateRamp.HeightBottom <> 60 Then RampMove.Enabled = 1
  517. StargateInvisible.Collidable = 0
  518. End If
  519. OldStargateRelay = StargateRelay
  520. End If
  521.  
  522. End Sub
  523.  
  524. ' Auxiliary Lights Timer (Playfield "Robo-Units" and Rear Chaser Lights)
  525. ' ==================================================================
  526. ' Thanks to Destruk for the lamp schematic!
  527. AuxLightsStep = 0
  528. Sub AuxLights_Timer
  529. AuxLightsStep = AuxLightsStep + 1
  530. Select Case AuxLightsStep
  531. Case 1
  532. SetLamp 100,0:SetLamp 89,0:SetLamp 90,0
  533. SetLamp 91,1:SetLamp 71,1:SetLamp 72,1
  534. DOF 100,0
  535. DOF 89,0
  536. DOF 90,0
  537. DOF 91,2
  538. DOF 71,2
  539. DOF 72,2
  540. Case 2
  541. SetLamp 91,0:SetLamp 71,0:SetLamp 72,0
  542. SetLamp 92,1:SetLamp 73,1:SetLamp 74,1
  543. DOF 91,0
  544. DOF 71,0
  545. DOF 72,0
  546. DOF 92,2
  547. DOF 73,2
  548. DOF 74,2
  549. Case 3
  550. SetLamp 92,0:SetLamp 73,0:SetLamp 74,0
  551. SetLamp 93,1:SetLamp 75,1:SetLamp 76,1
  552. DOF 92,0
  553. DOF 73,0
  554. DOF 74,0
  555. DOF 93,2
  556. DOF 75,2
  557. DOF 76,2
  558. Case 4
  559. SetLamp 93,0:SetLamp 75,0:SetLamp 76,0
  560. SetLamp 94,1:SetLamp 77,1:SetLamp 78,1
  561. DOF 93,0
  562. DOF 75,0
  563. DOF 76,0
  564. DOF 94,2
  565. DOF 77,2
  566. DOF 78,2
  567. Case 5
  568. SetLamp 94,0:SetLamp 77,0:SetLamp 78,0
  569. SetLamp 95,1:SetLamp 79,1:SetLamp 80,1
  570. DOF 94,0
  571. DOF 77,0
  572. DOF 78,0
  573. DOF 95,2
  574. DOF 79,2
  575. DOF 80,2
  576. Case 6
  577. SetLamp 95,0:SetLamp 79,0:SetLamp 80,0
  578. SetLamp 96,1:SetLamp 81,1:SetLamp 82,1
  579. DOF 95,0
  580. DOF 79,0
  581. DOF 80,0
  582. DOF 96,2
  583. DOF 81,2
  584. DOF 82,2
  585. Case 7
  586. SetLamp 96,0:SetLamp 81,0:SetLamp 82,0
  587. SetLamp 97,1:SetLamp 83,1:SetLamp 84,1
  588. DOF 96,0
  589. DOF 81,0
  590. DOF 82,0
  591. DOF 97,2
  592. DOF 83,2
  593. DOF 84,2
  594. Case 8
  595. SetLamp 97,0:SetLamp 83,0:SetLamp 84,0
  596. SetLamp 98,1:SetLamp 85,1:SetLamp 86,1
  597. DOF 97,0
  598. DOF 83,0
  599. DOF 84,0
  600. DOF 98,2
  601. DOF 85,2
  602. DOF 86,2
  603. Case 9
  604. SetLamp 98,0:SetLamp 85,0:SetLamp 86,0
  605. SetLamp 99,1:SetLamp 87,1:SetLamp 88,1
  606. DOF 98,0
  607. DOF 85,0
  608. DOF 86,0
  609. DOF 99,2
  610. DOF 87,2
  611. DOF 88,2
  612. Case 10
  613. SetLamp 99,0:SetLamp 87,0:SetLamp 88,0
  614. SetLamp 100,1:SetLamp 89,1:SetLamp 90,1
  615. DOF 99,0
  616. DOF 87,0
  617. DOF 88,0
  618. DOF 100,2
  619. DOF 89,2
  620. DOF 90,2
  621. End Select
  622. If AuxLightsStep = 10 Then AuxLightsStep = 0
  623. 'DOF 93,0
  624. End Sub
  625.  
  626. Set MotorCallback = GetRef("GameTimer")
  627.  
  628. Sub GameTimer
  629. 'RollingSound
  630. End Sub
  631.  
  632. '*****************************************
  633. ' Ball Shadow
  634. '*****************************************
  635.  
  636. Dim BallShadow
  637. BallShadow = Array (BallShadow1, BallShadow2)
  638.  
  639. Sub BallShadowUpdate()
  640. Dim BOT, b, shadowZ
  641. BOT = GetBalls
  642.  
  643. ' render the shadow for each ball
  644. For b = 0 to UBound(BOT)
  645. BallShadow(b).X = BOT(b).X
  646. BallShadow(b).Y = BOT(b).Y + 20
  647. 'If BOT(b).Z > 90 and BOT(b).Z < 120 Then
  648. ' BallShadow(b).visible = 1
  649. 'Else
  650. ' BallShadow(b).visible = 0
  651. 'End If
  652. Next
  653. End Sub
  654.  
  655. Dim XBallShadow
  656. XBallShadow = Array (XBallShadow1, XBallShadow2)
  657.  
  658.  
  659.  
  660. Sub XBallShadowUpdate()
  661. Dim XBOT, c, XshadowZ
  662. XBOT = GetBalls
  663.  
  664. ' render the shadow for each ball
  665. For c = 0 to UBound(XBOT)
  666. XBallShadow(c).X = XBOT(c).X
  667. XBallShadow(c).Y = XBOT(c).Y - 10
  668. If ballflare = 1 AND twos = 1 AND XBOT(c).VelY > 0 AND XBOT(c).Y < 1800 Then
  669. XBallShadow(c).visible = 1
  670. Else
  671. XBallShadow(c).visible = 0
  672. End If
  673. Shad_Rot.Interval = NOT XBOT(c).VelY
  674. Next
  675. End Sub
  676.  
  677. ' Ramp Movement Timer
  678. ' ==================================================================
  679. Sub RampMove_Timer
  680. Dim x:x = 20 * UpOrDown
  681. StargateRamp.HeightBottom = StargateRamp.HeightBottom + x
  682. StargateHelper.HeightBottom = StargateHelper.HeightBottom + x
  683. StargateHelper.HeightTop = StargateHelper.HeightTop + x
  684. RampRefresh.State = 1:RampRefresh.State = 0
  685. If StargateRamp.HeightBottom = 0 Or StargateRamp.HeightBottom = 60 Then RampMove.Enabled = 0
  686. End Sub
  687.  
  688. ' Rules
  689. ' ==================================================================
  690. ' Based on Inkochnito's Reproduction Card and JP's script
  691. Dim Msg(20)
  692. Sub Rules()
  693. Msg(0) = "HOW TO PLAY" &Chr(10)
  694. Msg(1) = "ROBO-WAR" &Chr(10) &Chr(10)
  695. Msg(2) = ""
  696. Msg(3) = "SPECIAL: ADD A LETTER TO R-O-B-O-W-A-R BY COMPLETING EITHER THE"
  697. Msg(4) = "TOP ROLLOVERS (R-O-B-O), OR BY HITTING THE STROBING"
  698. Msg(5) = "DROP TARGETS (B-E-T-A). COMPLETING (R-O-B-O-W-A-R)"
  699. Msg(6) = "LIGHTS A SPECIAL."
  700. Msg(7) = ""
  701. Msg(8) = "EXTRA BALL: COMPLETING THE ALPHA DROP TARGET SEQUENCE LIGHTS"
  702. Msg(9) = "AN EXTRA BALL."
  703. Msg(10) = ""
  704. Msg(11) = "MULTIPLIER: ADVANCE MULTIPLIER ON VARIOUS PLAYFIELD TARGETS"
  705. Msg(12) = "WHEN LIT. SCORE 10,000 TIMES MULTIPLIER FOR EACH"
  706. Msg(13) = "LETTER AWARDED IN (R-O-B-O-W-A-R) AT THE END OF A BALL"
  707. Msg(14) = "IN PLAY."
  708. Msg(15) = ""
  709. Msg(16) = "MULTI-BONUS: SCORE 5000 TIMES MULTIPLIER FOR EACH DROP TARGET"
  710. Msg(17) = "HIT DURING MULTI-BALL PLAY. SCORE MULTI-BONUS VALUE IN"
  711. Msg(18) = "HOLE DURING MULTI-BALL PLAY AND AFTER LAST BALL"
  712. Msg(19) = "IN PLAY."
  713. Msg(20) = ""
  714. Dim x
  715. For x = 1 To 20
  716. Msg(0) = Msg(0) + Msg(X) &Chr(13)
  717. Next
  718. MsgBox Msg(0), , " Instructions and Rule Card"
  719. End Sub
  720.  
  721. ' Dip Switches
  722. ' ==================================================================
  723. ' Gottlieb Robo-War
  724. ' originally added by Inkochnito
  725. ' Updated Switches 8, 31, and 32
  726. Sub editDips
  727. Dim vpmDips : Set vpmDips = New cvpmDips
  728. With vpmDips
  729. .AddForm 700,400,"Robo-War - DIP switches"
  730. .AddFrame 2,4,190,"Maximum Credits",49152,Array("8",0,"10",32768,"15",&H00004000,"20",49152)'dip 15&16
  731. .AddFrame 2,80,190,"Coin Chute Left and Right Control",&H00002000,Array("Separate",0,"Same",&H00002000)'dip 14
  732. .AddFrame 2,126,190,"Playfield Special",&H00200000,Array("Special",0,"Extra Ball",&H00200000)'dip 22
  733. .AddFrame 2,172,190,"Highest Games to Date Control",&H00000020,Array("No Effect",0,"Reset High Games #2-#5 on Power Off",&H00000020)'dip 6
  734. .AddFrame 2, 218, 190, "Auto-Percentage Control", &H00000080, Array("Disabled (Normal High Score Mode)", 0, "Enabled", &H00000080)'dip 8
  735. .AddFrame 2, 264, 190, "Alpha Drop Bank Sequence", &H40000000, Array("Also Award ROBOWAR Letter", 0, "Light Extra Ball Only", &H40000000)'dip 31
  736. .AddFrame 2, 310, 190, "Number of Active ADV X Targets", &H80000000, Array("More", 0, "Less", &H80000000)'dip 32
  737. .AddFrame 205,4,190,"Highest Game to Date Awards",&H00C00000,Array("None (Not Displayed)",0,"None",&H00800000,"2 Replay",&H00400000,"3 Replay",&H00C00000)'dip 23&24
  738. .AddFrame 205,80,190,"Balls/Game",&H01000000,Array("5",0,"3",&H01000000)'dip 25
  739. .AddFrame 205,126,190,"Replay Limit",&H04000000,Array("No Limit",0,"1",&H04000000)'dip 27
  740. .AddFrame 205,172,190,"Novelty",&H08000000,Array("Normal",0,"Score 500,000 in Place of Extra Ball and Special",&H08000000)'dip 28
  741. .AddFrame 205,218,190,"Game Mode",&H10000000,Array("Replay",0,"Extra Ball",&H10000000)'dip 29
  742. .AddFrame 205,264,190,"3rd Coin Chute Credit Control",&H20000000,Array("No Effect",0,"Add 9",&H20000000)'dip 30
  743. .AddChk 205,316,180,Array("Match",&H02000000)'dip 26
  744. .AddChk 205,331,190,Array("Attract Mode Sound",&H00000040)'dip 7
  745. .AddLabel 50,360,300,20,"After hitting OK, press F3 to reset game with new settings."
  746. .ViewDips
  747. End With
  748. End Sub
  749. Set vpmShowDips = GetRef("editDips")
  750.  
  751. Sub Primflip_Timer()
  752. FlipperT1.roty = LeftFlipper.currentangle + 245
  753. FlipperT5.roty = RightFlipper.currentangle + 116
  754. MiddleWheel.ObjRotz = LeftFlipper.currentangle - 90
  755. MiddleWheel1.ObjRotz = RightFlipper.currentangle - 100
  756. BallShadowUpdate
  757. XBallShadowUpdate
  758. End Sub
  759.  
  760. '****************************************
  761. ' JP's Fading Lamps v5 VP9 Fading only
  762. ' Based on PD's Fading Lights
  763. ' SetLamp 0 is Off
  764. ' SetLamp 1 is On
  765. ' LampState(x) current state
  766. '****************************************
  767.  
  768. Dim LampState(200), FadingLevel(200)
  769. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  770.  
  771. InitLamps()
  772. LampTimer.Interval = 10
  773. LampTimer.Enabled = 1
  774.  
  775.  
  776. Sub LampTimer_Timer()
  777. Dim chgLamp, num, chg, ii
  778. chgLamp = Controller.ChangedLamps
  779. If Not IsEmpty(chgLamp) Then
  780. For ii = 0 To UBound(chgLamp)
  781. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  782. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  783. Next
  784.  
  785. End If
  786.  
  787. UpdateLamps
  788. End Sub
  789.  
  790. Sub InitLamps()
  791. Dim x
  792. For x = 0 to 200
  793. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  794. FadingLevel(x) = 4 ' used to track the fading state
  795. FlashSpeedUp(x) = 0.2 ' faster speed when turning on the flasher
  796. FlashSpeedDown(x) = 0.1 ' slower speed when turning off the flasher
  797. FlashMax(x) = 1 ' the maximum value when on, usually 1
  798. FlashMin(x) = 0.05 ' the minimum value when off, usually 0
  799. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  800. Next
  801. End Sub
  802.  
  803. Sub UpdateLamps
  804.  
  805. ' I had to create lights for each of the relays, or they wouldn't be 100% reliable:
  806. XNFadeL 0, l0 ' ['Q' Relay] Game Over Relay
  807. XNFadeL 1, l1 ' ['T' Relay] Tilt Relay
  808. XNFadeL 2, l2 ' Ball Release
  809. ' NFadeL 4, l4 ' Sound 16
  810. 'XNFadeL 12, l12 ' ['S' Relay] Solenoid Multiplexer
  811. L12.State = LampState(12)
  812. XNFadeL 13, l13 ' ['A' Relay] Robo-Unit and Rear Chaser Light Sequences
  813. XNFadeL 14, l14 ' Stargate Ramp / Launch Attack
  814.  
  815. ' These lamps will fade slower during gameplay than they do during the attract sequence.
  816. If LampState(0) = 1 Then
  817. XNFadeL 3, l3 ' Fight Again
  818. XNFadeL 15, l15 ' 1x
  819. XNFadeL 16, l16 ' 2x
  820. XNFadeL 17, l17 ' 4x
  821. XNFadeL 18, l18
  822. XNFadeL 31, l31 ' Base
  823. XNFadeL 32, l32 ' III (Alpha)
  824. XNFadeL 33, l33 ' II (Alpha)
  825. XNFadeL 34, l34 ' I (Alpha)
  826. XNFadeL 35, l35 ' Special
  827. XNFadeL 36, l36 ' Special
  828. XNFadeL 37, l37 ' Special
  829. XNFadeL 38, l38 ' Special
  830. XNFadeL 39, l39 ' Adv X
  831. XNFadeL 40, l40 ' Adv X
  832. XNFadeL 41, l41 ' Adv X
  833. XNFadeL 42, l42 ' Adv X
  834. XNFadeL 43, l43 ' Battle Station
  835. Else
  836. XNFadeL 3, l3' Fight Again
  837. XNFadeL 15, l15 ' 1x
  838. XNFadeL 16, l16 ' 2x
  839. XNFadeL 17, l17 ' 4x
  840. XNFadeL 18, l18
  841. XNFadeL 31, l31 ' Base
  842. XNFadeLm 32, l32 ' III (Alpha)
  843. XNFadeL 32, l32sc ' III (Alpha)
  844. XNFadeL 33, l33 ' II (Alpha)
  845. XNFadeL 34, l34 ' I (Alpha)
  846. XNFadeLm 35, l35 ' Special
  847. XNFadeL 35, l35sc ' Special
  848. XNFadeL 36, l36 ' Special
  849. XNFadeLm 37, l37 ' Special
  850. XNFadeL 37, l37sc ' Special
  851. XNFadeLm 38, l38 ' Special
  852. XNFadeL 38, L38sc
  853. XNFadeL 39, l39 ' Adv X
  854. XNFadeL 40, l40 ' Adv X
  855. XNFadeL 41, l41 ' Adv X
  856. XNFadeL 42, l42 ' Adv X
  857. XNFadeL 43, l43 ' Battle Station
  858. End If
  859.  
  860. ' The rest are always the same speed.
  861. XNFadeLm 5, l5
  862. XNFadeL 5, l5a
  863. XNFadeLm 6, l6
  864. XNFadeL 6, l6a
  865. XNFadeLm 7, l7 ' (ro)B(owar)
  866. XNFadeL 7, l7a
  867. XNFadeLm 8, l8 ' (rob)O(war)
  868. XNFadeL 8, l8a
  869. XNFadeLm 9, l9 ' (robo)W(ar)
  870. XNFadeL 9, l9a
  871. XNFadeLm 10, l10 ' (robow)A(r)
  872. XNFadeL 10, l10a
  873. XNFadeLm 11, l11 ' (robowa)R
  874. XNFadeL 11, l11a
  875. XNFadeLm 19, l19 ' Extra Ball 1
  876. XNFadeL 19, l19x ' Extra Ball 1
  877. XNFadeLm 20, l20 ' Extra Ball 2
  878. XNFadeL 20, l20x ' Extra Ball 2
  879. XNFadeLm 21, l21 ' Extra Ball 3
  880. XNFadeL 21, l21x ' Extra Ball 2
  881. XNFadeLm 22, l22 ' Extra Ball 4
  882. XNFadeL 22, l22x ' Extra Ball 2
  883. XNFadeL 23, l23 ' R(obo)
  884. XNFadeL 24, l24 ' (r)O(bo)
  885. XNFadeL 25, l25 ' (ro)B(o)
  886. XNFadeL 26, l26 ' (rob)O
  887. XNFadeL 27, l27 ' B(eta)
  888. XNFadeL 28, l28 ' (b)E(ta)
  889. XNFadeL 29, l29 ' (be)T(a)
  890. XNFadeL 30, l30 ' (bet)A
  891. XNFadeL 44, l44 ' Power Surge
  892.  
  893. XNFadeLm 45, X45
  894. XNFadeLm 45, X45a
  895. XNFadeLm 45, X45b
  896. XNFadeLm 45, X45c
  897. XNFadeLm 45, X45d
  898. XNFadeLm 45, X45r
  899. XNFadeLm 45, X45sc
  900. XNFadeL 45, X45sc1
  901.  
  902. XNFadeLm 46, X46
  903. XNFadeLm 46, X46a
  904. XNFadeLm 46, X46b
  905. XNFadeLm 46, X46c
  906. XNFadeLm 46, X46d
  907. XNFadeLm 46, X46e
  908. XNFadeLm 46, X46r
  909. XNFadeLm 46, X46sc
  910. XNFadeL 46, X46sc1
  911.  
  912. XNFadeLm 47, X47
  913. XNFadeLm 47, X47a
  914. XNFadeLm 47, X47b
  915. XNFadeLm 47, X47c
  916. XNFadeL 47, X47d
  917.  
  918. SetLamp 147,LampState(47)
  919. Flashm 147, f47
  920. Flash 147, f47a
  921.  
  922. SetLamp 146,LampState(46)
  923. Flashm 146, f46
  924. Flashm 146, f46a
  925. Flash 146, f46b
  926.  
  927. SetLamp 145,LampState(45)
  928. Flash 145, f45
  929.  
  930. Flashm 164, RTF
  931. Flashm 164, RTF1
  932. Flash 164, RTFDim
  933.  
  934. Flash 161, LF61
  935.  
  936. Flashm 162, LF62
  937. Flash 162, LTFDim
  938. Flash 163, LF63
  939.  
  940. ' Flashers
  941. 'FadeL 161, l61, l61z ' Top Left Flasher 1
  942. 'FadeL 162, l62, l62z ' Top Left Flasher 2
  943. 'FadeL 163, l63, l63z ' Top Left Flasher 3
  944. 'FadeL 164, l64, l64z ' Top Right Flasher
  945. 'FlashAR 61, l61a, l61b, l61c, FRefresh1, 200, 200 ' Top Left Flasher 1
  946. 'FlashAR 62, l62a, l62b, l62c, FRefresh1, 200, 200 ' Top Left Flasher 2
  947. 'FlashAR 63, l63a, l63b, l63c, FRefresh1, 200, 200 ' Top Left Flasher 3
  948. 'FlashAR 64, l64a, l64b, l64c, FRefresh2, 200, 200 ' Top Right Flasher
  949. 'FlashAR 65, l65a, l65b, l65c, FRefresh3, 200, 200 ' Right Plastic Flasher
  950. 'FlashAR 66, l66a, l66b, l66c, FRefresh4, 200, 200 ' Left Plastic Flasher
  951. ' FlashAR 67 ' Stargate Flasher 1 (Didn't Use)
  952. ' FlashAR 68 ' Stargate Flasher 2 (Didn't Use)
  953.  
  954. ' Auxiliary Lights
  955. XNFadeL 71, l71
  956. XNFadeL 72, l72
  957. XNFadeL 73, l73
  958. XNFadeL 74, l74
  959. XNFadeL 75, l75
  960. XNFadeL 76, l76
  961. XNFadeL 77, l77
  962. XNFadeL 78, l78
  963. XNFadeL 79, l79
  964. XNFadeL 80, l80
  965. XNFadeL 81, l81
  966. XNFadeL 82, l82
  967. XNFadeL 83, l83
  968. XNFadeL 84, l84
  969. XNFadeL 85, l85
  970. XNFadeL 86, l86
  971. XNFadeL 87, l87
  972. XNFadeL 88, l88
  973. XNFadeL 89, l89
  974. XNFadeL 90, l90
  975.  
  976. XNFadeLm 91, l91a ' Rear Chaser Light
  977. XNFadeLm 91, l91b ' Rear Chaser Light
  978. XNFadeL 91, l91c ' Rear Chaser Light
  979.  
  980. SetLamp 191,LampState(91)
  981. Flash 191, F91
  982.  
  983. XNFadeLm 100, l100a ' Rear Chaser Light
  984. XNFadeLm 100, l100b ' Rear Chaser Light
  985. XNFadeL 100, l100c ' Rear Chaser Light
  986.  
  987. SetLamp 200,LampState(100)
  988. Flash 200, F100
  989.  
  990. XNFadeLm 92, l92a ' Rear Chaser Light
  991. XNFadeLm 92, l92b ' Rear Chaser Light
  992. XNFadeL 92, l92c ' Rear Chaser Light
  993.  
  994. SetLamp 192,LampState(92)
  995. Flash 192, F92
  996.  
  997. XNFadeLm 99, l99a ' Rear Chaser Light
  998. XNFadeLm 99, l99b ' Rear Chaser Light
  999. XNFadeL 99, l99c ' Rear Chaser Light
  1000.  
  1001. SetLamp 199,LampState(99)
  1002. Flash 199, F99
  1003.  
  1004. XNFadeLm 93, l93a ' Rear Chaser Light
  1005. XNFadeLm 93, l93b ' Rear Chaser Light
  1006. XNFadeL 93, l93c ' Rear Chaser Light
  1007.  
  1008. SetLamp 193,LampState(93)
  1009. Flash 193, F93
  1010.  
  1011. XNFadeLm 98, l98a ' Rear Chaser Light
  1012. XNFadeLm 98, l98b ' Rear Chaser Light
  1013. XNFadeL 98, l98c ' Rear Chaser Light
  1014.  
  1015. SetLamp 198,LampState(98)
  1016. Flash 198, F98
  1017.  
  1018. XNFadeLm 94, l94a ' Rear Chaser Light
  1019. XNFadeLm 94, l94b ' Rear Chaser Light
  1020. XNFadeL 94, l94c ' Rear Chaser Light
  1021.  
  1022. SetLamp 194,LampState(94)
  1023. Flash 194, F94
  1024.  
  1025. XNFadeLm 97, l97a ' Rear Chaser Light
  1026. XNFadeLm 97, l97b ' Rear Chaser Light
  1027. XNFadeL 97, l97c ' Rear Chaser Light
  1028.  
  1029. SetLamp 197,LampState(97)
  1030. Flash 197, F97
  1031.  
  1032. XNFadeLm 95, l95a ' Rear Chaser Light
  1033. XNFadeLm 95, l95b ' Rear Chaser Light
  1034. XNFadeL 95, l95c ' Rear Chaser Light
  1035.  
  1036. SetLamp 195, LampState(95)
  1037. Flash 195, F95
  1038.  
  1039. XNFadeLm 96, l96a ' Rear Chaser Light
  1040. XNFadeLm 96, l96b ' Rear Chaser Light
  1041. XNFadeL 96, l96c ' Rear Chaser Light
  1042.  
  1043. SetLamp 196,LampState(96)
  1044. Flash 196, F96
  1045.  
  1046. Dim gixx
  1047.  
  1048. If LampState(1) = 1 Then
  1049. For each gixx in GI:gixx.state = 0:next
  1050. DOF 150,0
  1051. else
  1052. For each gixx in GI:gixx.state = 1:next
  1053. DOF 150,1
  1054. End If
  1055.  
  1056. If LampState(1) = 1 AND gion = 1 Then
  1057. PlaySound "fx_relay"
  1058. DOF 103,0
  1059. gion = 0
  1060. End If
  1061.  
  1062. If LampState(1) = 0 AND gion = 0 Then
  1063. PlaySound "fx_relay"
  1064. DOF 103,1
  1065. gion = 1
  1066. End If
  1067.  
  1068. If LampState(1) = 1 Then
  1069. Table1.ColorGradeImage = "ColorGrade_off"
  1070. else
  1071. Table1.ColorGradeImage = "ColorGrade_on"
  1072. End If
  1073.  
  1074. if Alpha1.isdropped AND LampState(1) < 1 Then
  1075. FL1.opacity = 0
  1076. else
  1077. FL1.opacity = 55
  1078. End If
  1079.  
  1080. if Alpha2A.isdropped AND LampState(1) < 1 Then
  1081. FL2.opacity = 0
  1082. else
  1083. FL2.opacity = 55
  1084. End If
  1085.  
  1086. if Alpha2B.isdropped AND LampState(1) < 1 Then
  1087. FL3.opacity = 0
  1088. else
  1089. FL3.opacity = 55
  1090. End If
  1091.  
  1092. if Alpha3A.isdropped AND LampState(1) < 1 Then
  1093. FL4.opacity = 0
  1094. else
  1095. FL4.opacity = 55
  1096. End If
  1097.  
  1098. if Alpha3B.isdropped AND LampState(1) < 1 Then
  1099. FL5.opacity = 0
  1100. else
  1101. FL5.opacity = 55
  1102. End If
  1103.  
  1104. if Alpha3C.isdropped AND LampState(1) < 1 Then
  1105. FL6.opacity = 0
  1106. else
  1107. FL6.opacity = 55
  1108. End If
  1109.  
  1110. if betab.isdropped AND LampState(1) < 1 Then
  1111. FLb.opacity = 0
  1112. else
  1113. FLb.opacity = 55
  1114. End If
  1115.  
  1116. if betae.isdropped AND LampState(1) < 1 Then
  1117. FLe.opacity = 0
  1118. else
  1119. FLe.opacity = 55
  1120. End If
  1121.  
  1122. if betat.isdropped AND LampState(1) < 1 Then
  1123. FLt.opacity = 0
  1124. else
  1125. FLt.opacity = 55
  1126. End If
  1127.  
  1128. if betaa.isdropped AND LampState(1) < 1 Then
  1129. FLa.opacity = 0
  1130. else
  1131. FLa.opacity = 55
  1132. End If
  1133.  
  1134. End Sub
  1135.  
  1136. Sub AllLampsOff
  1137. Dim x
  1138. For x = 0 to 200
  1139. SetLamp x, 0
  1140. Next
  1141. End Sub
  1142.  
  1143. Sub SetLamp(nr, value)
  1144. If value <> LampState(nr) Then
  1145. LampState(nr) = abs(value)
  1146. FadingLevel(nr) = abs(value) + 4
  1147. End If
  1148. End Sub
  1149.  
  1150. 'Walls
  1151.  
  1152. Sub FadeW(nr, a, b, c)
  1153. Select Case LampState(nr)
  1154. Case 2:c.IsDropped = 1:LampState(nr) = 0 'Off
  1155. Case 3:b.IsDropped = 1:c.IsDropped = 0:LampState(nr) = 2 'fading...
  1156. Case 4:a.IsDropped = 1:b.IsDropped = 0:LampState(nr) = 3 'fading...
  1157. Case 5:c.IsDropped = 1:b.IsDropped = 0:LampState(nr) = 6 'ON
  1158. Case 6:b.IsDropped = 1:a.IsDropped = 0:LampState(nr) = 1 'ON
  1159. End Select
  1160. End Sub
  1161.  
  1162. Sub FadeWm(nr, a, b, c)
  1163. Select Case LampState(nr)
  1164. Case 2:c.IsDropped = 1
  1165. Case 3:b.IsDropped = 1:c.IsDropped = 0
  1166. Case 4:a.IsDropped = 1:b.IsDropped = 0
  1167. Case 5:c.IsDropped = 1:b.IsDropped = 0
  1168. Case 6:b.IsDropped = 1:a.IsDropped = 0
  1169. End Select
  1170. End Sub
  1171.  
  1172. Sub NFadeW(nr, a)
  1173. Select Case LampState(nr)
  1174. Case 4:a.IsDropped = 1:LampState(nr) = 0
  1175. Case 5:a.IsDropped = 0:LampState(nr) = 1
  1176. End Select
  1177. End Sub
  1178.  
  1179. Sub NFadeWm(nr, a)
  1180. Select Case LampState(nr)
  1181. Case 4:a.IsDropped = 1
  1182. Case 5:a.IsDropped = 0
  1183. End Select
  1184. End Sub
  1185.  
  1186. Sub NFadeWi(nr, a)
  1187. Select Case LampState(nr)
  1188. Case 4:a.IsDropped = 0:LampState(nr) = 0
  1189. Case 5:a.IsDropped = 1:LampState(nr) = 1
  1190. End Select
  1191. End Sub
  1192.  
  1193. Sub NFadeWim(nr, a)
  1194. Select Case LampState(nr)
  1195. Case 4:a.IsDropped = 0
  1196. Case 5:a.IsDropped = 1
  1197. End Select
  1198. End Sub
  1199.  
  1200. 'Lights
  1201.  
  1202. Sub XNFadeL(nr, object)
  1203. Select Case FadingLevel(nr)
  1204. Case 4:object.state = 0:FadingLevel(nr) = 0
  1205. Case 5:object.state = 1:FadingLevel(nr) = 1
  1206. End Select
  1207. End Sub
  1208.  
  1209. Sub XNFadeLm(nr, object) ' used for multiple lights
  1210. Select Case FadingLevel(nr)
  1211. Case 4:object.state = 0
  1212. Case 5:object.state = 1
  1213. End Select
  1214. End Sub
  1215.  
  1216. Sub Flash(nr, object)
  1217. Select Case FadingLevel(nr)
  1218. Case 4 'off
  1219. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1220. If FlashLevel(nr) < FlashMin(nr) Then
  1221. FlashLevel(nr) = FlashMin(nr)
  1222. FadingLevel(nr) = 0 'completely off
  1223. End if
  1224. Object.IntensityScale = FlashLevel(nr)
  1225. Case 5 ' on
  1226. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1227. If FlashLevel(nr) > FlashMax(nr) Then
  1228. FlashLevel(nr) = FlashMax(nr)
  1229. FadingLevel(nr) = 1 'completely on
  1230. End if
  1231. Object.IntensityScale = FlashLevel(nr)
  1232. End Select
  1233. ' Object.IntensityScale = 1
  1234. End Sub
  1235.  
  1236. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1237. Object.IntensityScale = FlashLevel(nr)
  1238. ' Object.IntensityScale = 1
  1239. End Sub
  1240.  
  1241. Sub FadeL(nr, a, b)
  1242. Select Case LampState(nr)
  1243. Case 2:b.state = 0:LampState(nr) = 0
  1244. Case 3:b.state = 1:LampState(nr) = 2
  1245. Case 4:a.state = 0:LampState(nr) = 3
  1246. Case 5:b.state = 1:LampState(nr) = 6
  1247. Case 6:a.state = 1:LampState(nr) = 1
  1248. End Select
  1249. End Sub
  1250.  
  1251. Sub FastL(nr, a, b)
  1252. Select Case LampState(nr)
  1253. Case 2:b.state = 0:LampState(nr) = 0
  1254. Case 3:b.state = 1:LampState(nr) = 2
  1255. Case 4:a.state = 0:LampState(nr) = 3
  1256. Case 5:a.state = 1:LampState(nr) = 1
  1257. End Select
  1258. End Sub
  1259.  
  1260. Sub FadeLm(nr, a, b)
  1261. Select Case LampState(nr)
  1262. Case 2:b.state = 0
  1263. Case 3:b.state = 1
  1264. Case 4:a.state = 0
  1265. Case 5:b.state = 1
  1266. Case 6:a.state = 1
  1267. End Select
  1268. End Sub
  1269.  
  1270. Sub NFadeL(nr, a)
  1271. Select Case LampState(nr)
  1272. Case 4:a.state = 0:LampState(nr) = 0
  1273. Case 5:a.State = 1:LampState(nr) = 1
  1274. End Select
  1275. End Sub
  1276.  
  1277. Sub NFadeLm(nr, a)
  1278. Select Case LampState(nr)
  1279. Case 4:a.state = 0
  1280. Case 5:a.State = 1
  1281. End Select
  1282. End Sub
  1283.  
  1284. Sub FadeOldL(nr, a, b, c)
  1285. Select Case LampState(nr)
  1286. Case 2:c.state = 0:LampState(nr) = 0
  1287. Case 3:b.state = 0:c.state = 1:LampState(nr) = 2
  1288. Case 4:a.state = 0:b.state = 1:LampState(nr) = 3
  1289. Case 5:a.state = 0:c.state = 0:b.state = 1:LampState(nr) = 6
  1290. Case 6:b.state = 0:a.state = 1:LampState(nr) = 1
  1291. End Select
  1292. End Sub
  1293.  
  1294. Sub FadeOldLm(nr, a, b, c)
  1295. Select Case LampState(nr)
  1296. Case 2:c.state = 0
  1297. Case 3:b.state = 0:c.state = 1
  1298. Case 4:a.state = 0:b.state = 1
  1299. Case 5:a.state = 0:c.state = 0:b.state = 1
  1300. Case 6:b.state = 0:a.state = 1
  1301. End Select
  1302. End Sub
  1303.  
  1304. 'Reels
  1305.  
  1306. Sub FadeR(nr, a)
  1307. Select Case LampState(nr)
  1308. Case 2:a.SetValue 3:LampState(nr) = 0
  1309. Case 3:a.SetValue 2:LampState(nr) = 2
  1310. Case 4:a.SetValue 1:LampState(nr) = 3
  1311. Case 5:a.SetValue 1:LampState(nr) = 6
  1312. Case 6:a.SetValue 0:LampState(nr) = 1
  1313. End Select
  1314. End Sub
  1315.  
  1316. Sub FadeRm(nr, a)
  1317. Select Case LampState(nr)
  1318. Case 2:a.SetValue 3
  1319. Case 3:a.SetValue 2
  1320. Case 4:a.SetValue 1
  1321. Case 5:a.SetValue 1
  1322. Case 6:a.SetValue 0
  1323. End Select
  1324. End Sub
  1325.  
  1326. 'Texts
  1327.  
  1328. Sub NFadeT(nr, a, b)
  1329. Select Case LampState(nr)
  1330. Case 4:a.Text = "":LampState(nr) = 0
  1331. Case 5:a.Text = b:LampState(nr) = 1
  1332. End Select
  1333. End Sub
  1334.  
  1335. Sub NFadeTm(nr, a, b)
  1336. Select Case LampState(nr)
  1337. Case 4:a.Text = ""
  1338. Case 5:a.Text = b
  1339. End Select
  1340. End Sub
  1341.  
  1342. ' Flash a light, not controlled by the rom
  1343.  
  1344. Sub FlashL(nr, a, b)
  1345. Select Case LampState(nr)
  1346. Case 1:b.state = 0:LampState(nr) = 0
  1347. Case 2:b.state = 1:LampState(nr) = 1
  1348. Case 3:a.state = 0:LampState(nr) = 2
  1349. Case 4:a.state = 1:LampState(nr) = 3
  1350. Case 5:b.state = 1:LampState(nr) = 4
  1351. End Select
  1352. End Sub
  1353.  
  1354. ' Light acting as a flash. C is the light number to be restored
  1355.  
  1356. Sub MFadeL(nr, a, b, c)
  1357. Select Case LampState(nr)
  1358. Case 2:b.state = 0:LampState(nr) = 0
  1359. If LampState(c) = 1 Then SetLamp c, 1
  1360. Case 3:b.state = 1:LampState(nr) = 2
  1361. Case 4:a.state = 0:LampState(nr) = 3
  1362. Case 5:a.state = 1:LampState(nr) = 1
  1363. End Select
  1364. End Sub
  1365.  
  1366. ' Added in version 5 : lights made with alpha ramps
  1367. ' a, b, c and d are the ramps from on to off
  1368. ' r is the refresh light
  1369. ' wt is the top width of the ramp
  1370. ' wb is the bottom width of the ramp
  1371.  
  1372. Sub FadeAR(nr, a, b, c, d, r, wt, wb)
  1373. Select Case LampState(nr)
  1374. Case 2:c.WidthBottom = 0:c.WidthTop = 0
  1375. d.WidthBottom = wb:d.WidthTop = wt
  1376. r.State = ABS(r.state -1)
  1377. LampState(nr) = 0 'Off
  1378. Case 3:b.WidthBottom = 0:b.WidthTop = 0
  1379. c.WidthBottom = wb:c.WidthTop = wt
  1380. r.State = ABS(r.state -1)
  1381. LampState(nr) = 2 'fading...
  1382. Case 4:a.WidthBottom = 0:a.WidthTop = 0
  1383. b.WidthBottom = wb:b.WidthTop = wt
  1384. r.State = ABS(r.state -1)
  1385. LampState(nr) = 3 'fading...
  1386. Case 5:d.WidthBottom = 0:d.WidthTop = 0
  1387. b.WidthBottom = wb:b.WidthTop = wt
  1388. r.State = ABS(r.state -1)
  1389. LampState(nr) = 6 ' 1/2 ON
  1390. Case 6:b.WidthBottom = 0:b.WidthTop = 0
  1391. a.WidthBottom = wb:a.WidthTop = wt
  1392. r.State = ABS(r.state -1)
  1393. LampState(nr) = 1 'ON
  1394. End Select
  1395. End Sub
  1396.  
  1397. Sub FadeARm(nr, a, b, c, d, r, wt, wb)
  1398. Select Case LampState(nr)
  1399. Case 2:c.WidthBottom = 0:c.WidthTop = 0
  1400. d.WidthBottom = wb:d.WidthTop = wt
  1401. r.State = ABS(r.state -1)
  1402. Case 3:b.WidthBottom = 0:b.WidthTop = 0
  1403. c.WidthBottom = wb:c.WidthTop = wt
  1404. r.State = ABS(r.state -1)
  1405. Case 4:a.WidthBottom = 0:a.WidthTop = 0
  1406. b.WidthBottom = wb:b.WidthTop = wt
  1407. r.State = ABS(r.state -1)
  1408. Case 5:d.WidthBottom = 0:d.WidthTop = 0
  1409. b.WidthBottom = wb:b.WidthTop = wt
  1410. r.State = ABS(r.state -1)
  1411. Case 6:b.WidthBottom = 0:b.WidthTop = 0
  1412. a.WidthBottom = wb:a.WidthTop = wt
  1413. r.State = ABS(r.state -1)
  1414. End Select
  1415. End Sub
  1416.  
  1417. Sub FlashAR(nr, a, b, c, r, wt, wb) 'used for reflections when the off is transparent - no ramp
  1418. Select Case LampState(nr)
  1419. Case 2:c.WidthBottom = 0:c.WidthTop = 0
  1420. r.State = ABS(r.state -1)
  1421. LampState(nr) = 0 'Off
  1422. Case 3:b.WidthBottom = 0:b.WidthTop = 0
  1423. c.WidthBottom = wb:c.WidthTop = wt
  1424. r.State = ABS(r.state -1)
  1425. LampState(nr) = 2 'fading...
  1426. Case 4:a.WidthBottom = 0:a.WidthTop = 0
  1427. b.WidthBottom = wb:b.WidthTop = wt
  1428. r.State = ABS(r.state -1)
  1429. LampState(nr) = 3 'fading...
  1430. Case 5:b.WidthBottom = wb:b.WidthTop = wt
  1431. r.State = ABS(r.state -1)
  1432. LampState(nr) = 6 ' 1/2 ON
  1433. Case 6:b.WidthBottom = 0:b.WidthTop = 0
  1434. a.WidthBottom = wb:a.WidthTop = wt
  1435. r.State = ABS(r.state -1)
  1436. LampState(nr) = 1 'ON
  1437. End Select
  1438. End Sub
  1439.  
  1440. Sub FlashARm(nr, a, b, c, r, wt, wb) 'used for reflections when the off is transparent - no ramp
  1441. Select Case LampState(nr)
  1442. Case 2:c.WidthBottom = 0:c.WidthTop = 0
  1443. r.State = ABS(r.state -1)
  1444. Case 3:b.WidthBottom = 0:b.WidthTop = 0
  1445. c.WidthBottom = wb:c.WidthTop = wt
  1446. r.State = ABS(r.state -1)
  1447. Case 4:a.WidthBottom = 0:a.WidthTop = 0
  1448. b.WidthBottom = wb:b.WidthTop = wt
  1449. r.State = ABS(r.state -1)
  1450. Case 5:b.WidthBottom = wb:b.WidthTop = wt
  1451. r.State = ABS(r.state -1)
  1452. Case 6:b.WidthBottom = 0:b.WidthTop = 0
  1453. a.WidthBottom = wb:a.WidthTop = wt
  1454. r.State = ABS(r.state -1)
  1455. End Select
  1456. End Sub
  1457.  
  1458. Sub NFadeAR(nr, a, b, r, wt, wb) ' a is the ramp on, b if the ramp off
  1459. Select Case LampState(nr)
  1460. Case 4:a.WidthBottom = 0:a.WidthTop = 0
  1461. b.WidthBottom = wb:b.WidthTop = wt
  1462. r.State = ABS(r.state -1)
  1463. LampState(nr) = 0 'off
  1464. Case 5:a.WidthBottom = wb:a.WidthTop = wt
  1465. b.WidthBottom = 0:b.WidthTop = 0
  1466. r.State = ABS(r.state -1)
  1467. LampState(nr) = 1 'on
  1468. End Select
  1469. End Sub
  1470.  
  1471. Sub NFadeARm(nr, a, b, r, wt, wb) ' a is the ramp on, b if the ramp off
  1472. Select Case LampState(nr)
  1473. Case 4:a.WidthBottom = 0:a.WidthTop = 0
  1474. b.WidthBottom = wb:b.WidthTop = wt
  1475. r.State = ABS(r.state -1)
  1476. Case 5:a.WidthBottom = wb:a.WidthTop = wt
  1477. b.WidthBottom = 0:b.WidthTop = 0
  1478. r.State = ABS(r.state -1)
  1479. End Select
  1480. End Sub
  1481.  
  1482. '--------- ADDED by JF
  1483. Sub BallRelease_UnHit(): DOF 112,2:End Sub
  1484. Sub Untrapper2_UnHit(): Untrapper2.Enabled = 0 : End Sub
  1485. '--------- END ADDED by JF
  1486.  
  1487. '*****************************************
  1488. ' JP's VP10 Rolling Sounds
  1489. '*****************************************
  1490.  
  1491. Const tnob = 8 ' total number of balls
  1492. ReDim rolling(tnob)
  1493. InitRolling
  1494.  
  1495. Sub InitRolling
  1496. Dim i
  1497. For i = 0 to tnob
  1498. rolling(i) = False
  1499. Next
  1500. End Sub
  1501.  
  1502. Sub RollingTimer_Timer()
  1503. Dim BOT, b
  1504. BOT = GetBalls
  1505.  
  1506. ' stop the sound of deleted balls
  1507. For b = UBound(BOT) + 1 to tnob
  1508. rolling(b) = False
  1509. StopSound("fx_ballrolling" & b)
  1510. Next
  1511.  
  1512. ' exit the sub if no balls on the table
  1513. If UBound(BOT) = -1 Then Exit Sub
  1514.  
  1515. ' play the rolling sound for each ball
  1516. For b = 0 to UBound(BOT)
  1517. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 AND BOT(b).z > 0 Then
  1518. rolling(b) = True
  1519. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1520. Else
  1521. If rolling(b) = True Then
  1522. StopSound("fx_ballrolling" & b)
  1523. rolling(b) = False
  1524. End If
  1525. End If
  1526. Next
  1527. End Sub
  1528.  
  1529. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1530. Vol = Csng(BallVel(ball) ^2 / 1)
  1531. End Function
  1532.  
  1533. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table" is the name of the table
  1534. Dim tmp
  1535. tmp = ball.x * 2 / table1.width-1
  1536. If tmp > 0 Then
  1537. Pan = Csng(tmp ^10)
  1538. Else
  1539. Pan = Csng(-((- tmp) ^10) )
  1540. End If
  1541. End Function
  1542.  
  1543. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1544. Pitch = BallVel(ball) * 20
  1545. End Function
  1546.  
  1547. Function BallVel(ball) 'Calculates the ball speed
  1548. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1549. End Function
  1550.  
  1551. '**********************
  1552. ' Ball Collision Sound
  1553. '**********************
  1554.  
  1555. Sub OnBallBallCollision(ball1, ball2, velocity)
  1556. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1557. End Sub
  1558. ' *********************************************************************
  1559. ' Supporting Ball & Sound Functions
  1560. ' *********************************************************************
  1561.  
  1562. Sub Pins_Hit (idx)
  1563. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1564. End Sub
  1565.  
  1566. Sub Targets_Hit (idx)
  1567. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1568. End Sub
  1569.  
  1570. Sub TargetBankWalls_Hit (idx)
  1571. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1572. End Sub
  1573.  
  1574. Sub Metals_Thin_Hit (idx)
  1575. PlaySound "fx_metalhit", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1576. End Sub
  1577.  
  1578. Sub Metals_Medium_Hit (idx)
  1579. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1580. End Sub
  1581.  
  1582. Sub Metals2_Hit (idx)
  1583. PlaySound "fx_metalclank", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1584. End Sub
  1585.  
  1586. Sub Gates_Hit (idx)
  1587. PlaySound "gate", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1588. End Sub
  1589.  
  1590. Sub Rolls_Hit (idx)
  1591. PlaySound "fx_sensor", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1592. End Sub
  1593.  
  1594. Sub Rubbers_Hit(idx)
  1595. dim finalspeed
  1596. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1597. If finalspeed > 20 then
  1598. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1599. End if
  1600. If finalspeed >= 6 AND finalspeed <= 20 then
  1601. RandomSoundRubber()
  1602. End If
  1603. End Sub
  1604.  
  1605. Sub Posts_Hit(idx)
  1606. dim finalspeed
  1607. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1608. If finalspeed > 16 then
  1609. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1610. End if
  1611. If finalspeed >= 6 AND finalspeed <= 16 then
  1612. RandomSoundRubber()
  1613. End If
  1614. End Sub
  1615.  
  1616. Sub RandomSoundRubber()
  1617. Select Case Int(Rnd*3)+1
  1618. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1619. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1620. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1621. End Select
  1622. End Sub
  1623.  
  1624. Sub LeftFlipper_Collide(parm)
  1625. RandomSoundFlipper()
  1626. End Sub
  1627.  
  1628. Sub RightFlipper_Collide(parm)
  1629. RandomSoundFlipper()
  1630. End Sub
  1631.  
  1632. Sub RandomSoundFlipper()
  1633. Select Case Int(Rnd*3)+1
  1634. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1635. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1636. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1637. End Select
  1638. End Sub
  1639.  
  1640. Sub Shad_Rot_Timer()
  1641. XBallShadow1.ObjRotZ = XBallShadow1.ObjRotZ + 1
  1642. XBallShadow2.ObjRotZ = XBallShadow2.ObjRotZ + 1
  1643. End Sub
  1644.  
  1645. Sub Table1_Exit
  1646. Controller.Stop
  1647. End Sub
Advertisement
Add Comment
Please, Sign In to add comment