Advertisement
Arngrim

IJ DOF

Jul 1st, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.41 KB | None | 0 0
  1. ' Indiana Jones: The Pinball Adventure / IPD No. 1267 / August, 1993 / 4 Players
  2. ' Thanks to destruk for previous code.
  3. ' Thanks to knorr and clark kent for the help and the resources.
  4. ' Thanks to flupper for bumper caps, flasher domes models.
  5. ' Thanks to VP Dev team for the freaking amazing VPX!
  6.  
  7. Option Explicit
  8. Randomize
  9.  
  10. '************************************************************************
  11. ' Table options
  12. '************************************************************************
  13. Const PropellerMod = 1 'Animate Bi-Plane Propeller when making left ramp
  14. Const InstrCardType = 1 'Instruction Cards Type (0= original, 1= custom, 2 = random)
  15. Const FlipperType = 0 'Flippers Type (0= red rubber, 1= black rubber, 2 = random)
  16. Const TargetDecals = 1 'Shows Custom Target Decals (0= no, 1= yes)
  17. Const SideCabDecals = 1 'Shows Custom Cabinet Decals (0= no, 1= yes)
  18. '************************************************************************
  19. ' End of table options
  20. '************************************************************************
  21.  
  22. Const BallSize = 52
  23. Const BallMass = 1.6
  24.  
  25. On Error Resume Next
  26. ExecuteGlobal GetTextFile("controller.vbs")
  27. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  28. On Error Goto 0
  29.  
  30. Dim DesktopMode:DesktopMode = Table1.ShowDT
  31. Dim UseVPMDMD:UseVPMDMD = DesktopMode
  32. Const UseVPMModSol = 1
  33.  
  34. LoadVPM "02800000", "WPC.VBS", 3.55
  35.  
  36. '************************************
  37. '******* Standard definitions *******
  38. '************************************
  39. ' Rom Name
  40. Const cGameName = "ij_l7"
  41.  
  42. ' Standard Options
  43. Const UseSolenoids = 1
  44. Const UseLamps = 1
  45. Const UseSync = 1
  46. Const HandleMech = 0
  47.  
  48. ' IJ Specific Option
  49. Const cSingleLFlip = 0
  50. Const cSingleRFlip = 0
  51.  
  52. ' Standard Sounds
  53. Const SSolenoidOn = "fx_Solenoid"
  54. Const SSolenoidOff = ""
  55. Const SCoin = "fx_Coin"
  56.  
  57. '************************************************************************
  58. ' Solenoids map
  59. '************************************************************************
  60.  
  61. '(*) handled by cvpmMech
  62.  
  63. SolCallback(1)="bsPopper.SolOut" 'BallPopper
  64. SolCallback(2)="AutoPlunger" 'BallLaunch
  65. SolCallback(3)="dtTotem.SolDropUp" 'TotemDropUp
  66. SolCallback(4)="SolBallRelease" 'BallRelease
  67. SolCallback(5)="dtBank.SolDropUp" 'CenterDropUp
  68. SolCallback(6)="SolIdol" 'IdolRelease
  69. SolCallback(7)="vpmSolSound SoundFX(""fx_Knocker"",DOFKnocker)," 'Knocker
  70. SolCallback(8)="bsLEject.SolOut" 'Left Eject
  71. SolCallback(9)="vpmSolSound SoundFX(""LeftJet"",DOFContactors)," 'Left Bumper
  72. SolCallback(10)="vpmSolSound SoundFX(""RightJet"",DOFContactors)," 'Right Bumper
  73. SolCallback(11)="vpmSolSound SoundFX(""BottomJet"",DOFContactors)," 'Bottom Bumper
  74. SolCallback(12)="vpmSolSound SoundFX(""RightSlingShot"",DOFContactors)," 'Right Sling
  75. SolCallback(13)="vpmSolSound SoundFX(""LeftSlingShot"",DOFContactors)," 'Left Sling
  76. SolCallback(14)="vpmSolGate LeftGate,SoundFX(""DiverterOn"",DOFContactors)," 'Left ControlGate
  77. SolCallback(15)="vpmSolGate RightGate,SoundFX(""DiverterOn"",DOFContactors)," 'Right ControlGate
  78. SolCallback(16)="dtTotem.SolDropDown" 'TotemDropDown
  79. SolCallback(17)="SetLamp 17," 'Insert:Eternal Life
  80. SolModCallback(18)="SetModLamp 18," 'Flasher:Light JackPot
  81. SolCallback(19)="SetLamp 19," 'Insert:Super Jackpot
  82. SolModCallback(20)="SetModLamp 20," 'Flasher:JackPot
  83. SolModCallback(21)="SetModLamp 21," 'Flasher:Path of Adventure
  84. SolCallback(22)="PoAMoveLeft" 'L_PoA (*)
  85. SolCallback(23)="PoAMoveRight" 'R_PoA (*)
  86. SolModCallback(24)="SetModLamp 24," 'Flasher:Plane Gun LEDS
  87. SolCallback(25)="SetLamp 25," 'Insert:Dogfight Hurry up
  88. SolModCallback(26)="SetModLamp 26," 'Flasher:Right Ramp (x3)
  89. SolModCallback(27)="SetModLamp 27," 'Flasher:Left Ramp
  90. SolCallback(28)="bsSubway.SolOut" 'SubwayRelease
  91.  
  92. SolCallback(33)="SolDivPower" 'DivPower
  93. SolCallback(34)="SolDivHold" 'DivHold
  94. SolCallback(35)="SolTopPostPower" 'TopPostPower
  95. SolCallback(36)="SolTopPostHold" 'TopPostHold
  96.  
  97. SolModCallback(51)="SetModLamp 51," 'Flasher:Left Side (x2)
  98. SolModCallback(52)="SetModLamp 52," 'Flasher:Right Side (x2)
  99. SolCallback(53)="SetLamp 53," 'Insert:Special (x2)
  100. SolCallback(54)="SetLamp 54," 'Insert:Totem Multi
  101. SolModCallback(55)="SetModLamp 55," 'Flasher:Jackpot Multi
  102. SolCallback(56)="SolMoveIdol" 'Idol Motor
  103.  
  104. SolCallback(sLLFlipper) = "SolLFlipper"
  105. SolCallback(sLRFlipper) = "SolRFlipper"
  106.  
  107. '************************************************************************
  108. ' Table Init
  109. '************************************************************************
  110.  
  111. Dim bsTrough, bsLEject, bsSubway, bsPopper, dtTotem, dtBank, PoAMech
  112.  
  113. Sub Table1_Init
  114. vpmInit Me
  115. With Controller
  116. .GameName = cGameName
  117. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  118. .SplashInfoLine = "Indiana Jones - The Pinball Adventure (Williams 1993)"
  119. .HandleKeyboard = 0
  120. .ShowTitle = 0
  121. .ShowDMDOnly = 1
  122. .ShowFrame = 0
  123. .HandleMechanics = 0
  124. .Hidden = DesktopMode
  125. On Error Resume Next
  126. .Run GetPlayerHWnd
  127. If Err Then MsgBox Err.Description
  128. On Error Goto 0
  129. .Switch(22) = 1 'close coin door
  130. .Switch(24) = 0 'always closed
  131. End With
  132.  
  133. ' Main Timer init
  134. PinMAMETimer.Interval = PinMAMEInterval
  135. PinMAMETimer.Enabled = 1
  136.  
  137. ' Nudging
  138. vpmNudge.TiltSwitch = 14
  139. vpmNudge.Sensitivity = 3
  140. vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingshot)
  141.  
  142. 'Trough
  143. Set bsTrough = New cvpmTrough
  144. With bsTrough
  145. .Size = 6
  146. .InitSwitches Array(86, 85, 84, 83, 82, 81)
  147. .InitExit BallRelease, 70, 15
  148. .InitEntrySounds "fx_drain", SoundFX(SSolenoidOn,DOFContactors), SoundFX(SSolenoidOn,DOFContactors)
  149. .InitExitSounds SoundFX(SSolenoidOn,DOFContactors), SoundFX("BallRelease",DOFContactors)
  150. .Balls = 6
  151. .CreateEvents "bsTrough", Drain
  152. End With
  153.  
  154. 'Left Eject
  155. Set bsLEject = new cvpmSaucer
  156. With bsLEject
  157. .InitKicker Sw31, 31, 170.5, 15, 0
  158. .InitSounds "fx_saucerHit", SoundFX("LeftEject",DOFContactors), SoundFX("LeftEject",DOFContactors)
  159. .CreateEvents "bsLEject", Sw31
  160. End With
  161.  
  162. 'Subway Eject
  163. Set bsSubway = new cvpmSaucer
  164. With bsSubway
  165. .InitKicker sw47, 47, 90, 10, 0
  166. .InitSounds "", SoundFX("SubWayRelease",DOFContactors), SoundFX("SubWayRelease",DOFContactors)
  167. .CreateEvents "bsSubway", Sw47
  168. End With
  169.  
  170. 'Subway Popper Eject
  171. Set bsPopper = new cvpmSaucer
  172. With bsPopper
  173. .InitKicker Sw44, 44, 0, 32, 1.56
  174. .InitSounds "", SoundFX("Ball Popper",DOFContactors), SoundFX("Ball Popper",DOFContactors)
  175. .CreateEvents "bsPopper", Sw44
  176. End With
  177.  
  178. 'Totem Drop Target
  179. Set dtTotem = New cvpmDropTarget
  180. With dtTotem
  181. .InitDrop sw11, 11
  182. .Initsnd SoundFX("TotemDropDown",DOFDropTargets), SoundFX("TotemDropUp",DOFDropTargets)
  183. End With
  184.  
  185. '3-bank Drop Target
  186. Set dtBank = New cvpmDropTarget
  187. With dtBank
  188. .InitDrop Array(sw115,sw116,sw117), Array(115,116,117)
  189. .Initsnd SoundFX("CenterDropBankDown",DOFDropTargets), SoundFX("CenterDropBankUp",DOFDropTargets)
  190. End With
  191.  
  192. 'Path of Adventure
  193. Set POAMech=New cvpmMech
  194. With POAMech
  195. .MType = vpmMechTwoDirSol + vpmMechStopEnd + vpmMechLinear
  196. .Sol1=23
  197. .Sol2=22
  198. .Length=9
  199. .Steps=9
  200. .AddSw 124,0,0
  201. .AddSw 125,8,8
  202. .CallBack=GetRef("UpdatePoA")
  203. .ACC=1
  204. .RET=1
  205. .Start
  206. End With
  207.  
  208. 'Init Captive Ball
  209. CapKicker.CreateSizedBallWithMass Ballsize/2, BallMass:CapKicker.kick 0,0 :CapKicker.enabled=0
  210.  
  211. 'Other Suff
  212. InitPoA:InitIdol:InitLamps:InitRolling:InitOptions
  213. DiverterOn.IsDropped=1
  214. End Sub
  215.  
  216. '************************************************************************
  217. ' Keys
  218. '************************************************************************
  219.  
  220. Sub Table1_KeyDown(ByVal Keycode)
  221. If Keycode= 3 Then Controller.Switch(12)=1
  222. If keycode = StartGameKey Then Controller.Switch(13) = 1
  223. If keycode = PlungerKey Then Controller.Switch(34) = 1
  224. If keycode = LeftTiltKey Then Nudge 90, 5:PlaySound SoundFX("fx_nudge",0)
  225. If keycode = RightTiltKey Then Nudge 270, 5:PlaySound SoundFX("fx_nudge",0)
  226. If keycode = CenterTiltKey Then Nudge 0, 6:PlaySound SoundFX("fx_nudge",0)
  227. If vpmKeyDown(keycode) Then Exit Sub
  228. End Sub
  229.  
  230. Sub Table1_KeyUp(ByVal Keycode)
  231. If Keycode = 3 Then Controller.Switch(12)=0
  232. If keycode = StartGameKey Then Controller.Switch(13) = 0
  233. If keycode = PlungerKey Then Controller.Switch(34) = 0
  234. If vpmKeyUp(keycode) Then Exit Sub
  235. End Sub
  236.  
  237. Sub Table1_Paused:Controller.Pause = True:End Sub
  238. Sub Table1_unPaused:Controller.Pause = False:End Sub
  239. Sub Table1_exit():Controller.Pause = False:Controller.Stop:End Sub
  240.  
  241. '************************************************************************
  242. ' Solenoids
  243. '************************************************************************
  244.  
  245. '*********** Flippers
  246. Sub SolLFlipper(Enabled)
  247. If Enabled AND BSTrough.Balls < 6 Then
  248. PlaySound SoundFX("fx_flipperup", DOFFlippers), 0, 1, -0.1, 0.15
  249. LeftFlipper.RotateToEnd
  250. Else
  251. PlaySound SoundFX("fx_flipperdown", DOFFlippers), 0, 1, -0.1, 0.15
  252. LeftFlipper.RotateToStart
  253. End If
  254. End Sub
  255.  
  256. Sub SolRFlipper(Enabled)
  257. If Enabled AND BSTrough.Balls < 6 Then
  258. PlaySound SoundFX("fx_flipperup", DOFFlippers), 0, 1, 0.1, 0.15
  259. RightFlipper.RotateToEnd
  260. Else
  261. PlaySound SoundFX("fx_flipperdown", DOFFlippers), 0, 1, 0.1, 0.15
  262. RightFlipper.RotateToStart
  263. End If
  264. End Sub
  265.  
  266. '*********** AutoPlunger
  267. Sub AutoPlunger(Enabled)
  268. If Enabled Then
  269. Plunger.Fire
  270. PlaySound SoundFX("Autoplunger",DOFContactors)
  271. End If
  272. End Sub
  273.  
  274. '*********** BallRelease
  275. Sub SolBallRelease(Enabled)
  276. If Enabled Then
  277. bsTrough.ExitSol_On
  278. If bsTrough.Balls Then vpmTimer.PulseSw 87
  279. End If
  280. End Sub
  281.  
  282. '*********** Diverter
  283. Dim DiverterDir
  284.  
  285. Sub SolDivPower(Enabled)
  286. If Enabled Then
  287. DiverterOff.IsDropped=1
  288. DiverterOn.IsDropped=0
  289. DiverterDir = 1
  290. Diverter.Interval = 5:Diverter.Enabled = 1
  291. PlaySound SoundFX("DiverterOn",DOFContactors)
  292. End If
  293. End Sub
  294.  
  295. Sub SolDivHold(Enabled)
  296. If NOT Enabled AND DiverterDir = 1 Then
  297. DiverterOff.IsDropped=0
  298. DiverterOn.IsDropped=1
  299. DiverterDir = -1
  300. Diverter.Interval = 5:Diverter.Enabled = 1
  301. PlaySound SoundFX("DiverterOff",DOFContactors)
  302. End If
  303. End Sub
  304.  
  305. Sub Diverter_Timer()
  306. DiverterP.RotZ=DiverterP.RotZ+DiverterDir
  307. If DiverterP.RotZ>2 AND DiverterDir=1 Then Me.Enabled=0:DiverterP.RotZ=2
  308. If DiverterP.RotZ<-30 AND DiverterDir=-1 Then Me.Enabled=0:DiverterP.RotZ=-30
  309. End Sub
  310.  
  311. '*********** Idol Motorized Toy
  312. Dim IdolPos, Ipos, IW
  313.  
  314. Sub InitIdol
  315. Controller.Switch(121)=1:Controller.Switch(122)=0:Controller.Switch(123)=0
  316. For each IW in IdolGuides:IW.IsDropped=1:Next
  317. IdolGuides(0).IsDropped=0:IdolPos = 0
  318. End Sub
  319.  
  320. Sub SolMoveIdol(enabled)
  321. If Enabled Then
  322. UpdateIdol.enabled = True
  323. DOF 102, DOFOn
  324. PlaySound SoundFX("IdolMotor",DOFGear)
  325. Else
  326. UpdateIdol.enabled = False
  327. ResetIdol.enabled = True
  328. End If
  329. End Sub
  330.  
  331. Sub UpdateIdol_timer
  332. ResetIdol.Enabled = False
  333. IdolPos=(IdolPos+1)Mod 360
  334. totem.rotz= -IdolPos:totem1.rotz = totem.rotz
  335. For each IW in IdolGuides:IW.IsDropped=1:Next
  336. IdolGuides(Int(IdolPos /10)).IsDropped=0
  337. Select Case IdolPos '91 '92 '93
  338. Case 0:Controller.Switch(122)=0:IPos=0 'Pos 1 1 0 0
  339. Case 60:Controller.Switch(123)=1:IPos=1 'Pos 2 1 0 1
  340. Case 120:Controller.Switch(121)=0:IPos=2 'Pos 3 0 0 1
  341. Case 180:Controller.Switch(122)=1:IPos=3 'Pos 4 0 1 1
  342. Case 240:Controller.Switch(123)=0:IPos=4 'Pos 5 0 1 0
  343. Case 300:Controller.Switch(121)=1:IPos=5 'Pos 6 1 1 0
  344. End Select
  345. Dim b,BOI:BOI=GetBalls
  346. For b = 0 to ubound(BOI)
  347. If BOI(b).X > (totem.X +10) AND BOI(b).Y< 1165 AND BOI(b).Y> 1035 AND BOI(b).Z> 70 Then
  348. If BOI(b).VelX<-1.5* Sin(IdolPos) Then BOI(b).VelX=-7* Sin(IdolPos)
  349. If BOI(b).VelY>-1.5* Cos(IdolPos) Then BOI(b).VelY=-7* Cos(IdolPos)
  350. End If
  351. Next
  352. End Sub
  353.  
  354. Sub ResetIdol_timer
  355. If totem.rotz< -60 * Ipos Then totem.rotz = totem.rotz + 1:totem1.rotz = totem.rotz
  356. If totem.rotz = -60 * Ipos Then Me.Enabled=0:IdolPos=-totem.rotz:StopSound "IdolMotor":DOF 102, DOFOff
  357. For each IW in IdolGuides:IW.IsDropped=1:Next
  358. IdolGuides(Int(IdolPos /10)).IsDropped=0
  359. End Sub
  360.  
  361. '*********** Idol Kickout
  362. Sub SolIdol(Enabled)
  363. If Enabled Then
  364. IdolStop.IsDropped=1:LockDoor1.Z=-55:LockDoor2.Z=-55:LockDoor3.Z=-55:Playsound SoundFX("IdolReleaseOn",DOFContactors)
  365. Else
  366. IdolStop.IsDropped=0:LockDoor1.Z=0:LockDoor2.Z=0:LockDoor3.Z=0:Playsound SoundFX("IdolReleaseOff",DOFContactors)
  367. End If
  368. End Sub
  369.  
  370. '*********** Path Of Adventure
  371. Dim movePoA,PoAPos,PoADropTrack,MyBall,Ballspeed
  372.  
  373. Sub InitPoA
  374. PoADropTrack=0:PoaPos=0:Ballspeed=0:TopPost.Z=0
  375. Controller.Switch (124) = 0 : Controller.Switch (125) = 0
  376. End Sub
  377.  
  378. Sub PoaMoveLeft(enabled)
  379. If enabled then
  380. movePoA=0
  381. Else
  382. ResetPoA.Enabled = 1
  383. End If
  384. End Sub
  385.  
  386. Sub PoAMoveRight(enabled)
  387. If Enabled Then
  388. movePoA=0
  389. Else
  390. ResetPoA.Enabled = 1
  391. End If
  392. End Sub
  393.  
  394. Sub ResetPoA_timer
  395. Dim ii
  396. movePoA=movePoA+1
  397. If NOT Controller.Switch (124) AND NOT Controller.Switch (125) AND movePoA > 50 AND NOT PoAPos=0 Then
  398. PoAPos = 0: Me.Enabled=0
  399. minipf.roty=PoAPos:minipf1.roty=PoAPos:minipf2.roty=PoAPos:minipf3.roty=PoAPos:minipf4.roty=PoAPos:minipf5.roty=PoAPos:minipf_screws.roty=-PoAPos
  400. li71.rotY=PoAPos:li72.rotY=PoAPos:li73.rotY=PoAPos:li74.rotY=PoAPos:li75.rotY=PoAPos
  401. li81.rotY=PoAPos:li82.rotY=PoAPos:li83.rotY=PoAPos:li84.rotY=PoAPos:li85.rotY=PoAPos
  402. sw65p.roty=PoAPos:sw66p.rotY=PoAPos:sw67p.rotY=PoAPos:sw68p.rotY=PoAPos
  403. sw75p.roty=PoAPos:sw76p.rotY=PoAPos:sw77p.rotY=PoAPos:sw78p.rotY=PoAPos
  404. For each ii in GIPOA:ii.rotY=PoAPos:Next
  405. End If
  406. End Sub
  407.  
  408. Sub UpdatePOA(oldPos,newPos,aspeed)
  409. Dim ii
  410. PoAPos=2*(POAMech.Position-4)
  411. minipf.roty=PoAPos:minipf1.roty=PoAPos:minipf2.roty=PoAPos:minipf3.roty=PoAPos:minipf4.roty=PoAPos:minipf5.roty=PoAPos:minipf_screws.roty=PoAPos:POASh.transX=PoaPos
  412. li71.rotY=PoAPos:li72.rotY=PoAPos:li73.rotY=PoAPos:li74.rotY=PoAPos:li75.rotY=PoAPos
  413. li81.rotY=PoAPos:li82.rotY=PoAPos:li83.rotY=PoAPos:li84.rotY=PoAPos:li85.rotY=PoAPos
  414. sw65p.roty=PoAPos:sw66p.rotY=PoAPos:sw67p.rotY=PoAPos:sw68p.rotY=PoAPos
  415. sw75p.roty=PoAPos:sw76p.rotY=PoAPos:sw77p.rotY=PoAPos:sw78p.rotY=PoAPos
  416. For each ii in GIPOA:ii.rotY=PoAPos:Next
  417. End Sub
  418.  
  419. Sub EnterPoA_hit:Me.TimerInterval=10:Me.TimerEnabled=1:Playsound "fx_balldrop":POABallShadow.visible=1:End Sub
  420. Sub EnterPoA_timer
  421. If NOT IsEmpty (myball) Then
  422. myball.velx = myball.velx + 0.5 * Sgn(PoAPos)
  423. If myball.VelY<0 Then myball.VelY=1
  424. POABallShadow.X = (myball.X - (Ballsize/6) + ((myball.X - (Table1.Width/2))/7)) + 10
  425. POABallShadow.Y = myball.Y + 20
  426. POABallShadow.Z = 156
  427. End If
  428. End Sub
  429.  
  430. Sub ExitPoA_hit:myball=empty:EnterPOA.TimerEnabled=0:Me.TimerInterval=100:Me.TimerEnabled=1:End Sub
  431. Sub ExitPoA_timer:Me.TimerEnabled=0:Playsound "fx_ramp_metal":POABallShadow.visible=0:POABallShadow.X=182:POABallShadow.Y=130:End Sub
  432.  
  433. Sub ExitBridge_hit:myball=empty:EnterPOA.TimerEnabled=0:Playsound "fx_ramp_turn":End Sub
  434.  
  435. '*********** Top Post
  436. Sub SolTopPostPower(Enabled)
  437. If Enabled Then
  438. If POADropTrack=1 Then Enabled=0
  439. DropPoA.IsDropped=1
  440. sw46.Kick 270,5
  441. TopPost.Z=-30
  442. If POADropTrack=0 Then Playsound SoundFX("TopPostDown",DOFContactors)
  443. Else
  444. DropPoA.IsDropped=0
  445. TopPost.Z=-30
  446. If POADropTrack=0 Then DivHelp.TimerInterval=400:DivHelp.TimerEnabled=1
  447. End If
  448. End Sub
  449.  
  450. Sub SolTopPostHold(Enabled)
  451. If Enabled Then
  452. POADropTrack=1
  453. DivHelp.IsDropped=1
  454. DropPoA.IsDropped=0
  455. TopPost.Z=-30:Playsound SoundFX("TopPostDown",DOFContactors)
  456. Else
  457. DivHelp.TimerInterval=400
  458. DivHelp.TimerEnabled=1
  459. End If
  460. End Sub
  461.  
  462. Sub DivHelp_timer
  463. Me.TimerEnabled=0
  464. POADropTrack=0
  465. DivHelp.IsDropped=0
  466. TopPost.Z=0:Playsound SoundFX("TopPostUp",DOFContactors)
  467. End Sub
  468.  
  469. Sub sw46_Hit()
  470. Set myball=ActiveBall
  471. BallSpeed=myBall.VelX
  472. If POADropTrack = 0 Then StopSound "fx_ramp_enter3"
  473. If POADropTrack = 1 Then sw46.Kick 270,ABS(Ballspeed)
  474. Controller.Switch(46)=1
  475. End Sub
  476.  
  477. Sub sw46_UnHit():Controller.Switch(46) = 0:End Sub
  478.  
  479. '************************************************************************
  480. ' Switches
  481. '************************************************************************
  482.  
  483. '*********** Drop Targets
  484. Sub sw11_dropped:dtTotem.Hit 1:End Sub
  485.  
  486. Sub sw115_dropped:dtBank.Hit 1:End Sub
  487. Sub sw116_dropped:dtBank.Hit 2:End Sub
  488. Sub sw117_dropped:dtBank.Hit 3:End Sub
  489.  
  490. Sub sw11_hit:Playsound SoundFX("DropTargetHit",DOFDropTargets):End Sub
  491. Sub sw115_hit:Playsound SoundFX("DropTargetHit",DOFDropTargets):End Sub
  492. Sub sw116_hit:Playsound SoundFX("DropTargetHit",DOFDropTargets):End Sub
  493. Sub sw117_hit:Playsound SoundFX("DropTargetHit",DOFDropTargets):End Sub
  494.  
  495. '*********** Rollovers
  496. Sub Sw15_Hit:Controller.Switch(15)=1: Playsound "fx_sensor": End Sub
  497. Sub Sw15_UnHit:Controller.Switch(15)=0: End Sub
  498. Sub Sw16_Hit:Controller.Switch(16)=1: Playsound "fx_sensor": End Sub
  499. Sub Sw16_UnHit:Controller.Switch(16)=0: End Sub
  500. Sub Sw17_Hit:Controller.Switch(17)=1: Playsound "fx_sensor": End Sub
  501. Sub Sw17_UnHit:Controller.Switch(17)=0: End Sub
  502. Sub Sw18_Hit:Controller.Switch(18)=1: Playsound "fx_sensor": End Sub
  503. Sub Sw18_UnHit:Controller.Switch(18)=0: End Sub
  504.  
  505. Sub Sw25_Hit:Controller.Switch(25)=1: Playsound "fx_sensor": End Sub
  506. Sub Sw25_UnHit:Controller.Switch(25)=0: End Sub
  507. Sub Sw26_Hit:Controller.Switch(26)=1: Playsound "fx_sensor": End Sub
  508. Sub Sw26_UnHit:Controller.Switch(26)=0: End Sub
  509. Sub Sw27_Hit:Controller.Switch(27)=1: Playsound "fx_sensor": End Sub
  510. Sub Sw27_UnHit:Controller.Switch(27)=0: End Sub
  511. Sub Sw28_Hit:Controller.Switch(28)=1: Playsound "fx_sensor": End Sub
  512. Sub Sw28_UnHit:Controller.Switch(28)=0: End Sub
  513.  
  514. Sub Sw32_Hit:Controller.Switch(32)=1:Activeball.VelY=1: Playsound "fx_sensor": End Sub
  515. Sub Sw32_UnHit:Controller.Switch(32)=0: End Sub
  516.  
  517. Sub Sw54_Hit:Controller.Switch(54)=1: Playsound "fx_sensor": End Sub
  518. Sub Sw54_UnHit:Controller.Switch(54)=0: End Sub
  519. Sub Sw55_Hit:Controller.Switch(55)=1: Playsound "fx_sensor": End Sub
  520. Sub Sw55_UnHit:Controller.Switch(55)=0: End Sub
  521. Sub Sw56_Hit:Controller.Switch(56)=1: Playsound "fx_sensor": End Sub
  522. Sub Sw56_UnHit:Controller.Switch(56)=0: End Sub
  523. Sub Sw57_Hit:Controller.Switch(57)=1: Playsound "fx_sensor": End Sub
  524. Sub Sw57_UnHit:Controller.Switch(57)=0: End Sub
  525. Sub Sw58_Hit:Controller.Switch(58)=1: Playsound "fx_sensor": End Sub
  526. Sub Sw58_UnHit:Controller.Switch(58)=0: End Sub
  527.  
  528. Sub Sw88_Hit:Controller.Switch(88)=1: Playsound "fx_sensor": End Sub
  529. Sub Sw88_UnHit:Controller.Switch(88)=0: End Sub
  530.  
  531. '*********** Slingshots
  532. Dim LStep, RStep
  533.  
  534. Sub LeftSlingShot_Slingshot()
  535. LSling1.Visible = 1
  536. Lemk.TransZ = -20
  537. LStep = 0
  538. vpmTimer.PulseSw 33
  539. Me.TimerInterval = 20:Me.TimerEnabled = 1
  540. End Sub
  541.  
  542. Sub LeftSlingShot_Timer()
  543. Select Case LStep
  544. Case 1:LSLing1.Visible = 0:LSLing2.Visible = 1:Lemk.TransZ = -10
  545. Case 2:LSLing2.Visible = 0:Lemk.TransZ = 0:Me.TimerEnabled = 0
  546. End Select
  547. LStep = LStep + 1
  548. End Sub
  549.  
  550. Sub RightSlingShot_Slingshot()
  551. RSling1.Visible = 1
  552. Remk.TransZ = -20
  553. RStep = 0
  554. vpmTimer.PulseSw 48
  555. Me.TimerInterval = 20:Me.TimerEnabled = 1
  556. End Sub
  557.  
  558. Sub RightSlingShot_Timer()
  559. Select Case RStep
  560. Case 1:RSLing1.Visible = 0:RSLing2.Visible = 1:Remk.TransZ = -10
  561. Case 2:RSLing2.Visible = 0:Remk.TransZ = 0:Me.TimerEnabled = 0
  562. End Select
  563. RStep = RStep + 1
  564. End Sub
  565.  
  566. '*********** Bumpers
  567. Sub Bumper1_Hit():vpmTimer.PulseSw 35:End Sub
  568. Sub Bumper2_Hit():vpmTimer.PulseSw 36:End Sub
  569. Sub Bumper3_Hit():vpmTimer.PulseSw 37:End Sub
  570.  
  571. '*********** Center Standup Target
  572. Sub Sw38_Hit():vpmTimer.PulseSw 38: Playsound SoundFX("fx_target",DOFTargets): End Sub
  573.  
  574. '*********** Left Ramp
  575. Sub Sw41_Hit():vpmtimer.pulseSw 41:End Sub
  576. Sub Sw118_Hit()
  577. vpmtimer.pulseSw 118:sw118p.Rotz=-50: Me.TimerEnabled=1:Playsound "fx_sensor"
  578. If PropellerMod=1 Then RotatePropeller
  579. End Sub
  580. Sub Sw118_timer:Me.TimerEnabled=0:sw118p.Rotz=-20:End Sub
  581.  
  582. '****** Propeller MOD
  583. Dim stepangle
  584.  
  585. Sub RotatePropeller()
  586. Playsound SoundFXDOF("fx_motor",101,DOFOn,DOFGear)
  587. PropellerMove.Enabled = 0
  588. PropellerMove.Interval = 10
  589. PropellerMove.Enabled = 1
  590. stepAngle=10
  591. End Sub
  592.  
  593. Sub PropellerMove_Timer()
  594. Propeller.roty = Propeller.roty + stepAngle
  595. If Propeller.roty >= 6*360 Then stepAngle = stepAngle - 0.2
  596. If stepAngle <= 0 Then Me.Enabled = 0 : Propeller.roty = Propeller.roty -6*360 : StopSound "fx_motor" : DOF 101, DOFOff
  597. End Sub
  598.  
  599. '*********** Right Ramp
  600. Sub Sw42_Hit():vpmtimer.pulseSw 42:End Sub
  601. Sub Sw74_Hit():vpmtimer.pulseSw 74:sw74p.Rotz=-30:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  602. Sub Sw74_timer:Me.TimerEnabled=0:sw74p.Rotz=0:End Sub
  603.  
  604. '*********** Idol Enter
  605. Sub sw43_hit():vpmtimer.pulseSw 43:End Sub
  606.  
  607. '*********** Subway Enter
  608. Sub Subwayhelp_hit:Me.Kick 30,8:End Sub
  609. Sub sw45_hit():vpmtimer.pulseSw 45:RandomSoundHole:End Sub
  610.  
  611. '*********** Captive Ball Target
  612. Sub Sw64_Hit():vpmTimer.PulseSw 64: Playsound SoundFX("fx_target",DOFTargets): End Sub
  613.  
  614. '*********** Captive Ball Opto
  615. Sub Sw71_Hit:Controller.Switch(71) = 1:End Sub
  616. Sub Sw71_UnHit:Controller.Switch(71) = 0:End Sub
  617.  
  618. '*********** Adventure Targets
  619. Sub Sw51_Hit():vpmTimer.PulseSw 51: Playsound SoundFX("fx_target",DOFTargets): End Sub '(U)
  620. Sub Sw52_Hit():vpmTimer.PulseSw 52: Playsound SoundFX("fx_target",DOFTargets): End Sub '(R)
  621. Sub Sw53_Hit():vpmTimer.PulseSw 53: Playsound SoundFX("fx_target",DOFTargets): End Sub '(E)
  622.  
  623. Sub Sw61_Hit():vpmTimer.PulseSw 61: Playsound SoundFX("fx_target",DOFTargets): End Sub '(A)
  624. Sub Sw62_Hit():vpmTimer.PulseSw 62: Playsound SoundFX("fx_target",DOFTargets): End Sub '(D)
  625. Sub Sw63_Hit():vpmTimer.PulseSw 63: Playsound SoundFX("fx_target",DOFTargets): End Sub '(V)
  626.  
  627. '*********** Path of Adventure
  628. Sub Sw65_Hit:vpmTimer.PulseSw 65:sw65p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  629. Sub Sw65_timer:Me.TimerEnabled=0:sw65p.rotx=0:End Sub
  630. Sub Sw66_Hit:vpmTimer.PulseSw 66:sw66p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  631. Sub Sw66_timer:Me.TimerEnabled=0:sw66p.rotx=0:End Sub
  632. Sub Sw67_Hit:vpmTimer.PulseSw 67:sw67p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  633. Sub Sw67_timer:Me.TimerEnabled=0:sw67p.rotx=0:End Sub
  634. Sub Sw68_Hit:vpmTimer.PulseSw 68:sw68p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  635. Sub Sw68_timer:Me.TimerEnabled=0:sw68p.rotx=0:End Sub
  636.  
  637. Sub sw72_hit():vpmtimer.pulseSw 72:Me.TimerInterval=200:Me.TimerEnabled=1:End Sub
  638. Sub sw72_timer():Me.TimerEnabled=0:RandomSoundHole:myball=empty:EnterPOA.TimerEnabled=0:End Sub
  639. Sub sw73_hit():vpmtimer.pulseSw 73:Me.TimerInterval=200:Me.TimerEnabled=1:End Sub
  640. Sub sw73_timer():Me.TimerEnabled=0:RandomSoundHole:myball=empty:EnterPOA.TimerEnabled=0:End Sub
  641.  
  642. Sub Sw75_Hit:vpmTimer.PulseSw 75:sw75p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  643. Sub Sw75_timer:Me.TimerEnabled=0:sw75p.rotx=0:End Sub
  644. Sub Sw76_Hit:vpmTimer.PulseSw 76:sw76p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  645. Sub Sw76_timer:Me.TimerEnabled=0:sw76p.rotx=0:End Sub
  646. Sub Sw77_Hit:vpmTimer.PulseSw 77:sw77p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  647. Sub Sw77_timer:Me.TimerEnabled=0:sw77p.rotx=0:End Sub
  648. Sub Sw78_Hit:vpmTimer.PulseSw 78:sw78p.rotx=-20:Me.TimerEnabled=1:Playsound "fx_sensor": End Sub
  649. Sub Sw78_timer:Me.TimerEnabled=0:sw78p.rotx=0:End Sub
  650.  
  651. ' *********************************************************************
  652. ' Lighting
  653. ' *********************************************************************
  654.  
  655. Dim FadingLevel(200), LampState(200)
  656.  
  657. Sub InitLamps
  658. On Error Resume Next
  659. Dim i
  660. For i=11 To 88: Execute "Lights(" & i & ") = Array (Light" & i & ",Light" & i & "a)": Next
  661. For i=0 to 200:LampState(i) = 0:FadingLevel(i) = 0:Next
  662. LampTimer.Interval = 10:LampTimer.Enabled = 1
  663. End Sub
  664.  
  665. Sub LampTimer_Timer()
  666. ' Flashers
  667. FadeLamp 17, FL_ELife
  668. FadeLamp 17, FL_ELifea
  669. FadeModLamp 18, FL_LJackpotA, 2
  670. FadeModLamp 18, FL_LJackpotB, 2
  671. FadeLamp 19, FL_SJackpot
  672. FadeLamp 19, FL_SJackpota
  673. FadeModLamp 20, FL_Jackpot, 2
  674. FadeModLamp 21, FL_POA, 2
  675. FadeModLamp 24, FL_PlaneGunsA, 2
  676. FadeModLamp 24, FL_PlaneGunsB, 2
  677. FadeLamp 25, FL_Dogfight
  678. FadeLamp 25, FL_Dogfighta
  679. FadeModLamp 26, FL_RRamp, 2
  680. FadeModLamp 26, FL_RRamp2, 2
  681. FadeModLamp 26, FL_RRamp3, 2
  682. FadeModLamp 26, FL_RRampa, 2
  683. FadeModLamp 26, FL_RRampb, 2
  684. FadeModLamp 26, FL_RRampbDT, 2
  685. FadeModLamp 26, FL_RRampr, 2
  686. FadeModLamp 26, FL_RRampr1, 2
  687. FadeModLamp 26, FL_RRampr2, 2
  688. FadeModLamp 27, FL_LRamp, 2
  689. FadeModLamp 27, FL_LRampa, 2
  690. FadeModLamp 27, FL_LRampb, 2
  691. FadeModLamp 27, FL_RRampa, 2
  692. FadeModLamp 27, FL_LRampbDT, 2
  693. FadeModLamp 27, FL_LRampr, 2
  694. FadeModLamp 27, FL_LRampr1, 2
  695. FadeModLamp 27, FL_LRampr2, 2
  696. FadeModLamp 27, FL_LRampr3, 2
  697. FadeModLamp 27, FL_LRampr4, 2
  698. FadeModLamp 27, FL_LRampr5, 2
  699. FadeModLamp 51, LeftSideFlashA, 2
  700. FadeModLamp 51, LeftSideFlashB, 2
  701. FadeModLamp 52, RightSideFlash, 2
  702. FadeModLamp 52, RightSideFlash1, 2
  703. FadeModLamp 52, RightSideFlasha, 2
  704. FadeModLamp 52, RightSideFlashb, 2
  705. FadeModLamp 52, RightSideFlashr, 2
  706. FadeModLamp 52, RightSideFlashr1, 2
  707. FadeModLamp 52, RightSideFlashr2, 2
  708. FadeModLamp 52, RightSideFlashr3, 2
  709. FadeLamp 53, FL_SpecialL
  710. FadeLamp 53, FL_SpecialR
  711. FadeLamp 53, FL_SpecialLa
  712. FadeLamp 53, FL_SpecialRa
  713. FadeLamp 54, FL_TotemMulti
  714. FadeLamp 54, FL_TotemMultiA
  715. FadeModLamp 55, FL_JackpotMultiA, 2
  716. FadeModLamp 55, FL_JackpotMultiB, 2
  717. 'i-n-D-Y inserts burst
  718. AddBurst 63, l63r
  719. AddBurst 64, l64r
  720. 'Mission inserts extra burst
  721. AddBurst 18, Light18b
  722. AddBurst 21, Light21b
  723. AddBurst 25, Light25b
  724. AddBurst 27, Light27b
  725. AddBurst 32, Light32b
  726. AddBurst 34, Light34b
  727. AddBurst 41, Light41b
  728. AddBurst 43, Light43b
  729. AddBurst 47, Light47b
  730. AddBurst 51, Light51b
  731. AddBurst 53, Light53b
  732. AddBurst 57, Light57b
  733. End Sub
  734.  
  735. Sub SetLamp(nr, enabled)
  736. LampState(nr) = enabled
  737. End Sub
  738.  
  739. Sub SetModLamp(nr, value)
  740. If value > 0 Then
  741. LampState(nr) = 1
  742. Else
  743. LampState(nr) = 0
  744. End If
  745. FadingLevel(nr) = value
  746. End Sub
  747.  
  748. Sub FadeLamp(nr, object)
  749. If TypeName(object) = "Light" Then
  750. Object.State = LampState(nr)
  751. End If
  752. If TypeName(object) = "Flasher" Then
  753. Object.visible = LampState(nr)
  754. End If
  755. End Sub
  756.  
  757. Sub FadeModLamp(nr, object, factor)
  758. Object.IntensityScale = FadingLevel(nr) * factor/255
  759. If TypeName(object) = "Light" Then
  760. Object.State = LampState(nr)
  761. End If
  762. If TypeName(object) = "Flasher" Then
  763. Object.visible = LampState(nr)
  764. End If
  765. End Sub
  766.  
  767. Sub AddBurst(nr,Object)
  768. object.visible = Controller.Lamp(nr)
  769. End Sub
  770.  
  771. '*********** General Illumination
  772. Set GiCallBack2 = GetRef("UpdateGi")
  773.  
  774. Sub UpdateGi(nr,step)
  775. Dim ii
  776. Select Case nr
  777. Case 0 'Top Playfield
  778. If step=0 Then
  779. DOF 103, DOFOff
  780. For each ii in GITop:ii.state=0:Next
  781. For each ii in GITopSides:ii.visible=0:Next
  782. For each ii in GIBumpers:ii.state=0:Next
  783. For each ii in GIPOA:ii.visible=0:Next
  784. Else
  785. DOF 103, DOFOn
  786. For each ii in GITop:ii.state=1:Next
  787. For each ii in GITopSides:ii.visible=1:Next
  788. For each ii in GIBumpers:ii.state=1:Next
  789. For each ii in GIPOA:ii.visible=1:Next
  790. End If
  791. For each ii in GITopSides:ii.IntensityScale = 0.125 * step:Next
  792. For each ii in GITop:ii.IntensityScale = 0.125 * step:Next
  793. For each ii in GIBumpers:ii.IntensityScale = 0.125 * step:Next
  794. For each ii in GIPOA:ii.IntensityScale = 0.125 * step:Next
  795. Case 1 'Bottom Playfield
  796. If step=0 Then
  797. For each ii in GIBot:ii.state=0:Next
  798. For each ii in GIBotSides:ii.visible=0:Next
  799. Else
  800. For each ii in GIBot:ii.state=1:Next
  801. For each ii in GIBotSides:ii.visible=1:Next
  802. End If
  803. For each ii in GIBot:ii.IntensityScale = 0.125 * step:Next
  804. For each ii in GIBotSides:ii.IntensityScale = 0.125 * step:Next
  805. If Step>=7 Then Table1.ColorGradeImage = "ColorGrade_8":Else Table1.ColorGradeImage = "ColorGrade_" & (step+1):End If
  806. Case 2 'Insert Top
  807. Case 3 'Insert Bottom
  808. Case 4 'Return Lane/coin
  809. If step=0 Then
  810. LiteHOF_L.state=0:LiteHOF_R.state=0
  811. Else
  812. LiteHOF_L.state=1:LiteHOF_R.state=1
  813. End If
  814. LiteHOF_L.IntensityScale = 0.125 * step:LiteHOF_R.IntensityScale = 0.125 * step
  815. End Select
  816. End Sub
  817.  
  818. ' *********************************************************************
  819. ' Supporting Ball & Sound Functions
  820. ' *********************************************************************
  821.  
  822. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  823. Vol = Csng(BallVel(ball) ^2 / 2000)
  824. End Function
  825.  
  826. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  827. Dim tmp
  828. tmp = ball.x * 2 / table1.width-1
  829. If tmp > 0 Then
  830. Pan = Csng(tmp ^10)
  831. Else
  832. Pan = Csng(-((- tmp) ^10) )
  833. End If
  834. End Function
  835.  
  836. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  837. Pitch = BallVel(ball) * 20
  838. End Function
  839.  
  840. Function BallVel(ball) 'Calculates the ball speed
  841. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  842. End Function
  843.  
  844. Function RndNum(min,max)
  845. RndNum = Int(Rnd()*(max-min+1))+min ' Sets a random number between min and max
  846. End Function
  847.  
  848. ' *********************************************************************
  849. ' Other Sound FX
  850. ' *********************************************************************
  851.  
  852. Sub OnBallBallCollision(ball1, ball2, velocity)
  853. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 500, Pan(ball1), 0, Pitch(ball1), 0, 0
  854. End Sub
  855.  
  856. Sub LeftFlipper_Collide(parm)
  857. RandomSoundFlipper
  858. End Sub
  859.  
  860. Sub Rightflipper_Collide(parm)
  861. RandomSoundFlipper
  862. End Sub
  863.  
  864. Sub Gates_Hit (idx)
  865. PlaySound "fx_gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  866. End Sub
  867.  
  868. Sub Posts_Hit(idx)
  869. dim finalspeed
  870. finalspeed=SQR((activeball.velx ^2) + (activeball.vely ^2))
  871. If finalspeed > 20 then
  872. PlaySound "fx_rubber", 0, 10*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  873. End if
  874. If finalspeed >= 6 AND finalspeed <= 20 then
  875. RandomSoundRubber()
  876. End If
  877. End Sub
  878.  
  879. Sub Rubbers_Hit(idx)
  880. dim finalspeed
  881. finalspeed=SQR((activeball.velx ^2) + (activeball.vely ^2))
  882. If finalspeed > 20 then
  883. PlaySound "fx_rubber", 0, 10*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  884. End if
  885. If finalspeed >= 6 AND finalspeed <= 20 then
  886. RandomSoundRubber()
  887. End If
  888. End Sub
  889.  
  890. Sub RandomSoundRubber()
  891. Select Case RndNum(1,3)
  892. Case 1 : PlaySound "fx_rubber_hit_1", 0, 10*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  893. Case 2 : PlaySound "fx_rubber_hit_2", 0, 10*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  894. Case 3 : PlaySound "fx_rubber_hit_3", 0, 10*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  895. End Select
  896. End Sub
  897.  
  898. Sub RandomSoundFlipper()
  899. Select Case RndNum(1,3)
  900. Case 1 : PlaySound "fx_flip_hit_1", 0, 20*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  901. Case 2 : PlaySound "fx_flip_hit_2", 0, 20*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  902. Case 3 : PlaySound "fx_flip_hit_3", 0, 20*Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  903. End Select
  904. End Sub
  905.  
  906. Sub RandomSoundHole()
  907. Select Case RndNum(1,3)
  908. Case 1 : PlaySound "fx_hole1"
  909. Case 2 : PlaySound "fx_hole2"
  910. Case 3 : PlaySound "fx_hole3"
  911. End Select
  912. End Sub
  913.  
  914. ' *********************************************************************
  915. ' Ball Drop & Ramp Sounds
  916. ' *********************************************************************
  917.  
  918. Sub SubwayEnter_Hit:Playsound "fx_plasticrolling":End Sub
  919. Sub SubwayExit_hit:StopSound "fx_plasticrolling":Playsound "fx_kickerstop":End Sub
  920.  
  921. Sub ShooterStart_Hit():StopSound "fx_launchball":If ActiveBall.VelY < 0 Then PlaySound "fx_launchball":End If:End Sub 'ball is going up
  922. Sub ShooterEnd_Hit:If ActiveBall.Z > 30 Then Me.TimerInterval=100:Me.TimerEnabled=1:End If:End Sub 'ball is flying
  923. Sub ShooterEnd_Timer(): Me.TimerEnabled=0 : PlaySound "fx_balldrop" : End Sub
  924.  
  925. Sub LREnter_Hit():If ActiveBall.VelY < 0 Then PlaySound "fx_lrenter":End If:End Sub 'ball is going up
  926. Sub LREnter_UnHit():If ActiveBall.VelY > 0 Then StopSound "fx_lrenter":End If:End Sub 'ball is going down
  927. Sub LREnter1_Hit():StopSound "fx_lrenter":PlaySound "fx_ramp_turn":End Sub
  928. Sub LREnter2_Hit():StopSound "fx_ramp_turn":PlaySound "fx_metalrolling":End Sub
  929. Sub LRExit_Hit():ActiveBall.VelY=1:StopSound "fx_metalrolling":Playsound "fx_wirerampexit":End Sub
  930.  
  931. Sub RREnter_Hit():If ActiveBall.VelY < 0 Then PlaySound "fx_ramp_enter1":End If:End Sub 'ball is going up
  932. Sub RREnter_UnHit():If ActiveBall.VelY > 0 Then StopSound "fx_ramp_enter1":End If:End Sub 'ball is going down
  933. Sub RREnter1_Hit():PlaySound "fx_ramp_enter2":End Sub
  934. Sub RREnter2_Hit():PlaySound "fx_ramp_enter2":End Sub
  935. Sub RREnter3_Hit():StopSound "fx_ramp_enter2": Playsound "fx_metalrolling":End Sub
  936. Sub RRExit_Hit():ActiveBall.VelY=1:StopSound "fx_metalrolling":Playsound "fx_wirerampexit":End Sub
  937.  
  938. Sub BREnter_Hit():StopSound "fx_ramp_enter2":PlaySound "fx_ramp_enter3":End Sub
  939. Sub BREnter1_Hit():PlaySound "fx_ramp_metal":End Sub
  940. Sub BREnter2_Hit():StopSound "fx_ramp_metal":PlaySound "fx_ramp_metal":End Sub
  941. Sub BREnter3_Hit():StopSound "fx_ramp_metal":PlaySound "fx_metalrolling":End Sub
  942. Sub BRExit_Hit():ActiveBall.VelY=1:StopSound "fx_metalrolling":Playsound "fx_wirerampexit":End Sub
  943.  
  944. ' *********************************************************************
  945. ' Left and Right Orbits Hack
  946. ' *********************************************************************
  947.  
  948. Sub LoopHelpL_Unhit():If ActiveBall.VelY > 20 Then ActiveBall.VelY = RndNum(18,20):End If:End Sub
  949. Sub LoopHelpR_Unhit():If ActiveBall.VelY > 20 Then ActiveBall.VelY = RndNum(18,20):End If:End Sub
  950.  
  951. ' *********************************************************************
  952. ' RealTime Updates
  953. ' *********************************************************************
  954. Set MotorCallback = GetRef("RealTimeUpdates")
  955.  
  956. Sub RealTimeUpdates()
  957. RollingSoundUpdate
  958. BallShadowUpdate
  959. PoALightsUpdate
  960. MechsUpdate
  961. End Sub
  962.  
  963. '*********** Rolling Sound *********************************
  964. Const tnob = 7 ' total number of balls : 6 (trough) + 1 (Captive Ball)
  965. Const fakeballs = 0 ' number of balls created on table start (rolling sound will be skipped)
  966. ReDim rolling(tnob)
  967.  
  968. Sub InitRolling:Dim i:For i=0 to (tnob-1):rolling(i) = False:Next:End Sub
  969.  
  970. Sub RollingSoundUpdate()
  971. Dim BOT, b
  972. BOT = GetBalls
  973. ' stop the sound of deleted balls
  974. If UBound(BOT)<(tnob - 1) Then
  975. For b = (UBound(BOT) + 1) to (tnob-1)
  976. rolling(b) = False
  977. StopSound("fx_ballrolling" & b)
  978. Next
  979. End If
  980. ' exit the Sub if no balls on the table
  981. If UBound(BOT) = fakeballs-1 Then Exit Sub
  982. ' play the rolling sound for each ball
  983. For b = fakeballs to UBound(BOT)
  984. If EnterPoA.TimerEnabled OR (BallVel(BOT(b)) > 1 AND BOT(b).z < 30) Then
  985. rolling(b) = True
  986. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) )/4, Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  987. Else
  988. If rolling(b) = True Then
  989. StopSound("fx_ballrolling" & b)
  990. rolling(b) = False
  991. End If
  992. End If
  993. Next
  994. End Sub
  995.  
  996. '*********** Ball Shadow *********************************
  997. Dim BallShadow
  998. BallShadow = Array (BallShadow1, BallShadow2, BallShadow3,Ballshadow4,Ballshadow5,Ballshadow6,Ballshadow7)
  999.  
  1000. Sub BallShadowUpdate()
  1001. Dim BOT, b
  1002. BOT = GetBalls
  1003. ' hide shadow of deleted balls
  1004. If UBound(BOT)<(tnob-1) Then
  1005. For b = (UBound(BOT) + 1) to (tnob-1)
  1006. BallShadow(b).visible = 0
  1007. Next
  1008. End If
  1009. ' exit the Sub if no balls on the table
  1010. If UBound(BOT) = -1 Then Exit Sub
  1011. ' render the shadow for each ball
  1012. For b = 0 to UBound(BOT)
  1013. If BOT(b).X < Table1.Width/2 Then
  1014. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 10
  1015. Else
  1016. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 10
  1017. End If
  1018. ballShadow(b).Y = BOT(b).Y + 20
  1019. If BOT(b).Z > 20 Then
  1020. BallShadow(b).visible = 1
  1021. Else
  1022. BallShadow(b).visible = 0
  1023. End If
  1024. Next
  1025. End Sub
  1026.  
  1027. '*********** Path of Adventure inserts *********************************
  1028. Sub PoALightsUpdate()
  1029. dim ii
  1030. On Error Resume next
  1031. For ii = 71 to 74
  1032. ExecuteGlobal "If controller.Lamp("&ii&") Then Li"&ii&".image= ""PoALight_on"":Li"&ii&".material= ""PoAInsertsOn"":Else Li"&ii&".image= ""PoALight_off"":Li"&ii&".material= ""PoAInsertsOff"":End If"
  1033. Next
  1034. For ii = 81 to 84
  1035. ExecuteGlobal "If controller.Lamp("&ii&") Then Li"&ii&".image= ""PoALight_on"":Li"&ii&".material= ""PoAInsertsOn"":Else Li"&ii&".image= ""PoALight_off"":Li"&ii&".material= ""PoAInsertsOff"":End If"
  1036. Next
  1037. If controller.Lamp(75) Then Li75.image= "PoAThePit_On":Li75.material= "PoAInsertsOn":Else Li75.image= "PoAThePit_Off":Li75.material= "PoAInsertsOff":End If
  1038. If controller.Lamp(85) Then Li85.image= "PoAEB_on":Li85.material= "PoAInsertsOn":Else Li85.image= "PoAEB_off":Li85.material= "PoAInsertsOff":End If
  1039. End Sub
  1040.  
  1041. '*********** Gates Primitives Sync *********************************
  1042. Sub MechsUpdate()
  1043. TopGateP.RotX = TopGate.currentangle
  1044. BottomGateP.RotX = BottomGate.currentangle + 10
  1045. LeftGateP.RotY = -LeftGate.currentangle
  1046. RightGateP.RotY = -RightGate.currentangle
  1047. LeftFlipperSh.RotZ = LeftFlipper.currentangle
  1048. RightFlipperSh.RotZ = RightFlipper.currentangle
  1049. End Sub
  1050.  
  1051. ' *********************************************************************
  1052. ' Table Options
  1053. ' *********************************************************************
  1054. Dim InstrChoice, FlipperChoice
  1055.  
  1056. Sub InitOptions
  1057. leftrail.visible = DesktopMode:rightrail.visible = DesktopMode
  1058. FL_LRampbDT.visible=DesktopMode:FL_LRampb.visible=NOT DesktopMode:FL_RRampbDT.visible=DesktopMode:FL_RRampb.visible=NOT DesktopMode
  1059. If DesktopMode Then FL_LRampr1.opacity=500 Else FL_LRampr1.opacity=100
  1060. If TargetDecals=0 Then
  1061. sw38.image="target-slim":sw51.image="target-round":sw52.image="target-round":sw53.image="target-round":sw61.image="target-round":sw62.image="target-round":sw63.image="target-round"
  1062. Else
  1063. sw38.image="target_slim":sw51.image="target_U":sw52.image="target_R":sw53.image="target_E":sw61.image="target_A":sw62.image="target_D":sw63.image="target_V"
  1064. End If
  1065. If SideCabDecals=0 Then
  1066. LeftCab.image = "sidecab":RightCab.image = "sidecab"
  1067. Else
  1068. LeftCab.image = "sidecabL_c":RightCab.image = "sidecabR_c"
  1069. End If
  1070. Select Case InstrCardType
  1071. Case 0
  1072. Card1.image= "IJ-Card1" : Card2.image= "IJ-Card2"
  1073. Case 1
  1074. Card1.image= "IJ-Card1c" : Card2.image= "IJ-Card2c"
  1075. Case 2
  1076. Randomize:InstrChoice = RndNum (0,1)
  1077. Select Case InstrChoice
  1078. Case 0
  1079. Card1.image= "IJ-Card1" : Card2.image= "IJ-Card2"
  1080. Case 1
  1081. Card1.image= "IJ-Card1c" : Card2.image= "IJ-Card2c"
  1082. End Select
  1083. End Select
  1084. Select Case FlipperType
  1085. Case 0
  1086. LeftFlipper.RubberMaterial= "Plastic" : RightFlipper.RubberMaterial= "Plastic"
  1087. Case 1
  1088. LeftFlipper.RubberMaterial= "Rubber Black" : RightFlipper.RubberMaterial= "Rubber Black"
  1089. Case 2
  1090. Randomize:FlipperChoice = RndNum (0,1)
  1091. Select Case FlipperChoice
  1092. Case 0
  1093. LeftFlipper.RubberMaterial= "Plastic" : RightFlipper.RubberMaterial= "Plastic"
  1094. Case 1
  1095. LeftFlipper.RubberMaterial= "Rubber Black" : RightFlipper.RubberMaterial= "Rubber Black"
  1096. End Select
  1097. End Select
  1098. Propeller.visible=PropellerMod:Propeller1.visible= NOT PropellerMod
  1099. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement