Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.45 KB | None | 0 0
  1. ' _______ __________________ _______ _______ _
  2. '( ___ )\__ __/\__ __/( ___ )( ____ \| \ /\
  3. '| ( ) | ) ( ) ( | ( ) || ( \/| \ / /
  4. '| (___) | | | | | | (___) || | | (_/ /
  5. '| ___ | | | | | | ___ || | | _ (
  6. '| ( ) | | | | | | ( ) || | | ( \ \
  7. '| ) ( | | | | | | ) ( || (____/\| / \ \
  8. '|/ \| )_( )_( |/ \|(_______/|_/ \/
  9. '
  10. ' _______ _______ _______ _______ _______ _______ _______ _______
  11. '( ____ \( ____ )( ___ )( ) ( )( ___ )( ____ )( ____ \
  12. '| ( \/| ( )|| ( ) || () () | | () () || ( ) || ( )|| ( \/
  13. '| (__ | (____)|| | | || || || | | || || || (___) || (____)|| (_____
  14. '| __) | __)| | | || |(_)| | | |(_)| || ___ || __)(_____ )
  15. '| ( | (\ ( | | | || | | | | | | || ( ) || (\ ( ) |
  16. '| ) | ) \ \__| (___) || ) ( | | ) ( || ) ( || ) \ \__/\____) |
  17. '|/ |/ \__/(_______)|/ \| |/ \||/ \||/ \__/\_______)
  18. '
  19. '
  20. '
  21. '
  22. ' ______________ ___ __ _
  23. ' / ____/ ____/ /__ ___ ____/ (_) /_(_)___ ____
  24. ' / / __/___ \/ //_/ / _ \/ __ / / __/ / __ \/ __ \
  25. '/ /_/ /___/ / ,< / __/ /_/ / / /_/ / /_/ / / / /
  26. '\____/_____/_/|_| \___/\__,_/_/\__/_/\____/_/ /_/
  27. '
  28.  
  29.  
  30. '//////////////////////////////////////////////////////////////////////
  31. ' Update VPINMAME.DLL to support WPC-95 FASTFLIPS (SAMBuild r4550 or newer)
  32. 'http://vpuniverse.com/forums/topic/3461-sambuild31-beta-thread/
  33. '//////////////////////////////////////////////////////////////////////
  34.  
  35.  
  36. ' Attack from Mars - IPDB No. 3781
  37. ' © Bally Williams 1995
  38. ' Design by Brian Eddy
  39. ' VPX recreation by g5k
  40. ' Thanks to:
  41. ' Tom Tower: Ramp, Main Saucer and Alien primitives
  42. ' DJRobX: Fastflips WPC95, SSF and sound sweeten, develop assistance
  43. ' JimmyFingers for passing on lots of helpful knowledge to do with GI
  44. ' Previous AFM VPX authors who's work helped guide the build on this one and to the components that are carried over
  45. ' To those in the Monster Bash Pincab and VP Junkies community that helped contributed artwork, photos and the banter
  46. ' The VPDevTeam and authors who have contributed to the projects and components that get passed on from table to table
  47. ' I'm sure there are primitives, scripts, sounds and so on that have been by others not mentioned above, thank you for your contributions!
  48. ' Thanks to Monsterbash Pincab for distribution and providing such a great resource for the community
  49.  
  50.  
  51. ' AFM Gameplay rules
  52. ' http://pinball.org/rules/attackfrommars.html
  53.  
  54.  
  55. '//////////////////////////////////////////////////////////////////////
  56. '// LAYER 01 = STANDARD VP OBJECTS
  57. '// LAYER 02 = MAIN SAUCER + DIVERTER
  58. '// LAYER 03 = INSERT LIGHTS
  59. '// LAYER 04 = RED FLASHERS
  60. '// LAYER 05 = BLUE/GREEN FLASHERS
  61. '// LAYER 06 = G5k 3D
  62. '// LAYER 07 = GI - Lower Zone
  63. '// LAYER 08 = GI - Mid Zone
  64. '// LAYER 09 = GI - Upper Zone
  65. '// LAYER 10 = INSERTs Spill to other objects (Cheap SSR)
  66. '// LAYER 11 = INSERTs LIGHT GLOW/BALL REFLECT
  67. '//////////////////////////////////////////////////////////////////////
  68.  
  69.  
  70. 'NOTE for 120hz users, select the object on the table, "LAMPTIMER" on layer 1 and change the value to 16 which will force the speed to match how it looks at 60hz
  71. '-1 (this is default and correct for 60hz)
  72.  
  73.  
  74.  
  75. Option Explicit
  76. Randomize
  77.  
  78.  
  79. '///////////////////////////////////////////////////////////////////////////////////////////////////
  80. ' _ ______ ______ ____ ______ _________ ___________ ________ ________ _____
  81. '| | / / __ \/ ____/ / __ \/ ____/ / ____/ | / ___/_ __/ / ____/ / / _/ __ \/ ___/
  82. '| | /| / / /_/ / / ______/ /_/ /___ \ / /_ / /| | \__ \ / / / /_ / / / // /_/ /\__ \
  83. '| |/ |/ / ____/ /__/_____/\__, /___/ / / __/ / ___ |___/ // / / __/ / /____/ // ____/___/ /
  84. '|__/|__/_/ \____/ /____/_____/ /_/ /_/ |_/____//_/ /_/ /_____/___/_/ /____/
  85. '
  86. '
  87. '///////////////////////////////////////////////////////////////////////////////////////////////////
  88. '// FAST FLIPS (DJRobX) - needs vpinmame.dll
  89. '// Available in SAMupdate 4550 or newer
  90. '// http://vpuniverse.com/forums/topic/3461-sambuild31-beta-thread/
  91. '// If you don't want to update change UseSolendoids below = 1
  92. '//////////////////////////////////////////////////////////////////////
  93. '//////////////////////////////////////////////////////////////////////
  94. '// UseSolenoids = [1 or 2] 1 = Standard flipper latency, 2 = FastFlips
  95.  
  96. Const UseSolenoids = 2
  97.  
  98. '//////////////////////////////////////////////////////////////////////
  99. '//////////////////////////////////////////////////////////////////////
  100.  
  101.  
  102. '//////////////////////////////////////////////////////////////////////
  103. 'Options to disable if your system is not coping
  104. '1=YES/ON 0=NO/OFF
  105.  
  106. 'If you are experiencing performance issues, the first thing you should do is turn off playfield reflections in table options/playfield graphics.
  107. 'Next I recommend changing STEELWALLS primitive to static rendering (large texture, but mostly obscured by other things on table)
  108.  
  109. 'PRELOAD ALL THE FLASHERS ON STARTUP
  110. 'NOTE: If saucer hesitates on first hit after lowering the bank
  111. 'you can use this and might help performance overall slightly. Causes the table to do a flash sequence at startup.
  112. Const PreloadMe = 1
  113.  
  114. 'OPTIONAL COOL STUFF
  115. '
  116. 'If you don't like things that are cool disable flasher effects below
  117. 'Might improve performance too :)
  118. ' 1 = ON (Default awesome), 0 = OFF (Lame)
  119. ' Additional performance tweaks:
  120. '
  121. Const AlienFlashers = 1 'New to v1.1
  122. Const SideWallFlashers = 1 'These add a lot visually but are also taxing
  123. Const ChromeRailFlashers = 1 'New to v1.1. May be better to change CHROMERAILS primitive to static rendering, will give more performance and improve AA quality (Note: If static though you do not get flashing effects on the rails)
  124. Const UFOFlashers = 1
  125. Const PlasticsTopFlasher = 1 'New to v1.1
  126. Const ApronGIProper = 0 'This would be the first thing to lose if you are trying to add performance as difference is minor. May also change APRON primitive to static rendering.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. '//////////////////////////////////////////////////////////////////////
  135.  
  136. Const UseLamps = 0
  137. Const UseSync = 0
  138. Const HandleMech = 0
  139. Const cSingleLFlip = 0
  140. Const cSingleRFlip = 0
  141. Const SCoin = "fx_Coin"
  142. Const UseVPMModSol = 1
  143.  
  144.  
  145. '//////////////////////////////////////////////////////////////////////
  146. '// DOF CONTROLLER INIT
  147. '//////////////////////////////////////////////////////////////////////
  148.  
  149. On Error Resume Next
  150. ExecuteGlobal GetTextFile("controller.vbs")
  151. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  152. On Error Goto 0
  153.  
  154. '//////////////////////////////////////////////////////////////////////
  155. '// VARIABLES
  156. '//////////////////////////////////////////////////////////////////////
  157.  
  158. Dim bsTrough, plungerIM, Ballspeed, bsL, bsR, aBall, bBall, dtDrop, currGITop, currGIMid, currGIBot
  159. Dim DesktopMode: DesktopMode = AFM.ShowDT
  160. Dim UseVPMDMD:UseVPMDMD = DesktopMode 'shows VPX internal DMD
  161.  
  162.  
  163. '//////////////////////////////////////////////////////////////////////
  164. '// VPM INIT
  165. '//////////////////////////////////////////////////////////////////////
  166.  
  167. Const BallSize = 50
  168. Const Ballmass = 1.7
  169.  
  170. LoadVPM "01560000", "WPC.VBS", 3.46
  171.  
  172. Sub LoadVPM(VPMver, VBSfile, VBSver)
  173. On Error Resume Next
  174. If ScriptEngineMajorVersion < 5 Then MsgBox "VB Script Engine 5.0 or higher required"
  175. ExecuteGlobal GetTextFile(VBSfile)
  176. If Err Then MsgBox "Unable to open " & VBSfile & ". Ensure that it is in the same folder as this table. " & vbNewLine & Err.Description
  177. Set Controller = CreateObject("VPinMAME.Controller")
  178. If Err Then MsgBox "Can't Load VPinMAME." & vbNewLine & Err.Description
  179. If VPMver > "" Then If Controller.Version < VPMver Or Err Then MsgBox "VPinMAME ver " & VPMver & " required."
  180. If VPinMAMEDriverVer < VBSver Or Err Then MsgBox VBSFile & " ver " & VBSver & " or higher required."
  181. On Error Goto 0
  182.  
  183. End Sub
  184.  
  185.  
  186.  
  187. Set GiCallback2 = GetRef("UpdateGI")
  188.  
  189. '//////////////////////////////////////////////////////////////////////
  190. '// GAME NAME
  191. '//////////////////////////////////////////////////////////////////////
  192.  
  193. Const cGameName = "afm_113b"
  194.  
  195.  
  196. '//////////////////////////////////////////////////////////////////////
  197. '// STARTUP SETTINGS
  198. '//////////////////////////////////////////////////////////////////////
  199.  
  200. SW45.isdropped=1:SW46.isdropped=1:SW47.isdropped=1
  201.  
  202. RightSlingRubber_A.visible=0
  203. LeftSlingRubber_A.visible=0
  204. SLINGL.visible=0
  205. SLINGR.visible=0
  206.  
  207.  
  208.  
  209.  
  210.  
  211. If ApronGIProper = 1 then APRON_GIoff.visible = 1 else APRON_GIoff.visible = 0
  212.  
  213. 'Show Desktop components and adjust sidewalls
  214. If DesktopMode Then
  215. Ufo.Z=20
  216. LED1.Z=20
  217. LED10.Z=20
  218. LED11.Z=20
  219. LED12.Z=20
  220. LED13.Z=20
  221. LED14.Z=20
  222. LED15.Z=20
  223. LED16.Z=20
  224. LED2.Z=20
  225. LED3.Z=20
  226. LED4.Z=20
  227. LED5.Z=20
  228. LED6.Z=20
  229. LED7.Z=20
  230. LED8.Z=20
  231. LED9.Z=20
  232. METALBRUSHED.Z=20
  233. ' SIDERAILS_B.visible=1
  234. ' CABINETSIDES.SIZE_Y=21
  235. ' CABINETSIDES.X=0
  236. ' CABINETSIDES.Z=0
  237. ' CABINETSIDES_GIOFF.SIZE_Y=21
  238. ' CABINETSIDES_GIOFF.X=0
  239. ' CABINETSIDES_GIOFF.Z=0
  240.  
  241. Else
  242. SIDERAILS_B.visible=0
  243. End if
  244.  
  245. CENTREBANK.Z=-76:SW45P.Z=-76:SW46P.Z=-76:SW47P.Z=-76
  246.  
  247. Diverter8.isdropped=1:Diverter7.isdropped=1:Diverter6.isdropped=1:Diverter5.isdropped=1
  248.  
  249. Diverter4.isdropped=1:Diverter3.isdropped=1:Diverter2.isdropped=1:Diverter1.isdropped=1
  250.  
  251. DivPos=0
  252.  
  253.  
  254.  
  255. '//////////////////////////////////////////////////////////////////////
  256. '// TABLE INIT
  257. '//////////////////////////////////////////////////////////////////////
  258.  
  259.  
  260. Sub AFM_Init
  261. vpmInit Me
  262. With Controller
  263. .GameName = cGameName
  264. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  265. .SplashInfoLine = "Attack from Mars" & vbNewLine & "g5k Edition"
  266. .Games(cGameName).Settings.Value("rol") = 0
  267. .HandleKeyboard = 0
  268. .ShowTitle = 0
  269. .ShowDMDOnly = 1
  270. .ShowFrame = 0
  271. .HandleMechanics = 0
  272. .Hidden = 0
  273. On Error Resume Next
  274. .Run GetPlayerHWnd
  275. If Err Then MsgBox Err.Description
  276. On Error Goto 0
  277. .Switch(22) = 1 'close coin door
  278. .Switch(24) = 1 'and keep it close
  279. End With
  280.  
  281. '//////////////////////////////////////////////////////////////////////
  282. '// PINMAME TIMER
  283. '//////////////////////////////////////////////////////////////////////
  284.  
  285. PinMAMETimer.Interval = PinMAMEInterval
  286. PinMAMETimer.Enabled = 1
  287.  
  288. '//////////////////////////////////////////////////////////////////////
  289. '// BALL TROUGH
  290. '//////////////////////////////////////////////////////////////////////
  291.  
  292. Set bsTrough = New cvpmTrough
  293. With bsTrough
  294. .size = 4
  295. .initSwitches Array(32, 33, 34, 35)
  296. .Initexit BallRelease, 90, 4
  297. .InitExitSounds SoundFX("BallRelease",DOFContactors), SoundFX("BallRelease",DOFContactors)
  298. .Balls = 4
  299. End With
  300.  
  301.  
  302. '//////////////////////////////////////////////////////////////////////
  303. '// IMPULSE PLUNGER
  304. '//////////////////////////////////////////////////////////////////////
  305.  
  306. Const IMPowerSetting = 60 'Plunger Power
  307. Const IMTime = 0.6 ' Time in seconds for Full Plunge
  308. Set plungerIM = New cvpmImpulseP
  309. With plungerIM
  310. .InitImpulseP swplunger, IMPowerSetting, IMTime
  311. .Random 3
  312. .switch 18
  313. .InitExitSnd SoundFX("ShooterLane",DOFContactors), ""
  314. .CreateEvents "plungerIM"
  315. End With
  316. TBPos=28:TBTimer.Enabled=0:TBDown=1:Controller.Switch(66) = 1:Controller.Switch(67) = 0
  317.  
  318.  
  319. '//////////////////////////////////////////////////////////////////////
  320. '// VUK
  321. '//////////////////////////////////////////////////////////////////////
  322.  
  323. ' Left hole
  324. Set bsL = New cvpmTrough
  325. With bsL
  326. .size = 1
  327. .initSwitches Array(36)
  328. .Initexit sw36, 180, 0
  329. .InitExitSounds "", SoundFX("VUKOut",DOFContactors)
  330. .InitExitVariance 3, 2
  331. End With
  332.  
  333. ' Set bsL = New cvpmBallStack
  334. ' With bsL
  335. ' .InitSw 0, 36, 0, 0, 0, 0, 0, 0
  336. ' .InitKick sw36, 180, 0
  337. ' .InitExitSnd SoundFX("VUKOut",DOFContactors), ""
  338. ' .KickForceVar = 3
  339. ' End With
  340.  
  341. '//////////////////////////////////////////////////////////////////////
  342. '// SCOOP
  343. '//////////////////////////////////////////////////////////////////////
  344.  
  345. Set bsR = New cvpmTrough
  346. With bsR
  347. .size = 4
  348. .initSwitches Array(37)
  349. .Initexit sw37, 198, 30
  350. .InitExitSounds "", SoundFX("ScoopExit",DOFContactors)
  351. .InitExitVariance 2, 2
  352. .MaxBallsPerKick = 1
  353. '.KickZ = 0.4
  354. '.KickAngleVar = 1
  355. End With
  356.  
  357. ' Set bsR = New cvpmBallStack
  358. ' With bsR
  359. ' .InitSw 0, 37, 0, 0, 0, 0, 0, 0
  360. ' .InitKick SW37, 198, 30
  361. ' .KickZ = 0.4
  362. ' .InitExitSnd SoundFx("ScoopExit",DOFContactors), ""
  363. ' .KickAngleVar = 1
  364. ' .KickBalls = 1
  365. ' End With
  366.  
  367. '//////////////////////////////////////////////////////////////////////
  368. '// DROPTARGET
  369. '//////////////////////////////////////////////////////////////////////
  370. Set dtDrop = New cvpmDropTarget
  371. With dtDrop
  372. .InitDrop sw77, 77
  373. .initsnd "", ""
  374. End With
  375.  
  376. '//////////////////////////////////////////////////////////////////////
  377. '// NUDGING
  378. '//////////////////////////////////////////////////////////////////////
  379.  
  380. vpmNudge.TiltSwitch = 14
  381. vpmNudge.Sensitivity = 5.35
  382. vpmNudge.TiltObj = Array(LeftBumper, BottomBumper, RightBumper, LeftSlingshot, RightSlingshot)
  383.  
  384. '//////////////////////////////////////////////////////////////////////
  385. '// UPDATE GI
  386. '//////////////////////////////////////////////////////////////////////
  387.  
  388. UpdateGI 0, 1:UpdateGI 1, 1:UpdateGI 2, 1
  389.  
  390.  
  391.  
  392. '//////////////////////////////////////////////////////////////////////
  393. '// END OF TABLE INIT
  394. '//////////////////////////////////////////////////////////////////////
  395. End Sub
  396.  
  397.  
  398.  
  399.  
  400. '//////////////////////////////////////////////////////////////////////
  401. '// CONTROLLER PAUSE
  402. '//////////////////////////////////////////////////////////////////////
  403.  
  404. Sub AFM_Paused:Controller.Pause = 1:End Sub
  405. Sub AFM_unPaused:Controller.Pause = 0:End Sub
  406.  
  407. '//////////////////////////////////////////////////////////////////////
  408. '// DRAIN HIT
  409. '//////////////////////////////////////////////////////////////////////
  410.  
  411. Sub Drain_Hit:PlaySoundAtVol "Drain",Drain,.8:bsTrough.AddBall Me:End Sub
  412. Sub Drain1_Hit:PlaySoundAtVol "Drain",Drain,.8:bsTrough.AddBall Me:End Sub
  413. Sub Drain2_Hit:PlaySoundAtVol "Drain",Drain,.8:bsTrough.AddBall Me:End Sub
  414.  
  415. '//////////////////////////////////////////////////////////////////////
  416. '// VUK HIT
  417. '//////////////////////////////////////////////////////////////////////
  418.  
  419. Sub sw36a_Hit:PlaySoundAtVol "VUKEnter",sw36a,1:bsL.AddBall Me:End Sub
  420.  
  421. '//////////////////////////////////////////////////////////////////////
  422. '// SCOOP HIT
  423. '//////////////////////////////////////////////////////////////////////
  424.  
  425. Sub sw37a_Hit:PlaySoundAtVol "ScoopBack",sw37a,1:bsR.AddBall Me:End Sub
  426.  
  427. Sub sw37_Hit
  428. PlaySoundAtVol "ScoopFront",sw37,1
  429. Set bBall = ActiveBall:Me.TimerEnabled =1
  430. bsR.AddBall 0
  431. End Sub
  432.  
  433. Sub sw37_Timer
  434. Do While bBall.Z >0
  435. bBall.Z = bBall.Z -5
  436. Exit Sub
  437. Loop
  438. Me.DestroyBall
  439. Me.TimerEnabled = 0
  440. End Sub
  441.  
  442. '//////////////////////////////////////////////////////////////////////
  443. '// SAUCER DROPHOLE HIT
  444. '//////////////////////////////////////////////////////////////////////
  445.  
  446. Sub sw78_Hit:PlaySoundAtVol "Drophole",sw78,1
  447. Set aBall = ActiveBall
  448. Me.TimerEnabled =1
  449. vpmTimer.PulseSwitch(78), 150, "bsl.addball 0 '"
  450. End Sub
  451.  
  452. Sub sw78_Timer
  453. Do While aBall.Z >0
  454. aBall.Z = aBall.Z -5
  455. Exit Sub
  456. Loop
  457. Me.DestroyBall
  458. Me.TimerEnabled = 0
  459. End Sub
  460.  
  461. '//////////////////////////////////////////////////////////////////////
  462. '// SAUCER TARGET HIT
  463. '//////////////////////////////////////////////////////////////////////
  464.  
  465. Sub sw77_Hit:dtDrop.Hit 1:End Sub
  466.  
  467. '//////////////////////////////////////////////////////////////////////
  468. '// KEYS
  469. '//////////////////////////////////////////////////////////////////////
  470.  
  471. Sub AFM_KeyDown(ByVal Keycode)
  472. If keycode = PlungerKey Then Controller.Switch(11) = 1:End If
  473. If keycode = CenterTiltKey Then Nudge 0, 5
  474. If vpmKeyDown(keycode) Then Exit Sub
  475. End Sub
  476.  
  477. Sub AFM_KeyUp(ByVal Keycode)
  478. If keycode = PlungerKey Then Controller.Switch(11) = 0
  479. If vpmKeyUp(keycode) Then Exit Sub
  480. End Sub
  481.  
  482. '//////////////////////////////////////////////////////////////////////
  483. '// SOLENOID CALLS
  484. '//////////////////////////////////////////////////////////////////////
  485.  
  486. SolCallback(1) = "Auto_Plunger"
  487. SolCallback(2) = "SolRelease"
  488. SolCallback(3) = "bsL.SolOut"
  489. SolCallback(4) = "bsR.SolOut"
  490. SolCallBack(5) = "Alien1Move"
  491. SolCallBack(6) = "Alien2Move"
  492. SolCallback(7) = "vpmSolSound SoundFX(""fx_Knocker"",DOFKnocker),"
  493. SolCallBack(8) = "Alien3Move"
  494. SolCallBack(14) = "Alien4Move"
  495. SolCallBack(15) = "SolUfoShake"
  496. SolCallback(16) = "ResetUFODrop"
  497. SolModCallback(17) = "setmodlamp 117,"
  498. SolModCallback(18) = "setmodlamp 118,"
  499. SolModCallback(19) = "setmodlamp 119,"
  500. SolModCallBack(20) = "setmodlamp 120,"
  501. SolModCallback(21) = "setmodlamp 121,"
  502. SolModCallback(22) = "setmodlamp 122,"
  503. SolModCallback(23) = "setmodlamp 123,"
  504. SolCallBack(24) = "TBMove"
  505. SolModCallBack(25) = "setmodlamp 125,"
  506. SolModCallBack(26) = "setmodlamp 126,"
  507. SolModCallBack(27) = "setmodlamp 127,"
  508. SolModCallBack(28) = "setmodlamp 128,"
  509. SolCallback(33) = "vpmSolGate RGate,false,"
  510. SolCallback(34) = "vpmSolGate LGate,false,"
  511. SolCallback(36) = "DivMove"
  512. SolModCallback(39) = "setmodlamp 123,"
  513. SolModCallback(43) = "setmodlamp 130,"
  514. SolCallback(sLRFlipper) = "SolRFlipper"
  515. SolCallback(sLLFlipper) = "SolLFlipper"
  516.  
  517. '//////////////////////////////////////////////////////////////////////
  518. '// FLIPPERS
  519. '//////////////////////////////////////////////////////////////////////
  520.  
  521. Sub SolLFlipper(Enabled)
  522. If UseSolenoids = 2 then Controller.Switch(swULFlip)=Enabled
  523. If Enabled Then
  524. PlaySoundAtVol SoundFX("FlipperUpRight",DOFContactors),LeftFlipper,3
  525. LeftFlipper.RotateToEnd
  526. Else
  527. PlaySoundAtVol SoundFX("FlipperDownLeft",DOFContactors),LeftFlipper,.2
  528. LeftFlipper.RotateToStart
  529. End If
  530. End Sub
  531.  
  532. Sub SolRFlipper(Enabled)
  533. if UseSolenoids = 2 then Controller.Switch(swURFlip)=Enabled
  534. If Enabled Then
  535. PlaySoundAtVol SoundFX("FlipperUpRight",DOFContactors),RightFlipper,2
  536. RightFlipper.RotateToEnd
  537. Else
  538. PlaySoundAtVol SoundFX("FlipperDownRight",DOFContactors),RightFlipper,.2
  539. RightFlipper.RotateToStart
  540. End If
  541. End Sub
  542.  
  543. '//////////////////////////////////////////////////////////////////////
  544. '// SOLENOID SUBS
  545. '//////////////////////////////////////////////////////////////////////
  546.  
  547. Sub Auto_Plunger(Enabled)
  548. If Enabled Then
  549. PlungerIM.AutoFire
  550. End If
  551. End Sub
  552.  
  553. Sub SolRelease(Enabled)
  554. If Enabled And bsTrough.Balls> 0 Then
  555. vpmTimer.PulseSw 31
  556. bsTrough.ExitSol_On
  557. End If
  558. End Sub
  559.  
  560. '//////////////////////////////////////////////////////////////////////
  561. '// POP BUMPERS
  562. '//////////////////////////////////////////////////////////////////////
  563.  
  564. Sub LeftBumper_Hit:vpmTimer.PulseSw 53:PlaySoundAtBumperVol "LeftBumper", LeftBumper,3
  565. End Sub
  566.  
  567. Sub BottomBumper_Hit:vpmTimer.PulseSw 54:PlaySoundAtBumperVol "BottomBumper", BottomBumper,3
  568. End Sub
  569.  
  570. Sub RightBumper_Hit:vpmTimer.PulseSw 55:PlaySoundAtBumperVol "RightBumper", RightBumper,3
  571. End Sub
  572.  
  573. '//////////////////////////////////////////////////////////////////////
  574. '// SLINGSHOTS
  575. '//////////////////////////////////////////////////////////////////////
  576.  
  577. Sub LeftSlingShot_Slingshot:LeftSlingRubber_A.visible = 1:SLINGL.visible = 1:PlaySound SoundFX("LeftSlingshot",DOFContactors):vpmTimer.PulseSw 51:LeftSlingshot.timerenabled = 1:End Sub
  578. Sub LeftSlingshot_timer:LeftSlingRubber_A.visible = 0:SLINGL.visible = 0:LeftSlingshot.timerenabled= 0:End Sub
  579.  
  580. Sub RightSlingShot_Slingshot:RightSlingRubber_A.visible = 1:SLINGR.visible = 1:PlaySound SoundFX("RightSlingshot",DOFContactors):vpmTimer.PulseSw 52:Rightslingshot.timerenabled = 1:End Sub
  581. Sub Rightslingshot_timer:RightSlingRubber_A.visible = 0:SLINGR.visible = 0:Rightslingshot.timerenabled= 0:End Sub
  582.  
  583.  
  584.  
  585. '//////////////////////////////////////////////////////////////////////
  586. '// MARTIAN TARGETS
  587. '//////////////////////////////////////////////////////////////////////
  588.  
  589.  
  590. '// "M"ARTIAN TARGET //////////////////////////////////////////////////
  591.  
  592. Sub SW56_Hit
  593. If SW56P.ObjRotY = 0 Then
  594. vpmTimer.PulseSw 56:SW56P.ObjRotY=1:SW56P1.ObjRotY=1:Me.TimerEnabled=1
  595. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  596. End If
  597. End Sub
  598.  
  599. Sub SW56_Timer:SW56P.ObjRotY=0:SW56P1.ObjRotY=0:Me.TimerEnabled=0:End Sub
  600.  
  601.  
  602. '// M"A"RTIAN TARGET //////////////////////////////////////////////////
  603.  
  604. Sub SW57_Hit
  605. If SW57P.ObjRotY = 0 Then
  606. vpmTimer.PulseSw 57:SW57P.ObjRotY=1:SW57P1.ObjRotY=1:Me.TimerEnabled = 1
  607. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  608. End If
  609. End Sub
  610.  
  611. Sub SW57_Timer:SW57P.ObjRotY=0:SW57P1.ObjRotY=0:Me.TimerEnabled=0:End Sub
  612.  
  613. '// MA"R"TIAN TARGET //////////////////////////////////////////////////
  614.  
  615. Sub SW58_Hit
  616. If SW58P.ObjRotY = 0 Then
  617. vpmTimer.PulseSw 58:SW58P.ObjRotY=-1:SW58P1.ObjRotY=-1:Me.TimerEnabled = 1
  618. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  619. End If
  620. End Sub
  621.  
  622. Sub SW58_Timer:SW58P.ObjRotY=0:SW58P1.ObjRotY=0:Me.TimerEnabled=0:End Sub
  623.  
  624.  
  625. '// MAR"T"IAN TARGET //////////////////////////////////////////////////
  626.  
  627.  
  628. Sub SW43_Hit
  629. If SW43P.ObjRotX = 0 Then
  630. vpmTimer.PulseSw 43:SW43P.ObjRotX=0.35:SW43P1.ObjRotX=0.35:Me.TimerEnabled=1
  631. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  632. End If
  633. End Sub
  634.  
  635. Sub SW43_Timer:SW43P.ObjRotX=0:SW43P1.ObjRotX=0:Me.TimerEnabled=0:End Sub
  636.  
  637.  
  638. '// MART"I"AN TARGET //////////////////////////////////////////////////
  639.  
  640. Sub SW44_Hit
  641. If SW44P.ObjRotY = 0 Then
  642. vpmTimer.PulseSw 44:SW44P.ObjRotX = 0.35:SW44P1.ObjRotX = 0.35:Me.TimerEnabled = 1
  643. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  644. End If
  645. End Sub
  646.  
  647. Sub SW44_Timer:SW44P.ObjRotX = 0:SW44P1.ObjRotX = 0:Me.TimerEnabled = 0:End Sub
  648.  
  649.  
  650.  
  651. '// MARTI"A"N TARGET //////////////////////////////////////////////////
  652.  
  653. Sub SW41_Hit
  654. If SW41P.ObjRotY = 0 Then
  655. vpmTimer.PulseSw 41:SW41P.ObjRotY = 1:SW41P1.ObjRotY = 1:Me.TimerEnabled = 1
  656. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  657. End If
  658. End Sub
  659.  
  660. Sub SW41_Timer:SW41P.ObjRotY = 0:SW41P1.ObjRotY = 0:Me.TimerEnabled = 0:End Sub
  661.  
  662.  
  663.  
  664. '// MARTIA"N" TARGET //////////////////////////////////////////////////
  665.  
  666. Sub SW42_Hit
  667. If SW42P.ObjRotY = 0 Then
  668. vpmTimer.PulseSw 42:SW42P.ObjRotY = 1:SW42P1.ObjRotY = 1:Me.TimerEnabled = 1
  669. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  670. End If
  671. End Sub
  672.  
  673. Sub SW42_Timer:SW42P.ObjRotY = 0:SW42P1.ObjRotY = 0:Me.TimerEnabled = 0:End Sub
  674.  
  675. '//////////////////////////////////////////////////////////////////////
  676. '// SAUCER TARGETS
  677. '//////////////////////////////////////////////////////////////////////
  678.  
  679. Sub SW75_Hit
  680. If SW75P.ObjRotY = 0 Then
  681. vpmTimer.PulseSw 75:SW75P.ObjRotY = 1:Me.TimerEnabled = 1
  682. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  683. End If
  684. End Sub
  685.  
  686. Sub SW75_Timer:SW75P.ObjRotY = 0:Me.TimerEnabled = 0:End Sub
  687.  
  688. Sub SW76_Hit
  689. If SW76P.ObjRotY = 0 Then
  690. vpmTimer.PulseSw 76:SW76P.ObjRotY = 1:Me.TimerEnabled = 1
  691. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  692. End If
  693. End Sub
  694.  
  695. Sub SW76_Timer:SW76P.ObjRotY = 0:Me.TimerEnabled = 0:End Sub
  696.  
  697. '//////////////////////////////////////////////////////////////////////
  698. '// TARGETBANK TARGETS
  699. '//////////////////////////////////////////////////////////////////////
  700.  
  701. Sub SW45_Hit
  702. If SW45P.ObjRotX = 0 Then
  703. vpmTimer.PulseSw 45:SW45P.ObjRotX = 0.35:Me.TimerEnabled = 1
  704. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  705. End If
  706. If Ballresting = True Then
  707. DPBall.VelY = ActiveBall.VelY * 3
  708. End If
  709. End Sub
  710.  
  711. Sub SW45_Timer:SW45P.ObjRotX = 0:Me.TimerEnabled = 0:End Sub
  712.  
  713. Sub SW46_Hit
  714. If SW46P.ObjRotX = 0 Then
  715. vpmTimer.PulseSw 46:SW46P.ObjRotX = 0.35:Me.TimerEnabled = 1
  716. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  717. End If
  718. If Ballresting = True Then
  719. DPBall.VelY = ActiveBall.VelY * 3
  720. End If
  721. End Sub
  722.  
  723. Sub SW46_Timer:SW46P.ObjRotX = 0:Me.TimerEnabled = 0:End Sub
  724.  
  725. Sub SW47_Hit
  726. If SW47P.ObjRotX = 0 Then
  727. vpmTimer.PulseSw 47:SW47P.ObjRotX = 0.35:Me.TimerEnabled = 1
  728. PlaySound SoundFX("TargetHit",DOFContactors),0,Vol(ActiveBall),Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  729. End If
  730. If Ballresting = True Then
  731. DPBall.VelY = ActiveBall.VelY * 3
  732. End If
  733. End Sub
  734.  
  735. Sub SW47_Timer:SW47P.ObjRotX = 0:Me.TimerEnabled = 0:End Sub
  736.  
  737.  
  738. Sub sw77_Dropped:dtDrop.Hit 1:End Sub
  739.  
  740. Sub ResetUFODrop(enabled)
  741. dtDrop.SolDropUp enabled
  742. if Enabled then sw77.visible = True
  743. End Sub
  744.  
  745.  
  746.  
  747. '//////////////////////////////////////////////////////////////////////
  748. '// RAMP SWITCHES
  749. '//////////////////////////////////////////////////////////////////////
  750.  
  751. Sub SW61_Hit:Controller.Switch(61) = 1:PlaySound "":End Sub
  752. Sub SW61_UnHit:Controller.Switch(61) = 0:End Sub
  753.  
  754. Sub SW62_Hit:Controller.Switch(62) = 1:PlaySound "":End Sub
  755. Sub SW62_UnHit:Controller.Switch(62) = 0:End Sub
  756.  
  757. Sub SW63_Hit:Controller.Switch(63) = 1:PlaySound "":End Sub
  758. Sub SW63_UnHit:Controller.Switch(63) = 0:End Sub
  759.  
  760. Sub SW64_Hit:Controller.Switch(64) = 1:PlaySound "":End Sub
  761. Sub SW64_UnHit:Controller.Switch(64) = 0:End Sub
  762.  
  763. Sub SW65_Hit:Controller.Switch(65) = 1:PlaySound "fx_metalrolling",0,Vol(ActiveBall)+2,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  764. Sub SW65_UnHit:Controller.Switch(65) = 0:End Sub
  765.  
  766.  
  767. '//////////////////////////////////////////////////////////////////////
  768. '// ROLLOVER SWITCHES
  769. '//////////////////////////////////////////////////////////////////////
  770.  
  771. Sub SW16_Hit:Controller.Switch(16) = 1:PlaySound "rollover",0,Vol(ActiveBall)+2,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  772. Sub SW16_UnHit:Controller.Switch(16) = 0:End Sub
  773.  
  774. Sub SW17_Hit:Controller.Switch(17) = 1:PlaySound "rollover",0,Vol(ActiveBall)+2,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  775. Sub SW17_UnHit:Controller.Switch(17) = 0:End Sub
  776.  
  777. Sub SW26_Hit:Controller.Switch(26) = 1:PlaySound "rollover",0,Vol(ActiveBall)+2,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  778. Sub SW26_UnHit:Controller.Switch(26) = 0:End Sub
  779.  
  780. Sub SW27_Hit:Controller.Switch(27) = 1:PlaySound "rollover",0,Vol(ActiveBall)+2,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  781. Sub SW27_UnHit:Controller.Switch(27) = 0:End Sub
  782.  
  783.  
  784. Sub SW38_Hit:Controller.Switch(38) = 1:PlaySound "rollover",0,Vol(ActiveBall)+1,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  785. Sub SW38_UnHit:Controller.Switch(38) = 0:End Sub
  786.  
  787. Sub SW48_Hit:Controller.Switch(48) = 1:PlaySound "rollover",0,Vol(ActiveBall)+1,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  788. Sub SW48_UnHit:Controller.Switch(48) = 0:End Sub
  789.  
  790. Sub SW71_Hit:Controller.Switch(71) = 1:PlaySound "rollover",0,Vol(ActiveBall)+1,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  791. Sub SW71_UnHit:Controller.Switch(71) = 0:End Sub
  792.  
  793. Sub SW72_Hit:Controller.Switch(72) = 1:PlaySound "rollover",0,Vol(ActiveBall)+1,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  794. Sub SW72_UnHit:Controller.Switch(72) = 0:End Sub
  795.  
  796. Sub SW73_Hit:Controller.Switch(73) = 1:PlaySound "rollover",0,Vol(ActiveBall)+1,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  797. Sub SW73_UnHit:Controller.Switch(73) = 0:End Sub
  798.  
  799. Sub SW74_Hit:Controller.Switch(74) = 1:PlaySound "rollover",0,Vol(ActiveBall)+1,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall):End Sub
  800. Sub SW74_UnHit:Controller.Switch(74) = 0:End Sub
  801.  
  802. '//////////////////////////////////////////////////////////////////////
  803. '// SAUCER MOVEMENT
  804. '//////////////////////////////////////////////////////////////////////
  805. Dim cBall, mMagnet
  806.  
  807. Sub WobbleMagnet_Init
  808. Set mMagnet = new cvpmMagnet
  809. With mMagnet
  810. .InitMagnet WobbleMagnet, 2
  811. .Size = 100
  812. .CreateEvents mMagnet
  813. .MagnetOn = True
  814. End With
  815. Set cBall = ckicker.createball:ckicker.Kick 0,0:mMagnet.addball cball
  816.  
  817. End Sub
  818.  
  819. Sub SolUfoShake(Enabled)
  820. If Enabled Then
  821. BigUfoShake
  822. PlaySound SoundFX("SaucerShake",DOFShaker),0,2,0,0,0,0,1,-.3
  823. End If
  824. End Sub
  825.  
  826. Sub BigUfoShake
  827. cball.velx = 4
  828. cball.vely = -18
  829. End Sub
  830.  
  831. Sub UfoShaker_Timer
  832. Dim a, b, c
  833. a = 90-((ckicker.y - cball.y) / 5)
  834. b = (ckicker.y - cball.y) / 10
  835. c = (cball.x - ckicker.x) / 5
  836.  
  837.  
  838.  
  839.  
  840. Ufo.rotx = a:Ufo.transz = b:Ufo.rotz = c
  841. 'LED1.rotx = a:LED1.transz = b:LED1.rotz = c
  842. 'LED2.rotx = a:LED2.transz = b:LED2.rotz = c
  843. 'LED3.rotx = a:LED3.transz = b:LED3.rotz = c
  844. LED4.rotx = a:LED4.transz = b:LED4.rotz = c
  845. LED5.rotx = a:LED5.transz = b:LED5.rotz = c
  846. LED6.rotx = a:LED6.transz = b:LED6.rotz = c
  847. LED7.rotx = a:LED7.transz = b:LED7.rotz = c
  848. LED8.rotx = a:LED8.transz = b:LED8.rotz = c
  849. LED9.rotx = a:LED9.transz = b:LED9.rotz = c
  850. LED10.rotx = a:LED10.transz = b:LED10.rotz = c
  851. LED11.rotx = a:LED11.transz = b:LED11.rotz = c
  852. LED12.rotx = a:LED12.transz = b:LED12.rotz = c
  853. LED13.rotx = a:LED13.transz = b:LED13.rotz = c
  854. 'LED14.rotx = a:LED14.transz = b:LED14.rotz = c
  855. 'LED15.rotx = a:LED15.transz = b:LED15.rotz = c
  856. 'LED16.rotx = a:LED16.transz = b:LED16.rotz = c
  857. End Sub
  858.  
  859. '//////////////////////////////////////////////////////////////////////
  860. '// ALIEN MOVEMENTS
  861. '//////////////////////////////////////////////////////////////////////
  862.  
  863. Dim Alien1Pos
  864.  
  865. Sub Alien1Move (enabled)
  866. if enabled then
  867. Alien1Timer.Enabled=1
  868. PlaySoundAtVol SoundFX("AlienShake1",DOFShaker),Licht14,2
  869. End If
  870. End Sub
  871.  
  872. Sub Alien1Timer_Timer()
  873. Select Case Alien1Pos
  874. Case 0: Alien_LF.Z=0:AlienPost1.Z=-60
  875. Case 1: Alien_LF.Z=5:AlienPost1.Z=-55
  876. Case 2: Alien_LF.Z=10:AlienPost1.Z=-50
  877. Case 3: Alien_LF.Z=15:AlienPost1.Z=-45
  878. Case 4: Alien_LF.Z=20:AlienPost1.Z=-40
  879. Case 5: Alien_LF.Z=25:AlienPost1.Z=-35
  880. Case 6: Alien_LF.Z=30:AlienPost1.Z=-30
  881. Case 7: Alien_LF.Z=35:AlienPost1.Z=-25
  882. Case 8: Alien_LF.Z=40:AlienPost1.Z=-20
  883. Case 9: Alien_LF.Z=35:AlienPost1.Z=-25
  884. Case 10: Alien_LF.Z=30:AlienPost1.Z=-30
  885. Case 11: Alien_LF.Z=25:AlienPost1.Z=-35
  886. Case 12: Alien_LF.Z=20:AlienPost1.Z=-40
  887. Case 13: Alien_LF.Z=15:AlienPost1.Z=-45
  888. Case 14: Alien_LF.Z=10:AlienPost1.Z=-50
  889. Case 15: Alien_LF.Z=5:AlienPost1.Z=-55
  890. Case 16: Alien_LF.Z=0:AlienPost1.Z=-60:Alien1Pos=0:Alien1Timer.Enabled=0
  891. End Select
  892.  
  893. If Alien1Pos=>0 then Alien1Pos=Alien1Pos+1
  894. End Sub
  895.  
  896.  
  897. Dim Alien2Pos
  898.  
  899. Sub Alien2Move (enabled)
  900. if enabled then
  901. Alien2Timer.Enabled=1
  902. PlaySoundAtVol SoundFX("AlienShake2",DOFShaker),f28a,2
  903. End If
  904. End Sub
  905.  
  906. Sub Alien2Timer_Timer()
  907. Select Case Alien2Pos
  908. Case 0: Alien_LR.Z=0:AlienPost2.Z=-60
  909. Case 1: Alien_LR.Z=5:AlienPost2.Z=-55
  910. Case 2: Alien_LR.Z=10:AlienPost2.Z=-50
  911. Case 3: Alien_LR.Z=15:AlienPost2.Z=-45
  912. Case 4: Alien_LR.Z=20:AlienPost2.Z=-40
  913. Case 5: Alien_LR.Z=25:AlienPost2.Z=-35
  914. Case 6: Alien_LR.Z=30:AlienPost2.Z=-30
  915. Case 7: Alien_LR.Z=35:AlienPost2.Z=-25
  916. Case 8: Alien_LR.Z=40:AlienPost2.Z=-20
  917. Case 9: Alien_LR.Z=35:AlienPost2.Z=-25
  918. Case 10: Alien_LR.Z=30:AlienPost2.Z=-30
  919. Case 11: Alien_LR.Z=25:AlienPost2.Z=-35
  920. Case 12: Alien_LR.Z=20:AlienPost2.Z=-40
  921. Case 13: Alien_LR.Z=15:AlienPost2.Z=-45
  922. Case 14: Alien_LR.Z=10:AlienPost2.Z=-50
  923. Case 15: Alien_LR.Z=5:AlienPost2.Z=-55
  924. case 16: Alien_LR.Z=0:AlienPost2.Z=-60:Alien2Pos=1:Alien2Timer.Enabled=0
  925. End Select
  926.  
  927. If Alien2Pos=>0 then Alien2Pos=Alien2Pos+1
  928. End Sub
  929.  
  930. Dim Alien3Pos
  931.  
  932. Sub Alien3Move (enabled)
  933. if enabled then
  934. Alien3Timer.Enabled=1
  935. PlaySoundAtVol SoundFX("AlienShake3",DOFShaker),f28a,2
  936. End If
  937. End Sub
  938.  
  939. Sub Alien3Timer_Timer()
  940. Select Case Alien3Pos
  941. Case 0: Alien_RR.Z=0:AlienPost3.Z=-60
  942. Case 1: Alien_RR.Z=5:AlienPost3.Z=-55
  943. Case 2: Alien_RR.Z=10:AlienPost3.Z=-50
  944. Case 3: Alien_RR.Z=15:AlienPost3.Z=-45
  945. Case 4: Alien_RR.Z=20:AlienPost3.Z=-40
  946. Case 5: Alien_RR.Z=25:AlienPost3.Z=-35
  947. Case 6: Alien_RR.Z=30:AlienPost3.Z=-30
  948. Case 7: Alien_RR.Z=35:AlienPost3.Z=-25
  949. Case 8: Alien_RR.Z=40:AlienPost3.Z=-20
  950. Case 9: Alien_RR.Z=35:AlienPost3.Z=-25
  951. Case 10: Alien_RR.Z=30:AlienPost3.Z=-30
  952. Case 11: Alien_RR.Z=25:AlienPost3.Z=-35
  953. Case 12: Alien_RR.Z=20:AlienPost3.Z=-40
  954. Case 13: Alien_RR.Z=15:AlienPost3.Z=-45
  955. Case 14: Alien_RR.Z=10:AlienPost3.Z=-50
  956. Case 15: Alien_RR.Z=5:AlienPost3.Z=-55
  957. Case 16: Alien_RR.Z=0:AlienPost3.Z=-60:Alien3Pos=1:Alien3Timer.Enabled=0
  958.  
  959. End Select
  960.  
  961.  
  962. If Alien3Pos=>0 then Alien3Pos=Alien3Pos+1
  963. End Sub
  964.  
  965.  
  966. Dim Alien4Pos
  967.  
  968. Sub Alien4Move (enabled)
  969. if enabled then
  970. Alien4Timer.Enabled=1
  971. PlaySoundAtVol SoundFX("AlienShake4",DOFShaker),Licht9,2
  972. End If
  973. End Sub
  974.  
  975. Sub Alien4Timer_Timer()
  976. Select Case Alien4Pos
  977. Case 0: Alien_RF.Z=0:AlienPost4.Z=-60
  978. Case 1: Alien_RF.Z=5:AlienPost4.Z=-55
  979. Case 2: Alien_RF.Z=10:AlienPost4.Z=-50
  980. Case 3: Alien_RF.Z=15:AlienPost4.Z=-45
  981. Case 4: Alien_RF.Z=20:AlienPost4.Z=-40
  982. Case 5: Alien_RF.Z=25:AlienPost4.Z=-35
  983. Case 6: Alien_RF.Z=30:AlienPost4.Z=-30
  984. Case 7: Alien_RF.Z=35:AlienPost4.Z=-25
  985. Case 8: Alien_RF.Z=40:AlienPost4.Z=-20
  986. Case 9: Alien_RF.Z=35:AlienPost4.Z=-25
  987. Case 10: Alien_RF.Z=30:AlienPost4.Z=-30
  988. Case 11: Alien_RF.Z=25:AlienPost4.Z=-35
  989. Case 12: Alien_RF.Z=20:AlienPost4.Z=-40
  990. Case 13: Alien_RF.Z=15:AlienPost4.Z=-45
  991. Case 14: Alien_RF.Z=10:AlienPost4.Z=-50
  992. Case 15: Alien_RF.Z=5:AlienPost4.Z=-55
  993. Case 16: Alien_RF.Z=0:AlienPost4.Z=-60:Alien4Pos=1:Alien4Timer.Enabled=0
  994.  
  995. End Select
  996.  
  997. If Alien4Pos=>0 then Alien4Pos=Alien4Pos+1
  998. End Sub
  999.  
  1000. '//////////////////////////////////////////////////////////////////////
  1001. '// TARGETBANK MOVEMENT
  1002. '//////////////////////////////////////////////////////////////////////
  1003.  
  1004. Dim TBPos, TBDown
  1005.  
  1006. Sub TBMove (enabled)
  1007. TBTimer.Enabled = Enabled
  1008. if enabled then PlaySoundAt SoundFX("TargetBank",DOFContactors),DPTrigger
  1009. End Sub
  1010.  
  1011. Sub TBTimer_Timer()
  1012. Select Case TBPos
  1013. Case 0: CENTREBANK.Z=-20:SW45P.Z=-20:SW46P.Z=-20:SW47P.Z=-20:TBPos=0:Controller.Switch(66) = 0:Controller.Switch(67) = 1::SW45.isdropped=0:SW46.isdropped=0:SW47.isdropped=0:DPWall.isdropped=0:DPWall1.isdropped=1:DPRAMP.collidable=1
  1014. Case 1: CENTREBANK.Z=-22:SW45P.Z=-22:SW46P.Z=-22:SW47P.Z=-22:Controller.Switch(67) = 0
  1015. Case 2: CENTREBANK.Z=-24:SW45P.Z=-24:SW46P.Z=-24:SW47P.Z=-24
  1016. Case 3: CENTREBANK.Z=-26:SW45P.Z=-26:SW46P.Z=-26:SW47P.Z=-26
  1017. Case 4: CENTREBANK.Z=-28:SW45P.Z=-28:SW46P.Z=-28:SW47P.Z=-28
  1018. Case 5: CENTREBANK.Z=-30:SW45P.Z=-30:SW46P.Z=-30:SW47P.Z=-30
  1019. Case 6: CENTREBANK.Z=-32:SW45P.Z=-32:SW46P.Z=-32:SW47P.Z=-32
  1020. Case 7: CENTREBANK.Z=-34:SW45P.Z=-34:SW46P.Z=-34:SW47P.Z=-34
  1021. Case 8: CENTREBANK.Z=-36:SW45P.Z=-36:SW46P.Z=-36:SW47P.Z=-36
  1022. Case 9: CENTREBANK.Z=-38:SW45P.Z=-38:SW46P.Z=-38:SW47P.Z=-38
  1023. Case 10: CENTREBANK.Z=-40:SW45P.Z=-40:SW46P.Z=-40:SW47P.Z=-40
  1024. Case 11: CENTREBANK.Z=-42:SW45P.Z=-42:SW46P.Z=-42:SW47P.Z=-42
  1025. Case 12: CENTREBANK.Z=-44:SW45P.Z=-44:SW46P.Z=-44:SW47P.Z=-44:
  1026. Case 13: CENTREBANK.Z=-46:SW45P.Z=-46:SW46P.Z=-46:SW47P.Z=-46:
  1027. Case 14: CENTREBANK.Z=-48:SW45P.Z=-48:SW46P.Z=-48:SW47P.Z=-48
  1028. Case 15: CENTREBANK.Z=-50:SW45P.Z=-50:SW46P.Z=-50:SW47P.Z=-50
  1029. Case 16: CENTREBANK.Z=-52:SW45P.Z=-52:SW46P.Z=-52:SW47P.Z=-52
  1030. Case 17: CENTREBANK.Z=-54:SW45P.Z=-54:SW46P.Z=-54:SW47P.Z=-54
  1031. Case 18: CENTREBANK.Z=-56:SW45P.Z=-56:SW46P.Z=-56:SW47P.Z=-56
  1032. Case 19: CENTREBANK.Z=-58:SW45P.Z=-58:SW46P.Z=-58:SW47P.Z=-58
  1033. Case 20: CENTREBANK.Z=-60:SW45P.Z=-60:SW46P.Z=-60:SW47P.Z=-60
  1034. Case 21: CENTREBANK.Z=-62:SW45P.Z=-62:SW46P.Z=-62:SW47P.Z=-62
  1035. Case 22: CENTREBANK.Z=-64:SW45P.Z=-64:SW46P.Z=-64:SW47P.Z=-64
  1036. Case 23: CENTREBANK.Z=-66:SW45P.Z=-66:SW46P.Z=-66:SW47P.Z=-66
  1037. Case 24: CENTREBANK.Z=-68:SW45P.Z=-68:SW46P.Z=-68:SW47P.Z=-68
  1038. Case 25: CENTREBANK.Z=-70:SW45P.Z=-70:SW46P.Z=-70:SW47P.Z=-70
  1039. Case 26: CENTREBANK.Z=-72:SW45P.Z=-72:SW46P.Z=-72:SW47P.Z=-72
  1040. Case 27: CENTREBANK.Z=-74:SW45P.Z=-74:SW46P.Z=-74:SW47P.Z=-74
  1041. Case 28: CENTREBANK.Z=-76:SW45P.Z=-76:SW46P.Z=-76:SW47P.Z=-76:SW45.isdropped=1:SW46.isdropped=1:SW47.isdropped=1:DPWALL.isdropped=1:DPRAMP.collidable=0:Controller.Switch(66) = 0
  1042. Case 29: Controller.Switch(66) = 1:Controller.Switch(67) = 0
  1043. End Select
  1044.  
  1045. If TBDown=0 then TBPos=TBPos+1
  1046. If TBDown=1 then TBPos=TBPos-1
  1047. if TBPos < -2 then TBDown = 0 else if TBPos > 31 then TBDown = 1
  1048. End Sub
  1049.  
  1050. '//////////////////////////////////////////////////////////////////////
  1051. '// DIRTY POOL HANDLE
  1052. '//////////////////////////////////////////////////////////////////////
  1053.  
  1054. Dim DPBall, Ballresting
  1055.  
  1056. DPBall = ""
  1057. Ballresting = False
  1058.  
  1059. Sub DPTrigger_Hit
  1060. Ballresting = True
  1061. Set DPBall = ActiveBall
  1062. End Sub
  1063.  
  1064. Sub DPTrigger_UnHit
  1065. Ballresting = False
  1066. DPRAMP.collidable=0
  1067. End Sub
  1068.  
  1069. '//////////////////////////////////////////////////////////////////////
  1070. '// DIVERTER MOVEMENT
  1071. '//////////////////////////////////////////////////////////////////////
  1072.  
  1073. Dim DivPos, DivClosed, DiverterDir
  1074.  
  1075. Sub DivMove(Enabled)
  1076. If Enabled Then
  1077. PlaySound SoundFX("Diverter",DOFContactors)
  1078. DiverterDir = 1
  1079. Else
  1080. DiverterDir = -1
  1081. End If
  1082.  
  1083. DivTimer.Enabled = 0
  1084. If DivPos <1 Then DivPos = 1
  1085. If DivPos > 8 Then DivPos = 8
  1086.  
  1087. DivTimer.Enabled = 1
  1088. End Sub
  1089.  
  1090. Sub DivTimer_Timer()
  1091. Select Case DivPos
  1092. Case 0:Diverter.ObjRotZ=-15:Diverter9.IsDropped = 0:Diverter8.IsDropped = 1:DivTimer.Enabled = 0
  1093. Case 1:Diverter.ObjRotZ=-8:Diverter8.IsDropped = 0:Diverter9.IsDropped = 1:Diverter7.IsDropped = 1
  1094. Case 2:Diverter.ObjRotZ=-3:Diverter7.IsDropped = 0:Diverter8.IsDropped = 1:Diverter6.IsDropped = 1
  1095. Case 3:Diverter.ObjRotZ=2:Diverter6.IsDropped = 0:Diverter7.IsDropped = 1:Diverter5.IsDropped = 1
  1096. Case 4:Diverter.ObjRotZ=7:Diverter5.IsDropped = 0:Diverter6.IsDropped = 1:Diverter4.IsDropped = 1
  1097. Case 5:Diverter.ObjRotZ=12:Diverter4.IsDropped = 0:Diverter5.IsDropped = 1:Diverter3.IsDropped = 1
  1098. Case 6:Diverter.ObjRotZ=17:Diverter3.IsDropped = 0:Diverter4.IsDropped = 1:Diverter2.IsDropped = 1
  1099. Case 7:Diverter.ObjRotZ=22:Diverter2.IsDropped = 0:Diverter3.IsDropped = 1:Diverter1.IsDropped = 1
  1100. Case 8:Diverter.ObjRotZ=27:Diverter1.IsDropped = 0:Diverter2.isdropped = 0
  1101. Case 9:DivTimer.Enabled = 0
  1102. End Select
  1103.  
  1104. DivPos = DivPos + DiverterDir
  1105. End Sub
  1106.  
  1107. '//////////////////////////////////////////////////////////////////////
  1108. '// OBJECT SOUND EFFECTS
  1109. '//////////////////////////////////////////////////////////////////////
  1110.  
  1111. Sub LeftPost_Hit(): PlaySoundAt "RubberHit",ActiveBall: End Sub
  1112.  
  1113. Sub LeftSlingRubber_Hit(): PlaySoundAt "RubberHit",ActiveBall:End Sub
  1114.  
  1115. Sub RightPost_Hit(): PlaySoundAt "RubberHit",ActiveBall: End Sub
  1116.  
  1117. Sub RightSlingRubber_Hit(): PlaySoundAt "RubberHit",ActiveBall:End Sub
  1118.  
  1119. Sub Rubber3_Hit(): PlaySoundAt "RubberHit3",ActiveBall: End Sub
  1120.  
  1121. Sub Rubber6_Hit(): PlaySoundAt "RubberHit3",ActiveBall: End Sub
  1122.  
  1123. Sub Wall14_Hit(): PlaySoundAt "Objecthit",ActiveBall:End Sub
  1124.  
  1125. Sub Wall31_Hit(): PlaySoundAt "Objecthit",ActiveBall:End Sub
  1126.  
  1127. Sub Wall29_Hit(): PlaySoundAt "Objecthit",ActiveBall:End Sub
  1128.  
  1129. Sub Wall34_Hit(): PlaySoundAt "Objecthit",ActiveBall:End Sub
  1130.  
  1131.  
  1132.  
  1133.  
  1134. Sub LeftFlipper_Collide(parm):
  1135. Ballspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1136. If Ballspeed >2 then Playsound "RubberHit2" Else Playsound "RubberHitLow":End If:End Sub
  1137.  
  1138. Sub RightFlipper_Collide(parm):
  1139. Ballspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1140. If Ballspeed >2 then Playsound "RubberHit2" Else Playsound "RubberHitLow":End If:End Sub
  1141.  
  1142. Sub RDrop_Hit()
  1143. ActiveBall.VelZ = -2
  1144. ActiveBall.VelY = 0
  1145. ActiveBall.VelX = 0
  1146. StopSound "fx_metalrolling"
  1147. PlaySound "Balldrop",0,1,.4,0,0,0,1,.8
  1148. End Sub
  1149.  
  1150. Sub LDrop_Hit()
  1151. ActiveBall.VelZ = -2
  1152. ActiveBall.VelY = 0
  1153. ActiveBall.VelX = 0
  1154. StopSound "fx_metalrolling"
  1155. PlaySound "Balldrop",0,1,-.4,0,0,0,1,.8
  1156. End Sub
  1157.  
  1158. Sub LRoll_Hit()
  1159. PlaySound "fx_metalrolling",0,Vol(ActiveBall)+2,Pan(ActiveBall),0,0,1,0,AudioFade(ActiveBall)
  1160. End Sub
  1161.  
  1162. '//////////////////////////////////////////////////////////////////////
  1163. '// BALL SOUND FUNCTIONS
  1164. '//////////////////////////////////////////////////////////////////////
  1165.  
  1166. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1167. Vol = Csng(BallVel(ball) ^2 / 1000)
  1168. End Function
  1169.  
  1170. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "AFM" is the name of the table
  1171. Dim tmp
  1172. tmp = ball.x * 2 / AFM.width-1
  1173. If tmp > 0 Then
  1174. Pan = Csng(tmp ^10)
  1175. Else
  1176. Pan = Csng(-((- tmp) ^10) )
  1177. End If
  1178. End Function
  1179.  
  1180. function AudioFade(ball)
  1181. Dim tmp
  1182. tmp = ball.y * 2 / AFM.height-1
  1183. If tmp > 0 Then
  1184. AudioFade = Csng(tmp ^10)
  1185. Else
  1186. AudioFade = Csng(-((- tmp) ^10) )
  1187. End If
  1188. End Function
  1189.  
  1190. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1191. Pitch = BallVel(ball) * 20
  1192. End Function
  1193.  
  1194. Function BallVel(ball) 'Calculates the ball speed
  1195. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1196. End Function
  1197.  
  1198. '//////////////////////////////////////////////////////////////////////
  1199. '// JP VPX ROLLING SOUNDS
  1200. '//////////////////////////////////////////////////////////////////////
  1201.  
  1202. Const tnob = 5 ' total number of balls in this table is 4, but always use a higher number here because of the timing
  1203. ReDim rolling(tnob)
  1204. InitRolling
  1205.  
  1206. Sub InitRolling
  1207. Dim i
  1208. For i = 0 to tnob
  1209. rolling(i) = False
  1210. Next
  1211. End Sub
  1212.  
  1213. Sub RollingUpdate()
  1214. Dim BOT, b
  1215. BOT = GetBalls
  1216. ' stop the sound of deleted balls
  1217. For b = UBound(BOT) + 1 to tnob
  1218. rolling(b) = False
  1219. StopSound("fx_ballrolling" & b)
  1220. Next
  1221.  
  1222. ' exit the sub if no balls on the table
  1223. If UBound(BOT) = -1 Then Exit Sub
  1224.  
  1225. ' play the rolling sound for each ball
  1226. For b = 0 to UBound(BOT)
  1227. If BallVel(BOT(b) ) > 1 Then
  1228. rolling(b) = True
  1229. if BOT(b).z < 30 Then ' Ball on playfield
  1230. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0, AudioFade(BOT(b) )
  1231. Else ' Ball on raised ramp
  1232. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) )*.6, Pan(BOT(b) ), 0, Pitch(BOT(b) )+50000, 1, 0, AudioFade(BOT(b) )
  1233. End If
  1234. Else
  1235. If rolling(b) = True Then
  1236. StopSound("fx_ballrolling" & b)
  1237. rolling(b) = False
  1238. End If
  1239. End If
  1240. Next
  1241. End Sub
  1242.  
  1243. '//////////////////////////////////////////////////////////////////////
  1244. '// BALL COLLISION SOUNDS
  1245. '//////////////////////////////////////////////////////////////////////
  1246.  
  1247. Sub OnBallBallCollision(ball1, ball2, velocity)
  1248. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 200, Pan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  1249. End Sub
  1250.  
  1251. '//////////////////////////////////////////////////////////////////////
  1252. '// Positional Sound Playback Functions by DJRobX
  1253. '//////////////////////////////////////////////////////////////////////
  1254.  
  1255. 'Set position as table object (Use object or light but NOT wall) and Vol to 1
  1256.  
  1257. Sub PlaySoundAt(sound, tableobj)
  1258. PlaySound sound, 1, 1, Pan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1259. End Sub
  1260.  
  1261.  
  1262. 'Set all as per ball position & speed.
  1263.  
  1264. Sub PlaySoundAtBall(sound)
  1265. PlaySound sound, 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  1266. End Sub
  1267.  
  1268.  
  1269. 'Set position as table object and Vol manually.
  1270.  
  1271. Sub PlaySoundAtVol(sound, tableobj, Vol)
  1272. PlaySound sound, 1, Vol, Pan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  1273. End Sub
  1274.  
  1275.  
  1276. 'Set all as per ball position & speed, but Vol Multiplier may be used eg; PlaySoundAtBallVol "sound",3
  1277.  
  1278. Sub PlaySoundAtBallVol(sound, VolMult)
  1279. PlaySound sound, 0, Vol(ActiveBall) * VolMult, Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
  1280. End Sub
  1281.  
  1282.  
  1283. 'Set position as bumperX and Vol manually.
  1284.  
  1285. Sub PlaySoundAtBumperVol(sound, tableobj, Vol)
  1286. PlaySound sound, 1, Vol, Pan(tableobj), 0,0,1, 1, AudioFade(tableobj)
  1287. End Sub
  1288.  
  1289.  
  1290. Dim NextOrbitHit:NextOrbitHit = 0
  1291.  
  1292. Sub WireRampBumps_Hit(idx)
  1293. if BallVel(ActiveBall) > .3 and Timer > NextOrbitHit then
  1294. RandomBump3 .5, Pitch(ActiveBall)+5
  1295. ' Schedule the next possible sound time. This prevents it from rapid-firing noises too much.
  1296. ' Lowering these numbers allow more closely-spaced clunks.
  1297. NextOrbitHit = Timer + .2 + (Rnd * .2)
  1298. end if
  1299. End Sub
  1300.  
  1301. Sub PlasticRampBumps_Hit(idx)
  1302. if BallVel(ActiveBall) > .3 and Timer > NextOrbitHit then
  1303. RandomBump 2, Pitch(ActiveBall)
  1304. ' Schedule the next possible sound time. This prevents it from rapid-firing noises too much.
  1305. ' Lowering these numbers allow more closely-spaced clunks.
  1306. NextOrbitHit = Timer + .1 + (Rnd * .2)
  1307. end if
  1308. End Sub
  1309.  
  1310.  
  1311. Sub MetalGuideBumps_Hit(idx)
  1312. if BallVel(ActiveBall) > .3 and Timer > NextOrbitHit then
  1313. RandomBump2 2, Pitch(ActiveBall)
  1314. ' Schedule the next possible sound time. This prevents it from rapid-firing noises too much.
  1315. ' Lowering these numbers allow more closely-spaced clunks.
  1316. NextOrbitHit = Timer + .2 + (Rnd * .2)
  1317. end if
  1318. End Sub
  1319.  
  1320. Sub MetalWallBumps_Hit(idx)
  1321. if BallVel(ActiveBall) > .3 and Timer > NextOrbitHit then
  1322. RandomBump 2, 20000 'Increased pitch to simulate metal wall
  1323. ' Schedule the next possible sound time. This prevents it from rapid-firing noises too much.
  1324. ' Lowering these numbers allow more closely-spaced clunks.
  1325. NextOrbitHit = Timer + .2 + (Rnd * .2)
  1326. end if
  1327. End Sub
  1328.  
  1329.  
  1330. '' Requires rampbump1 to 7 in Sound Manager
  1331. Sub RandomBump(voladj, freq)
  1332. dim BumpSnd:BumpSnd= "rampbump" & CStr(Int(Rnd*7)+1)
  1333. PlaySound BumpSnd, 0, Vol(ActiveBall)*voladj, Pan(ActiveBall), 0, freq, 0, 1, AudioFade(ActiveBall)
  1334. End Sub
  1335.  
  1336. ' Requires metalguidebump1 to 2 in Sound Manager
  1337. Sub RandomBump2(voladj, freq)
  1338. dim BumpSnd:BumpSnd= "metalguidebump" & CStr(Int(Rnd*2)+1)
  1339. PlaySound BumpSnd, 0, Vol(ActiveBall)*voladj, Pan(ActiveBall), 0, freq, 0, 1, AudioFade(ActiveBall)
  1340. End Sub
  1341.  
  1342. ' Requires WireRampBump1 to 5 in Sound Manager
  1343. Sub RandomBump3(voladj, freq)
  1344. dim BumpSnd:BumpSnd= "WireRampBump" & CStr(Int(Rnd*5)+1)
  1345. PlaySound BumpSnd, 0, Vol(ActiveBall)*voladj, Pan(ActiveBall), 0, freq, 0, 1, AudioFade(ActiveBall)
  1346. End Sub
  1347.  
  1348.  
  1349.  
  1350. ' Stop Bump Sounds - Place triggers for these at the end of the ramps, to ensure that no bump sounds are played after the ball leaves the ramp.
  1351.  
  1352. Sub BumpSTOP1_Hit ()
  1353. dim i:for i=1 to 4:StopSound "WireRampBump" & i:next
  1354. NextOrbitHit = Timer + 1
  1355. End Sub
  1356.  
  1357. Sub BumpSTOP2_Hit ()
  1358. dim i:for i=1 to 4:StopSound "WireRampBump" & i:next
  1359. NextOrbitHit = Timer + 1
  1360. End Sub
  1361.  
  1362.  
  1363.  
  1364.  
  1365. '//////////////////////////////////////////////////////////////////////
  1366. '// GI CONTROL
  1367. '//////////////////////////////////////////////////////////////////////
  1368.  
  1369.  
  1370. Sub UpdateGI(no, step)
  1371. Dim gistep, ii, a
  1372. gistep = step / 8
  1373. Select Case no
  1374. Case 0
  1375. if Round(8*gistep) < 1.25 then PLASTICS_Bottom.visible = 0 else PLASTICS_Bottom.visible = 1 end If
  1376. PLASTICS_Bottom.material = "GIFade" & Round(8*gistep)
  1377. STARPOSTS.material = "GIFade" & Round(8*gistep)
  1378.  
  1379. If ApronGIProper = 1 Then
  1380. APRON.material = "GIFade" & Round(8*gistep)
  1381. Else
  1382. APRON.material = "GIFadeNoOpacity" & Round(8*gistep)
  1383. End If
  1384.  
  1385. batleft.material = "FlipperPlastic" & Round(8*gistep)
  1386. batright.material = "FlipperPlastic" & Round(8*gistep)
  1387. For each ii in GIBottom
  1388. ii.IntensityScale = gistep
  1389. currGIBot = 8*gistep
  1390. Next
  1391. Case 1
  1392. if Round(8*gistep) < 1.25 then PLASTICS_MidL.visible = 0 else PLASTICS_MidL.visible = 1 end If
  1393. if Round(8*gistep) < 1.25 then PLASTICS_MidR.visible = 0 else PLASTICS_MidR.visible = 1 end If
  1394. PLASTICS_MidL.material = "GIFade" & Round(8*gistep)
  1395. PLASTICS_MidR.material = "GIFade" & Round(8*gistep)
  1396. SIDEWALL.material = "GIFade" & Round(8*gistep)
  1397. if Round(8*gistep) < 1.25 then SIDEWALL.visible = 0 else SIDEWALL.visible = 1 end If
  1398. if Round(8*gistep) >= 7 then SIDEWALL_GIOFF.visible = 0 else SIDEWALL_GIOFF.visible = 1 end If
  1399. LEFTPOPPERSCOOP.material = "GIFade" & Round(8*gistep)
  1400. SW56P.material = "GIFade" & Round(8*gistep)
  1401. SW57P.material = "GIFade" & Round(8*gistep)
  1402. SW58P.material = "GIFade" & Round(8*gistep)
  1403. SW42P.material = "GIFade" & Round(8*gistep)
  1404. SW41P.material = "GIFade" & Round(8*gistep)
  1405. SAUCERSML.material = "GIFade" & Round(8*gistep)
  1406. STEELWALLS.material = "GIFadeNoOpacity" & Round(8*gistep)
  1407. Diverter.material = "GIFadeNoOpacity" & Round(8*gistep)
  1408. For each ii in GIMiddle
  1409. ii.IntensityScale = gistep
  1410. currGIMid = 8*gistep
  1411. Next
  1412. Case 2
  1413. if Round(8*gistep) < 1.25 then PLASTICS_Top.visible = 0 else PLASTICS_Top.visible = 1 end If
  1414. PLASTICS_Top.material = "GIFade" & Round(8*gistep)
  1415. CLEARAMPS.material = "ClearRamp1" & Round(8*gistep)
  1416.  
  1417. if Round(8*gistep) < 1.1 then
  1418. CLEARAMPS.image = "CLEARAMPS_A"
  1419. Alien_LF.image = "ALIEN_LF_A"
  1420. Alien_LR.image = "ALIEN_LR_A"
  1421. Alien_RF.image = "ALIEN_RF_A"
  1422. Alien_RR.image = "ALIEN_RR_A"
  1423. Ufo.image = "UFO_GIOff"
  1424. else
  1425. CLEARAMPS.image = "CLEARAMPS_B"
  1426. Alien_LF.image = "ALIEN_LF_A"
  1427. Alien_LR.image = "ALIEN_LR_A"
  1428. Alien_RF.image = "ALIEN_RF_A"
  1429. Alien_RR.image = "ALIEN_RR_A"
  1430. Ufo.image = "UFO_RG"
  1431. end If
  1432.  
  1433. 'REARWALL.material = "GIFadeNoOpacity" & Round(8*gistep)
  1434. REDPLASTICS.material = "GIFade" & Round(8*gistep)
  1435. SW43P.material = "GIFade" & Round(8*gistep)
  1436. SW44P.material = "GIFade" & Round(8*gistep)
  1437. For each ii in GITop
  1438. ii.IntensityScale = gistep
  1439. currGITop = 8*gistep
  1440. Next
  1441. End Select
  1442. End Sub
  1443.  
  1444.  
  1445. '//////////////////////////////////////////////////////////////////////
  1446. '// REALTIME UPDATES
  1447. '//////////////////////////////////////////////////////////////////////
  1448.  
  1449. Set MotorCallback = GetRef("RealTimeUpdates")
  1450.  
  1451. Sub RealTimeUpdates
  1452. RollingUpdate
  1453. End Sub
  1454.  
  1455. '//////////////////////////////////////////////////////////////////////
  1456. '// JP FADING LIGHT SYSTEM
  1457. '//////////////////////////////////////////////////////////////////////
  1458.  
  1459. Dim LampState(200), FadingLevel(200), ModLevel(200)
  1460. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  1461.  
  1462. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  1463. LampTimer.Interval = -1 'lamp fading speed
  1464. LampTimer.Enabled = 1
  1465.  
  1466.  
  1467.  
  1468. ' Lamp & Flasher Timers
  1469.  
  1470.  
  1471. '//PRELOADING LIGHTS ON START HERE////////////////////////////////////
  1472.  
  1473. Dim GIInit: GIInit=90
  1474.  
  1475. Sub LampTimer_Timer()
  1476.  
  1477. If PreloadMe = 1 Then
  1478. if GIInit > 0 Then
  1479. GIInit = GIInit -1
  1480. if GIInit <= 90 and GIInit > 82 then
  1481. UpdateGI 0, GIInit-82
  1482. UpdateGI 1, GIInit-82
  1483. UpdateGI 2, GIInit-82
  1484. Else
  1485. if GIInit < 40 then
  1486. UpdateGI 0, 8:UpdateGI 1, 8:UpdateGI 2, 8
  1487. elseif GIInit >= 40 and GIInit <=82 then
  1488. UpdateGI 0, 0:UpdateGI 1, 0:UpdateGI 2, 0
  1489. end if
  1490. end if
  1491. if (GIInit mod 40) > 1 then SetLamp 90 + (GIInit mod 40) +1, 1
  1492. SetLamp 90 + (GIInit mod 40) + 2, 0
  1493. end if
  1494. End If
  1495.  
  1496.  
  1497. Dim chgLamp, num, chg, ii
  1498. chgLamp = Controller.ChangedLamps
  1499. If Not IsEmpty(chgLamp) Then
  1500. For ii = 0 To UBound(chgLamp)
  1501. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  1502. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  1503. Next
  1504. End If
  1505. UpdateLamps
  1506. End Sub
  1507.  
  1508. '//////////////////////////////////////////////////////////////////////
  1509. '// INSERT LIGHTS
  1510. '//////////////////////////////////////////////////////////////////////
  1511.  
  1512. Sub UpdateLamps
  1513.  
  1514. NFadeLm 11, l11, l11b
  1515. NFadeLm 12, l12, l12b
  1516. NFadeLm 13, l13, l13b
  1517. NFadeLm 14, l14, l14b
  1518. NFadeLmm 15, l15l, l15r, l15a
  1519. NFadeLm 16, l16, l16b
  1520. NFadeLm 17, l17, l17b
  1521. NFadeLmm 18, l18, l18b, l18a
  1522. NFadeLm 21, l21, l21b
  1523. NFadeLm 22, l22, l22b
  1524. NFadeLm 23, l23, l23b
  1525. NFadeLm 24, l24, l24b
  1526. NFadeLmm 25, l25, l25b, l25a
  1527. NFadeLm 26, l26, l26b
  1528. NFadeLm 27, l27, l27b
  1529. NFadeLm 28, l28, l28b
  1530. NFadeLm 31, l31, l31b
  1531. NFadeLm 32, l32, l32b
  1532. NFadeLm 33, l33, l33b
  1533. NFadeLm 34, l34, l34b
  1534. NFadeLm 35, l35, l35b
  1535. NFadeLm 36, l36, l36b
  1536. NFadeLm 37, l37, l37b
  1537. NFadeLm 38, l38, l38b
  1538. NFadeLmm 41, l41, l41b, l41a
  1539. NFadeLmm 42, l42, l42b, l42a
  1540. NFadeLmm 43, l43, l43b, l43a
  1541. NFadeLmm 44, l44, l44b, l44a
  1542. NFadeLmm 45, l45, l45b, l45a
  1543. NFadeLmm 46, l46, l46b, l46a
  1544. NFadeLmm 47, l47, l47b, l47a
  1545. NFadeLmm 48, l48, l48b, l48a
  1546. NFadeLm 51, l51, l51b
  1547. NFadeLm 52, l52, l52b
  1548. NFadeLm 53, l53, l53b
  1549. NFadeLm 54, l54, l54b
  1550. NFadeLm 55, l55, l55b
  1551. NFadeLm 56, l56, l56b
  1552. NFadeLm 57, l57, l57b
  1553. NFadeLm 58, l58, l58b
  1554. NFadeLm 61, l61, l61b
  1555. NFadeLm 62, l62, l62b
  1556. NFadeLm 63, l63, l63b
  1557. NFadeLm 64, l64, l64b
  1558. NFadeLm 65, l65, l65b
  1559. NFadeLm 66, l66, l66b
  1560. NFadeLm 67, l67, l67b
  1561. NFadeLmm 68, l68, l68b, l68a
  1562. NFadeLmm 71, l71, l71b, l71a
  1563. NFadeLm 72, l72, l72b
  1564. NFadeLm 73, l73, l73b
  1565. NFadeLm 74, l74, l74b
  1566. NFadeLmm 75, l75, l75b, l75a
  1567. NFadeLm 76, l76, l76b
  1568. NFadeLm 77, l77, l77b
  1569. NFadeLm 78, l78, l78b
  1570. NFadeLmm 81, l81, l81b, l81a
  1571. NFadeLmm 82, l82, l82b, l82a
  1572. NFadeLmm 83, l83, l83b, l83a
  1573. NFadeLmm 84, l84, l84b, l84a
  1574. NFadeLmm 85, l85, l85b, l85a
  1575.  
  1576. '86 - Launch button LED
  1577. '88 - Start button LED
  1578.  
  1579. 'NFadeL 86, l86
  1580. 'NFadeL 88, l88
  1581.  
  1582. '//////////////////////////////////////////////////////////////////////
  1583. '// FLASHER
  1584. '//////////////////////////////////////////////////////////////////////
  1585.  
  1586. NFadeLmf 117, F17dr, F17flare
  1587. NFadeLmf 118, F18dr, F18flare
  1588. NFadeLmf 119, F19dr, F19flare
  1589. NFadeLmf 125, f25dr, F25flare
  1590. NFadeLmf 126, F26dr, F26flare
  1591. NFadeLmf 127, f27dr, F27flare
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597. 'NFadeLmm 117, F17, F17b, F17c
  1598. 'NFadeLmm 118, F18, F18b, F18c
  1599. 'NFadeLmm 119, F19, F19b, F19c
  1600.  
  1601.  
  1602. NFadeLmf 120, f20, f20a
  1603. NFadeLm 121, F21, F21a
  1604. NFadeLmf 123, f23, f23c
  1605. 'NFadeLmm 125, F25, F25b, F25c
  1606. 'NFadeLmm 126, F26, F26b, F26c
  1607. 'NFadeLmm 127, F27, F27b, F27c
  1608. NFadeLmf 128, f28, f28a
  1609.  
  1610.  
  1611.  
  1612.  
  1613. '//////////////////////////////////////////////////////////////////////
  1614. '// SAUCER LED
  1615. '//////////////////////////////////////////////////////////////////////
  1616.  
  1617.  
  1618. FadeObj 94, Led4, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1619. FadeObj 95, Led5, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1620. FadeObj 96, Led6, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1621. FadeObj 97, Led7, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1622. FadeObj 98, Led8, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1623. FadeObj 101, Led9, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1624. FadeObj 102, Led10, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1625. FadeObj 103, Led11, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1626. FadeObj 104, Led12, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1627. FadeObj 105, Led13, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1628.  
  1629.  
  1630. '// These LEDS are round back so not visibile - Off for performance ///////
  1631. 'FadeObj 91, Led1, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1632. 'FadeObj 92, Led2, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1633. 'FadeObj 93, Led3, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1634.  
  1635. 'FadeObj 106, Led14, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1636. 'FadeObj 107, Led15, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1637. 'FadeObj 108, Led16, "UFOLED_A", "UFOLED_B", "UFOLED_C", "UFOLED_D"
  1638.  
  1639.  
  1640.  
  1641.  
  1642. '///////////////////////////////////////////////////////////////////////////
  1643. '// FLASHERS - 20 = LeftFlasher 23 = Saucer Flasher 28 = Right Flasher 39 = Strobe
  1644. '///////////////////////////////////////////////////////////////////////////
  1645.  
  1646.  
  1647. If UFOFlashers =1 Then
  1648. NFadeObjm 120, Ufo, "UFO_RF", "UFO_RG"
  1649. NFadeObjm 123, Ufo, "UFO_Flasher_D", "UFO_RG"
  1650. NFadeObjm 128, Ufo, "UFO_LF", "UFO_RG"
  1651. End If
  1652.  
  1653. If ChromeRailFlashers = 1 Then
  1654.  
  1655. ' FLASHERS / STROBE - switchback to GI off texture
  1656. NFadeObjm 120, CHROMERAILS, "CHROMERAILS_D", "CHROMERAILS_A"
  1657. NFadeObjm 123, CHROMERAILS, "CHROMERAILS_C", "CHROMERAILS_A"
  1658. NFadeObjm 128, CHROMERAILS, "CHROMERAILS_E", "CHROMERAILS_A"
  1659.  
  1660. ' REDFLASHERS - switchback to GI on texture
  1661. NFadeObjm 125, CHROMERAILS, "CHROMERAILS_F", "CHROMERAILS_B"
  1662. NFadeObjm 126, CHROMERAILS, "CHROMERAILS_F", "CHROMERAILS_B"
  1663. NFadeObjm 127, CHROMERAILS, "CHROMERAILS_F", "CHROMERAILS_B"
  1664. NFadeObjm 117, CHROMERAILS, "CHROMERAILS_F", "CHROMERAILS_B"
  1665. NFadeObjm 119, CHROMERAILS, "CHROMERAILS_F", "CHROMERAILS_B"
  1666. NFadeObjm 118, CHROMERAILS, "CHROMERAILS_F", "CHROMERAILS_B"
  1667.  
  1668.  
  1669. NFadeObjm 120, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_C", "LEFTPOPPERSCOOP_A"
  1670. NFadeObjm 123, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_C", "LEFTPOPPERSCOOP_A"
  1671. NFadeObjm 128, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_C", "LEFTPOPPERSCOOP_A"
  1672. NFadeObjm 125, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_F", "LEFTPOPPERSCOOP_A"
  1673. NFadeObjm 126, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_F", "LEFTPOPPERSCOOP_A"
  1674. NFadeObjm 127, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_F", "LEFTPOPPERSCOOP_A"
  1675. NFadeObjm 117, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_F", "LEFTPOPPERSCOOP_A"
  1676. NFadeObjm 119, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_F", "LEFTPOPPERSCOOP_A"
  1677. NFadeObjm 118, LEFTPOPPERSCOOP_GIOFF, "LEFTPOPPERSCOOP_F", "LEFTPOPPERSCOOP_A"
  1678.  
  1679. NFadeObjm 120, METALBRUSHED, "METALBRUSHED_C", "METALBRUSHED_B"
  1680. NFadeObjm 123, METALBRUSHED, "METALBRUSHED_C", "METALBRUSHED_B"
  1681. NFadeObjm 128, METALBRUSHED, "METALBRUSHED_C", "METALBRUSHED_B"
  1682. NFadeObjm 125, METALBRUSHED, "METALBRUSHED_F", "METALBRUSHED_B"
  1683. NFadeObjm 126, METALBRUSHED, "METALBRUSHED_F", "METALBRUSHED_B"
  1684. NFadeObjm 127, METALBRUSHED, "METALBRUSHED_F", "METALBRUSHED_B"
  1685. NFadeObjm 117, METALBRUSHED, "METALBRUSHED_F", "METALBRUSHED_B"
  1686. NFadeObjm 119, METALBRUSHED, "METALBRUSHED_F", "METALBRUSHED_B"
  1687. NFadeObjm 118, METALBRUSHED, "METALBRUSHED_F", "METALBRUSHED_B"
  1688.  
  1689. NFadeObjm 120, BLACK_PAINTED, "BLACK_PAINTED_C", "BLACK_PAINTED_A"
  1690. NFadeObjm 123, BLACK_PAINTED, "BLACK_PAINTED_C", "BLACK_PAINTED_A"
  1691. NFadeObjm 128, BLACK_PAINTED, "BLACK_PAINTED_C", "BLACK_PAINTED_A"
  1692. NFadeObjm 125, BLACK_PAINTED, "BLACK_PAINTED_F", "BLACK_PAINTED_A"
  1693. NFadeObjm 126, BLACK_PAINTED, "BLACK_PAINTED_F", "BLACK_PAINTED_A"
  1694. NFadeObjm 127, BLACK_PAINTED, "BLACK_PAINTED_F", "BLACK_PAINTED_A"
  1695. NFadeObjm 117, BLACK_PAINTED, "BLACK_PAINTED_F", "BLACK_PAINTED_A"
  1696. NFadeObjm 119, BLACK_PAINTED, "BLACK_PAINTED_F", "BLACK_PAINTED_A"
  1697. NFadeObjm 118, BLACK_PAINTED, "BLACK_PAINTED_F", "BLACK_PAINTED_A"
  1698.  
  1699.  
  1700. End If
  1701.  
  1702. If PlasticsTopFlasher = 1 Then
  1703. NFadeObjm 123, PLASTICS_Top, "PLASTICS_C", "PLASTICS_B"
  1704. NFadeObjm 123, PLASTICS_Top_GIOFF, "PLASTICS_C", "PLASTICS_A"
  1705. NFadeObjm 123, REDPLASTICS_GIOFF, "RED_PLASTICS_FLASHERS", "REDPLASTICS_A"
  1706.  
  1707.  
  1708. If currGITop <4 Then
  1709. NFadeObjm 123, CLEARAMPS, "CLEARAMPS_C", "CLEARAMPS_A"
  1710. Else
  1711. NFadeObjm 123, CLEARAMPS, "CLEARAMPS_C", "CLEARAMPS_B"
  1712. End If
  1713.  
  1714. End If
  1715.  
  1716. If AlienFlashers = 1 Then
  1717. NFadeObjm 120, Alien_LF, "ALIEN_LF_D", "ALIEN_LF_A"
  1718. NFadeObjm 120, Alien_RF, "ALIEN_RF_D", "ALIEN_RF_A"
  1719. NFadeObjm 120, Alien_RR, "ALIEN_RR_D", "ALIEN_RR_A"
  1720. NFadeObjm 120, Alien_LR, "ALIEN_LR_D", "ALIEN_LR_A"
  1721.  
  1722. NFadeObjm 123, Alien_LF, "ALIEN_LF_C", "ALIEN_LF_A"
  1723. NFadeObjm 123, Alien_RF, "ALIEN_RF_C", "ALIEN_RF_A"
  1724. NFadeObjm 123, Alien_RR, "ALIEN_RR_C", "ALIEN_RR_A"
  1725. NFadeObjm 123, Alien_LR, "ALIEN_LR_C", "ALIEN_LR_A"
  1726.  
  1727. NFadeObjm 128, Alien_LF, "ALIEN_LF_E", "ALIEN_LF_A"
  1728. NFadeObjm 128, Alien_RF, "ALIEN_RF_E", "ALIEN_RF_A"
  1729. NFadeObjm 128, Alien_RR, "ALIEN_RR_E", "ALIEN_RR_A"
  1730. NFadeObjm 128, Alien_LR, "ALIEN_LR_E", "ALIEN_LR_A"
  1731. End If
  1732.  
  1733. If SideWallFlashers = 1 Then
  1734. NFadeObjmm 120, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_DF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_D"
  1735. NFadeObjmm 123, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_CF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_C"
  1736. NFadeObjmm 128, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_EF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_E"
  1737. NFadeObjmm 117, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_FF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_F"
  1738. NFadeObjmm 118, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_FF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_F"
  1739. NFadeObjmm 119, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_FF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_F"
  1740. NFadeObjmm 125, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_FF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_F"
  1741. NFadeObjmm 126, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_FF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_F"
  1742. NFadeObjmm 127, SIDEWALL, SIDEWALL_GIOFF, "SIDEWALL_FF", "SIDEWALL_B", "SIDEWALL_A", "SIDEWALL_F"
  1743. End If
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751. End Sub
  1752.  
  1753. '//////////////////////////////////////////////////////////////////////
  1754. '// LAMP SUBS
  1755. '//////////////////////////////////////////////////////////////////////
  1756.  
  1757. Sub InitLamps()
  1758. Dim x
  1759. For x = 0 to 200
  1760. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  1761. FadingLevel(x) = 4 ' used to track the fading state
  1762. ModLevel(x) = 0
  1763. FlashSpeedUp(x) = 0.2 ' faster speed when turning on the flasher
  1764. FlashSpeedDown(x) = 0.01 ' slower speed when turning off the flasher
  1765. FlashMax(x) = 1 ' the maximum value when on, usually 1
  1766. FlashMin(x) = 0 ' the minimum value when off, usually 0
  1767. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  1768. Next
  1769. End Sub
  1770.  
  1771. Sub AllLampsOff
  1772. Dim x
  1773. For x = 0 to 200
  1774. SetLamp x, 0
  1775. Next
  1776. End Sub
  1777.  
  1778. Sub SetLamp(nr, value)
  1779. If value <> LampState(nr) Then
  1780. LampState(nr) = abs(value)
  1781. FadingLevel(nr) = abs(value) + 4
  1782. End If
  1783. End Sub
  1784.  
  1785. Sub SetModLamp(nr, value)
  1786. dim TurnedOn:TurnedOn = 0
  1787. if value > 0 then TurnedOn = 1
  1788. If TurnedOn <> LampState(nr) Then
  1789. LampState(nr) = abs(TurnedOn)
  1790. FadingLevel(nr) = abs(TurnedOn) + 4
  1791. end if
  1792. ModLevel(nr) = value
  1793. End Sub
  1794.  
  1795. '//////////////////////////////////////////////////////////////////////
  1796. '// VPX STANDARD LIGHTS
  1797. '//////////////////////////////////////////////////////////////////////
  1798.  
  1799. Sub NFadeL(nr, object)
  1800. Select Case FadingLevel(nr)
  1801. Case 4:object.state = 0:FadingLevel(nr) = 0
  1802. Case 5:object.state = 1:FadingLevel(nr) = 1
  1803. End Select
  1804. if (ModLevel(nr) > 0) Then
  1805. object.IntensityScale = ModLevel(nr) / 255
  1806. end if
  1807.  
  1808. End Sub
  1809.  
  1810. Sub NFadeLm(nr, object, object2) ' used for multiple lights
  1811. Select Case FadingLevel(nr)
  1812. Case 4:object.state = 0 : object2.state=0
  1813. Case 5:object.state = 1: object2.state=1
  1814. End Select
  1815. if (ModLevel(nr) > 0) Then
  1816. object.IntensityScale = ModLevel(nr) / 128 : object2.IntensityScale=ModLevel(nr) / 128
  1817. end if
  1818. End Sub
  1819.  
  1820.  
  1821. Sub NFadeLmf(nr, object, object2) ' used for multiple lights
  1822. Select Case FadingLevel(nr)
  1823. Case 4:object.state = 0 : object2.visible=0
  1824. Case 5:object.state = 1: object2.visible=1
  1825. End Select
  1826. End Sub
  1827.  
  1828.  
  1829. Sub NFadeLf(nr, object) ' used for multiple lights
  1830. Select Case FadingLevel(nr)
  1831. Case 4:object.visible=0
  1832. Case 5:object.visible=1
  1833. End Select
  1834. End Sub
  1835.  
  1836.  
  1837.  
  1838. Sub NFadeLmm(nr, object, object2, object3) ' used for multiple lights
  1839. Select Case FadingLevel(nr)
  1840. Case 4:object.state = 0 : object2.state=0 : object3.state=0
  1841. Case 5:object.state = 1: object2.state=1 : object3.state=1
  1842. End Select
  1843. if (ModLevel(nr) > 0) Then
  1844. object.IntensityScale = ModLevel(nr) / 128 : object2.IntensityScale=ModLevel(nr) / 128 : object3.IntensityScale =ModLevel(nr) / 128
  1845. end if
  1846. End Sub
  1847.  
  1848. '//////////////////////////////////////////////////////////////////////
  1849. '// VPX RAMP & PRIMITIVE LIGHTS
  1850. '//////////////////////////////////////////////////////////////////////
  1851.  
  1852. Sub FadeObj(nr, object, a, b, c, d)
  1853. Select Case FadingLevel(nr)
  1854. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  1855. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  1856. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1857. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1858. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1859. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  1860. End Select
  1861. End Sub
  1862.  
  1863. Sub FadeObjm(nr, object, a, b, c, d)
  1864. Select Case FadingLevel(nr)
  1865. Case 4:object.image = b
  1866. Case 5:object.image = a
  1867. Case 9:object.image = c
  1868. Case 13:object.image = d
  1869. End Select
  1870. End Sub
  1871.  
  1872. Sub NFadeObj(nr, object, a, b)
  1873. Select Case FadingLevel(nr)
  1874. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1875. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1876. End Select
  1877. End Sub
  1878.  
  1879.  
  1880. Sub NFadeObjmm(nr, object, object2, a, b, c, d)
  1881. Select Case FadingLevel(nr)
  1882. Case 4:object.image = b:FadingLevel(nr) = 0: object2.image = c:FadingLevel(nr) = 0 'off
  1883. Case 5:object.image = a:FadingLevel(nr) = 1: object2.image = d:FadingLevel(nr) = 1 'on
  1884. End Select
  1885. End Sub
  1886.  
  1887.  
  1888.  
  1889. Sub NFadeObjm(nr, object, a, b)
  1890. Select Case FadingLevel(nr)
  1891. Case 4:object.image = b
  1892. Case 5:object.image = a
  1893. End Select
  1894. End Sub
  1895.  
  1896. '//////////////////////////////////////////////////////////////////////
  1897. '// VPX FLASHER OBJECTS
  1898. '//////////////////////////////////////////////////////////////////////
  1899.  
  1900. Sub SetFlash(nr, stat)
  1901. FadingLevel(nr) = ABS(stat)
  1902. End Sub
  1903.  
  1904. Sub Flash(nr, object)
  1905. Select Case FadingLevel(nr)
  1906. Case 4 'off
  1907. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1908. If FlashLevel(nr) < FlashMin(nr) Then
  1909. FlashLevel(nr) = FlashMin(nr)
  1910. FadingLevel(nr) = 0 'completely off
  1911. End if
  1912. Object.IntensityScale = FlashLevel(nr)
  1913. Case 5 ' on
  1914. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1915. If FlashLevel(nr) > FlashMax(nr) Then
  1916. FlashLevel(nr) = FlashMax(nr)
  1917. FadingLevel(nr) = 1 'completely on
  1918. End if
  1919. Object.IntensityScale = FlashLevel(nr)
  1920. End Select
  1921. End Sub
  1922.  
  1923. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1924. Object.IntensityScale = FlashLevel(nr)
  1925. End Sub
  1926.  
  1927. '//////////////////////////////////////////////////////////////////////
  1928. '// VPX REELS & TEXT
  1929. '//////////////////////////////////////////////////////////////////////
  1930.  
  1931. Sub FadeR(nr, object)
  1932. Select Case FadingLevel(nr)
  1933. Case 4:object.SetValue 1:FadingLevel(nr) = 6 'fading to off...
  1934. Case 5:object.SetValue 0:FadingLevel(nr) = 1 'ON
  1935. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1936. Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1937. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1938. Case 13:object.SetValue 3:FadingLevel(nr) = 0 'Off
  1939. End Select
  1940. End Sub
  1941.  
  1942. Sub FadeRm(nr, object)
  1943. Select Case FadingLevel(nr)
  1944. Case 4:object.SetValue 1
  1945. Case 5:object.SetValue 0
  1946. Case 9:object.SetValue 2
  1947. Case 3:object.SetValue 3
  1948. End Select
  1949. End Sub
  1950.  
  1951. Sub NFadeT(nr, object, message)
  1952. Select Case FadingLevel(nr)
  1953. Case 4:object.Text = "":FadingLevel(nr) = 0
  1954. Case 5:object.Text = message:FadingLevel(nr) = 1
  1955. End Select
  1956. End Sub
  1957.  
  1958. Sub NFadeTm(nr, object, b)
  1959. Select Case FadingLevel(nr)
  1960. Case 4:object.Text = ""
  1961. Case 5:object.Text = message
  1962. End Select
  1963. End Sub
  1964.  
  1965.  
  1966.  
  1967. '//////////////////////////////////////////////////////////////////////
  1968. ' FLIPPER SHADOWS
  1969. '//////////////////////////////////////////////////////////////////////
  1970.  
  1971. Sub GraphicsTimer_Timer()
  1972. batleft.objrotz = LeftFlipper.CurrentAngle + 1
  1973. batleftshadow.objrotz = batleft.objrotz
  1974. batright.objrotz = RightFlipper.CurrentAngle - 1
  1975. batrightshadow.objrotz = batright.objrotz
  1976. End Sub
  1977.  
  1978. '//////////////////////////////////////////////////////////////////////
  1979. ' BALL SHADOWS
  1980. '//////////////////////////////////////////////////////////////////////
  1981.  
  1982.  
  1983. Dim BallShadow
  1984. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  1985.  
  1986. Sub BallShadowUpdate_timer()
  1987. Dim BOT, b
  1988. BOT = GetBalls
  1989. ' hide shadow of deleted balls
  1990. If UBound(BOT)<(tnob-1) Then
  1991. For b = (UBound(BOT) + 1) to (tnob-1)
  1992. BallShadow(b).visible = 0
  1993. Next
  1994. End If
  1995. ' exit the Sub if no balls on the table
  1996. If UBound(BOT) = -1 Then Exit Sub
  1997. If UBound(BOT) > UBound (BallShadow) Then Exit Sub
  1998. ' render the shadow for each ball
  1999. For b = 0 to UBound(BOT)
  2000. if not BOT(b) is Cball then
  2001. If BOT(b).X < 1024/2 Then
  2002. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (1024/2))/7)) + 5
  2003. Else
  2004. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (1024/2))/7)) - 5
  2005. End If
  2006. ballShadow(b).Y = BOT(b).Y + 10
  2007. If BOT(b).Z > 20 Then
  2008. BallShadow(b).visible = 1
  2009. Else
  2010. BallShadow(b).visible = 0
  2011. End If
  2012. end if
  2013. Next
  2014. End Sub
  2015.  
  2016.  
  2017.  
  2018. ' _________ ____ ________ __ _ ________ __ ____ ______
  2019. ' / ____/ | / __ \/_ __/ / / / | | / / _/ / / / / __ )/ ____/
  2020. ' / __/ / /| | / /_/ / / / / /_/ / | | /| / // // / / / / __ / __/
  2021. ' / /___/ ___ |/ _, _/ / / / __ / | |/ |/ // // /___/ /___ / /_/ / /___
  2022. '/_____/_/ |_/_/ |_| /_/ /_/ /_/ |__/|__/___/_____/_____/ /_____/_____/
  2023. '
  2024. ' ____ __ ______ _____
  2025. ' / __ \/ / / / __ \/ ___/
  2026. ' / / / / / / / /_/ /\__ \
  2027. '/ /_/ / /_/ / _, _/___/ /
  2028. '\____/\____/_/ |_|/____/
  2029. '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement