Arngrim

Untitled

Feb 3rd, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 207.17 KB | None | 0 0
  1. ' *********************************************************************
  2. ' ** **
  3. ' ** FUTURE PINBALL **
  4. ' ** Metal Slug V2.0 **
  5. ' ** **
  6. ' ** 2006 Brendan Bailey (Pinwizkid) **
  7. ' ** Update by Dominique Camus (DoCam) **
  8. ' ** **
  9. ' ** Last update: 2.0 - November 1st, 2009 **
  10. ' ** **
  11. ' *********************************************************************
  12.  
  13.  
  14.  
  15. ' *** WHAT'S NEW IN 2.0 BETA ? ***
  16. '
  17. ' - Some textures are now correct (for FP 1.9), using TGA with alpha channel for transparency (instead of BMP), resized to "power of 2".
  18. ' - Reworked kickback with an invisible moveable guide, more reliable. Increased delay to avoid FP bug (ball outside cabinet !).
  19. ' - Updated delay for auto plunger.
  20. ' - Reworked displayed messages, formatted scores (comma as separator), text alignments, etc.
  21. ' - Added feature: table setup. Press & hold both flipper keys during attract mode to enter setup. You can set number of balls
  22. ' (3/5/7/9), ball saver duration (15/30/45/60 sec), POW bonus value, how POW bonus is held or not, Jackpot value and tilt sensitivity.
  23. ' You can reset to default (factory) settings only (as defined by Brendan in v1.0: 5 balls, 15 sec. ball saver, POW bonus = 10,000,
  24. ' Jackpot = 300,000, tilt sensitivity set as medium = 2 warnings), high score table only, or both settings/high scores.
  25. ' - Using left or right flip key during attract advances quickly to the next message.
  26. ' - Added random POW names (got from real Metal Slug Super Vehicle-001) and ranks (when you get a POW bonus).
  27. ' - Unlit missions (1/2/3/4/5/!) at the end of final mission.
  28. ' - Reworked ball saver (normal blink, then fast blink during last 5 seconds), grace delay when hitting outlane trigger.
  29. ' - Fixed ball saver reactivation when the current played ball returns to the plunger lane.
  30. ' - Reworked the "ball saver" for 5-ball multiball during final mission.
  31. ' - Reworked the bonus countdown sequence, character sound moved to other unusued channel.
  32. ' - Boredom effect set to 0 (means disabled) for both backglass and 'HUD' displays.
  33. ' - Added myself (Dominique Camus a.k.a. DoCam) in special thanks section during attract mode (Brendan's request :-) Thanks !
  34. ' - Reworked tilt subroutine.
  35. '
  36. ' *** TODO ***
  37. '
  38. ' - Cleaning VB code, doing script and variables optimizations, adding more comments ASAP.
  39. ' - Timer optimizations (remove unused, multipurpose if possible by using .UserData timer property).
  40. ' - Reworking entirely the display (bad boredom effects, message priorities).
  41. ' - Explosion textures (JPG) conversion to "power of 2" size.
  42.  
  43.  
  44.  
  45. ' *********************************************************************
  46. ' ** **
  47. ' ** VARIABLES & CONSTANTS DECLARATIONS **
  48. ' ** **
  49. ' *********************************************************************
  50.  
  51.  
  52.  
  53.  
  54. Option Explicit
  55. Randomize
  56.  
  57. '---------- UltraDMD Unique Table Color preference -------------
  58. Dim DMDColor, DMDColorSelect, UseFullColor
  59. Dim DMDPosition, DMDPosX, DMDPosY, DMDSize, DMDWidth, DMDHeight
  60.  
  61.  
  62. UseFullColor = "True" ' "True" / "False"
  63. DMDColorSelect = "Red" ' Rightclick on UDMD window to get full list of colours
  64.  
  65. DMDPosition = False ' Use Manual DMD Position, True / False
  66. DMDPosX = 100 ' Position in Decimal
  67. DMDPosY = 40 ' Position in Decimal
  68.  
  69. DMDSize = False ' Use Manual DMD Size, True / False
  70. DMDWidth = 512 ' Width in Decimal
  71. DMDHeight = 128 ' Height in Decimal
  72.  
  73. 'Note open Ultradmd and right click on window to get the various sizes in decimal
  74.  
  75. GetDMDColor
  76. Sub GetDMDColor
  77. Dim WshShell,filecheck,directory
  78. Set WshShell = CreateObject("WScript.Shell")
  79. If DMDSize then
  80. WshShell.RegWrite "HKCU\Software\UltraDMD\w",DMDWidth,"REG_DWORD"
  81. WshShell.RegWrite "HKCU\Software\UltraDMD\h",DMDHeight,"REG_DWORD"
  82. End if
  83. If DMDPosition then
  84. WshShell.RegWrite "HKCU\Software\UltraDMD\x",DMDPosX,"REG_DWORD"
  85. WshShell.RegWrite "HKCU\Software\UltraDMD\y",DMDPosY,"REG_DWORD"
  86. End if
  87. WshShell.RegWrite "HKCU\Software\UltraDMD\fullcolor",UseFullColor,"REG_SZ"
  88. WshShell.RegWrite "HKCU\Software\UltraDMD\color",DMDColorSelect,"REG_SZ"
  89. End Sub
  90.  
  91. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  92. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  93. ' //////////////////////
  94. ' B2S Light Show
  95. ' cause i mean everyone loves a good light show
  96. ' 1 = Background
  97. ' 2 = Tank
  98. ' 3 = Marco
  99. ' 4 = Gun
  100. ' 5 = Logo
  101. ' 6 = All Lights
  102. ' /////////////////////
  103. ' example B2S call
  104. ' startB2S(#)
  105.  
  106. Dim b2sstep
  107. b2sstep = 0
  108. 'b2sflash.enabled = 0
  109. Dim b2satm
  110.  
  111. Sub startB2S(aB2S)
  112. b2sflash.enabled = 1
  113. b2satm = ab2s
  114. End Sub
  115.  
  116. Sub b2sflash_timer
  117. If B2SOn Then
  118. b2sstep = b2sstep + 1
  119. Select Case b2sstep
  120. Case 0
  121. Controller.B2SSetData b2satm, 0
  122. Case 1
  123. Controller.B2SSetData b2satm, 1
  124. Case 2
  125. Controller.B2SSetData b2satm, 0
  126. Case 3
  127. Controller.B2SSetData b2satm, 1
  128. Case 4
  129. Controller.B2SSetData b2satm, 0
  130. Case 5
  131. Controller.B2SSetData b2satm, 1
  132. Case 6
  133. Controller.B2SSetData b2satm, 0
  134. Case 7
  135. Controller.B2SSetData b2satm, 1
  136. Case 8
  137. Controller.B2SSetData b2satm, 0
  138. b2sstep = 0
  139. b2sflash.enabled = 0
  140. End Select
  141. End If
  142. End Sub
  143.  
  144. ' /////////////////
  145. ' END b2s
  146. ' well that was quick, tacos anyone?
  147. ' /////////////////
  148. Const BallSize = 50
  149. Const BallMass = 1.2
  150.  
  151. ExecuteGlobal GetTextFile("FPVPX.vbs")
  152. If Err Then MsgBox "you need the fpvpx.vbs for the proper functioning of the table"
  153.  
  154. ' Load the core.vbs for supporting Subs and functions
  155. LoadCoreFiles
  156.  
  157.  
  158. Sub LoadCoreFiles
  159. On Error Resume Next
  160. ExecuteGlobal GetTextFile("core.vbs")
  161. If Err Then MsgBox "Can't open core.vbs"
  162. ExecuteGlobal GetTextFile("controller.vbs")
  163. If Err Then MsgBox "Can't open controller.vbs"
  164. On Error Goto 0
  165. End Sub
  166.  
  167. Const cGameName = "metalslug"
  168.  
  169.  
  170. if Table1.ShowDT Then
  171. D1.visible = 1
  172. Else
  173. D1.visible = 0
  174. End If
  175.  
  176. ' Define any Constants
  177. Const TableName = "Metal Slug"
  178. Const myVersion = "1.0.0"
  179. Const MaxPlayers = 4 ' from 1 to 4
  180. Const BallSaverTime = 15 ' in seconds
  181. Const MaxMultiplier = 5 ' limit to 5x in this game, both bonus multiplier and playfield multiplier
  182. Const BallsPerGame = 3 ' usually 3 or 5
  183. Const MaxMultiballs = 5 ' max number of balls during multiballs
  184.  
  185. ' Define Global Variables
  186. Dim PlayersPlayingGame
  187. Dim CurrentPlayer
  188. Dim Credits
  189. Dim BonusPoints(4)
  190. Dim BonusHeldPoints(4)
  191. Dim BonusMultiplier(4)
  192. Dim PlayfieldMultiplier(4)
  193. Dim bBonusHeld
  194. Dim BallsRemaining(4)
  195. Dim ExtraBallsAwards(4)
  196. Dim Score(4)
  197. Dim HighScore(10)
  198. Dim HighScoreName(10)
  199. Dim Jackpot(4)
  200. Dim SuperJackpot
  201. Dim Tilt
  202. Dim TiltSensitivity
  203. Dim Tilted
  204. Dim TotalGamesPlayed
  205. Dim mBalls2Eject
  206. Dim SkillshotValue(4)
  207. Dim bAutoPlunger
  208. Dim bInstantInfo
  209. Dim bAttractMode
  210.  
  211. ' Define Game Control Variables
  212. Dim LastSwitchHit
  213. Dim BallsOnPlayfield
  214. Dim BallsInLock(4)
  215. Dim BallsInHole
  216.  
  217. ' Define Game Flags
  218. Dim bFreePlay
  219. Dim bGameInPlay
  220. Dim bOnTheFirstBall
  221. Dim bBallInPlungerLane
  222. Dim bBallSaverActive
  223. Dim bBallSaverReady
  224. Dim bMultiBallMode
  225. Dim bMusicOn
  226. Dim bSkillshotReady
  227. Dim bExtraBallWonThisBall
  228. Dim bJustStarted
  229. Dim bJackpot
  230.  
  231. ' core.vbs variables
  232. Dim plungerIM 'used mostly as an autofire plunger during multiballs
  233.  
  234.  
  235.  
  236.  
  237.  
  238. ' Define global arrays (for table setup).
  239. '
  240. Const stMaxParam = 8 ' Setup: number of parameters.
  241. Dim stParam(8) ' Setup: parameter names.
  242. Dim stNumberValues(8) ' Setup: number of possible value for each parameter.
  243. Dim stValue(8, 6) ' Setup: list of values (for each parameter).
  244. Dim stCurrentValue(8) ' Setup: current selected (or default) value for each parameter.
  245.  
  246.  
  247.  
  248. ' Define global arrays (for POW names and ranks).
  249. '
  250. Dim POWName(100) ' Prisoner names (got from Metal Slug Super Vehicle-001, NeoGeo version).
  251. Dim POWRank(12) ' Prisoner ranks (from PVT to GEN).
  252.  
  253.  
  254.  
  255. ' Initialize POW names array (will be randomly shuffled).
  256. '
  257. POWName(1) = "HYMENEUS" : POWName(2) = "FUKUMINI" : POWName(3) = "MARSYAS" : POWName(4) = "PLUTO" : POWName(5) = "FABRE"
  258. POWName(6) = "JASON" : POWName(7) = "LAOCOON" : POWName(8) = "GARFIELD" : POWName(9) = "HABARA" : POWName(10) = "PRIAPUS"
  259. POWName(11) = "MERCURY" : POWName(12) = "SILVANUS" : POWName(13) = "OEDIPUS" : POWName(14) = "CHRISTIAN" : POWName(15) = "OSBORN"
  260. POWName(16) = "SATYR" : POWName(17) = "HECTOR" : POWName(18) = "THETIS" : POWName(19) = "AKIMOTO" : POWName(20) = "WOEIKOV"
  261. POWName(21) = "FREDERIK" : POWName(22) = "JAMES" : POWName(23) = "PHOEBE" : POWName(24) = "BIGPOWER" : POWName(25) = "SARPEDON"
  262. POWName(26) = "EASTWOOD" : POWName(27) = "URANFF" : POWName(28) = "WITTFOGEL" : POWName(29) = "RICCI" : POWName(30) = "WATSUK"
  263. POWName(31) = "OKUMA" : POWName(32) = "CADMUS" : POWName(33) = "PHILEMON" : POWName(34) = "GANYMEDE" : POWName(35) = "ACHATES"
  264. POWName(36) = "GRIFFIS" : POWName(37) = "KHUNG" : POWName(38) = "ICARUS" : POWName(39) = "MIDAS" : POWName(40) = "ALMAGRO"
  265. POWName(41) = "SANTAYANA" : POWName(42) = "MAUBONT" : POWName(43) = "KARIBE" : POWName(44) = "SUZUKI" : POWName(45) = "BUCHHOLTZ"
  266. POWName(46) = "GOODYEAR" : POWName(47) = "FORTUNA" : POWName(48) = "POLLUX" : POWName(49) = "KARIMEN" : POWName(50) = "APPLETON"
  267. POWName(51) = "POPLIN" : POWName(52) = "BAILEY" : POWName(53) = "KRUPSKAIA" : POWName(54) = "HOWOOD" : POWName(55) = "KENDALL"
  268. POWName(56) = "HANEDA" : POWName(57) = "BIROLINEN" : POWName(58) = "WATTS" : POWName(59) = "PALES" : POWName(60) = "VIGNEAUD"
  269. POWName(61) = "QUEZON" : POWName(62) = "PERSEUS" : POWName(63) = "COOPER" : POWName(64) = "SANDE" : POWName(65) = "ALARCON"
  270. POWName(66) = "DAIMYO" : POWName(67) = "EPIGONI" : POWName(68) = "ALCMANEON" : POWName(69) = "NYANDABA" : POWName(70) = "YOSHII"
  271. POWName(71) = "ANCHISES" : POWName(72) = "SEMIRAMIS" : POWName(73) = "LANDE" : POWName(74) = "SHIINE" : POWName(75) = "COOLEY"
  272. POWName(76) = "ORIKASA" : POWName(77) = "BORODIN" : POWName(78) = "VALCAN" : POWName(79) = "ALDRINGEN" : POWName(80) = "GULIEH"
  273. POWName(81) = "ARCHANGEL" : POWName(82) = "PUSHKIN" : POWName(83) = "TAUNA" : POWName(84) = "MURRAI" : POWName(85) = "NEMESIS"
  274. POWName(86) = "DOROTHY" : POWName(87) = "JACKSON" : POWName(88) = "HOLMES" : POWName(89) = "NYMPHUS" : POWName(90) = "MEDUSA"
  275. POWName(91) = "MORGA" : POWName(92) = "KOYAMA" : POWName(93) = "BONNET" : POWName(94) = "KOUROGI" : POWName(95) = "KIRIYAMA"
  276. POWName(96) = "CENTAUR" : POWName(97) = "VESPUCCI" : POWName(98) = "ARACHNE" : POWName(99) = "PELEUS" : POWName(100) = "INOMATA"
  277.  
  278.  
  279.  
  280. ' Initialize POW ranks array.
  281. '
  282. POWRank(1) = "PVT" : POWRank(2) = "PFC" : POWRank(3) = "CPL" : POWRank(4) = "SGT" : POWRank(5) = "FSG" : POWRank(6) = "SMA"
  283. POWRank(7) = "2LT" : POWRank(8) = "LT" : POWRank(9) = "CPT" : POWRank(10) = "LCL" : POWRank(11) = "COL" : POWRank(12) = "GEN"
  284.  
  285.  
  286.  
  287. ' Define global variables.
  288. '
  289. Dim stCurrentParam ' Setup: current parameter (actually displayed).
  290. Dim Ball ' Ball in play.
  291. 'Dim BallsOnPlayfield ' Number of balls on playfield, including locked balls.
  292. Dim BallsLocked ' Number of balls locked in kickers.
  293. Dim OutLaneSound ' Pointer to sound when a ball hit an inlane/outlane (three possible sounds).
  294. Dim POWBonus ' POW bonus collected during each ball or since begin of game.
  295. Dim POWBonusBall ' POW bonus collected during each ball (always resetted).
  296. Dim POWBonusCount ' POW bonus (used for bonus countdown sequence).
  297. Dim POWNamePtr ' Pointer to POW name array (from 1 to 100).
  298. Dim TempState ' This temporary variable is used for POW lane light rotations (when pressing left or right flipper key).
  299. Dim WeaponTargetsMove ' Pointer to move WEAPON targets while playing missions 2 and 5.
  300. Dim SlugSound ' Pointer to next sound to be played on SLUG target hit.
  301. Dim RemainingJets ' Remaining jets, while playing mission 3.
  302. Dim RemainingPOW ' Remaining POW while playing mission 4.
  303. Dim RemainingAllen ' Remaining Allen's energy, during mission 5.
  304. Dim CurrentWeapon ' Pointer to current weapon.
  305. Dim Mission ' Current (or next) mission.
  306. Dim NextMessage ' Pointer to next message to be displayed.
  307.  
  308.  
  309.  
  310. ' Define game flags - also known as boolean (TRUE/FALSE) variables.
  311. '
  312. Dim bPlayingBall ' TRUE while the player is playing ball (useful for display)
  313. Dim bLeftInLaneIsLit ' Left inlane light (TRUE means lit).
  314. Dim bRightInLaneIsLit ' Right inlane light (TRUE means lit).
  315. Dim bBallSaverIsActive ' TRUE if the ball saver is active.
  316. Dim bCanActivateBallSaver ' TRUE if ball saver can be activated (only at the begin of each ball)
  317. Dim bExtraBallAward ' TRUE if an extra ball is awarded.
  318. Dim bKickbackIsLit ' Kickback light (TRUE means lit).
  319. 'Dim bBallInPlungerLane ' TRUE if a ball is in the plunger lane.
  320. Dim bBallOnLeftOutLaneTrigger ' TRUE while a ball press the outlane trigger.
  321. Dim bLockIsLit ' TRUE if a ball can be locked in kicker.
  322. Dim bBallInKicker1 ' TRUE if a ball is in kicker 1 (left side kicker).
  323. Dim bBallLockedInKicker1 ' TRUE if a ball is locked in kicker 1 (left side kicker).
  324. Dim bBallInKicker2 ' TRUE if a ball is in kicker 2 (right side kicker).
  325. Dim bBallLockedInKicker2 ' TRUE if a ball is locked in kicker 2 (right side kicker).
  326. Dim bBallInKicker3 ' TRUE if a ball is in kicker 3 (center kicker, near bumpers).
  327. Dim bBallLockedInKicker3 ' TRUE if a ball is locked in kicker 3 (center kicker, near bumpers).
  328. Dim bBallInKicker4 ' TRUE if a ball is in kicker 4 (top left kicker).
  329. Dim bBallLockedInKicker4 ' TRUE if a ball is locked in kicker 4 (top left kicker).
  330. 'Dim bMultiBallMode ' Is a multiball mode active ?
  331. Dim bJackpotIsLit ' TRUE if JACKPOT is lit.
  332. Dim bJackpotScored ' TRUE if JACKPOT already scored.
  333. Dim bW1TargetIsDown ' WEAPON drop targets states (used to fix after mission).
  334. Dim bW2TargetIsDown
  335. Dim bW3TargetIsDown
  336. Dim bW4TargetIsDown
  337. Dim bW5TargetIsDown
  338. Dim bW6TargetIsDown
  339. Dim bWallIsDown ' TRUE when all WEAPON drop targets (wall) is down.
  340. Dim bMissionIsLit ' TRUE if the next mission can be started.
  341. Dim bFinalMissionIsReady ' TRUE if the final mission is ready.
  342. Dim bPlayingMission ' TRUE when a mission is playing.
  343. Dim bPlayingMission1 ' TRUE while playing mission 1 (or scoring mission 1 during final mission).
  344. Dim bPlayingMission2 ' TRUE while playing mission 2 (weapon targets practice).
  345. Dim bPlayingMission3 ' TRUE while playing mission 3 (bumpers super jets).
  346. Dim bPlayingMission4 ' TRUE while playing mission 4 (POW).
  347. Dim bPlayingMission5 ' TRUE while playing mission 5 (Defeat Allen O'Neill).
  348. Dim bPlayingFinalMission ' TRUE while playing final mission.
  349. Dim bMissionSuspended ' TRUE if the current mission is suspended.
  350. Dim bInterruptedDisplay ' TRUE when display is interrupted (ie: cannot be updated).
  351. Dim bCanDisplayMessage ' TRUE allows ShowNextMessage() process.
  352. Dim bEnteringAHighScore ' TRUE while the player is entering their name into the high score table.
  353. Dim bAllowEnterSetup ' TRUE if setup mode is allowed (during attract mode)
  354. Dim bRunningSetup ' TRUE during setup.
  355. Dim bLeftFlipPressed ' Used to entering setup mode (TRUE while left flipper key is pressed during game over mode).
  356. Dim bRightFlipPressed ' Also used to entering setup mode (TRUE while right flipper key is pressed during game over mode).
  357.  
  358. Dim nvR1, nvR2, nvR3, nvR4, nvR5
  359. Dim nvS1, nvS2, nvS3, nvS4, nvS5
  360.  
  361. ' *********************************************************************
  362. ' Visual Pinball Defined Script Events
  363. ' *********************************************************************
  364.  
  365. Sub Table1_Init()
  366. LoadEM
  367. Dim i
  368. Randomize
  369.  
  370.  
  371. 'Impulse Plunger as autoplunger
  372. Const IMPowerSetting = 50 ' Plunger Power
  373. Const IMTime = 1.1 ' Time in seconds for Full Plunge
  374. Set plungerIM = New cvpmImpulseP
  375. With plungerIM
  376. .InitImpulseP swplunger, IMPowerSetting, IMTime
  377. .Random 1.5
  378. .InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_solenoid", DOFContactors)
  379. .CreateEvents "plungerIM"
  380. End With
  381.  
  382.  
  383. DisplayB2SText " GAME OVER "
  384.  
  385. Kicker5.CreateBall
  386. Kicker5.kick 0, 2
  387.  
  388. ' Display "GAME OVER" message.
  389. D1.Text = " GAME OVER "
  390.  
  391. FixTargetTimer.Enabled = TRUE
  392.  
  393. 'StopSound Song:Song = ""
  394. PlaySound "mu_MSmissioncomplete"
  395.  
  396. ' Misc. VP table objects Initialisation, droptargets, animations...
  397. VPObjects_Init
  398.  
  399. ' load saved values, highscore, names, jackpot
  400. Loadhs
  401.  
  402. ' Initalise the DMD display
  403. DMD_Init
  404.  
  405. ' freeplay or coins
  406. bFreePlay = False 'we dont want coins
  407.  
  408. ' Init main variables and any other flags
  409. bAttractMode = False
  410. bOnTheFirstBall = False
  411. bBallInPlungerLane = False
  412. bBallSaverActive = False
  413. bBallSaverReady = False
  414. bMultiBallMode = False
  415. bGameInPlay = False
  416. bAutoPlunger = False
  417. bMusicOn = True
  418. BallsOnPlayfield = 0
  419. Tilt = 0
  420. TiltSensitivity = 6
  421. Tilted = False
  422. bBonusHeld = False
  423. bJustStarted = True
  424. bJackpot = False
  425. bInstantInfo = False
  426. ' set any lights for the attract mode
  427. GiOff
  428. EndAttractMode
  429. 'StartAttractMode
  430. vpmtimer.addtimer 8000, "EnterAttractMode '"
  431. ' FuturePinball_BeginPlay
  432.  
  433. For i = 1 To MaxPlayers
  434. Score(i) = 0
  435. BonusPoints(i) = 0
  436. BonusHeldPoints(i) = 0
  437. BonusMultiplier(i) = 1
  438. BallsRemaining(i) = BallsPerGame
  439. ExtraBallsAwards(i) = 0
  440. Next
  441.  
  442. If Credits > 0 Then DOF 136, DOFOn
  443.  
  444. End Sub
  445.  
  446.  
  447. ' *********************************************************************
  448. ' ** **
  449. ' ** FUTURE PINBALL DEFINED SCRIPT EVENTS **
  450. ' ** **
  451. ' *********************************************************************
  452.  
  453.  
  454.  
  455. ' The subroutine is called immediately the game engine is ready to start processing the script.
  456. '
  457. ' *** DOCAM OPTIMIZED ***
  458. '
  459. Sub FuturePinball_BeginPlay()
  460. ' Randomize
  461. ' Check if fpRAM is valid (regardling 'signature').
  462. ' If nvS1 <> "METALSLUGv2" Then
  463. ' If the 'signature' doesn't match, reset to default (factory) table settings.
  464. ' SetupMenuResetSettings()
  465. ' Write the valid 'signature' to fpRAM.
  466. ' nvS1 = "METALSLUGv2"
  467. ' End If
  468. ' Set the tilt sensitivity.
  469. ' Select Case nvR5
  470. ' Case 1: nvTiltWarnings = 9
  471. ' Case 2: nvTiltWarnings = 4
  472. ' Case 3: nvTiltWarnings = 2
  473. ' Case 4: nvTiltWarnings = 0
  474. ' End Select
  475. ' Display "GAME OVER" message.
  476. ' D1.Text = " GAME OVER "
  477. ' D2.Text = " GAME OVER "
  478. ' Create the captive ball.
  479. 'Kicker5.CreateCaptiveBall()
  480. 'Kicker5.SolenoidPulse(100)
  481. ' Give a small delay before raising C1/C2/C3 drop targets.
  482. ' FixTargetTimer.Enabled = TRUE
  483. ' Play default music.
  484. ' PlayMusic 1, "MSmissioncomplete", FALSE
  485. ' Force player to put quarter (coin key) in the machine.
  486. ' nvCredits = 0
  487. ' Reset player's score to 0.
  488. ' nvScore(1) = 0
  489. ' Initialize any other variables and flags.
  490. ' bEnteringAHighScore = FALSE
  491. ' BallsOnPlayfield = 0
  492. ' Initialize setup mode flags.
  493. ' bAllowEnterSetup = FALSE
  494. ' bRunningSetup = FALSE
  495. ' bLeftFlipPressed = FALSE
  496. ' bRightFlipPressed = FALSE
  497. ' Set the GAME OVER state (attract mode).
  498. ' EndOfGame()
  499. End Sub
  500.  
  501.  
  502.  
  503. ' This subroutine is called when the user has exited the game by pressing Escape key (Metal Slug table doesn't use this subroutine).
  504. '
  505. ' *** DOCAM OPTIMIZED ***
  506. '
  507. 'Sub FuturePinball_EndPlay()
  508. 'End Sub
  509.  
  510.  
  511.  
  512. ' The user has pressed a key.
  513. '
  514. ' *** DOCAM MUST BE CHECKED ***
  515. '
  516.  
  517.  
  518.  
  519. '******
  520. ' Keys
  521. '******
  522.  
  523.  
  524. Sub Table1_KeyDown(ByVal Keycode)
  525. If Keycode = AddCreditKey Then
  526. Credits = Credits + 1
  527. DOF 136, DOFOn
  528. If(Tilted = False) Then
  529. PlaySound "fx_coin"
  530. DisplayB2SText " CREDITS " &credits
  531. D1.Text = " CREDITS " &credits
  532. PlaySound "go"
  533. If NOT bGameInPlay Then ShowTableInfo:
  534. End If
  535. End If
  536.  
  537. If keycode = PlungerKey Then
  538. if bBallInPlungerLane Then
  539. DOF 125, DOFPulse
  540. DOF 114, DOFPulse
  541. end if
  542. PlungerIM.AutoFire
  543. ' If allowed, activate the ball saver (during 15, 30, 45 or 60 seconds, regardling table setup).
  544. If bCanActivateBallSaver Then
  545. bCanActivateBallSaver = FALSE
  546. bBallSaverIsActive = TRUE
  547. BallSaverClockTimer.Uservalue = 1
  548. BallSaverClockTimer.enabled = TRUE
  549. ShootAgainLight.BlinkInterval = 150
  550. ShootAgainLight.State = BulbBlink
  551. End If
  552. End If
  553.  
  554. If bGameInPlay AND NOT Tilted Then
  555. If keycode = LeftTiltKey Then Nudge 90, 6:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt
  556. If keycode = RightTiltKey Then Nudge 270, 6:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt
  557. If keycode = CenterTiltKey Then Nudge 0, 7:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt
  558.  
  559. If keycode = LeftFlipperKey Then SolLFlipper 1
  560. If keycode = RightFlipperKey Then SolRFlipper 1
  561.  
  562. If keycode = StartGameKey Then
  563. If((PlayersPlayingGame < MaxPlayers) AND(bOnTheFirstBall = True) ) Then
  564.  
  565. If(bFreePlay = True) Then
  566. PlayersPlayingGame = PlayersPlayingGame + 1
  567. TotalGamesPlayed = TotalGamesPlayed + 1
  568. Else
  569. If(Credits > 0) then
  570. PlayersPlayingGame = PlayersPlayingGame + 1
  571. TotalGamesPlayed = TotalGamesPlayed + 1
  572. Credits = Credits - 1
  573. If Credits < 1 Then DOF 136, DOFOff
  574. Else
  575. ' Not Enough Credits to start a game.
  576.  
  577. 'DMD CenterLine(0, "CREDITS " & Credits), CenterLine(1, "INSERT COIN"), 0, eNone, eBlink, eNone, 500, True, ""
  578. End If
  579. End If
  580. End If
  581. End If
  582. Else ' If (GameInPlay)
  583.  
  584. If keycode = StartGameKey Then
  585. If(bFreePlay = True) Then
  586. If(BallsOnPlayfield = 0) Then
  587. ResetForNewGame()
  588. End If
  589. Else
  590. If(Credits > 0) Then
  591. If(BallsOnPlayfield = 0) Then
  592. Credits = Credits - 1
  593. If Credits < 1 Then DOF 136, DOFOff
  594. ResetForNewGame()
  595. End If
  596. Else
  597. ' Not Enough Credits to start a game.
  598. D1.Text = " CREDITS " &credits&" INSERT COIN"
  599. DisplayB2SText " CREDITS " &credits &" INSERT COIN "
  600. End If
  601. End If
  602. End If
  603. End If ' If (GameInPlay)
  604.  
  605. If hsbModeActive Then EnterHighScoreKey(keycode)
  606.  
  607. ' Table specific
  608. End Sub
  609.  
  610. Sub Table1_KeyUp(ByVal keycode)
  611. If bGameInPLay AND NOT Tilted Then
  612. If keycode = LeftFlipperKey Then SolLFlipper 0
  613. If keycode = RightFlipperKey Then SolRFlipper 0
  614. End If
  615. End Sub
  616.  
  617.  
  618. Sub InstantInfoTimer_Timer
  619. InstantInfoTimer.Enabled = False
  620. bInstantInfo = True
  621. DMDFlush
  622. UltraDMDTimer.Enabled = 1
  623. End Sub
  624.  
  625. Sub InstantInfo
  626. D1.Text = " POW " &POWBonusCount
  627. ' Jackpot = 1000000 + Round(Score(CurrentPlayer) / 10, 0)
  628. ' DMD "black.jpg", "", "INSTANT INFO", 500
  629. ' DMD "black.jpg", "JACKPOT", Jackpot, 800
  630. ' DMD "black.jpg", "LEVEL", Level(CurrentPlayer), 800
  631. ' DMD "black.jpg", "BONUS MULT", BonusMultiplier(CurrentPlayer), 800
  632. ' DMD "black.jpg", "ORBIT BONUS", OrbitHits, 800
  633. ' DMD "black.jpg", "LANE BONUS", LaneBonus, 800
  634. ' DMD "black.jpg", "TARGET BONUS", TargetBonus, 800
  635. ' DMD "black.jpg", "RAMP BONUS", RampBonus, 800
  636. ' DMD "black.jpg", "MONSTERS KILLED", Monsters(CurrentPlayer), 800
  637. End Sub
  638.  
  639. '*************
  640. ' Pause Table
  641. '*************
  642.  
  643. Sub table1_Paused
  644. End Sub
  645.  
  646. Sub table1_unPaused
  647. End Sub
  648.  
  649. Sub table1_Exit
  650. Savehs
  651. End Sub
  652.  
  653. '********************
  654. ' Flippers
  655. '********************
  656.  
  657. Sub SolLFlipper(Enabled)
  658. startB2S(4)
  659. If Enabled Then
  660. PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, 1, -0.05, 0.15
  661. LeftFlipper.RotateToEnd
  662. RotateLaneLightsLeft
  663.  
  664. Else
  665. PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, -0.05, 0.15
  666. LeftFlipper.RotateToStart
  667. End If
  668. End Sub
  669.  
  670. Sub SolRFlipper(Enabled)
  671. startB2S(4)
  672. If Enabled Then
  673. PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, 1, 0.05, 0.15
  674. RightFlipper.RotateToEnd
  675. RightFlipper1.RotateToEnd
  676. RotateLaneLightsRight
  677.  
  678. Else
  679. PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, 0.05, 0.15
  680. RightFlipper.RotateToStart
  681. RightFlipper1.RotateToStart
  682. End If
  683. End Sub
  684.  
  685. ' flippers hit Sound
  686.  
  687. Sub LeftFlipper_Collide(parm)
  688. PlaySound "fx_rubber_flipper", 0, parm / 10, -0.05, 0.25
  689. End Sub
  690.  
  691. Sub RightFlipper_Collide(parm)
  692. PlaySound "fx_rubber_flipper", 0, parm / 10, 0.05, 0.25
  693. End Sub
  694.  
  695. Sub RotateLaneLightsLeft
  696. Dim TempState
  697. TempState = POWLaneLight1.State
  698. POWLaneLight1.State = POWLaneLight2.State
  699. POWLaneLight2.State = POWLaneLight3.State
  700. POWLaneLight3.State = TempState
  701. End Sub
  702.  
  703. Sub RotateLaneLightsRight
  704. Dim TempState
  705. TempState = POWLaneLight3.State
  706. POWLaneLight3.State = POWLaneLight2.State
  707. POWLaneLight2.State = POWLaneLight1.State
  708. POWLaneLight1.State = TempState
  709. End Sub
  710.  
  711. '*********
  712. ' TILT
  713. '*********
  714.  
  715. 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round
  716.  
  717. Sub CheckTilt 'Called when table is nudged
  718. Tilt = Tilt + TiltSensitivity 'Add to tilt count
  719. TiltDecreaseTimer.Enabled = True
  720. If(Tilt> TiltSensitivity) AND(Tilt <15) Then 'show a warning
  721. 'DMDFlush
  722. 'DMD "", " ", "CAREFUL!", 800
  723. DisplayB2SText "CAREFUL!"
  724. End if
  725. If Tilt> 15 Then 'If more that 15 then TILT the table
  726. Tilted = True
  727. 'display Tilt
  728. 'DMDFlush
  729. 'DisplayB2SText "TILT!"
  730. DMD "", " ", "TILT!", 99999
  731. DisableTable True
  732. TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained
  733. End If
  734. End Sub
  735.  
  736. Sub TiltDecreaseTimer_Timer
  737. ' DecreaseTilt
  738. If Tilt> 0 Then
  739. Tilt = Tilt - 0.1
  740. Else
  741. TiltDecreaseTimer.Enabled = False
  742. End If
  743. End Sub
  744.  
  745. Sub DisableTable(Enabled)
  746. If Enabled Then
  747. 'turn off GI and turn off all the lights
  748. GiOff
  749. LightSeqTilt.Play SeqAllOff
  750. 'Disable slings, bumpers etc
  751. LeftFlipper.RotateToStart
  752. RightFlipper.RotateToStart
  753. 'Bumper1.Force = 0
  754.  
  755. LeftSlingshotRubber.Disabled = 1
  756. RightSlingshotRubber.Disabled = 1
  757. Else
  758. 'turn back on GI and the lights
  759. GiOn
  760. LightSeqTilt.StopPlay
  761. 'Bumper1.Force = 6
  762. LeftSlingshotRubber.Disabled = 0
  763. RightSlingshotRubber.Disabled = 0
  764. 'clean up the buffer display
  765. DMDFlush
  766. End If
  767. End Sub
  768.  
  769. Sub TiltRecoveryTimer_Timer()
  770. ' if all the balls have been drained then..
  771. If(BallsOnPlayfield = 0) Then
  772. ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted)
  773. EndOfBall()
  774. TiltRecoveryTimer.Enabled = False
  775. End If
  776. ' else retry (checks again in another second or so)
  777. End Sub
  778.  
  779. '********************
  780. ' Music as wav sounds
  781. '********************
  782.  
  783. Dim Song
  784. Song = ""
  785.  
  786. Sub PlaySong(name)
  787. If bMusicOn Then
  788. If Song <> name Then
  789. StopSound Song
  790. Song = name
  791. If Song = "mu_end" Then
  792. PlaySound Song, 0, 0.1 'this last number is the volume, from 0 to 1
  793. Else
  794. PlaySound Song, -1, 0.1 'this last number is the volume, from 0 to 1
  795. End If
  796. End If
  797. End If
  798. End Sub
  799.  
  800. '**********************
  801. ' GI effects
  802. ' independent routine
  803. ' it turns on the gi
  804. ' when there is a ball
  805. ' in play
  806. '**********************
  807.  
  808. Dim OldGiState
  809. OldGiState = -1 'start witht the Gi off
  810.  
  811. Sub ChangeGi(col) 'changes the gi color
  812. Dim bulb
  813. For each bulb in aGILights
  814. SetLightColor bulb, col, -1
  815. Next
  816. End Sub
  817.  
  818. Sub GIUpdateTimer_Timer
  819. Dim tmp, obj
  820. tmp = Getballs
  821. If UBound(tmp) <> OldGiState Then
  822. OldGiState = Ubound(tmp)
  823. If UBound(tmp) = 0 Then 'we have 4 captive balls on the table (-1 means no balls, 0 is the first ball, 1 is the second..)
  824. GiOff ' turn off the gi if no active balls on the table, we could also have used the variable ballsonplayfield.
  825. Else
  826. Gion
  827. End If
  828. End If
  829. End Sub
  830.  
  831. Sub GiOn
  832. DOF 126, DOFOn
  833. Dim bulb
  834. For each bulb in aGiLights
  835. bulb.State = 1
  836. Next
  837. Table1.ColorGradeImage = "ColorGradeLUT256x16_ConSat"
  838. End Sub
  839.  
  840. Sub GiOff
  841. DOF 126, DOFOff
  842. Dim bulb
  843. For each bulb in aGiLights
  844. bulb.State = 0
  845. Next
  846. Table1.ColorGradeImage = "ColorGradeLUT256x16_ConSatDark"
  847. End Sub
  848.  
  849.  
  850.  
  851. ' GI & light sequence effects
  852.  
  853. Sub GiEffect(n)
  854. Dim ii
  855. Select Case n
  856. Case 0 'all off
  857. LightSeqGi.Play SeqAlloff
  858. Case 1 'all blink
  859. LightSeqGi.UpdateInterval = 10
  860. LightSeqGi.Play SeqBlinking, , 10, 10
  861. Case 2 'random
  862. LightSeqGi.UpdateInterval = 10
  863. LightSeqGi.Play SeqRandom, 50, , 1000
  864. Case 3 'upon
  865. LightSeqGi.UpdateInterval = 4
  866. LightSeqGi.Play SeqUpOn, 5, 1
  867. Case 4 ' left-right-left
  868. LightSeqGi.UpdateInterval = 5
  869. LightSeqGi.Play SeqLeftOn, 10, 1
  870. LightSeqGi.UpdateInterval = 5
  871. LightSeqGi.Play SeqRightOn, 10, 1
  872. End Select
  873. End Sub
  874.  
  875. Sub LightEffect(n)
  876. Select Case n
  877. Case 0 ' all off
  878. LightSeqInserts.Play SeqAlloff
  879. Case 1 'all blink
  880. LightSeqInserts.UpdateInterval = 10
  881. LightSeqInserts.Play SeqBlinking, , 10, 10
  882. Case 2 'random
  883. LightSeqInserts.UpdateInterval = 10
  884. LightSeqInserts.Play SeqRandom, 50, , 1000
  885. Case 3 'upon
  886. LightSeqInserts.UpdateInterval = 4
  887. LightSeqInserts.Play SeqUpOn, 10, 1
  888. Case 4 ' left-right-left
  889. LightSeqInserts.UpdateInterval = 5
  890. LightSeqInserts.Play SeqLeftOn, 10, 1
  891. LightSeqInserts.UpdateInterval = 5
  892. LightSeqInserts.Play SeqRightOn, 10, 1
  893. End Select
  894. End Sub
  895.  
  896. ' Flasher Effects using lights
  897.  
  898. Dim FEStep, FEffect
  899. FEStep = 0
  900. FEffect = 0
  901.  
  902. Sub FlashEffect(n)
  903. Dim ii
  904. Select case n
  905. Case 0 ' all off
  906. LightSeqFlasher.Play SeqAlloff
  907. Case 1 'all blink
  908. LightSeqFlasher.UpdateInterval = 10
  909. LightSeqFlasher.Play SeqBlinking, , 10, 10
  910. Case 2 'random
  911. LightSeqFlasher.UpdateInterval = 10
  912. LightSeqFlasher.Play SeqRandom, 50, , 1000
  913. Case 3 'upon
  914. LightSeqFlasher.UpdateInterval = 4
  915. LightSeqFlasher.Play SeqUpOn, 10, 1
  916. Case 4 ' left-right-left
  917. LightSeqFlasher.UpdateInterval = 5
  918. LightSeqFlasher.Play SeqLeftOn, 10, 1
  919. LightSeqFlasher.UpdateInterval = 5
  920. LightSeqFlasher.Play SeqRightOn, 10, 1
  921. End Select
  922. End Sub
  923.  
  924. ' *********************************************************************
  925. ' Supporting Ball & Sound Functions
  926. ' *********************************************************************
  927.  
  928. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  929. Vol = Csng(BallVel(ball) ^2 / 1500)
  930. End Function
  931.  
  932. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  933. Dim tmp
  934. tmp = ball.x * 2 / table1.width-1
  935. If tmp> 0 Then
  936. Pan = Csng(tmp ^10)
  937. Else
  938. Pan = Csng(-((- tmp) ^10) )
  939. End If
  940. End Function
  941.  
  942. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  943. Pitch = BallVel(ball) * 20
  944. End Function
  945.  
  946. Function BallVel(ball) 'Calculates the ball speed
  947. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  948. End Function
  949.  
  950. '*****************************************
  951. ' JP's VP10 Rolling Sounds
  952. '*****************************************
  953.  
  954. Const tnob = 20 ' total number of balls
  955. Const lob = 1 'number of locked balls
  956. ReDim rolling(tnob)
  957. InitRolling
  958.  
  959. Sub InitRolling
  960. Dim i
  961. For i = 0 to tnob
  962. rolling(i) = False
  963. Next
  964. End Sub
  965.  
  966. Sub RollingUpdate()
  967. Dim BOT, b, ballpitch
  968. BOT = GetBalls
  969.  
  970. ' stop the sound of deleted balls
  971. For b = UBound(BOT) + 1 to tnob
  972. rolling(b) = False
  973. StopSound("fx_ballrolling" & b)
  974. Next
  975.  
  976. ' exit the sub if no balls on the table
  977. If UBound(BOT) = -1 Then Exit Sub 'there no extra balls on this table
  978.  
  979. ' play the rolling sound for each ball
  980. For b = lob to UBound(BOT)
  981. If BallVel(BOT(b) )> 1 Then
  982. If BOT(b).z <30 Then
  983. ballpitch = Pitch(BOT(b) )
  984. Else
  985. ballpitch = Pitch(BOT(b) ) * 50
  986. End If
  987. rolling(b) = True
  988. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, ballpitch, 1, 0
  989. Else
  990. If rolling(b) = True Then
  991. StopSound("fx_ballrolling" & b)
  992. rolling(b) = False
  993. End If
  994. End If
  995. Next
  996. End Sub
  997.  
  998. '**********************
  999. ' Ball Collision Sound
  1000. '**********************
  1001.  
  1002. Sub OnBallBallCollision(ball1, ball2, velocity)
  1003. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1004. End Sub
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. '*********** BALL SHADOW *********************************
  1011. Dim BallShadow
  1012. BallShadow = Array (BallShadow1, BallShadow2, BallShadow3, BallShadow4, BallShadow5, BallShadow6)
  1013.  
  1014. Sub BallShadowUpdate()
  1015. Dim BOT, b
  1016. BOT = GetBalls
  1017. ' render the shadow for each ball
  1018. For b = 0 to Ubound(BOT)
  1019. If BOT(b).X < Table1.Width/2 Then
  1020. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/10)) + 10
  1021. Else
  1022. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/10)) - 10
  1023. End If
  1024. ballShadow(b).Y = BOT(b).Y + 15
  1025. If BOT(b).Z > 20 Then
  1026. BallShadow(b).visible = 1
  1027. Else
  1028. BallShadow(b).visible = 0
  1029. End If
  1030. Next
  1031. End Sub
  1032.  
  1033.  
  1034.  
  1035. '******************************
  1036. ' Diverse Collection Hit Sounds
  1037. '******************************
  1038.  
  1039. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1040. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber_band", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1041. Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1042. Sub aRubber_Pins_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1043. Sub aPlastics_Hit(idx):PlaySound "fx_plastichit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1044. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1045. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  1046.  
  1047.  
  1048.  
  1049. ' *********************************************************************
  1050. ' User Defined Script Events
  1051. ' *********************************************************************
  1052.  
  1053. ' Initialise the Table for a new Game
  1054. '
  1055.  
  1056. Sub StopGameOverSong
  1057. PlaySong "mu_end"
  1058. StopSound Song:Song = "":
  1059. Stopsound "MSgameover"
  1060. Stopsound "MShighscore"
  1061. End Sub
  1062.  
  1063. Sub ResetForNewGame()
  1064. Dim i
  1065.  
  1066. 'D2.text = "juego nuevo"
  1067.  
  1068. EndMultiball()
  1069.  
  1070. LeftSlingshotRubber.Disabled = 0
  1071. RightSlingshotRubber.Disabled = 0
  1072. Bumper1.Force = 7
  1073. Bumper2.Force = 7
  1074. Bumper3.Force = 7
  1075.  
  1076. bGameInPLay = True
  1077. StopSound Song:Song = "":
  1078. PlaySong "mu_Metalslug3"
  1079.  
  1080. DisplayB2SText " METAL SLUG "
  1081. D1.Text = " METAL SLUG "
  1082.  
  1083. EndAttractMode()
  1084. Ball = 0
  1085.  
  1086. GiOn
  1087.  
  1088. TotalGamesPlayed = TotalGamesPlayed + 1
  1089. CurrentPlayer = 1
  1090. PlayersPlayingGame = 1
  1091. bOnTheFirstBall = True
  1092. For i = 1 To MaxPlayers
  1093. Score(i) = 0
  1094. BonusPoints(i) = 0
  1095. BonusHeldPoints(i) = 0
  1096. BonusMultiplier(i) = 1
  1097. BallsRemaining(i) = BallsPerGame
  1098. ExtraBallsAwards(i) = 0
  1099. Next
  1100.  
  1101. DisplayScore
  1102.  
  1103. ' initialise any other flags
  1104. Tilt = 0
  1105.  
  1106.  
  1107. ' you may wish to start some music, play a sound, do whatever at this point
  1108. FirstBallDelayTimer.enabled = 1
  1109. ' Pick randomly the first POW name (between 1 to 100 inclusive).
  1110. POWNamePtr = Int(Rnd(1) * 100) + 1
  1111.  
  1112. End Sub
  1113.  
  1114. ' This is used to delay the start of a game to allow any attract sequence to
  1115. ' complete. When it expires it creates a ball for the player to start playing with
  1116.  
  1117. Sub FirstBall
  1118. ' reset the table for a new ball
  1119. ResetForNewPlayerBall()
  1120. ' create a new ball in the shooters lane
  1121. CreateNewBall()
  1122. End Sub
  1123.  
  1124. ' (Re-)Initialise the Table for a new ball (either a new ball after the player has
  1125. ' lost one or we have moved onto the next player (if multiple are playing))
  1126.  
  1127. Sub ResetForNewPlayerBall()
  1128. ' make sure the correct display is upto date
  1129. AddScore 0
  1130.  
  1131. bCanActivateBallSaver = TRUE
  1132.  
  1133.  
  1134. bPlayingBall = TRUE
  1135.  
  1136.  
  1137. ' set the current players bonus multiplier back down to 1X
  1138. 'SetBonusMultiplier 1
  1139.  
  1140. ' reset any drop targets, lights, game Mode etc..
  1141.  
  1142. BonusPoints(CurrentPlayer) = 0
  1143. bBonusHeld = False
  1144. bExtraBallWonThisBall = False
  1145.  
  1146. 'Reset any table specific
  1147.  
  1148.  
  1149. 'This is a new ball, so activate the ballsaver
  1150. bBallSaverReady = True
  1151.  
  1152. 'and the skillshot
  1153. bSkillShotReady = True
  1154.  
  1155. 'Change the music ?
  1156. End Sub
  1157.  
  1158. ' Create a new ball on the Playfield
  1159.  
  1160. Sub CreateNewBall()
  1161. ' create a ball in the plunger lane kicker.
  1162. BallRelease.CreateSizedball BallSize / 2
  1163.  
  1164. ' There is a (or another) ball on the playfield
  1165. BallsOnPlayfield = BallsOnPlayfield + 1
  1166.  
  1167. ' kick it out..
  1168. PlaySound SoundFXDOF("fx_Ballrel", 121, DOFPulse, DOFContactors), 0, 1, 0.1, 0.1
  1169. BallRelease.Kick 95, 4
  1170. DOF 109, DOFPulse
  1171.  
  1172. 'PlungerKickerSolenoidPulse()
  1173.  
  1174. ' if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations)
  1175. ' set the bAutoPlunger flag to kick the ball in play automatically
  1176. If BallsOnPlayfield> 1 Then
  1177. DOF 129, DOFPulse
  1178. bMultiBallMode = True
  1179. bAutoPlunger = True
  1180. End If
  1181. End Sub
  1182.  
  1183. ' Add extra balls to the table with autoplunger
  1184. ' Use it as AddMultiball 4 to add 4 extra balls to the table
  1185.  
  1186. Sub AddMultiball(nballs)
  1187. mBalls2Eject = mBalls2Eject + nballs
  1188. CreateMultiballTimer.Enabled = True
  1189. 'and eject the first ball
  1190. CreateMultiballTimer_Timer
  1191. End Sub
  1192.  
  1193. ' Eject the ball after the delay, AddMultiballDelay
  1194. Sub CreateMultiballTimer_Timer()
  1195. ' wait if there is a ball in the plunger lane
  1196. If bBallInPlungerLane Then
  1197. Exit Sub
  1198. Else
  1199. If BallsOnPlayfield <MaxMultiballs Then
  1200. CreateNewBall()
  1201. mBalls2Eject = mBalls2Eject -1
  1202. If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer
  1203. CreateMultiballTimer.Enabled = False
  1204. End If
  1205. Else 'the max number of multiballs is reached, so stop the timer
  1206. mBalls2Eject = 0
  1207. CreateMultiballTimer.Enabled = False
  1208. End If
  1209. End If
  1210. End Sub
  1211.  
  1212. ' The Player has lost his ball (there are no more balls on the playfield).
  1213. ' Handle any bonus points awarded
  1214.  
  1215. Sub EndOfBall()
  1216. Playsound "Marcodie"
  1217. Playsound "explode3"
  1218. FlashOff()
  1219. ' Assume the player isn't playing a ball.
  1220. bPlayingBall = FALSE
  1221. ' D1.QueueText " ", seScrollUpOver, 10
  1222. ' D2.QueueText " ", seScrollUpOver, 10
  1223. If bPlayingMission Then EndMission()
  1224. If Not(Tilted) Then
  1225. ' D1.FlushQueue()
  1226. ' D2.FlushQueue()
  1227. InterruptDisplay(1600)
  1228. D1.Text = "<<<<++ KILLED IN ACTION ++>>>>"
  1229. DisplayB2SText "<<<<++ KILLED IN ACTION ++>>>>"
  1230. ' D1.QueueText "<<<<++ KILLED IN ACTION ++>>>>", seWipeIn, 800
  1231. ' D2.QueueText "<<<<++ KILLED IN ACTION ++>>>>", seWipeIn, 800
  1232. End If
  1233. EndOfBallTimer2.Enabled = TRUE
  1234. End Sub
  1235.  
  1236. ' The Timer which delays the machine to allow any bonus points to be added up
  1237. ' has expired. Check to see if there are any extra balls for this player.
  1238. ' if not, then check to see if this was the last ball (of the currentplayer)
  1239. '
  1240. Sub EndOfBall2()
  1241. ' if were tilted, reset the internal tilted flag (this will also
  1242. ' set TiltWarnings back to zero) which is useful if we are changing player LOL
  1243. Tilted = False
  1244. Tilt = 0
  1245. DisableTable False 'enable again bumpers and slingshots
  1246.  
  1247. ' has the player won an extra-ball ? (might be multiple outstanding)
  1248. If(ExtraBallsAwards(CurrentPlayer) <> 0) Then
  1249. 'debug.print "Extra Ball"
  1250.  
  1251. ' yep got to give it to them
  1252. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) - 1
  1253.  
  1254. ' if no more EB's then turn off any shoot again light
  1255. If(ExtraBallsAwards(CurrentPlayer) = 0) Then
  1256. ShootAgainLight.State = 0
  1257. End If
  1258.  
  1259. ' You may wish to do a bit of a song AND dance at this point
  1260. 'DMD "extra-ball.wmv", "", "", 5000
  1261.  
  1262. ' In this table an extra ball will have the skillshot and ball saver, so we reset the playfield for the new ball
  1263. ResetForNewPlayerBall()
  1264.  
  1265. ' Create a new ball in the shooters lane
  1266. CreateNewBall()
  1267. Else ' no extra balls
  1268.  
  1269. BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer) - 1
  1270.  
  1271. ' was that the last ball ?
  1272. If(BallsRemaining(CurrentPlayer) <= 0) Then
  1273. 'debug.print "No More Balls, High Score Entry"
  1274.  
  1275. ' Submit the currentplayers score to the High Score system
  1276. ' CheckHighScore()
  1277. ' you may wish to play some music at this point
  1278.  
  1279. Else
  1280.  
  1281. ' not the last ball (for that player)
  1282. ' if multiple players are playing then move onto the next one
  1283. EndOfBallComplete()
  1284. End If
  1285. End If
  1286. End Sub
  1287.  
  1288. ' This function is called when the end of bonus display
  1289. ' (or high score entry finished) AND it either end the game or
  1290. ' move onto the next player (or the next ball of the same player)
  1291. '
  1292. 'Sub EndOfBallComplete()
  1293. ' Dim NextPlayer
  1294.  
  1295. 'debug.print "EndOfBall - Complete"
  1296.  
  1297. ' are there multiple players playing this game ?
  1298. ' If(PlayersPlayingGame> 1) Then
  1299. ' then move to the next player
  1300. ' NextPlayer = CurrentPlayer + 1
  1301. ' are we going from the last player back to the first
  1302. ' (ie say from player 4 back to player 1)
  1303. ' If(NextPlayer> PlayersPlayingGame) Then
  1304. ' NextPlayer = 1
  1305. ' End If
  1306. ' Else
  1307. ' NextPlayer = CurrentPlayer
  1308. ' End If
  1309.  
  1310. 'debug.print "Next Player = " & NextPlayer
  1311.  
  1312. ' is it the end of the game ? (all balls been lost for all players)
  1313. ' If((BallsRemaining(CurrentPlayer) <= 0) AND(BallsRemaining(NextPlayer) <= 0) ) Then
  1314. ' you may wish to do some sort of Point Match free game award here
  1315. ' generally only done when not in free play mode
  1316.  
  1317. ' set the machine into game over mode
  1318. ' EndOfGame()
  1319.  
  1320. ' you may wish to put a Game Over message on the desktop/backglass
  1321.  
  1322. ' Else
  1323. ' set the next player
  1324. ' CurrentPlayer = NextPlayer
  1325.  
  1326. ' make sure the correct display is up to date
  1327. ' AddScore 0
  1328.  
  1329. ' reset the playfield for the new player (or new ball)
  1330. ' ResetForNewPlayerBall()
  1331.  
  1332. ' AND create a new ball
  1333. ' CreateNewBall()
  1334.  
  1335. ' play a sound if more than 1 player
  1336. ' If PlayersPlayingGame> 1 Then
  1337. ' PlaySound "vo_player" &CurrentPlayer
  1338. ' D1.Text = " PLAYER " &CurrentPlayer
  1339. ' DMD "", " ", "PLAYER " &CurrentPlayer, 800
  1340. ' End If
  1341. ' End If
  1342. 'End Sub
  1343.  
  1344. ' This function is called at the End of the Game, it should reset all
  1345. ' Drop targets, AND eject any 'held' balls, start any attract sequences etc..
  1346.  
  1347. Sub EndOfGame()
  1348. bGameInPLay = False
  1349. ' just ended your game then play the end of game tune
  1350. If NOT bJustStarted Then
  1351. 'PlaySong "m_end"
  1352. End If
  1353.  
  1354. Dim i, j, iswap
  1355. Dim POWNameTemp
  1356. Dim Rand(100)
  1357.  
  1358. EndMission()
  1359.  
  1360. 'D2.text = "game over"
  1361.  
  1362. PlayersPlayingGame = 0
  1363.  
  1364. bJustStarted = False
  1365. ' ensure that the flippers are down
  1366. SolLFlipper 0
  1367. SolRFlipper 0
  1368.  
  1369. LeftSlingshotRubber.Disabled = 1
  1370. RightSlingshotRubber.Disabled = 1
  1371. Bumper1.Force = 0
  1372. Bumper2.Force = 0
  1373. Bumper3.Force = 0
  1374.  
  1375. ' terminate all Mode - eject locked balls
  1376. ' most of the Mode/timers terminate at the end of the ball
  1377. 'PlayQuote.Enabled = 0
  1378. ' show game over on the DMD
  1379. 'DMD "game-over.wmv", "", "", 11000
  1380.  
  1381. ' set any lights for the attract mode
  1382. GiOff
  1383. FlashEffect 0
  1384. FlashEffectMissionTimer.enabled = 0
  1385. 'StartAttractMode
  1386.  
  1387. ' you may wish to light any Game Over Light you may have
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393. Kicker1SolenoidPulse()
  1394. Kicker2SolenoidPulse()
  1395. Kicker3SolenoidPulse()
  1396. Kicker4SolenoidPulse()
  1397. bBallLockedInKicker1 = 0
  1398. bBallLockedInKicker2 = 0
  1399. bBallLockedInKicker3 = 0
  1400. bBallLockedInKicker4 = 0
  1401. bBallInKicker1 = 0
  1402. bBallInKicker2 = 0
  1403. bBallInKicker3 = 0
  1404. bBallInKicker4 = 0
  1405. BallsLocked = 0
  1406. FlashOff()
  1407. ' BallsOnPlayfield = 0
  1408. PlayfieldTimer.Enabled = TRUE
  1409. ' Let Future Pinball know that the game has finished. This also clear the fpGameInPlay flag.
  1410. 'EndGame()
  1411. ' LookAtBackbox()
  1412. D1.Text = " GAME OVER "
  1413. DisplayB2SText " GAME OVER "
  1414. Playsound "msmissioncomplete"
  1415. ' Ensure that the flippers are down.
  1416. 'LeftFlipper.SolenoidOff()
  1417. 'RightFlipper.SolenoidOff()
  1418. ' Entering attract mode (lights and messages).
  1419. EnterAttractMode()
  1420. ' Doing POW name table randomly shuffled.
  1421. For i = 1 To 100
  1422. Rand(i) = Int(Rnd(1) * 10000)
  1423. Next
  1424. For i = 1 To 99
  1425. For j = i + 1 To 100
  1426. If Rand(i) > Rand(j) Then
  1427. iswap = Rand(i)
  1428. Rand(i) = Rand(j)
  1429. Rand(j) = iswap
  1430. POWNameTemp = POWName(i)
  1431. POWName(i) = POWName(j)
  1432. POWName(j) = POWNameTemp
  1433. End If
  1434. Next
  1435. Next
  1436.  
  1437.  
  1438. FixTargetTimer.enabled = 1
  1439.  
  1440.  
  1441. End Sub
  1442.  
  1443. Function Balls
  1444. Dim tmp
  1445. tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1
  1446. If tmp> BallsPerGame Then
  1447. Balls = BallsPerGame
  1448. Else
  1449. Balls = tmp
  1450. End If
  1451. End Function
  1452.  
  1453.  
  1454.  
  1455. ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane
  1456. ' Check to see if a ball saver mechanism is needed and if so fire it up.
  1457.  
  1458. Sub swPlungerRest_Hit()
  1459. 'debug.print "ball in plunger lane"
  1460. ' some sound according to the ball position
  1461. PlaySound "fx_sensor", 0, 1, 0.15, 0.25
  1462. bBallInPlungerLane = TRUE
  1463. ' turn on Launch light is there is one
  1464. 'LaunchLight.State = 2
  1465.  
  1466. 'be sure to update the Scoreboard after the animations, if any
  1467. UltraDMDScoreTimer.Enabled = 1
  1468.  
  1469. ' kick the ball in play if the bAutoPlunger flag is on
  1470. ' If bAutoPlunger Then
  1471. 'debug.print "autofire the ball"
  1472. ' PlungerIM.AutoFire
  1473. ' DOF 131, DOFPulse
  1474. ' DOF 125, DOFPulse
  1475. ' bAutoPlunger = False
  1476. ' End If
  1477. ' if there is a need for a ball saver, then start off a timer
  1478. ' only start if it is ready, and it is currently not running, else it will reset the time period
  1479. If(bBallSaverReady = True) AND(BallSaverTime <> 0) And(bBallSaverActive = False) Then
  1480. EnableBallSaver BallSaverTime
  1481. End If
  1482. 'Start the Selection of the skillshot if ready
  1483. ' If bSkillShotReady Then
  1484. ' swPlungerRest.TimerEnabled = 1 ' this is a new ball, so show the launch ball if inactive for 6 seconds
  1485. ' UpdateSkillshot()
  1486. ' End If
  1487. ' remember last trigger hit by the ball.
  1488.  
  1489. End Sub
  1490.  
  1491. ' The ball is released from the plunger turn off some flags and check for skillshot
  1492.  
  1493. Sub swPlungerRest_UnHit()
  1494. bBallInPlungerLane = False
  1495. ' If bSkillShotReady Then
  1496. ' ResetSkillShotTimer.Enabled = 1
  1497. ' End If
  1498. ' If NOT bMultiballMode Then
  1499. ' PlaySong "mu_msmain"
  1500. ' End If
  1501. DMDFLush
  1502. DMD "Explosion.gif", "", "", 2800
  1503. ' turn off LaunchLight
  1504. ' LaunchLight.State = 0
  1505. End Sub
  1506.  
  1507.  
  1508.  
  1509.  
  1510. Sub EnableBallSaver(seconds)
  1511. 'debug.print "Ballsaver started"
  1512. ' set our game flag
  1513. bBallSaverActive = True
  1514. bBallSaverReady = False
  1515. ' start the timer
  1516. BallSaverTimerExpired.Interval = 1000 * seconds
  1517. BallSaverTimerExpired.Enabled = True
  1518. BallSaverSpeedUpTimer.Interval = 1000 * seconds -(1000 * seconds) / 3
  1519. BallSaverSpeedUpTimer.Enabled = True
  1520. ' if you have a ball saver light you might want to turn it on at this point (or make it flash)
  1521. ShootAgainLight.BlinkInterval = 160
  1522. SetLightColor ShootAgainLight, amber, 2
  1523. End Sub
  1524.  
  1525. ' The ball saver timer has expired. Turn it off AND reset the game flag
  1526. '
  1527. Sub BallSaverTimerExpired_Timer()
  1528. 'debug.print "Ballsaver ended"
  1529. BallSaverTimerExpired.Enabled = False
  1530. ' clear the flag
  1531. bBallSaverActive = False
  1532. ' if you have a ball saver light then turn it off at this point
  1533. ShootAgainLight.State = 0
  1534. End Sub
  1535.  
  1536. Sub BallSaverSpeedUpTimer_Timer()
  1537. 'debug.print "Ballsaver Speed Up Light"
  1538. BallSaverSpeedUpTimer.Enabled = False
  1539. ' Speed up the blinking
  1540. ShootAgainLight.BlinkInterval = 80
  1541. ShootAgainLight.State = 2
  1542. End Sub
  1543.  
  1544. ' *********************************************************************
  1545. ' Supporting Score Functions
  1546. ' *********************************************************************
  1547.  
  1548. ' Add points to the score AND update the score board
  1549. ' In this table we use SecondRound variable to double the score points in the second round after killing Malthael
  1550. Sub AddScore(points)
  1551. If(Tilted = False) Then
  1552. ' add the points to the current players score variable
  1553. Score(CurrentPlayer) = Score(CurrentPlayer) + points * SecondRound
  1554. ' update the score displays
  1555. 'DMDScore
  1556. End if
  1557.  
  1558. ' you may wish to check to see if the player has gotten a replay
  1559. End Sub
  1560.  
  1561. ' Add bonus to the bonuspoints AND update the score board
  1562.  
  1563. Sub AddBonus(points) 'not used in this table, since there are many different bonus items.
  1564. If(Tilted = False) Then
  1565. ' add the bonus to the current players bonus variable
  1566. BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points
  1567. ' update the score displays
  1568. ' DMDScore
  1569. End if
  1570.  
  1571. ' you may wish to check to see if the player has gotten a replay
  1572. End Sub
  1573.  
  1574. ' Add some points to the current Jackpot.
  1575. '
  1576. Sub AddJackpot(points) 'not used in this table
  1577. ' Jackpots only generally increment in multiball mode AND not tilted
  1578. ' but this doesn't have to be the case
  1579. 'If(Tilted = False)Then
  1580.  
  1581. ' If(bMultiBallMode = True) Then
  1582. ' Jackpot = Jackpot + points
  1583. ' you may wish to limit the jackpot to a upper limit, ie..
  1584. ' If (Jackpot >= 6000) Then
  1585. ' Jackpot = 6000
  1586. ' End if
  1587. 'End if
  1588. 'End if
  1589. End Sub
  1590.  
  1591. Sub AddSuperJackpot(points)
  1592. If(Tilted = False) Then
  1593.  
  1594. ' If(bMultiBallMode = True) Then
  1595. ' SuperJackpot = SuperJackpot + points
  1596. ' you may wish to limit the jackpot to a upper limit, ie..
  1597. ' If (Jackpot >= 6000) Then
  1598. ' Jackpot = 6000
  1599. ' End if
  1600. 'End if
  1601. End if
  1602. End Sub
  1603.  
  1604.  
  1605.  
  1606. ' Set the Bonus Multiplier to the specified level AND set any lights accordingly
  1607. ' There is no bonus multiplier lights in this table
  1608.  
  1609.  
  1610.  
  1611. Sub AwardExtraBall()
  1612. If NOT bExtraBallWonThisBall Then
  1613. ' DMDBlink "", " ", "EXTRA BALL WON", 100, 10
  1614. 'DMD "extra-ball.wmv", "", "", 5000
  1615. ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1
  1616. bExtraBallWonThisBall = True
  1617. GiEffect 1
  1618. LightEffect 2
  1619. END If
  1620. End Sub
  1621.  
  1622. Sub AwardSpecial()
  1623. DisplayB2SText " CONGRATULATION GREAT SCORE "
  1624. Credits = Credits + 1
  1625. DOF 140, DOFOn
  1626. DisplayB2SText " CREDITS " &Credits
  1627. GiEffect 1
  1628. LightEffect 1
  1629. End Sub
  1630.  
  1631. 'in this table the jackpot is always 1 million + 10% of your score
  1632.  
  1633. Sub AwardJackpot() 'award a normal jackpot, double or triple jackpot
  1634. Jackpot = 1000000 + Round(Score(CurrentPlayer) / 10, 0)
  1635. ' DMDBlink "", "JACKPOT", Jackpot, 100, 10
  1636. PlaySound "criticalhit"
  1637. AddScore Jackpot
  1638. GiEffect 1
  1639. LightEffect 2
  1640. FlashEffect 2
  1641. End Sub
  1642.  
  1643. Sub AwardDoubleJackpot() 'in this table the jackpot is always 1 million + 10% of your score
  1644. Jackpot = (1000000 + Round(Score(CurrentPlayer) / 10, 0) ) * 2
  1645. ' DMDBlink "", "DOUBLE JACKPOT", Jackpot, 100, 10
  1646. PlaySound "criticalhit"
  1647. AddScore Jackpot
  1648. GiEffect 1
  1649. LightEffect 2
  1650. FlashEffect 2
  1651. End Sub
  1652.  
  1653. Sub AwardSuperJackpot() 'this is actually a tripple jackpot
  1654. DOF 133, DOFPulse
  1655. SuperJackpot = (1000000 + Round(Score(CurrentPlayer) / 10, 0) ) * 3
  1656. ' DMDBlink "", "SUPER JACKPOT", SuperJackpot, 100, 10
  1657. PlaySound "criticalhit"
  1658. AddScore SuperJackpot
  1659. GiEffect 1
  1660. LightEffect 2
  1661. FlashEffect 2
  1662. End Sub
  1663.  
  1664. Sub AwardSkillshot()
  1665. Dim i
  1666. DOF 131, DOFPulse
  1667. ResetSkillShotTimer_Timer
  1668. 'show dmd animation
  1669. DMDFlush
  1670. Select case SkillShotValue(CurrentPlayer)
  1671. case 1000000
  1672. ' DMD "skillshot1.wmv", " ", " ", 5000
  1673. AddScore SkillshotValue(CurrentPLayer)
  1674. case 2000000
  1675. ' DMD "skillshot2.wmv", " ", " ", 5000
  1676. AddScore SkillshotValue(CurrentPLayer)
  1677. case 3000000
  1678. ' DMD "skillshot3.wmv", " ", " ", 5000
  1679. AddScore SkillshotValue(CurrentPLayer)
  1680. case 4000000
  1681. ' DMD "skillshot4.wmv", " ", " ", 5000
  1682. AddScore SkillshotValue(CurrentPLayer)
  1683. case 5000000
  1684. ' DMD "skillshot5.wmv", " ", " ", 5000
  1685. AddScore SkillshotValue(CurrentPLayer)
  1686. case ELSE
  1687. ' DMD "skillshot.wmv", " ", " ", 5000
  1688. AddScore SkillshotValue(CurrentPLayer)
  1689. End Select
  1690. ' increment the skillshot value with 1 million
  1691. SkillShotValue(CurrentPLayer) = SkillShotValue(CurrentPLayer) + 1000000
  1692. 'do some light show
  1693. GiEffect 1
  1694. LightEffect 2
  1695. 'enable the start act/battle by opening the chest door
  1696. DropChestDoor
  1697. End Sub
  1698.  
  1699. Sub Congratulation()
  1700. Dim tmp
  1701. tmp = "vo_congrat" & INT(RND * 21 + 1)
  1702. PlaySound tmp
  1703. End Sub
  1704.  
  1705.  
  1706.  
  1707.  
  1708. '*****************************
  1709. ' Load / Save / Highscore
  1710. '*****************************
  1711.  
  1712. Sub Loadhs
  1713. Dim x
  1714. x = LoadValue(TableName, "HighScore1")
  1715. If(x <> "") Then HighScore(0) = CDbl(x) Else HighScore(0) = 100000 End If
  1716.  
  1717. x = LoadValue(TableName, "HighScore1Name")
  1718. If(x <> "") Then HighScoreName(0) = x Else HighScoreName(0) = "AAA" End If
  1719.  
  1720. x = LoadValue(TableName, "HighScore2")
  1721. If(x <> "") then HighScore(1) = CDbl(x) Else HighScore(1) = 100000 End If
  1722.  
  1723. x = LoadValue(TableName, "HighScore2Name")
  1724. If(x <> "") then HighScoreName(1) = x Else HighScoreName(1) = "BBB" End If
  1725.  
  1726. x = LoadValue(TableName, "HighScore3")
  1727. If(x <> "") then HighScore(2) = CDbl(x) Else HighScore(2) = 100000 End If
  1728.  
  1729. x = LoadValue(TableName, "HighScore3Name")
  1730. If(x <> "") then HighScoreName(2) = x Else HighScoreName(2) = "CCC" End If
  1731.  
  1732. x = LoadValue(TableName, "HighScore4")
  1733. If(x <> "") then HighScore(3) = CDbl(x) Else HighScore(3) = 100000 End If
  1734.  
  1735. x = LoadValue(TableName, "HighScore4Name")
  1736. If(x <> "") then HighScoreName(3) = x Else HighScoreName(3) = "DDD" End If
  1737.  
  1738. x = LoadValue(TableName, "Credits")
  1739. If(x <> "") then Credits = CInt(x) Else Credits = 0 End If
  1740.  
  1741. 'x = LoadValue(TableName, "Jackpot")
  1742. 'If(x <> "") then Jackpot = CDbl(x) Else Jackpot = 200000 End If
  1743. x = LoadValue(TableName, "TotalGamesPlayed")
  1744. If(x <> "") then TotalGamesPlayed = CInt(x) Else TotalGamesPlayed = 0 End If
  1745. End Sub
  1746.  
  1747. Sub Savehs
  1748. SaveValue TableName, "HighScore1", HighScore(0)
  1749. SaveValue TableName, "HighScore1Name", HighScoreName(0)
  1750. SaveValue TableName, "HighScore2", HighScore(1)
  1751. SaveValue TableName, "HighScore2Name", HighScoreName(1)
  1752. SaveValue TableName, "HighScore3", HighScore(2)
  1753. SaveValue TableName, "HighScore3Name", HighScoreName(2)
  1754. SaveValue TableName, "HighScore4", HighScore(3)
  1755. SaveValue TableName, "HighScore4Name", HighScoreName(3)
  1756. SaveValue TableName, "Credits", Credits
  1757. 'SaveValue TableName, "Jackpot", Jackpot
  1758. SaveValue TableName, "TotalGamesPlayed", TotalGamesPlayed
  1759. End Sub
  1760.  
  1761. ' ***********************************************************
  1762. ' High Score Initals Entry Functions - based on Black's code
  1763. ' ***********************************************************
  1764.  
  1765. Dim hsbModeActive
  1766. Dim hsEnteredName
  1767. Dim hsEnteredDigits(3)
  1768. Dim hsCurrentDigit
  1769. Dim hsValidLetters
  1770. Dim hsCurrentLetter
  1771. Dim hsLetterFlash
  1772.  
  1773. Sub CheckHighscore()
  1774. Dim tmp
  1775. tmp = Score(1)
  1776.  
  1777. If Score(2)> tmp Then tmp = Score(2)
  1778. If Score(3)> tmp Then tmp = Score(3)
  1779. If Score(4)> tmp Then tmp = Score(4)
  1780.  
  1781. If tmp> HighScore(1) Then 'add 1 credit for beating the highscore
  1782. AwardSpecial()
  1783. End If
  1784.  
  1785. If tmp> HighScore(3) Then
  1786. vpmtimer.addtimer 2000, "PlaySound ""vo_contratulationsgreatscore"" '"
  1787. HighScore(3) = tmp
  1788. 'enter player's name
  1789. HighScoreEntryInit()
  1790. Else
  1791. EndOfBallComplete()
  1792. End If
  1793. End Sub
  1794.  
  1795. Sub HighScoreEntryInit()
  1796. hsbModeActive = True
  1797. PlaySound "vo_enteryourinitials"
  1798. hsLetterFlash = 0
  1799.  
  1800. hsEnteredDigits(0) = "A"
  1801. hsEnteredDigits(1) = "A"
  1802. hsEnteredDigits(2) = "A"
  1803. hsCurrentDigit = 0
  1804.  
  1805. hsValidLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ<+-0123456789" ' < is used to delete the last letter
  1806. hsCurrentLetter = 1
  1807. DMDFlush
  1808. DMDId "hsc", "", "YOUR NAME:", " ", 999999
  1809. HighScoreDisplayName()
  1810. End Sub
  1811.  
  1812. Sub EnterHighScoreKey(keycode)
  1813. If keycode = LeftFlipperKey Then
  1814. Playsound "fx_Previous"
  1815. hsCurrentLetter = hsCurrentLetter - 1
  1816. if(hsCurrentLetter = 0) then
  1817. hsCurrentLetter = len(hsValidLetters)
  1818. end if
  1819. HighScoreDisplayName()
  1820. End If
  1821.  
  1822. If keycode = RightFlipperKey Then
  1823. Playsound "fx_Next"
  1824. hsCurrentLetter = hsCurrentLetter + 1
  1825. if(hsCurrentLetter> len(hsValidLetters) ) then
  1826. hsCurrentLetter = 1
  1827. end if
  1828. HighScoreDisplayName()
  1829. End If
  1830.  
  1831. If keycode = StartGameKey OR keycode = PlungerKey Then
  1832. if(mid(hsValidLetters, hsCurrentLetter, 1) <> "<") then
  1833. playsound "fx_Enter"
  1834. hsEnteredDigits(hsCurrentDigit) = mid(hsValidLetters, hsCurrentLetter, 1)
  1835. hsCurrentDigit = hsCurrentDigit + 1
  1836. if(hsCurrentDigit = 3) then
  1837. HighScoreCommitName()
  1838. else
  1839. HighScoreDisplayName()
  1840. end if
  1841. else
  1842. playsound "fx_Esc"
  1843. hsEnteredDigits(hsCurrentDigit) = " "
  1844. if(hsCurrentDigit> 0) then
  1845. hsCurrentDigit = hsCurrentDigit - 1
  1846. end if
  1847. HighScoreDisplayName()
  1848. end if
  1849. end if
  1850. End Sub
  1851.  
  1852. Sub HighScoreDisplayName()
  1853. Dim i, TempStr
  1854.  
  1855. TempStr = " >"
  1856. if(hsCurrentDigit> 0) then TempStr = TempStr & hsEnteredDigits(0)
  1857. if(hsCurrentDigit> 1) then TempStr = TempStr & hsEnteredDigits(1)
  1858. if(hsCurrentDigit> 2) then TempStr = TempStr & hsEnteredDigits(2)
  1859.  
  1860. if(hsCurrentDigit <> 3) then
  1861. if(hsLetterFlash <> 0) then
  1862. TempStr = TempStr & "_"
  1863. else
  1864. TempStr = TempStr & mid(hsValidLetters, hsCurrentLetter, 1)
  1865. end if
  1866. end if
  1867.  
  1868. if(hsCurrentDigit <1) then TempStr = TempStr & hsEnteredDigits(1)
  1869. if(hsCurrentDigit <2) then TempStr = TempStr & hsEnteredDigits(2)
  1870.  
  1871. TempStr = TempStr & "< "
  1872. DMDMod "hsc", "YOUR NAME:", Mid(TempStr, 2, 5), 999999
  1873. End Sub
  1874.  
  1875. Sub HighScoreCommitName()
  1876. hsbModeActive = False
  1877. 'PlaySong "m_end"
  1878. hsEnteredName = hsEnteredDigits(0) & hsEnteredDigits(1) & hsEnteredDigits(2)
  1879. if(hsEnteredName = " ") then
  1880. hsEnteredName = "YOU"
  1881. end if
  1882.  
  1883. HighScoreName(3) = hsEnteredName
  1884. SortHighscore
  1885. DMDFlush
  1886. EndOfBallComplete()
  1887. End Sub
  1888.  
  1889. Sub SortHighscore
  1890. Dim tmp, tmp2, i, j
  1891. For i = 0 to 3
  1892. For j = 0 to 2
  1893. If HighScore(j) <HighScore(j + 1) Then
  1894. tmp = HighScore(j + 1)
  1895. tmp2 = HighScoreName(j + 1)
  1896. HighScore(j + 1) = HighScore(j)
  1897. HighScoreName(j + 1) = HighScoreName(j)
  1898. HighScore(j) = tmp
  1899. HighScoreName(j) = tmp2
  1900. End If
  1901. Next
  1902. Next
  1903. End Sub
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909. '****************************************
  1910. ' Real Time updatess using the GameTimer
  1911. '****************************************
  1912. 'used for all the real time updates
  1913.  
  1914. Sub GameTimer_Timer
  1915. RollingUpdate
  1916. BallShadowUpdate
  1917.  
  1918. If KickbackLight.state = 1 And bGameInPlay And Not Tilted Then
  1919. LeftOutLaneTrigger.enabled = 1
  1920. Else
  1921. LeftOutLaneTrigger.enabled = 0
  1922. End If
  1923. ' add any other real time update subs, like gates or diverters
  1924. End Sub
  1925.  
  1926. '********************************************************************************************
  1927. ' Only for VPX 10.2 and higher.
  1928. ' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms)
  1929. ' When TotalPeriod done, light or flasher will be set to FinalState value where
  1930. ' Final State values are: 0=Off, 1=On, 2=Return to previous State
  1931. '********************************************************************************************
  1932.  
  1933. Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first version
  1934.  
  1935. If TypeName(MyLight) = "Light" Then
  1936.  
  1937. If FinalState = 2 Then
  1938. FinalState = MyLight.State 'Keep the current light state
  1939. End If
  1940. MyLight.BlinkInterval = BlinkPeriod
  1941. MyLight.Duration 2, TotalPeriod, FinalState
  1942. ElseIf TypeName(MyLight) = "Flasher" Then
  1943.  
  1944. Dim steps
  1945.  
  1946. ' Store all blink information
  1947. steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform
  1948. If FinalState = 2 Then 'Keep the current flasher state
  1949. FinalState = ABS(MyLight.Visible)
  1950. End If
  1951. MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state
  1952.  
  1953. ' Start blink timer and create timer subroutine
  1954. MyLight.TimerInterval = BlinkPeriod
  1955. MyLight.TimerEnabled = 0
  1956. MyLight.TimerEnabled = 1
  1957. ExecuteGlobal "Sub " & MyLight.Name & "_Timer:" & "Dim tmp, steps, fstate:tmp=me.UserValue:fstate = tmp MOD 10:steps= tmp\10 -1:Me.Visible = steps MOD 2:me.UserValue = steps *10 + fstate:If Steps = 0 then Me.Visible = fstate:Me.TimerEnabled=0:End if:End Sub"
  1958. End If
  1959. End Sub
  1960.  
  1961. '******************************************
  1962. ' Change light color - simulate color leds
  1963. ' changes the light color and state
  1964. ' 10 colors: red, orange, amber, yellow...
  1965. '******************************************
  1966. ' in this table this colors are use to keep track of the progress during the acts and battles
  1967.  
  1968. 'colors
  1969. Dim red, orange, amber, yellow, darkgreen, green, blue, darkblue, purple, white
  1970.  
  1971. red = 10
  1972. orange = 9
  1973. amber = 8
  1974. yellow = 7
  1975. darkgreen = 6
  1976. green = 5
  1977. blue = 4
  1978. darkblue = 3
  1979. purple = 2
  1980. white = 1
  1981.  
  1982. Sub SetLightColor(n, col, stat)
  1983. Select Case col
  1984. Case 0
  1985. n.color = RGB(18, 0, 0)
  1986. n.colorfull = RGB(255, 0, 0)
  1987. Case red
  1988. n.color = RGB(18, 0, 0)
  1989. n.colorfull = RGB(255, 0, 0)
  1990. Case orange
  1991. n.color = RGB(18, 3, 0)
  1992. n.colorfull = RGB(255, 64, 0)
  1993. Case amber
  1994. n.color = RGB(193, 49, 0)
  1995. n.colorfull = RGB(255, 153, 0)
  1996. Case yellow
  1997. n.color = RGB(18, 18, 0)
  1998. n.colorfull = RGB(255, 255, 0)
  1999. Case darkgreen
  2000. n.color = RGB(0, 8, 0)
  2001. n.colorfull = RGB(0, 64, 0)
  2002. Case green
  2003. n.color = RGB(0, 18, 0)
  2004. n.colorfull = RGB(0, 255, 0)
  2005. Case blue
  2006. n.color = RGB(0, 18, 18)
  2007. n.colorfull = RGB(0, 255, 255)
  2008. Case darkblue
  2009. n.color = RGB(0, 8, 8)
  2010. n.colorfull = RGB(0, 64, 64)
  2011. Case purple
  2012. n.color = RGB(128, 0, 128)
  2013. n.colorfull = RGB(255, 0, 255)
  2014. Case white
  2015. n.color = RGB(255, 252, 224)
  2016. n.colorfull = RGB(193, 91, 0)
  2017. Case white
  2018. n.color = RGB(255, 252, 224)
  2019. n.colorfull = RGB(193, 91, 0)
  2020. End Select
  2021. If stat <> -1 Then
  2022. n.State = 0
  2023. n.State = stat
  2024. End If
  2025. End Sub
  2026.  
  2027. Sub ResetAllLightsColor ' Called at a new game
  2028. 'shoot again
  2029. SetLightColor ShootAgainLight, amber, -1
  2030. End Sub
  2031.  
  2032. Sub UpdateBonusColors
  2033. End Sub
  2034.  
  2035. '*************************
  2036. ' Rainbow Changing Lights
  2037. '*************************
  2038.  
  2039. Dim RGBStep, RGBFactor, rRed, rGreen, rBlue, RainbowLights
  2040.  
  2041. Sub StartRainbow(n)
  2042. set RainbowLights = n
  2043. RGBStep = 0
  2044. RGBFactor = 5
  2045. rRed = 255
  2046. rGreen = 0
  2047. rBlue = 0
  2048. RainbowTimer.Enabled = 1
  2049. End Sub
  2050.  
  2051. Sub StopRainbow()
  2052. Dim obj
  2053. RainbowTimer.Enabled = 0
  2054. RainbowTimer.Enabled = 0
  2055. End Sub
  2056.  
  2057. Sub RainbowTimer_Timer 'rainbow led light color changing
  2058. Dim obj
  2059. Select Case RGBStep
  2060. Case 0 'Green
  2061. rGreen = rGreen + RGBFactor
  2062. If rGreen> 255 then
  2063. rGreen = 255
  2064. RGBStep = 1
  2065. End If
  2066. Case 1 'Red
  2067. rRed = rRed - RGBFactor
  2068. If rRed <0 then
  2069. rRed = 0
  2070. RGBStep = 2
  2071. End If
  2072. Case 2 'Blue
  2073. rBlue = rBlue + RGBFactor
  2074. If rBlue> 255 then
  2075. rBlue = 255
  2076. RGBStep = 3
  2077. End If
  2078. Case 3 'Green
  2079. rGreen = rGreen - RGBFactor
  2080. If rGreen <0 then
  2081. rGreen = 0
  2082. RGBStep = 4
  2083. End If
  2084. Case 4 'Red
  2085. rRed = rRed + RGBFactor
  2086. If rRed> 255 then
  2087. rRed = 255
  2088. RGBStep = 5
  2089. End If
  2090. Case 5 'Blue
  2091. rBlue = rBlue - RGBFactor
  2092. If rBlue <0 then
  2093. rBlue = 0
  2094. RGBStep = 0
  2095. End If
  2096. End Select
  2097. For each obj in RainbowLights
  2098. obj.color = RGB(rRed \ 10, rGreen \ 10, rBlue \ 10)
  2099. obj.colorfull = RGB(rRed, rGreen, rBlue)
  2100. Next
  2101. End Sub
  2102.  
  2103. '***********************************************************************************
  2104. ' JPS DMD - very simple DMD routines using UltraDMD
  2105. '***********************************************************************************
  2106.  
  2107. Dim UltraDMD
  2108.  
  2109. ' DMD using UltraDMD calls
  2110.  
  2111. Sub DMD(background, toptext, bottomtext, duration)
  2112. UltraDMD.DisplayScene00 background, toptext, 15, bottomtext, 15, 14, duration, 14
  2113. UltraDMDScoreTimer.Enabled = 1 'to show the score after the animation/message
  2114. End Sub
  2115.  
  2116. Sub DMDBlink(background, toptext, bottomtext, duration, nblinks) 'blinks the lower text nblinks times
  2117. Dim i
  2118. For i = 1 to nblinks
  2119. UltraDMD.DisplayScene00 background, toptext, 15, bottomtext, 15, 14, duration, 14
  2120. Next
  2121.  
  2122. UltraDMDScoreTimer.Enabled = 1 'to show the score after the animation/message
  2123. End Sub
  2124.  
  2125. Sub DMDScore
  2126.  
  2127. If NOT UltraDMD.IsRendering Then
  2128. Dim i
  2129. ' ShowTableInfo
  2130. 'UltraDMD.SetScoreboardBackgroundImage "metalslug.png", 15, 15
  2131. DMD "metalslug.jpg", "", "", 5000
  2132. ' UltraDMD.DisplayScene00 "MetalSluglogo.png", "", 14, 2, "", -1, -1', UltraDMD_Animation_None, 100, UltraDMD_Animation_None
  2133. ' UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(1), Score(2), Score(3), Score(4), "Player " & CurrentPlayer, "Ball " & Balls
  2134. Else
  2135. UltraDMDScoreTimer.Enabled = 1
  2136. End If
  2137.  
  2138. End Sub
  2139.  
  2140. Sub DMDScoreNow
  2141. DMDFlush
  2142. DMDScore
  2143. DisplayScore
  2144. End Sub
  2145.  
  2146. Sub DMDFLush
  2147. UltraDMDTimer.Enabled = 0
  2148. UltraDMDScoreTimer.Enabled = 0
  2149. UltraDMD.CancelRendering
  2150. UltraDMD.Clear
  2151. End Sub
  2152.  
  2153. Sub DMDScrollCredits(background, text, duration)
  2154. UltraDMD.ScrollingCredits background, text, 15, 14, duration, 14
  2155. End Sub
  2156.  
  2157. Sub DMDId(id, background, toptext, bottomtext, duration)
  2158. UltraDMD.DisplayScene00ExwithID id, False, background, toptext, 15, 0, bottomtext, 15, 0, 14, duration, 14
  2159. End Sub
  2160.  
  2161. Sub DMDMod(id, toptext, bottomtext, duration)
  2162. UltraDMD.ModifyScene00Ex id, toptext, bottomtext, duration
  2163. End Sub
  2164.  
  2165. Sub UltraDMDTimer_Timer() 'used for repeating the attrack mode and the instant info.
  2166. If bInstantInfo Then
  2167. InstantInfo
  2168. ElseIf bAttractMode Then
  2169. ShowTableInfo
  2170. End If
  2171. End Sub
  2172.  
  2173. Sub UltraDMDScoreTimer_Timer()
  2174. If NOT UltraDMD.IsRendering Then
  2175. DMDScoreNow
  2176. End If
  2177. End Sub
  2178.  
  2179.  
  2180. Sub DMD_Init
  2181. Set UltraDMD = CreateObject("UltraDMD.DMDObject")
  2182. If UltraDMD is Nothing Then
  2183. MsgBox "No UltraDMD found. This table will NOT run without it."
  2184. Exit Sub
  2185. End If
  2186.  
  2187. UltraDMD.Init
  2188. If Not UltraDMD.GetMajorVersion = 1 Then
  2189. MsgBox "Incompatible Version of UltraDMD found."
  2190. Exit Sub
  2191. End If
  2192.  
  2193. If UltraDMD.GetMinorVersion <1 Then
  2194. MsgBox "Incompatible Version of UltraDMD found. Please update to version 1.1 or newer."
  2195. Exit Sub
  2196. End If
  2197.  
  2198. Dim fso:Set fso = CreateObject("Scripting.FileSystemObject")
  2199. Dim curDir:curDir = fso.GetAbsolutePathName(".")
  2200.  
  2201. Dim DirName
  2202. DirName = curDir& "\" &TableName& ".UltraDMD"
  2203.  
  2204. If Not fso.FolderExists(DirName) Then _
  2205. Msgbox "UltraDMD userfiles directory '" & DirName & "' does not exist." & CHR(13) & "No graphic images will be displayed on the DMD"
  2206. UltraDMD.SetProjectFolder DirName
  2207.  
  2208. ' wait for the animation to end
  2209. While UltraDMD.IsRendering = True
  2210. WEnd
  2211.  
  2212. ' Show ROM version number
  2213. DMD "", "Metal Slug", "ROM VERS " &myVersion, 2000
  2214. End Sub
  2215.  
  2216. ' ********************************
  2217. ' Table info & Attract Mode
  2218. ' ********************************
  2219.  
  2220. Sub ShowTableInfo
  2221.  
  2222. Dim i
  2223. 'info goes in a loop only stopped by the credits and the startkey
  2224. If Score(1) Then
  2225. DMD "", "PLAYER 1", Score(1), 3000
  2226. End If
  2227. If Score(2) Then
  2228. DMD "", "PLAYER 2", Score(2), 3000
  2229. End If
  2230. If Score(3) Then
  2231. DMD "", "PLAYER 3", Score(3), 3000
  2232. End If
  2233. If Score(4) Then
  2234. DMD "", "PLAYER 4", Score(4), 3000
  2235. End If
  2236.  
  2237.  
  2238. 'coins or freeplay
  2239. If bFreePlay Then
  2240. DMD " ", "FREE PLAY", 2000
  2241. DMD "IntroMS.wmv", "", "", 24500
  2242. Else
  2243. If Credits> 0 Then
  2244. DMD "", "CREDITS " &credits, "PRESS START", 2000
  2245. Else
  2246. DMD "", "CREDITS " &credits, "INSERT COIN", 2000
  2247. End If
  2248. DMD "IntroMS.wmv", "", "", 24500
  2249. End If
  2250. ' some info about the table
  2251. DMD "", "Javier And Pinwizkid", "PRESENTS", 3000
  2252. DMD "", "", " Metal Slug ", 3000
  2253. ' Highscores
  2254. DMD "", "HIGHSCORE 1", HighScoreName(0) & " " & HighScore(0), 3000
  2255. DMD "", "HIGHSCORE 2", HighScoreName(1) & " " & HighScore(1), 3000
  2256. DMD "", "HIGHSCORE 3", HighScoreName(2) & " " & HighScore(2), 3000
  2257. DMD "", "HIGHSCORE 4", HighScoreName(3) & " " & HighScore(3), 3000
  2258. End Sub
  2259.  
  2260. Sub StartAttractMode()
  2261. bAttractMode = True
  2262. UltraDMDTimer.Enabled = 1
  2263. StartLightSeq
  2264. ShowTableInfo
  2265. StopGameOverSong
  2266. End Sub
  2267.  
  2268. Sub StopAttractMode()
  2269. bAttractMode = False
  2270. DMDScoreNow
  2271. LightSeqAttract.StopPlay
  2272. LightSeqFlasher.StopPlay
  2273. ' StopRainbow
  2274. ' ResetAllLightsColor
  2275. 'StopSong
  2276. End Sub
  2277.  
  2278. Sub StartLightSeq()
  2279. 'lights sequences
  2280. LightSeqFlasher.UpdateInterval = 150
  2281. LightSeqFlasher.Play SeqRandom, 10, , 50000
  2282. LightSeqAttract.Play SeqBlinking, , 5, 150
  2283. LightSeqAttract.Play SeqRandom, 40, , 4000
  2284. LightSeqAttract.Play SeqAllOff
  2285. LightSeqAttract.UpdateInterval = 8
  2286. LightSeqAttract.Play SeqUpOn, 50, 1
  2287. LightSeqAttract.UpdateInterval = 8
  2288. LightSeqAttract.Play SeqDownOn, 25, 1
  2289. LightSeqAttract.UpdateInterval = 8
  2290. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2291. LightSeqAttract.UpdateInterval = 8
  2292. LightSeqAttract.Play SeqUpOn, 25, 1
  2293. LightSeqAttract.UpdateInterval = 8
  2294. LightSeqAttract.Play SeqDownOn, 25, 1
  2295. LightSeqAttract.UpdateInterval = 8
  2296. LightSeqAttract.Play SeqUpOn, 25, 1
  2297. LightSeqAttract.UpdateInterval = 8
  2298. LightSeqAttract.Play SeqDownOn, 25, 1
  2299. LightSeqAttract.UpdateInterval = 10
  2300. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2301. LightSeqAttract.UpdateInterval = 5
  2302. LightSeqAttract.Play SeqRightOn, 50, 1
  2303. LightSeqAttract.UpdateInterval = 5
  2304. LightSeqAttract.Play SeqLeftOn, 50, 1
  2305. LightSeqAttract.UpdateInterval = 8
  2306. LightSeqAttract.Play SeqRightOn, 50, 1
  2307. LightSeqAttract.UpdateInterval = 8
  2308. LightSeqAttract.Play SeqLeftOn, 50, 1
  2309. LightSeqAttract.UpdateInterval = 8
  2310. LightSeqAttract.Play SeqRightOn, 40, 1
  2311. LightSeqAttract.UpdateInterval = 8
  2312. LightSeqAttract.Play SeqLeftOn, 40, 1
  2313. LightSeqAttract.UpdateInterval = 10
  2314. LightSeqAttract.Play SeqRightOn, 30, 1
  2315. LightSeqAttract.UpdateInterval = 10
  2316. LightSeqAttract.Play SeqLeftOn, 30, 1
  2317. LightSeqAttract.UpdateInterval = 8
  2318. LightSeqAttract.Play SeqRightOn, 25, 1
  2319. LightSeqAttract.UpdateInterval = 8
  2320. LightSeqAttract.Play SeqLeftOn, 25, 1
  2321. LightSeqAttract.UpdateInterval = 8
  2322. LightSeqAttract.Play SeqRightOn, 15, 1
  2323. LightSeqAttract.UpdateInterval = 8
  2324. LightSeqAttract.Play SeqLeftOn, 15, 1
  2325. LightSeqAttract.UpdateInterval = 10
  2326. LightSeqAttract.Play SeqCircleOutOn, 15, 3
  2327. LightSeqAttract.UpdateInterval = 8
  2328. LightSeqAttract.Play SeqLeftOn, 25, 1
  2329. LightSeqAttract.UpdateInterval = 8
  2330. LightSeqAttract.Play SeqRightOn, 25, 1
  2331. LightSeqAttract.UpdateInterval = 8
  2332. LightSeqAttract.Play SeqLeftOn, 25, 1
  2333. LightSeqAttract.UpdateInterval = 8
  2334. LightSeqAttract.Play SeqUpOn, 25, 1
  2335. LightSeqAttract.UpdateInterval = 8
  2336. LightSeqAttract.Play SeqDownOn, 25, 1
  2337. LightSeqAttract.UpdateInterval = 8
  2338. LightSeqAttract.Play SeqUpOn, 25, 1
  2339. LightSeqAttract.UpdateInterval = 8
  2340. LightSeqAttract.Play SeqDownOn, 25, 1
  2341. LightSeqAttract.UpdateInterval = 5
  2342. LightSeqAttract.Play SeqStripe1VertOn, 50, 2
  2343. LightSeqAttract.UpdateInterval = 8
  2344. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2345. LightSeqAttract.UpdateInterval = 8
  2346. LightSeqAttract.Play SeqStripe1VertOn, 50, 3
  2347. LightSeqAttract.UpdateInterval = 8
  2348. LightSeqAttract.Play SeqLeftOn, 25, 1
  2349. LightSeqAttract.UpdateInterval = 8
  2350. LightSeqAttract.Play SeqRightOn, 25, 1
  2351. LightSeqAttract.UpdateInterval = 8
  2352. LightSeqAttract.Play SeqLeftOn, 25, 1
  2353. LightSeqAttract.UpdateInterval = 8
  2354. LightSeqAttract.Play SeqUpOn, 25, 1
  2355. LightSeqAttract.UpdateInterval = 8
  2356. LightSeqAttract.Play SeqDownOn, 25, 1
  2357. LightSeqAttract.UpdateInterval = 8
  2358. LightSeqAttract.Play SeqCircleOutOn, 15, 2
  2359. LightSeqAttract.UpdateInterval = 8
  2360. LightSeqAttract.Play SeqStripe2VertOn, 50, 3
  2361.  
  2362. End Sub
  2363.  
  2364. Sub LightSeqAttract_PlayDone()
  2365. StartLightSeq()
  2366. End Sub
  2367.  
  2368. Sub LightSeqTilt_PlayDone()
  2369. LightSeqTilt.Play SeqAllOff
  2370. End Sub
  2371.  
  2372. Sub LightSeqSkillshot_PlayDone()
  2373. LightSeqSkillshot.Play SeqAllOff
  2374. End Sub
  2375.  
  2376. '***********************************************************************
  2377. ' *********************************************************************
  2378. ' Table Specific Script Starts Here
  2379. ' *********************************************************************
  2380. '***********************************************************************
  2381.  
  2382. ' droptargets, animations, etc
  2383. Sub VPObjects_Init
  2384.  
  2385. End Sub
  2386.  
  2387.  
  2388.  
  2389.  
  2390. Sub Game_Init() 'called at the start of a new game
  2391. Dim i
  2392. bExtraBallWonThisBall = False
  2393. TurnOffPlayfieldLights()
  2394.  
  2395.  
  2396.  
  2397. End Sub
  2398.  
  2399.  
  2400. Sub TurnOffPlayfieldLights()
  2401. Dim a
  2402. For each a in aLights
  2403. a.State = 0
  2404. Next
  2405. End Sub
  2406.  
  2407. Sub ResetNewBallLights()
  2408. ' LightArrow1.State = 2
  2409. ' LightArrow6.State = 2
  2410. ' l53.State = 2
  2411. End Sub
  2412.  
  2413.  
  2414. Sub UpdateSkillShot() 'Updates the skillshot light
  2415. LightSeqSkillshot.Play SeqAllOff
  2416. 'DMDFlush
  2417. End Sub
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451. ' The user has paused the game (Metal Slug table doesn't use this subroutine).
  2452. '
  2453. ' *** DOCAM OPTIMIZED ***
  2454.  
  2455.  
  2456.  
  2457.  
  2458. ' The user has resumed the paused game (Metal Slug table doesn't use this subroutine).
  2459. '
  2460. ' *** DOCAM OPTIMIZED ***
  2461. '
  2462.  
  2463.  
  2464.  
  2465. ' The played has nudged the table a little too hard/much and a "Warning" must be given to the player.
  2466. ' Metal Slug table uses to clear warnings if tilt is disabled.
  2467. '
  2468. ' *** DOCAM OPTIMIZED ***
  2469. '
  2470.  
  2471.  
  2472.  
  2473.  
  2474. ' The player has tilted the machine (too many "Warnings").
  2475. '
  2476. ' *** DOCAM MUST BE CHECKED ***
  2477. '
  2478. Sub FuturePinball_Tilted()
  2479. If Not(bPlayingBall) Then
  2480. ' Ignore the tilt when the player is not playing (e.g. during bonus countdown sequence).
  2481. Tilted = FALSE
  2482. Exit Sub
  2483. End If
  2484. PlaySound "Tilt"
  2485. ' Terminate current mission.
  2486. EndMission()
  2487. ' Stop theme.
  2488. StopMusic 1
  2489. Playsound "mordenlaugh", FALSE
  2490. If bPlayingFinalMission Then ingamereset()
  2491. ' Ensure all the flippers are down (as the keys won't work from now on).
  2492. LeftFlipper.SolenoidOff()
  2493. RightFlipper.SolenoidOff()
  2494. TopRightFlipper.SolenoidOff()
  2495. ' Ensure they're are not any ball near kickback.
  2496. bKickbackIsLit = FALSE
  2497. KickbackLight.State = 0
  2498. KickbackGuide.isDropped = 1
  2499. ' Disable ball saver.
  2500. BallSaverClockTimerUserData = 0
  2501. bBallSaverIsActive = FALSE
  2502. ShootAgainLight.State = 0
  2503. ShootAgainLight.BlinkInterval = 150
  2504. ' Ensure the wall (WEAPON drop targets) is down during locating ball(s).
  2505. W1.Isdropped = 1
  2506. W2.Isdropped = 1
  2507. W3.Isdropped = 1
  2508. W4.Isdropped = 1
  2509. W5.Isdropped = 1
  2510. W6.Isdropped = 1
  2511. ' Turn off general illumination (GI).
  2512. GIOff()
  2513. FlashEffect 0
  2514. FlashEffectMissionTimer.enabled = 0
  2515. ' Start the tilt recovery timer which waits until all balls have drained before doing the end of ball sequence (or end of game).
  2516. TiltRecoveryTimer.Interval = 1000
  2517. TiltRecoveryTimer.Enabled = TRUE
  2518. End Sub
  2519.  
  2520.  
  2521.  
  2522. ' A music channel has finished playing. Channel is set to the channel number that has finished (Metal Slug table doesn't use this subroutine).
  2523. '
  2524. ' *** DOCAM OPTIMIZED ***
  2525. '
  2526.  
  2527.  
  2528.  
  2529.  
  2530. ' High Score entry has been completed by the player.
  2531. ' Position is set to the position in the high score table (1 - 10), or 0 when no new high score.
  2532. ' Special is set to 1 if the Special high score was beaten (Metal Slug table doesn't use Special high score).
  2533. '
  2534. ' *** DOCAM OPTIMIZED ***
  2535. '
  2536. Sub FuturePinball_NameEntryComplete(ByVal Position, ByVal Special)
  2537. bEnteringAHighScore = FALSE
  2538. EndOfBallComplete()
  2539. End Sub
  2540.  
  2541.  
  2542.  
  2543. ' *********************************************************************
  2544. ' ** **
  2545. ' ** TABLE OBJECT SCRIPT EVENTS (HIT & UNHIT) **
  2546. ' ** **
  2547. ' *********************************************************************
  2548.  
  2549.  
  2550.  
  2551. ' *********************************************************************
  2552. ' ** PLUNGER LANE TRIGGER **
  2553. ' *********************************************************************
  2554.  
  2555.  
  2556.  
  2557. ' A ball is pressing down the trigger in the plunger lane.
  2558. '
  2559. ' *** DOCAM OPTIMIZED ***
  2560. '
  2561. Sub PlungerLaneTrigger_Hit()
  2562. bBallInPlungerLane = TRUE
  2563. End Sub
  2564.  
  2565.  
  2566.  
  2567. ' The ball quits the plunger lane trigger.
  2568. '
  2569. ' *** DOCAM OPTIMIZED ***
  2570. '
  2571. Sub PlungerLaneTrigger_UnHit()
  2572. bBallInPlungerLane = FALSE
  2573. End Sub
  2574.  
  2575.  
  2576.  
  2577. ' *********************************************************************
  2578. ' ** "POW" LANES TRIGGERS **
  2579. ' *********************************************************************
  2580.  
  2581.  
  2582.  
  2583. ' The "P" letter trigger has been hit (POW lanes).
  2584. '
  2585. ' *** DOCAM OPTIMIZED ***
  2586. '
  2587. Sub POWLane1_Hit()
  2588. startB2S(3)
  2589. DOF 127, DOFPulse
  2590. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2591. AddScore(100)
  2592. PlaySound "Lane1"
  2593. ' Turn on "P" letter light.
  2594. POWLaneLight1.State = 1
  2595. ' Check if all POW letters are completed.
  2596. CheckPOWLanes()
  2597. End Sub
  2598.  
  2599.  
  2600.  
  2601. ' The "O" letter trigger has been hit (POW lanes).
  2602. '
  2603. ' *** DOCAM OPTIMIZED ***
  2604. '
  2605. Sub POWLane2_Hit()
  2606. startB2S(2)
  2607. DOF 128, DOFPulse
  2608. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2609. AddScore(100)
  2610. PlaySound "Lane1"
  2611. ' Turn on "O" letter light.
  2612. POWLaneLight2.State = 1
  2613. ' Check if all POW letters are completed.
  2614. CheckPOWLanes()
  2615. End Sub
  2616.  
  2617.  
  2618.  
  2619. ' The "W" letter trigger has been hit (POW lanes).
  2620. '
  2621. ' *** DOCAM OPTIMIZED ***
  2622. '
  2623. Sub POWLane3_Hit()
  2624. startB2S(1)
  2625. DOF 129, DOFPulse
  2626. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2627. AddScore(100)
  2628. PlaySound "Lane1"
  2629. ' Turn on "W" letter light.
  2630. POWLaneLight3.State = 1
  2631. ' Check if all POW letters are completed.
  2632. CheckPOWLanes()
  2633. End Sub
  2634.  
  2635.  
  2636.  
  2637. ' *********************************************************************
  2638. ' ** THE LOOP TRIGGER **
  2639. ' *********************************************************************
  2640.  
  2641.  
  2642.  
  2643. ' The loop trigger has been hit.
  2644. '
  2645. ' *** DOCAM OPTIMIZED ***
  2646. '
  2647. Sub LoopTrigger_Hit()
  2648. startB2S(6)
  2649. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2650. ResetWEAPONTargets()
  2651. PlaySound "explode3"
  2652. AddScore(2500)
  2653. End Sub
  2654.  
  2655.  
  2656.  
  2657. ' *********************************************************************
  2658. ' ** OUTLANES & INLANES TRIGGERS **
  2659. ' *********************************************************************
  2660.  
  2661.  
  2662.  
  2663. ' The left inlane trigger has been hit.
  2664. '
  2665. ' *** DOCAM OPTIMIZED ***
  2666. '
  2667. Sub LeftInLaneTrigger_Hit()
  2668. startB2S(3)
  2669. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2670. DOF 111, DOFPulse
  2671. ' Add 1000 points.
  2672. AddScore(1000)
  2673. ' Play specific sound.
  2674. PlaySound "go"
  2675. ' Lit the left inlane light.
  2676. LeftInLaneLight.State = 1
  2677. bLeftInLaneIsLit = TRUE
  2678. If bRightInLaneIsLit Then
  2679. ' If the right inlane light is also lit, lit the kickback...
  2680. LightKickback()
  2681. ' ...and the red right outlane light.
  2682. RightOutLaneLight.State = 1
  2683. End If
  2684. End Sub
  2685.  
  2686.  
  2687.  
  2688. ' The right inlane trigger has been hit.
  2689. '
  2690. ' *** DOCAM OPTIMIZED ***
  2691. '
  2692. Sub RightInLaneTrigger_Hit()
  2693. startB2S(2)
  2694. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2695. DOF 112, DOFPulse
  2696. ' Add 1000 points.
  2697. AddScore(1000)
  2698. ' Play specific sound.
  2699. PlaySound "go"
  2700. ' Lit the right inlane light.
  2701. RightInLaneLight.State = 1
  2702. bRightInLaneIsLit = TRUE
  2703. If bLeftInLaneIsLit Then
  2704. ' If the left inlane light is also lit, lit the kickback...
  2705. LightKickback()
  2706. ' ...and the red right outlane light.
  2707. RightOutLaneLight.State = 1
  2708. End If
  2709. End Sub
  2710.  
  2711.  
  2712.  
  2713. ' The left outlane trigger has been hit.
  2714. '
  2715. ' *** DOCAM OPTIMIZED ***
  2716. '
  2717. Sub LeftOutLaneTrigger_Hit()
  2718. startB2S(4)
  2719. If fpTilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2720. DOF 110, DOFPulse
  2721. ' This flag indicates the trigger is pressed.
  2722. bBallOnLeftOutLaneTrigger = TRUE
  2723. If bKickbackIsLit Then
  2724. KickbackTimer.Uservalue = 1 ' UserData = 1 means ready for kickback.
  2725. KickbackTimer.Enabled = TRUE
  2726. KickbackLight.state = BulbOff', "10", 100
  2727. FlashForMs KickbackLight, 500, 50, 0
  2728. Else
  2729. ' Kickback is disabled.
  2730. ' Play outlane sound.
  2731. PlayOutLaneSound()
  2732. If bBallSaverIsActive Then
  2733. ' Give 3 seconds saver grace delay, only if ball saver is active.
  2734. BallSaverClockTimer.Uservalue = 3
  2735. BallSaverClockTimer.Enabled = FALSE
  2736. BallSaverClockTimer.interval = 3000
  2737. ShootAgainLight.BlinkInterval = 50
  2738. ShootAgainLight.State = BulbBlink
  2739. End If
  2740. ' Add 2000 points.
  2741. AddScore(2000)
  2742. End If
  2743. End Sub
  2744.  
  2745.  
  2746.  
  2747. ' The right outlane trigger has been unhit.
  2748. '
  2749. ' *** DOCAM OPTIMIZED ***
  2750. '
  2751. Sub LeftOutLaneTrigger_UnHit()
  2752. startB2S(4)
  2753. If fpTilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2754. ' Disable the kickback mechanism.
  2755. bBallOnLeftOutLaneTrigger = FALSE
  2756. KickbackTimer.Enabled = FALSE
  2757. KickbackTimer.Uservalue = 0
  2758. End Sub
  2759.  
  2760.  
  2761.  
  2762. ' The right outlane trigger has been hit.
  2763. '
  2764. ' *** DOCAM OPTIMIZED ***
  2765. '
  2766. Dim BallSaverClockTimerUserData
  2767.  
  2768. Sub RightOutLaneTrigger_Hit()
  2769. startB2S(1)
  2770. If fpTilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2771. DOF 113, DOFPulse
  2772. ' Add 2000 points.
  2773. AddScore(2000)
  2774.  
  2775. If ShootAgainLight.State = 0 Then
  2776. bBallSaverIsActive = FALSE
  2777. End If
  2778.  
  2779. If bBallSaverIsActive = True Then
  2780. ' Give 3 seconds saver grace delay, only if ball saver is active.
  2781. BallSaverClockTimer.Uservalue = 3
  2782. BallSaverClockTimer.Enabled = FALSE
  2783. BallSaverClockTimer.interval = 3000
  2784. ShootAgainLight.BlinkInterval = 50
  2785. ShootAgainLight.State = BulbBlink
  2786. End If
  2787. ' Play outlane sound.
  2788. PlayOutLaneSound()
  2789. ' Give additional 2000 points only if (red) right outlane is lit.
  2790. If RightOutLaneLight.State = BulbOn Then AddScore(20000)
  2791. End Sub
  2792.  
  2793.  
  2794. ' *********************************************************************
  2795. ' ** RUBBERS & SLINGSHOTS **
  2796. ' *********************************************************************
  2797.  
  2798.  
  2799.  
  2800. ' The left slingshot has been hit.
  2801. '
  2802. ' *** DOCAM OPTIMIZED ***
  2803. '
  2804. Dim LStep, RStep
  2805. Sub LeftSlingshotRubber_Slingshot()
  2806. startB2S(4)
  2807. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2808.  
  2809. PlaySound SoundFXDOF("LeftSlingShot", 103, DOFPulse, DOFContactors), 0, 1, -0.05, 0.05
  2810. LeftSling4.Visible = 1
  2811. Lemk.RotX = 26
  2812. LStep = 0
  2813. LeftSlingshotRubber.TimerEnabled = True
  2814.  
  2815. ' Play specific sound.
  2816. Playsound "Rocket1"
  2817. ' Add 110 points.
  2818. AddScore(110)
  2819. ' Flash the lights around the lime slingshot.
  2820. FlashForMs LeftSlingshotBulb1, 100, 50, 1
  2821. FlashForMs LeftSlingshotBulb2, 100, 50, 1
  2822. DOF 140, DOFPulse
  2823. End Sub
  2824.  
  2825.  
  2826. Sub LeftSlingshotRubber_Timer
  2827. Select Case LStep
  2828. Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
  2829. Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
  2830. Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -10:LeftSlingshotRubber.TimerEnabled = 0
  2831. End Select
  2832.  
  2833. LStep = LStep + 1
  2834. End Sub
  2835.  
  2836. ' The right slingshot has been hit,
  2837. '
  2838. ' *** DOCAM OPTIMIZED ***
  2839. '
  2840. Sub RightSlingshotRubber_Slingshot()
  2841. startB2S(4)
  2842. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2843.  
  2844. PlaySound SoundFXDOF("RightSlingShot", 104, DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
  2845. DOF 121, DOFPulse
  2846. RightSling4.Visible = 1
  2847. Remk.RotX = 26
  2848. RStep = 0
  2849. RightSlingShotRubber.TimerEnabled = True
  2850.  
  2851. ' Play specific sound.
  2852. Playsound "Rocket1"
  2853. ' Add 110 points.
  2854. AddScore(110)
  2855. ' Flash the lights around the right slingshot.
  2856. FlashForMs RightSlingshotBulb1, 100, 50, 1
  2857. FlashForMs RightSlingshotBulb2, 100, 50, 1
  2858. DOF 141, DOFPulse
  2859. End Sub
  2860.  
  2861. Sub RightSlingShotRubber_Timer
  2862. Select Case RStep
  2863. Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
  2864. Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
  2865. Case 3:RightSLing2.Visible = 0:Remk.RotX = -10:RightSlingShotRubber.TimerEnabled = 0
  2866. End Select
  2867.  
  2868. RStep = RStep + 1
  2869. End Sub
  2870.  
  2871.  
  2872. ' The left slingshot has been hit.
  2873. '
  2874. ' *** DOCAM OPTIMIZED ***
  2875. '
  2876. Sub Rubber6_Hit()
  2877. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  2878. AddScore(10)
  2879. Playsound "go"
  2880. End Sub
  2881.  
  2882.  
  2883.  
  2884. ' *********************************************************************
  2885. ' ** METALSLUG DROP TARGETS BANKS **
  2886. ' *********************************************************************
  2887.  
  2888.  
  2889.  
  2890. ' The drop target "M" (from METAL drop targets bank) has been hit.
  2891. '
  2892. ' *** DOCAM OPTIMIZED ***
  2893. '
  2894. Sub Slug1_Hit()
  2895. startB2S(1)
  2896. DOF 122, DOFPulse
  2897. ' Raise the drop target and ignore if the table is tilted.
  2898. If Tilted Then
  2899. Slug1.SolenoidPulse()
  2900. Exit Sub
  2901. End If
  2902. AddScore(500)
  2903. Slug1Light.State = 1
  2904. CheckSLUGTimer.Enabled = TRUE
  2905. PlaySlugSound()
  2906. Playsound "gun8"
  2907. If bPlayingMission1 Then ScoreMission1()
  2908. End Sub
  2909.  
  2910.  
  2911.  
  2912. ' The drop target "E" (from METAL drop targets bank) has been hit.
  2913. '
  2914. ' *** DOCAM OPTIMIZED ***
  2915. '
  2916. Sub Slug2_Hit()
  2917. startB2S(1)
  2918. DOF 122, DOFPulse
  2919. ' Raise the drop target and ignore if the table is tilted.
  2920. If Tilted Then
  2921. Slug2.SolenoidPulse()
  2922. Exit Sub
  2923. End If
  2924. AddScore(500)
  2925. Slug2Light.State = 1
  2926. CheckSLUGTimer.Enabled = TRUE
  2927. PlaySlugSound()
  2928. Playsound "gun9"
  2929. If bPlayingMission1 Then ScoreMission1()
  2930. End Sub
  2931.  
  2932.  
  2933.  
  2934. ' The drop target "T" (from METAL drop targets bank) has been hit.
  2935. '
  2936. ' *** DOCAM OPTIMIZED ***
  2937. '
  2938. Sub Slug3_Hit()
  2939. startB2S(1)
  2940. DOF 122, DOFPulse
  2941. ' Raise the drop target and ignore if the table is tilted.
  2942. If Tilted Then
  2943. Slug3.SolenoidPulse()
  2944. Exit Sub
  2945. End If
  2946. AddScore(500)
  2947. Slug3Light.State = 1
  2948. CheckSLUGTimer.Enabled = TRUE
  2949. PlaySlugSound()
  2950. Playsound "gun8"
  2951. If bPlayingMission1 Then ScoreMission1()
  2952. End Sub
  2953.  
  2954.  
  2955.  
  2956. ' The drop target "A" (from METAL drop targets bank) has been hit.
  2957. '
  2958. ' *** DOCAM OPTIMIZED ***
  2959. '
  2960. Sub Slug4_Hit()
  2961. startB2S(1)
  2962. DOF 122, DOFPulse
  2963. ' Raise the drop target and ignore if the table is tilted.
  2964. If Tilted Then
  2965. Slug4.SolenoidPulse()
  2966. Exit Sub
  2967. End If
  2968. AddScore(500)
  2969. Slug4Light.State = 1
  2970. CheckSLUGTimer.Enabled = TRUE
  2971. PlaySlugSound()
  2972. Playsound "gun9"
  2973. If bPlayingMission1 Then ScoreMission1()
  2974. End Sub
  2975.  
  2976.  
  2977.  
  2978. ' The drop target "L" (from METAL drop targets bank) has been hit.
  2979. '
  2980. ' *** DOCAM OPTIMIZED ***
  2981. '
  2982. Sub Slug5_Hit()
  2983. startB2S(1)
  2984. DOF 122, DOFPulse
  2985. ' Raise the drop target and ignore if the table is tilted.
  2986. If Tilted Then
  2987. Slug5.SolenoidPulse()
  2988. Exit Sub
  2989. End If
  2990. AddScore(500)
  2991. Slug5Light.State = 1
  2992. CheckSLUGTimer.Enabled = TRUE
  2993. PlaySlugSound()
  2994. Playsound "gun8"
  2995. If bPlayingMission1 Then ScoreMission1()
  2996. End Sub
  2997.  
  2998.  
  2999.  
  3000. ' The drop target "S" (from SLUG drop targets bank) has been hit.
  3001. '
  3002. ' *** DOCAM OPTIMIZED ***
  3003. '
  3004. Sub Slug6_Hit()
  3005. startB2S(1)
  3006. DOF 132, DOFPulse
  3007. ' Raise the drop target and ignore if the table is tilted.
  3008. If Tilted Then
  3009. Slug6.SolenoidPulse()
  3010. Exit Sub
  3011. End If
  3012. AddScore(500)
  3013. Slug6Light.State = 1
  3014. CheckSLUGTimer.Enabled = TRUE
  3015. PlaySlugSound()
  3016. Playsound "gun9"
  3017. If bPlayingMission1 Then ScoreMission1()
  3018. End Sub
  3019.  
  3020.  
  3021.  
  3022. ' The drop target "L" (from SLUG drop targets bank) has been hit.
  3023. '
  3024. ' *** DOCAM OPTIMIZED ***
  3025. '
  3026. Sub Slug7_Hit()
  3027. startB2S(1)
  3028. DOF 132, DOFPulse
  3029. ' Raise the drop target and ignore if the table is tilted.
  3030. If Tilted Then
  3031. Slug7.SolenoidPulse()
  3032. Exit Sub
  3033. End If
  3034. AddScore(500)
  3035. Slug7Light.State = 1
  3036. CheckSLUGTimer.Enabled = TRUE
  3037. PlaySlugSound()
  3038. Playsound "gun8"
  3039. If bPlayingMission1 Then ScoreMission1()
  3040. End Sub
  3041.  
  3042.  
  3043.  
  3044. ' The drop target "U" (from SLUG drop targets bank) has been hit.
  3045. '
  3046. ' *** DOCAM OPTIMIZED ***
  3047. '
  3048. Sub Slug8_Hit()
  3049. startB2S(1)
  3050. DOF 132, DOFPulse
  3051. ' Raise the drop target and ignore if the table is tilted.
  3052. If Tilted Then
  3053. Slug8.SolenoidPulse()
  3054. Exit Sub
  3055. End If
  3056. AddScore(500)
  3057. Slug8Light.State = 1
  3058. CheckSLUGTimer.Enabled = TRUE
  3059. PlaySlugSound()
  3060. Playsound "gun9"
  3061. If bPlayingMission1 Then ScoreMission1()
  3062. End Sub
  3063.  
  3064.  
  3065.  
  3066. ' The drop target "G" (from SLUG drop targets bank) has been hit.
  3067. '
  3068. ' *** DOCAM OPTIMIZED ***
  3069. '
  3070. Sub Slug9_Hit()
  3071. startB2S(1)
  3072. DOF 132, DOFPulse
  3073. ' Raise the drop target and ignore if the table is tilted.
  3074. If Tilted Then
  3075. Slug9.SolenoidPulse()
  3076. Exit Sub
  3077. End If
  3078. AddScore(500)
  3079. Slug9Light.State = 1
  3080. CheckSLUGTimer.Enabled = TRUE
  3081. PlaySlugSound()
  3082. Playsound "gun8"
  3083. If bPlayingMission1 Then ScoreMission1()
  3084. End Sub
  3085.  
  3086.  
  3087.  
  3088. ' *********************************************************************
  3089. ' ** WEAPON DROP TARGETS BANK **
  3090. ' *********************************************************************
  3091.  
  3092.  
  3093.  
  3094. ' The drop target "W" (from WEAPON drop targets bank, also called "the wall") has been hit.
  3095. '
  3096. ' *** DOCAM OPTIMIZED ***
  3097. '
  3098. Sub W1_Hit()
  3099. startB2S(1)
  3100. DOF 134, DOFPulse
  3101. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3102. If Not(bMultiBallMode) Then
  3103. If bPlayingMission Then
  3104. If bPlayingMission1 Then
  3105. ScoreMission1()
  3106. W1Light.State = 1
  3107. bW1TargetIsDown = TRUE
  3108. CheckWeapon()
  3109. ElseIf bPlayingMission2 Then
  3110. FlashForMs W1Light, 500, 100, 0
  3111. ScoreMission2()
  3112. ElseIf bPlayingMission5 Then
  3113. FlashForMs W1Light, 500, 100, 0
  3114. ScoreMission5()
  3115. ElseIf bPlayingMission3 Or bPlayingMission4 Or bPlayingFinalMission Then
  3116. Playsound "steel"
  3117. W1Light.State = 1
  3118. bW1TargetIsDown = TRUE
  3119. CheckWeapon()
  3120. AddScore(500)
  3121. End If
  3122. Else
  3123. Playsound "steel"
  3124. AddScore(500)
  3125. W1Light.State = 1
  3126. bW1TargetIsDown = TRUE
  3127. CheckWeapon()
  3128. End If
  3129. End If
  3130. End Sub
  3131.  
  3132.  
  3133.  
  3134. ' The drop target "E" (from WEAPON drop targets bank, also called "the wall") has been hit.
  3135. '
  3136. ' *** DOCAM OPTIMIZED ***
  3137. '
  3138. Sub W2_Hit()
  3139. startB2S(1)
  3140. DOF 134, DOFPulse
  3141. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3142. If Not(bMultiBallMode) Then
  3143. If bPlayingMission Then
  3144. If bPlayingMission1 Then
  3145. ScoreMission1()
  3146. W2Light.State = 1
  3147. bW2TargetIsDown = TRUE
  3148. CheckWeapon()
  3149. ElseIf bPlayingMission2 Then
  3150. FlashForMs W2Light, 500, 100, 0
  3151. ScoreMission2()
  3152. ElseIf bPlayingMission5 Then
  3153. FlashForMs W2Light, 500, 100, 0
  3154. ScoreMission5()
  3155. ElseIf bPlayingMission3 Or bPlayingMission4 Or bPlayingFinalMission Then
  3156. Playsound "steel"
  3157. W2Light.State = 1
  3158. bW2TargetIsDown = TRUE
  3159. CheckWeapon()
  3160. AddScore(500)
  3161. End If
  3162. Else
  3163. Playsound "steel"
  3164. AddScore(500)
  3165. W2Light.State = 1
  3166. bW2TargetIsDown = TRUE
  3167. CheckWeapon()
  3168. End If
  3169. End If
  3170. End Sub
  3171.  
  3172.  
  3173.  
  3174. ' The drop target "A" (from WEAPON drop targets bank, also called "the wall") has been hit.
  3175. '
  3176. ' *** DOCAM OPTIMIZED ***
  3177. '
  3178. Sub W3_Hit()
  3179. startB2S(1)
  3180. DOF 134, DOFPulse
  3181. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3182. If Not(bMultiBallMode) Then
  3183. If bPlayingMission Then
  3184. If bPlayingMission1 Then
  3185. ScoreMission1()
  3186. W3Light.State = 1
  3187. bW3TargetIsDown = TRUE
  3188. CheckWeapon()
  3189. ElseIf bPlayingMission2 Then
  3190. FlashForMs W3Light, 500, 100, BulbOff
  3191. ScoreMission2()
  3192. ElseIf bPlayingMission5 Then
  3193. FlashForMs W3Light, 500, 100, BulbOff
  3194. ScoreMission5()
  3195. ElseIf bPlayingMission3 Or bPlayingMission4 Or bPlayingFinalMission Then
  3196. Playsound "steel"
  3197. W3Light.State = 1
  3198. bW3TargetIsDown = TRUE
  3199. CheckWeapon()
  3200. AddScore(500)
  3201. End If
  3202. Else
  3203. Playsound "steel"
  3204. AddScore(500)
  3205. W3Light.State = 1
  3206. bW3TargetIsDown = TRUE
  3207. CheckWeapon()
  3208. End If
  3209. End If
  3210. End Sub
  3211.  
  3212.  
  3213.  
  3214. ' The drop target "P" (from WEAPON drop targets bank, also called "the wall") has been hit.
  3215. '
  3216. ' *** DOCAM OPTIMIZED ***
  3217. '
  3218. Sub W4_Hit()
  3219. startB2S(1)
  3220. DOF 134, DOFPulse
  3221. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3222. If Not(bMultiBallMode) Then
  3223. If bPlayingMission Then
  3224. If bPlayingMission1 Then
  3225. ScoreMission1()
  3226. W4Light.State = 1
  3227. bW4TargetIsDown = TRUE
  3228. CheckWeapon()
  3229. ElseIf bPlayingMission2 Then
  3230. FlashForMs W4Light, 500, 100, 0
  3231. ScoreMission2()
  3232. ElseIf bPlayingMission5 Then
  3233. FlashForMs W4Light, 500, 100, 0
  3234. ScoreMission5()
  3235. ElseIf bPlayingMission3 Or bPlayingMission4 Or bPlayingFinalMission Then
  3236. Playsound "steel"
  3237. W4Light.State = 1
  3238. bW4TargetIsDown = TRUE
  3239. CheckWeapon()
  3240. AddScore(500)
  3241. End If
  3242. Else
  3243. Playsound "steel"
  3244. AddScore(500)
  3245. W4Light.State = 1
  3246. bW4TargetIsDown = TRUE
  3247. CheckWeapon()
  3248. End If
  3249. End If
  3250. End Sub
  3251.  
  3252.  
  3253.  
  3254. ' The drop target "O" (from WEAPON drop targets bank, also called "the wall") has been hit.
  3255. '
  3256. ' *** DOCAM OPTIMIZED ***
  3257. '
  3258. Sub W5_Hit()
  3259. startB2S(1)
  3260. DOF 134, DOFPulse
  3261. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3262. If Not(bMultiBallMode) Then
  3263. If bPlayingMission Then
  3264. If bPlayingMission1 Then
  3265. ScoreMission1()
  3266. W5Light.State = 1
  3267. bW5TargetIsDown = TRUE
  3268. CheckWeapon()
  3269. ElseIf bPlayingMission2 Then
  3270. FlashForMs W5Light, 500, 100, 0
  3271. ScoreMission2()
  3272. ElseIf bPlayingMission5 Then
  3273. FlashForMs W5Light, 500, 100, 0
  3274. ScoreMission5()
  3275. ElseIf bPlayingMission3 Or bPlayingMission4 Or bPlayingFinalMission Then
  3276. Playsound "steel"
  3277. W5Light.State = 1
  3278. bW5TargetIsDown = TRUE
  3279. CheckWeapon()
  3280. AddScore(500)
  3281. End If
  3282. Else
  3283. Playsound "steel"
  3284. AddScore(500)
  3285. W5Light.State = 1
  3286. bW5TargetIsDown = TRUE
  3287. CheckWeapon()
  3288. End If
  3289. End If
  3290. End Sub
  3291.  
  3292.  
  3293.  
  3294. ' The drop target "N" (from WEAPON drop targets bank, also called "the wall") has been hit.
  3295. '
  3296. ' *** DOCAM OPTIMIZED ***
  3297. '
  3298. Sub W6_Hit()
  3299. startB2S(1)
  3300. DOF 134, DOFPulse
  3301. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3302. If Not(bMultiBallMode) Then
  3303. If bPlayingMission Then
  3304. If bPlayingMission1 Then
  3305. ScoreMission1()
  3306. W6Light.State = 1
  3307. bW6TargetIsDown = TRUE
  3308. CheckWeapon()
  3309. ElseIf bPlayingMission2 Then
  3310. FlashForMs W6Light, 500, 100, 0
  3311. ScoreMission2()
  3312. ElseIf bPlayingMission5 Then
  3313. FlashForMs W6Light, 500, 100, 0
  3314. ScoreMission5()
  3315. ElseIf bPlayingMission3 Or bPlayingMission4 Or bPlayingFinalMission Then
  3316. Playsound "steel"
  3317. W6Light.State = 1
  3318. bW6TargetIsDown = TRUE
  3319. CheckWeapon()
  3320. AddScore(500)
  3321. End If
  3322. Else
  3323. Playsound "steel"
  3324. AddScore(500)
  3325. W6Light.State = 1
  3326. bW6TargetIsDown = TRUE
  3327. CheckWeapon()
  3328. End If
  3329. End If
  3330. End Sub
  3331.  
  3332.  
  3333.  
  3334. ' *********************************************************************
  3335. ' ** LEFT-SIDE DROP TARGETS BANK **
  3336. ' *********************************************************************
  3337.  
  3338.  
  3339.  
  3340. ' The first left-side target has been hit.
  3341. '
  3342. ' *** DOCAM OPTIMIZED ***
  3343. '
  3344. Sub S1_Hit()
  3345. startB2S(1)
  3346. DOF 118, DOFPulse
  3347. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3348. AddScore(1000)
  3349. Playsound "explode4"
  3350. S1Light.State = 1
  3351. If bPlayingMission1 Then ScoreMission1()
  3352. End Sub
  3353.  
  3354.  
  3355.  
  3356. ' The second left-side target has been hit.
  3357. '
  3358. ' *** DOCAM OPTIMIZED ***
  3359. '
  3360. Sub S2_Hit()
  3361. startB2S(1)
  3362. DOF 118, DOFPulse
  3363. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3364. AddScore(2000)
  3365. Playsound "explode4"
  3366. S2Light.State = 1
  3367. If bPlayingMission1 Then ScoreMission1()
  3368. End Sub
  3369.  
  3370.  
  3371.  
  3372. ' The last left-side target has been hit.
  3373. '
  3374. ' *** DOCAM OPTIMIZED ***
  3375. '
  3376. Sub S3_Hit()
  3377. startB2S(1)
  3378. DOF 118, DOFPulse
  3379. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3380. AddScore(3000)
  3381. Playsound "explode4"
  3382. S3Light.State = 1
  3383. If bPlayingMission1 Then ScoreMission1()
  3384. End Sub
  3385.  
  3386.  
  3387.  
  3388. ' *********************************************************************
  3389. ' ** CAPTIVE BALL DROP TARGETS BANK **
  3390. ' *********************************************************************
  3391.  
  3392.  
  3393.  
  3394. ' The captive drop target 1 (bottom) has been hit.
  3395. '
  3396. ' *** DOCAM OPTIMIZED ****
  3397. '
  3398. Sub C1_Hit()
  3399. startB2S(1)
  3400. DOF 119, DOFPulse
  3401. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3402. If bGameInPlay Then
  3403. C1Light.State = 1
  3404. AddScore(2000)
  3405. If bPlayingMission Then
  3406. If bPlayingMission1 Then ScoreMission1()
  3407. If bPlayingMission4 Then ScoreMission4()
  3408. Else
  3409. LightMission()
  3410. Playsound "Thankyou"
  3411. End If
  3412. End If
  3413. End Sub
  3414.  
  3415.  
  3416.  
  3417. ' The captive drop target 2 (middle) has been hit.
  3418. '
  3419. ' *** DOCAM OPTIMIZED ****
  3420. '
  3421. Sub C2_Hit()
  3422. startB2S(1)
  3423. DOF 119, DOFPulse
  3424. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3425. If bGameInPlay Then
  3426. C2Light.State = 1
  3427. AddScore(2000)
  3428. If bPlayingMission Then
  3429. If bPlayingMission1 Then ScoreMission1()
  3430. If bPlayingMission4 Then ScoreMission4()
  3431. Else
  3432. LightMission()
  3433. Playsound "Thankyou"
  3434. End If
  3435. End If
  3436. End Sub
  3437.  
  3438.  
  3439.  
  3440. ' The captive drop target 3 (top) has been hit.
  3441. '
  3442. ' *** DOCAM OPTIMIZED ****
  3443. '
  3444. Sub C3_Hit()
  3445. startB2S(1)
  3446. DOF 119, DOFPulse
  3447. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3448. If bGameInPlay Then
  3449. C1Light.State = 2
  3450. C2Light.State = 2
  3451. C3Light.State = 2
  3452. AddScore(2000)
  3453. If bPlayingMission Then
  3454. If bPlayingMission1 Then ScoreMission1()
  3455. If bPlayingMission4 Then ScoreMission4()
  3456. Else
  3457. LightMission()
  3458. Playsound "Thankyou"
  3459. End If
  3460. End If
  3461. End Sub
  3462.  
  3463.  
  3464.  
  3465. ' *********************************************************************
  3466. ' ** CAPTIVE BALL TARGET **
  3467. ' *********************************************************************
  3468.  
  3469.  
  3470.  
  3471. ' The captive target has been hit.
  3472. '
  3473. ' *** DOCAM OPTIMIZED ****
  3474. '
  3475. Sub C4_Hit()
  3476. startB2S(6)
  3477. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3478. ' This statement drops the next side target (useful to open access to kicker 4).
  3479. If S1.IsDropped = 1 Then
  3480. If S2.IsDropped = 1 Then
  3481. If Not(S3.IsDropped) Then
  3482. S3.isdropped = 1
  3483. S3Light.State = 1
  3484. End If
  3485. Else
  3486. S2.isdropped = 1
  3487. S2Light.State = 1
  3488. End If
  3489. Else
  3490. S1.isdropped = 1
  3491. S1Light.State = 1
  3492. End If
  3493. Playsound "Ok"
  3494. AdvancePOW()
  3495. AddScore(8000)
  3496. If Not(bPlayingMission) And Not(bMissionSuspended) Then LightMission()
  3497. If bPlayingMission Then
  3498. If bPlayingMission1 Then ScoreMission1()
  3499. If bPlayingMission4 Then ScoreMission4()
  3500. End If
  3501. If bPlayingFinalMission Then
  3502. InterruptDisplay(600)
  3503. AddScore(50000)
  3504. 'D1.FlushQueue()
  3505. 'D2.FlushQueue()
  3506. D1.Text = " * 40,000 * "
  3507. DisplayB2SText " * 40,000 * "
  3508. 'D1.QueueText " 40,000 ", seBlinkMask, 300
  3509. 'D2.QueueText " 40,000 ", seBlinkMask, 300
  3510. End If
  3511. End Sub
  3512.  
  3513.  
  3514.  
  3515. ' *********************************************************************
  3516. ' ** DRAIN & KICKERS **
  3517. ' *********************************************************************
  3518.  
  3519.  
  3520.  
  3521. ' Lost a ball (falling in drain).
  3522. '
  3523. ' *** DOCAM OPTIMIZED ***
  3524. '
  3525. Sub Drain_Hit()
  3526. startB2S(6)
  3527. DOF 130, DOFPulse
  3528. ' Destroy the ball.
  3529. Drain.DestroyBall()
  3530. BallsOnPlayfield = BallsOnPlayfield - 1
  3531. ' Pretend to knock the ball into the ball storage mechanism.
  3532. PlaySound "Drain"
  3533. If fpTilted Then FixWeapon()
  3534. ' If there is a game in progress and not tilted.
  3535. If bGameInPlay And Not(fpTilted) Then
  3536. If Not(bPlayingFinalMission) Then
  3537.  
  3538. If ShootAgainLight.State = 0 Then
  3539. bBallSaverIsActive = FALSE
  3540. End If
  3541.  
  3542. If bBallSaverIsActive = True Then
  3543. bBallSaverIsActive = FALSE
  3544. BallSaverClockTimer.Enabled = FALSE
  3545. BallSaverClockTimer.Uservalue = 0
  3546. ShootAgainLight.State = BulbOff
  3547. ShootAgainLight.BlinkInterval = 150
  3548. AutoBall()
  3549. 'D1.FlushQueue()
  3550. 'D2.FlushQueue()
  3551.  
  3552. D1.Text = " BALL SAVED "
  3553. DisplayB2SText " BALL SAVED "
  3554. 'D2.QueueText " BALL SAVED ", seBlinkMask, 150
  3555. Else
  3556. If (BallsOnPlayfield = 0) Then EndOfBall()
  3557. If (BallsOnPlayfield = 1) And (BallsLocked = 1) Then EndOfBall()
  3558. If (BallsOnPlayfield = 2) And (BallsLocked = 2) Then EndOfBall()
  3559. If (BallsOnPlayfield = 3) And (BallsLocked = 3) Then EndOfBall()
  3560. If (BallsOnPlayfield = 1) And (BallsLocked = 0) Then EndMultiBall()
  3561. If (BallsOnPlayfield = 3) And (BallsLocked = 0) Then Playsound "Fiodie"
  3562. If (BallsOnPlayfield = 2) And (BallsLocked = 0) Then Playsound "Eridie"
  3563. If (BallsOnPlayfield = 1) And (BallsLocked = 0) Then Playsound "Tarmadie"
  3564. End If
  3565. Else
  3566. If Not(FiveBallOverTimer.Enabled) Then
  3567. If BallsOnPlayfield = 0 Then
  3568. ' Terminate the final mission (mission all over).
  3569. ' LookAtBackbox()
  3570. ' PlayMusic 1, "Msmissionallover", FALSE
  3571. ' PlayMusic 4, "missionallover", FALSE
  3572. MissionAllOverTimer.Enabled = TRUE
  3573. FinalMissionShowTimer.Uservalue = 11
  3574. FinalMissionShowTimer.Enabled = TRUE
  3575. bPlayingMission = FALSE
  3576. bPlayingFinalMission = FALSE
  3577. bPlayingMission1 = FALSE
  3578. NextMessage = 9
  3579. bCanDisplayMessage = TRUE
  3580. BallsLocked = 0
  3581. DisplayB2SText " MISSION ALL OVER "
  3582. D1.Text = " MISSION ALL OVER "
  3583. End If
  3584. End If
  3585. End If
  3586. End If
  3587. End Sub
  3588.  
  3589.  
  3590.  
  3591. ' A ball may of rolled into the plunger lane kicker, if so, kick it back out again.
  3592. '
  3593. ' *** DOCAM OPTIMIZED ***
  3594. '
  3595. Sub PlungerKicker_Hit()
  3596. PlungerKickerSolenoidPulse()
  3597. End Sub
  3598.  
  3599.  
  3600.  
  3601. ' The kicker 1 (bottom left side) has been hit.
  3602. '
  3603. ' *** DOCAM OPTIMIZED ****
  3604. '
  3605. Sub Kicker1_Hit()
  3606. startB2S(3)
  3607. If bBallLockedInKicker1 Then
  3608. ' Prevent the _Hit() event when a ball is already locked (when a locked ball is hit by another ball, this generate _Hit event !).
  3609. Exit Sub
  3610. Else
  3611. If Tilted Then
  3612. ' Eject the ball if the table is tilted.
  3613. If bBallInKicker1 And Not(bBallLockedInKicker1) Then
  3614. Kicker1SolenoidPulse()
  3615. bBallInKicker1 = FALSE
  3616. Exit Sub
  3617. End If
  3618. End If
  3619. bBallInKicker1 = TRUE
  3620. AddScore(5000)
  3621. If bFinalMissionIsReady Then
  3622. StartMission()
  3623. Else
  3624. If bLockIsLit Then
  3625. LockBall()
  3626. If bMissionIsLit Then StartMissionSoon()
  3627. Else
  3628. If bMissionIsLit And Not(bMultiBallMode) Then StartMission()
  3629. Kicker1Timer.Enabled = TRUE
  3630. End If
  3631. End If
  3632. If bPlayingFinalMission Then AddScore 20000
  3633. End If
  3634. End Sub
  3635.  
  3636. Sub Kicker1SolenoidPulse()
  3637. Kicker1.kick 170, 15
  3638. Playsound SoundFXDOF("fx_kicker",108,DOFPulse,DOFContactors)
  3639. DOF 114, DOFPulse
  3640. End Sub
  3641.  
  3642.  
  3643. ' The kicker 2 (bottom right side) has been hit.
  3644. '
  3645. ' *** DOCAM WORKING ****
  3646. '
  3647. Sub Kicker2_Hit()
  3648. startB2S(2)
  3649. If bBallLockedInKicker2 Then
  3650. ' Prevent the _Hit() event when a ball is already locked (when a locked ball is hit by another ball, this generate _Hit event !).
  3651. Exit Sub
  3652. Else
  3653. If Tilted Then
  3654. ' Eject the ball if the table is tilted.
  3655. If bBallInKicker2 And Not(bBallLockedInKicker2) Then
  3656. Kicker2SolenoidPulse()
  3657. bBallInKicker2 = FALSE
  3658. Exit Sub
  3659. End If
  3660. End If
  3661. bBallInKicker2 = TRUE
  3662. AddScore(5000)
  3663. If bFinalMissionIsReady Then
  3664. StartMission()
  3665. Else
  3666. If bLockIsLit Then
  3667. LockBall()
  3668. If bMissionIsLit Then StartMissionSoon()
  3669. Else
  3670. If bMissionIsLit And Not(bMultiBallMode) Then StartMission()
  3671. Kicker2Timer.Enabled = TRUE
  3672. End If
  3673. End If
  3674. If bPlayingFinalMission Then AddScore(20000)
  3675. End If
  3676. End Sub
  3677.  
  3678.  
  3679. Sub Kicker2SolenoidPulse()
  3680. Kicker2.kick 220, 15
  3681. Playsound SoundFXDOF("fx_kicker",115,DOFPulse,DOFContactors)
  3682. DOF 114, DOFPulse
  3683. End Sub
  3684.  
  3685. ' The kicker 3 (center) has been hit.
  3686. '
  3687. ' *** DOCAM WORKING ****
  3688. '
  3689. Sub Kicker3_Hit()
  3690. startB2S(5)
  3691. If bBallLockedInKicker3 Then
  3692. ' Prevent the _Hit() event when a ball is already locked (when a locked ball is hit by another ball, this generate _Hit event !).
  3693. Exit Sub
  3694. Else
  3695. If Tilted Then
  3696. ' Eject the ball if the table is tilted.
  3697. If bBallInKicker3 And Not(bBallLockedInKicker3) Then
  3698. Kicker3SolenoidPulse()
  3699. bBallInKicker3 = FALSE
  3700. Exit Sub
  3701. End If
  3702. End If
  3703. bBallInKicker3 = TRUE
  3704. AddScore(5000)
  3705. If bFinalMissionIsReady Then
  3706. StartMission()
  3707. Else
  3708. If bLockIsLit Then
  3709. LockBall()
  3710. If bMissionIsLit Then StartMissionSoon()
  3711. Else
  3712. If bMissionIsLit And Not(bMultiBallMode) Then StartMission()
  3713. Kicker3Timer.Enabled = TRUE
  3714. End If
  3715. End If
  3716. If bPlayingFinalMission Then AddScore(20000)
  3717. End If
  3718. End Sub
  3719.  
  3720. Sub Kicker3SolenoidPulse()
  3721. Kicker3.kick 165, 15
  3722. Playsound SoundFXDOF("fx_kicker",116,DOFPulse,DOFContactors)
  3723. DOF 114, DOFPulse
  3724. End Sub
  3725.  
  3726. ' The kicker 4 (top of the table) has been hit.
  3727. '
  3728. ' *** DOCAM OPTIMIZED ****
  3729. '
  3730.  
  3731. Sub Kicker4_Hit()
  3732. startB2S(4)
  3733. If bBallLockedInKicker4 Then
  3734. ' Prevent the _Hit() event when a ball is already locked (when a locked ball is hit by another ball, this generate _Hit event !).
  3735. Exit Sub
  3736. Else
  3737. ' Eject the ball if the table is tilted.
  3738. If Tilted Then
  3739. If bBallInKicker4 And Not(bBallLockedInKicker4) Then
  3740. Kicker4SolenoidPulse()
  3741. bBallInKicker4 = FALSE
  3742. Exit Sub
  3743. End If
  3744. End If
  3745. bBallInKicker4 = TRUE
  3746. AddScore(5000)
  3747. If bFinalMissionIsReady Then
  3748. StartMission()
  3749. Else
  3750. If bLockIsLit Then
  3751. LockBall()
  3752. Else
  3753. Kicker4Timer.Enabled = TRUE
  3754. End If
  3755. End If
  3756. If bPlayingFinalMission Then AddScore(20000)
  3757. End If
  3758. If bJackpotIsLit Then
  3759. ' Scoring jackpot.
  3760. GIOff()
  3761. FlashEffect 0
  3762. FlashEffectMissionTimer.enabled = 0
  3763. AddScore(nvR4 * 100000)
  3764. JackpotLight.State = 1
  3765. bJackpotScored = TRUE
  3766. bJackpotIsLit = FALSE
  3767. If Not(bPlayingFinalMission) Then StopMusic 1
  3768. JackpotDisplayTimerUserData = 0
  3769. JackpotDisplayTimer.Enabled = TRUE
  3770. End If
  3771. End Sub
  3772.  
  3773. Sub Kicker4SolenoidPulse()
  3774. Kicker4.kick 270, 25
  3775. Playsound SoundFXDOF("fx_kicker",117,DOFPulse,DOFContactors)
  3776. End Sub
  3777.  
  3778. ' *********************************************************************
  3779. ' ** BUMPERS **
  3780. ' *********************************************************************
  3781.  
  3782.  
  3783.  
  3784. ' The bumper 1 (top left) has been hit.
  3785. '
  3786. ' *** DOCAM OPTIMIZED ***
  3787. '
  3788. Sub Bumper1_Hit()
  3789. startB2S(3)
  3790. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3791. AddScore(1000)
  3792. If bPlayingMission Then
  3793. FlashForMs F9, 100, 50, 2
  3794. DOF 144, DOFPulse
  3795. If bPlayingMission3 Then
  3796. RemainingJets = RemainingJets - 1
  3797. CheckJets()
  3798. Else
  3799. 'Playsound "gun9"
  3800. playsound SoundFXDOF("gun9",106,DOFPulse,DOFContactors)
  3801. End If
  3802. Else
  3803. FlashForMs F9, 100, 50, 0
  3804. DOF 144, DOFPulse
  3805. 'Playsound "gun9"
  3806. playsound SoundFXDOF("gun9",106,DOFPulse,DOFContactors)
  3807. End If
  3808. If bPlayingFinalMission Then AddScore(5000)
  3809. End Sub
  3810.  
  3811.  
  3812.  
  3813. ' The bumper 2 (top right) has been hit.
  3814. '
  3815. ' *** DOCAM OPTIMIZED ***
  3816. '
  3817. Sub Bumper2_Hit()
  3818. startB2S(2)
  3819. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3820. AddScore(1000)
  3821. If bPlayingMission Then
  3822. FlashForMs F10, 100, 50, 2
  3823. DOF 142, DOFPulse
  3824. If bPlayingMission3 Then
  3825. RemainingJets = RemainingJets - 1
  3826. CheckJets()
  3827. Else
  3828. 'Playsound "gun8"
  3829. playsound SoundFXDOF("gun8",105,DOFPulse,DOFContactors)
  3830. End If
  3831. Else
  3832. FlashForMs F10, 100, 50, 0
  3833. DOF 142, DOFPulse
  3834. 'Playsound "gun8"
  3835. playsound SoundFXDOF("gun8",105,DOFPulse,DOFContactors)
  3836. End If
  3837. If bPlayingFinalMission Then AddScore(5000)
  3838. End Sub
  3839.  
  3840.  
  3841.  
  3842. ' The bumper 2 (bottom) has been hit.
  3843. '
  3844. ' *** DOCAM OPTIMIZED ***
  3845. '
  3846. Sub Bumper3_Hit()
  3847. startB2S(5)
  3848. If Tilted Then Exit Sub ' Ignore this _Hit() event if the table is tilted.
  3849. AddScore(1000)
  3850. If bPlayingMission Then
  3851. FlashForMs F6, 100, 50, 2
  3852. DOF 143, DOFPulse
  3853. If bPlayingMission3 Then
  3854. RemainingJets = RemainingJets - 1
  3855. CheckJets()
  3856. Else
  3857. 'Playsound "gun9"
  3858. playsound SoundFXDOF("gun9",107,DOFPulse,DOFContactors)
  3859. End If
  3860. Else
  3861. FlashForMs F6, 100, 50, 0
  3862. DOF 143, DOFPulse
  3863. 'Playsound "gun9"
  3864. playsound SoundFXDOF("gun9",107,DOFPulse,DOFContactors)
  3865. End If
  3866. If bPlayingFinalMission Then AddScore(5000)
  3867. End Sub
  3868.  
  3869.  
  3870.  
  3871. ' *********************************************************************
  3872. ' ** **
  3873. ' ** TIMER EVENTS **
  3874. ' ** **
  3875. ' *********************************************************************
  3876.  
  3877.  
  3878.  
  3879. ' This timer is used to delay the start of a game to allow any attract sequence to
  3880. ' complete. When it expires, it creates a ball for the player to start playing.
  3881. '
  3882. ' *** DOCAM OPTIMIZED ***
  3883. '
  3884.  
  3885. Sub FirstBallDelayTimer_timer()
  3886. ' Stop the timer.
  3887. FirstBallDelayTimer.Enabled = FALSE
  3888. ' Be sure the camera is correctly looking the table.
  3889. ' LookAtPlayfield()
  3890. ' Main theme.
  3891. PlaySong "mu_MSMain"
  3892. ' Turn on GI.
  3893. GIOn()
  3894. ' Set other flags and required lits.
  3895. bPlayingMission = FALSE
  3896. bMissionIsLit = FALSE
  3897. bMissionSuspended = FALSE
  3898. bLockIsLit = FALSE
  3899. bFinalMissionIsReady = FALSE
  3900. ' Turn on "mission ready" lites.
  3901. LightMission()
  3902. ' Enable the kickback.
  3903. LightKickback()
  3904. ' Raise drop targets.
  3905. ResetSLUGTargets()
  3906. ResetCaptiveTargets()
  3907. ResetSideTargets()
  3908. CurrentWeapon = 0
  3909. Score(1) = 0
  3910. ' Reset mission lights.
  3911. Mission1Light.State = BulbBlink', "10", 150
  3912. Mission2Light.State = BulbOff', "10", 150
  3913. Mission3Light.State = BulbOff', "10", 150
  3914. Mission4Light.State = BulbOff', "10", 150
  3915. Mission5Light.State = BulbOff', "10", 150
  3916. Mission6Light.State = BulbOff', "10", 150
  3917. ' Raise the SLUG drop targets.
  3918. ResetSLUGTargets()
  3919. ' Reset mission.
  3920. Mission = 0
  3921. ' Raise WEAPON drop targets.
  3922. bWallIsDown = TRUE
  3923. ResetWEAPONTargets()
  3924. bWallIsDown = FALSE
  3925. Weapon1.State = BulbBlink', "10", 150
  3926. ' Set the initial POW bonus (regardling table setup).
  3927. If nvR3 = 3 Then
  3928. ' If POW BONUS HOLD set to ALWAYS (bonus held until game over), bonus starts at 0, then kept during whole game.
  3929. POWBonus = 0
  3930. POWBonusBall = 0
  3931. Else
  3932. ' Otherwise, bonus starts at 1.
  3933. POWBonus = 1
  3934. POWBonusBall = 1
  3935. End If
  3936. ' Update score (at 0) and Ball in play.
  3937. Ball = Ball + 1
  3938. AddScore(0)
  3939. ' Reset the table for a new ball.
  3940. ResetForNewPlayerBall()
  3941. ' Create a new ball in the shooters lane.
  3942. CreateNewBall()
  3943. End Sub
  3944.  
  3945.  
  3946.  
  3947. ' The tilt recovery timer waits for all the balls to drain before continuing on as per normal.
  3948. '
  3949. ' *** DOCAM MUST BE CHECKED ***
  3950. '
  3951. Sub TiltRecoveryTimer_Timer()
  3952. ' disable the timer.
  3953. TiltRecoveryTimer.Enabled = FALSE
  3954. If (BallsOnPlayfield - BallsLocked) = 0 Then
  3955. ' Restore the general illumation (GI).
  3956. GIOn()
  3957. ' Restore the WEAPON drop targets state.
  3958. FixWeapon()
  3959. ' If all non locked ball(s) have been drained, then do the normal end of ball.
  3960. EndOfBall()
  3961. Else
  3962. ' otherwise retry in another second (wait for locating ball(s)).
  3963. TiltRecoveryTimer.Interval = 1000
  3964. TiltRecoveryTimer.Enabled = TRUE
  3965. End If
  3966. End Sub
  3967.  
  3968.  
  3969.  
  3970. ' Called when the 'delay to protect' display is expired.
  3971. '
  3972. ' *** DOCAM MUST BE CHECKED ***
  3973. '
  3974. Sub InterruptDisplayTimer_Timer()
  3975. InterruptDisplayTimer.Enabled = FALSE
  3976. bInterruptedDisplay = FALSE
  3977. If bPlayingBall Then AddScore(0)
  3978. End Sub
  3979.  
  3980.  
  3981.  
  3982. ' *** DOCAM MUST BE CHECKED ***
  3983. '
  3984. Sub EndOfBallTimer2_Timer()
  3985. EndOfBallTimer2.Enabled = FALSE
  3986. ' Only process any of this if the table is not tilted.
  3987. ' The tilt recovery mechanism will handle any extra ball or end of game.
  3988. If Not(Tilted) Then
  3989. ' Table is not tilted: add in POW bonus points.
  3990. POWBonusCount = POWBonus
  3991. If POWBonusCount = 0 Then
  3992. EndOfBallTimer.Interval = 3200
  3993. Else
  3994. EndOfBallTimer.Interval = 5000
  3995. End If
  3996. POWBonusTimer.Enabled = TRUE
  3997. Else
  3998. ' Table is tilted: no bonus, so move to the next state quickly.
  3999. EndOfBallTimer.Interval = 20
  4000. POWBonusCount = 0
  4001. End If
  4002. ' start the end of ball timer which allows you to add a delay at this point
  4003. EndOfBallTimer.Enabled = TRUE
  4004. End Sub
  4005.  
  4006.  
  4007.  
  4008. ' This which delays the machine to allow any bonus points to be added up has expired.
  4009. ' Check to see if there are any extra ball for the player.
  4010. ' if not, check to see if this was the last ball.
  4011. '
  4012. ' *** DOCAM MUST BE CHECKED ***
  4013. '
  4014. Sub EndOfBallTimer_Timer()
  4015. Dim PosInTable
  4016. Dim Suffix
  4017. ' disable the timer
  4018. EndOfBallTimer.Enabled = FALSE
  4019. ' if were tilted, reset the internal tilted flag (this will also
  4020. ' set fpTiltWarnings back to zero) which is useful if we are changing player LOL
  4021. Tilted = FALSE
  4022. ' Has the player won an extra-ball ?
  4023. If bExtraBallAward Then
  4024. ' Reset the POW bonus if required (POW BONUS HOLD set to NEVER).
  4025. If nvR3 = 1 Then
  4026. POWBonus = 1
  4027. POWBonusBall = 1
  4028. Else
  4029. POWBonusBall = 0
  4030. End If
  4031. ' Turn on Shoot Again light.
  4032. ShootAgainLight.State = 1
  4033. ' Display SHOOT AGAIN.
  4034. ExtraBallShowTimer.Enabled = TRUE
  4035. ' DMDBlink "", " ", " * S H O O T A G A I N * ", 50, 20
  4036. D1.Text = " * S H O O T A G A I N * "
  4037. DisplayB2SText " * S H O O T A G A I N * "
  4038. ' D1.QueueText " * S H O O T A G A I N * ", seBlinkMask, 1000
  4039. ' D2.QueueText " * S H O O T A G A I N * ", seBlinkMask, 1000
  4040. Playsound "cheers"
  4041. CurrentWeapon = 0
  4042. Weapon1.State = 2
  4043. Weapon2.State = 0
  4044. Weapon3.State = 0
  4045. Weapon4.State = 0
  4046. Weapon5.State = 0
  4047. Weapon6.State = 0
  4048. ExtraBall.State = 0
  4049. Else
  4050. Ball = Ball + 1
  4051. If BallsPerGame - Ball < 0 Then
  4052. ' It was the last ball.
  4053. If Score(1) > HighScore(10) Then
  4054. ' 10st score was beaten.
  4055. PosInTable = 10
  4056. ' Check the position in high score table.
  4057. If Score(1) > HighScore(9) Then PosInTable = 9
  4058. If Score(1) > HighScore(8) Then PosInTable = 8
  4059. If Score(1) > HighScore(7) Then PosInTable = 7
  4060. If Score(1) > HighScore(6) Then PosInTable = 6
  4061. If Score(1) > HighScore(5) Then PosInTable = 5
  4062. If Score(1) > HighScore(4) Then PosInTable = 4
  4063. If Score(1) > HighScore(3) Then PosInTable = 3
  4064. If Score(1) > HighScore(2) Then PosInTable = 2
  4065. If Score(1) > HighScore(1) Then PosInTable = 1
  4066. ' Define the suffix like st, nd, rd or th.
  4067. If PosInTable = 1 Then
  4068. Suffix = "ST"
  4069. ElseIf PosInTable = 2 Then
  4070. Suffix = "ND"
  4071. ElseIf PosInTable = 3 Then
  4072. Suffix = "RD"
  4073. Else
  4074. Suffix = "TH"
  4075. End If
  4076. ' Display final score.
  4077. If Score(1) < 1000000 Then
  4078. D1.Text = FormatScore(Score(1)) & String(10 - Len(PosInTable), " ") & "HIGH SCORE <" & PosInTable & Suffix & ">"
  4079. DisplayB2SText (Score(1)) & String(10 - Len(PosInTable), " ") & "HIGH SCORE <" & PosInTable & Suffix & ">"
  4080. Else
  4081. D1.Text = FormatScore(Score(1)) & String(16 - Len(Score(1)) - Len(PosInTable), " ") & "HIGH SCORE <" & PosInTable & Suffix & ">"
  4082. DisplayB2SText (Score(1)) & String(16 - Len(Score(1)) - Len(PosInTable), " ") & "HIGH SCORE <" & PosInTable & Suffix & ">"
  4083. End If
  4084. ' Submit the player score to the High Score system built into Future Pinball if required.
  4085. 'bEnteringAHighScore = TRUE
  4086. ' Play the high score music.
  4087. 'Playsound "MShighscore"
  4088. CheckHighscore()': hsbModeActive = True
  4089. Else
  4090. ' Player's score doesn't fit in the "top ten".
  4091. If Score(1) < 1000000 Then
  4092. D1.Text = FormatScore(Score(1)) & " GAME OVER"
  4093. DisplayB2SText (Score(1)) & " GAME OVER"
  4094. Else
  4095. D1.Text = FormatScore(Score(1)) & String(22 - Len(Score(1)), " ") & "GAME OVER"
  4096. DisplayB2SText (Score(1)) & String(22 - Len(Score(1)), " ") & "GAME OVER"
  4097. End If
  4098. bEnteringAHighScore = FALSE
  4099. ' Play the game over music.
  4100. Playsound "MSgameover"
  4101. ' Delay the game over during 7 seconds.
  4102. GameOverTimer.Enabled = TRUE
  4103. End If
  4104. Else
  4105. ' Reset the POW bonus to 1 if required (POW BONUS HOLD set to NEVER or EXTRA-BALL from the setup menu).
  4106. If nvR3 <> 3 Then
  4107. POWBonus = 1
  4108. POWBonusBall = 1
  4109. Else
  4110. POWBonusBall = 0
  4111. End If
  4112. ' It is not the last ball.
  4113. EndOfBallComplete()
  4114. End If
  4115. End If
  4116. End Sub
  4117.  
  4118.  
  4119.  
  4120. ' This timer is used to add a 7 seconds delay before game over state (when no entry in high score table).
  4121. '
  4122. ' *** DOCAM OPTIMIZED ***
  4123. '
  4124. Sub GameOverTimer_Timer()
  4125. StopSound Song:Song = ""
  4126. GameOverTimer.Enabled = FALSE
  4127. EndOfBallComplete()
  4128. End Sub
  4129.  
  4130.  
  4131.  
  4132. ' This timer disable the kickback mechanism.
  4133. '
  4134. ' *** DOCAM OPTIMIZED ***
  4135. '
  4136.  
  4137. Sub KickbackTimer_timer()
  4138. KickbackTimer.Enabled = FALSE
  4139. DOF 124, DOFPulse
  4140. If KickbackTimer.Uservalue = 1 Then
  4141. ' Play rocket explosion sound.
  4142. Playsound "rocket2"
  4143. ' Add 2000 points.
  4144. AddScore(2000)
  4145. ' Unlit kickback orange light.
  4146. bKickbackIsLit = FALSE
  4147. KickbackLight.State = 0
  4148. ' Open the left outlane.
  4149. KickbackGuide.isDropped = TRUE
  4150. ' Eject the ball.
  4151. KickbackPlungerSolenoidPulse()
  4152. End If
  4153. End Sub
  4154.  
  4155.  
  4156. Sub KickbackPlungerSolenoidPulse()
  4157. LeftOutLaneTrigger.kick 0, 40
  4158. LaserKickP1.TransY = 90
  4159. vpmtimer.addtimer 800, "LaserKickP1.TransY = 0 '"
  4160. Playsound SoundFX("bumper_retro")
  4161. End sub
  4162.  
  4163. ' This timer handles the regular ball saver mechanism.
  4164. '
  4165. ' *** DOCAM OPTIMIZED ***
  4166. '
  4167. Sub BallSaverClockTimer_Timer()
  4168. BallSaverClockTimer.Enabled = FALSE
  4169. If BallSaverClockTimer.Uservalue = 1 Then
  4170. ' At this point: remain 10 seconds.
  4171. BallSaverClockTimer.Uservalue = 2
  4172. BallSaverClockTimer.Interval = 5000
  4173. ShootAgainLight.BlinkInterval = 100
  4174. ShootAgainLight.State = BulbBlink
  4175. ElseIf BallSaverClockTimer.Uservalue = 2 Then
  4176. ' At this point: remain 5 seconds.
  4177. BallSaverClockTimer.Uservalue = 3
  4178. BallSaverClockTimer.Interval = 5000
  4179. ShootAgainLight.BlinkInterval = 50
  4180. ShootAgainLight.State = BulbBlink
  4181. ElseIf BallSaverClockTimer.Uservalue = 3 Then
  4182. ' Ball saver delay has been expired.
  4183. BallSaverClockTimer.Uservalue = 0
  4184. ShootAgainLight.State = BulbOff
  4185. bBallSaverIsActive = FALSE
  4186. ShootAgainLight.BlinkInterval = 150
  4187. End If
  4188.  
  4189.  
  4190. End Sub
  4191.  
  4192.  
  4193.  
  4194. ' This timer is used to display the POW bonus countdown sequence.
  4195. '
  4196. ' *** DOCAM OPTIMIZED ***
  4197. '
  4198. Dim POWBonusTimerUserData
  4199. Sub POWBonusTimer_Timer()
  4200. Dim lenPOWBonus
  4201. Dim lenPOWBase
  4202. Dim lenPOWScore
  4203. POWBonusTimer.Uservalue = POWBonusTimer.Uservalue + 1
  4204. If POWBonusCount = 0 Then
  4205. Select Case POWBonusTimer.Uservalue
  4206. Case 12:
  4207. 'D1.FlushQueue()
  4208. 'D2.FlushQueue()
  4209. DisplayB2SText String(32, " ")
  4210. D1.Text = String(32, " ")
  4211. 'D1.UpdateInterval = 20
  4212. 'D2.UpdateInterval = 20
  4213. D1.Text = " NO POW BONUS "', seScrollIn, 1000, 0, TRUE
  4214. DisplayB2SText " NO POW BONUS "
  4215. Case 14:
  4216. Playsound "cmonboy"
  4217. Case 22:
  4218. 'D1.FlushQueue()
  4219. 'D2.FlushQueue()
  4220. 'D1.UpdateInterval = 10
  4221. 'D2.UpdateInterval = 10
  4222. POWBonusTimer.Enabled = FALSE
  4223. POWBonusTimer.Uservalue = 0
  4224. POWBonusCount = 0
  4225. End Select
  4226. Else
  4227. Select Case POWBonusTimer.Uservalue
  4228. Case 8:
  4229. lenPOWBonus = Len(POWBonus)
  4230. lenPOWBase = Len(1000 * nvR2)
  4231. lenPOWScore = Len(1000 * nvR2 * POWBonus)
  4232. DisplayB2SText (POWBonus) & " POW " & String(lenPOWBase, " ") & " " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4233. D1.Text = FormatScore(POWBonus) & " POW " & String(lenPOWBase, " ") & " " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4234. Playsound "Thankyou"
  4235. Case 15:
  4236. lenPOWBonus = Len(POWBonus)
  4237. lenPOWBase = Len(1000 * nvR2)
  4238. lenPOWScore = Len(1000 * nvR2 * POWBonus)
  4239. DisplayB2SText (POWBonus) & " POW X " & String(lenPOWBase, " ") & " " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4240. D1.Text = FormatScore(POWBonus) & " POW X " & String(lenPOWBase, " ") & " " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4241. Playsound "Steel"
  4242. Case 20:
  4243. lenPOWBonus = Len(POWBonus)
  4244. lenPOWBase = Len(1000 * nvR2)
  4245. lenPOWScore = Len(1000 * nvR2 * POWBonus)
  4246. DisplayB2SText (POWBonus) & " POW X " & FormatScore(nvR2 * 1000) & " " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4247. D1.Text = FormatScore(POWBonus) & " POW X " & FormatScore(nvR2 * 1000) & " " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4248. Playsound "Steel"
  4249. Case 25:
  4250. lenPOWBonus = Len(POWBonus)
  4251. lenPOWBase = Len(1000 * nvR2)
  4252. lenPOWScore = Len(1000 * nvR2 * POWBonus)
  4253. DisplayB2SText (POWBonus) & " POW X " & FormatScore(nvR2 * 1000) & " = " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4254. D1.Text = FormatScore(POWBonus) & " POW X " & FormatScore(nvR2 * 1000) & " = " & String(lenPOWScore, " ") & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4255. Playsound "Steel"
  4256. Case 30:
  4257. lenPOWBonus = Len(POWBonus)
  4258. lenPOWBase = Len(1000 * nvR2)
  4259. lenPOWScore = Len(1000 * nvR2 * POWBonus)
  4260. DisplayB2SText (POWBonus) & " POW X " & FormatScore(nvR2 * 1000) & " = " & FormatScore(1000 * nvR2 * POWBonus) & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4261. D1.Text = FormatScore(POWBonus) & " POW X " & FormatScore(nvR2 * 1000) & " = " & FormatScore(1000 * nvR2 * POWBonus) & String(Int((18 - lenPOWBonus - lenPOWBase - lenPOWScore) / 2), " ")
  4262. If POWBonusBall < 10 Then
  4263. Playsound "Ok"
  4264. Else
  4265. Playsound "youregreat"
  4266. End If
  4267. Case 42:
  4268. POWBonusTimer.Enabled = FALSE
  4269. POWBonusTimer.Uservalue = 0
  4270. Score(1) = Score(1) + (1000 * nvR2 * POWBonus)
  4271. End Select
  4272. End If
  4273. End Sub
  4274.  
  4275.  
  4276.  
  4277. ' This timer is called every second (like a stopwatch) during missions 1 and 2.
  4278. '
  4279. ' *** DOCAM OPTIMIZED ***
  4280. '
  4281. Sub MissionTimer_Timer()
  4282. MissionTimerUserData = MissionTimerUserData - 1
  4283. If MissionTimerUserData = 0 Then
  4284. MissionTimer.Enabled = FALSE
  4285. CompleteMission()
  4286. End If
  4287. If bPlayingMission1 Then
  4288. If MissionTimerUserData < 32 then
  4289. NextMessage = 2
  4290. bCanDisplayMessage = TRUE
  4291. ShowNextMessage()
  4292. End If
  4293. ElseIf bPlayingMission2 Then
  4294. If MissionTimerUserData < 32 Then
  4295. NextMessage = 4
  4296. bCanDisplayMessage = TRUE
  4297. ShowNextMessage()
  4298. End If
  4299. End If
  4300. End Sub
  4301.  
  4302.  
  4303.  
  4304. ' This timer is called to animate WEAPON targets while playing mission 2 or mission 5.
  4305. '
  4306. ' *** DOCAM OPTIMIZED ***
  4307. '
  4308. Dim AnimateWeaponTimerUserData
  4309. Sub AnimateWeaponTimer_Timer()
  4310. AnimateWeaponTimer.Uservalue = AnimateWeaponTimer.Uservalue + 1
  4311. Select Case Mission
  4312. Case 2:
  4313. Select Case AnimateWeaponTimer.Uservalue
  4314. Case 1:
  4315. W1.Isdropped = 0
  4316. W6.Isdropped = 1
  4317. W1Light.state = 2
  4318. Case 2:
  4319. W2.Isdropped = 0
  4320. W1.Isdropped = 1
  4321. W1Light.state = 0
  4322. W2Light.state = 2
  4323. Case 3:
  4324. W3.Isdropped = 0
  4325. W2.Isdropped = 1
  4326. W2Light.state = 0
  4327. W3Light.state = 2
  4328. Case 4:
  4329. W4.Isdropped = 0
  4330. W3.Isdropped = 1
  4331. W3Light.state = 0
  4332. W4Light.state = 2
  4333. Case 5:
  4334. W5.Isdropped = 0
  4335. W4.Isdropped = 1
  4336. W4Light.state = 0
  4337. W5Light.state = 2
  4338. Case 6:
  4339. W6.Isdropped = 0
  4340. W5.Isdropped = 1
  4341. W5Light.state = 0
  4342. W6Light.state = 2
  4343. Case 7:
  4344. W1.Isdropped = 0
  4345. W6.Isdropped = 1
  4346. W6Light.state = 0
  4347. W1Light.state = 2
  4348. Case 8:
  4349. W3.Isdropped = 0
  4350. W1.Isdropped = 1
  4351. W1Light.state = 0
  4352. W3Light.state = 2
  4353. Case 9:
  4354. W5.Isdropped = 0
  4355. W3.Isdropped = 1
  4356. W3Light.state = 0
  4357. W5Light.state = 2
  4358. Case 10:
  4359. W2.Isdropped = 0
  4360. W5.Isdropped = 1
  4361. W5Light.state = 0
  4362. W2Light.state = 2
  4363. Case 11:
  4364. W4.Isdropped = 0
  4365. W2.Isdropped = 1
  4366. W2Light.state = 0
  4367. W4Light.state = 2
  4368. Case 12:
  4369. W6.Isdropped = 0
  4370. W4.Isdropped = 1
  4371. W4Light.state = 0
  4372. W6Light.state = 2
  4373. AnimateWeaponTimer.Uservalue = 0
  4374. End Select
  4375. Case 5:
  4376. Select Case AnimateWeaponTimer.Uservalue
  4377. Case 1:
  4378. W1.Isdropped = 0
  4379. W6.Isdropped = 1
  4380. W6Light.state = 0
  4381. W1Light.state = 2
  4382. Playsound "allenlaugh"
  4383. Case 2:
  4384. W6.Isdropped = 0
  4385. W1.Isdropped = 1
  4386. W1Light.state = 0
  4387. W6Light.state = 2
  4388. Playsound "allenlaugh"
  4389. Case 3:
  4390. W2.Isdropped = 0
  4391. W6.Isdropped = 1
  4392. W6Light.state = 0
  4393. W2Light.state = 2
  4394. Playsound "cmonboy"
  4395. Case 4:
  4396. W5.Isdropped = 0
  4397. W2.Isdropped = 1
  4398. W2Light.state = 0
  4399. W5Light.state = 2
  4400. Playsound "gohometomommy"
  4401. Case 5:
  4402. W3.Isdropped = 0
  4403. W5.Isdropped = 1
  4404. W3Light.state = 0
  4405. W5Light.state = 2
  4406. Playsound "allenlaugh"
  4407. Case 6:
  4408. W4.Isdropped = 0
  4409. W3.Isdropped = 1
  4410. W4Light.state = 0
  4411. W3Light.state = 2
  4412. Playsound "cmonboy"
  4413. Case 7:
  4414. W3.Isdropped = 0
  4415. W4.Isdropped = 1
  4416. W4Light.state = 0
  4417. W3Light.state = 2
  4418. Playsound "youremincemeat"
  4419. Case 8:
  4420. W5.Isdropped = 0
  4421. W3.Isdropped = 1
  4422. W3Light.state = 0
  4423. W5Light.state = 2
  4424. Playsound "cmonboy"
  4425. Case 9:
  4426. W2.Isdropped = 0
  4427. W5.Isdropped = 1
  4428. W5Light.state = 0
  4429. W2Light.state = 2
  4430. Playsound "allenlaugh"
  4431. Case 10:
  4432. W6.Isdropped = 0
  4433. W2.Isdropped = 1
  4434. W2Light.state = 0
  4435. W6Light.state = 2
  4436. Playsound "gohometomommy"
  4437. AnimateWeaponTimer.Uservalue = 0
  4438. End Select
  4439. End Select
  4440. End Sub
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446. ' *** DOCAM OPTIMIZED ***
  4447. '
  4448. Sub PlayfieldTimer_Timer()
  4449. PlayfieldTimer.Enabled = FALSE
  4450. ' LookAtPlayfield()
  4451. End Sub
  4452.  
  4453.  
  4454.  
  4455. ' *** DOCAM OPTIMIZED ***
  4456. '
  4457. Sub ExtraBallShowTimer_Timer()
  4458. ExtraBallShowTimer.Enabled = FALSE
  4459. bExtraBallAward = FALSE
  4460. EndOfBallComplete()
  4461. End Sub
  4462.  
  4463.  
  4464.  
  4465. ' This timer is used to autoplung a ball.
  4466. '
  4467. ' *** DOCAM OPTIMIZED ***
  4468. '
  4469. Sub AutoBallTimer_Timer()
  4470. AutoBallTimer.Enabled = FALSE
  4471. PlungerSolenoidPulse.Interval = 2000
  4472. PlungerSolenoidPulse.enabled = 1
  4473. Playsound "gun6"
  4474. FlashAnimate3()
  4475. End Sub
  4476.  
  4477. Sub PlungerSolenoidPulse_Timer
  4478. PlungerSolenoidPulse.enabled = 0
  4479. plungerIM.AutoFire
  4480. DOF 125, DOFPulse
  4481. DOF 114, DOFPulse
  4482. End Sub
  4483.  
  4484. ' *** DOCAM OPTIMIZED ****
  4485. '
  4486. Sub Kicker1Timer_Timer()
  4487. Kicker1Timer.Enabled = FALSE
  4488. Kicker1SolenoidPulse()
  4489. bBallInKicker1 = FALSE
  4490. L1.State = 0
  4491. Playsound "Rocket2"
  4492. End Sub
  4493.  
  4494.  
  4495.  
  4496. ' *** DOCAM OPTIMIZED ****
  4497. '
  4498. Sub Kicker2Timer_Timer()
  4499. Kicker2Timer.Enabled = FALSE
  4500. Kicker2SolenoidPulse()
  4501. bBallInKicker2 = FALSE
  4502. L2.State = 0
  4503. Playsound "Rocket2"
  4504. End Sub
  4505.  
  4506.  
  4507.  
  4508. ' *** DOCAM OPTIMIZED ****
  4509. '
  4510. Sub Kicker3Timer_Timer()
  4511. Kicker3Timer.Enabled = FALSE
  4512. Kicker3SolenoidPulse()
  4513. bBallInKicker3 = FALSE
  4514. L3.State = 0
  4515. Playsound "Rocket2"
  4516. End Sub
  4517.  
  4518.  
  4519.  
  4520. ' *** DOCAM OPTIMIZED ****
  4521. '
  4522. Sub Kicker4Timer_Timer()
  4523. Kicker4Timer.Enabled = FALSE
  4524. Kicker4SolenoidPulse()
  4525. bBallInKicker4 = FALSE
  4526. L4.State = 0
  4527. Playsound "Rocket2"
  4528. End Sub
  4529.  
  4530.  
  4531.  
  4532. ' *** DOCAM OPTIMIZED ****
  4533. '
  4534. Sub KickOutBallTimer_Timer()
  4535. KickOutBallTimer.Enabled = FALSE
  4536. If Not(bLockIsLit) Then
  4537. If bBallInKicker1 Then Kicker1Timer.Enabled = TRUE
  4538. If bBallInKicker2 Then Kicker2Timer.Enabled = TRUE
  4539. If bBallInKicker3 Then Kicker3Timer.Enabled = TRUE
  4540. If bBallInKicker4 Then Kicker4Timer.Enabled = TRUE
  4541. End If
  4542. End Sub
  4543.  
  4544.  
  4545.  
  4546. ' This timer is called by FuturePinball_BeginPlay (raising C1/C2/C3 drop targets after captive ball creation/ejection).
  4547. '
  4548. ' *** DOCAM OPTIMIZED ***
  4549. '
  4550. Sub FixTargetTimer_Timer()
  4551. ' Disable this timer.
  4552. FixTargetTimer.Enabled = FALSE
  4553. ' Raise the three drop targets behind the captive ball.
  4554. C1.Isdropped = 0
  4555. C2.Isdropped = 0
  4556. C3.Isdropped = 0
  4557. End Sub
  4558.  
  4559.  
  4560.  
  4561. ' This timer checks the METALSLUG drop targets, doing actions if all targets are dropped.
  4562. '
  4563. ' *** DOCAM OPTIMIZED ***
  4564. '
  4565. Sub CheckSLUGTimer_Timer()
  4566. CheckSLUGTimer.Enabled = FALSE
  4567. If Slug1.IsDropped = 1 And Slug2.IsDropped = 1 And Slug3.IsDropped = 1 And Slug4.IsDropped = 1 And Slug5.IsDropped = 1 And Slug6.IsDropped = 1 And Slug7.IsDropped = 1 And Slug8.IsDropped = 1 And Slug9.IsDropped = 1 Then
  4568. ResetSLUGTargets()
  4569. AddScore(20000)
  4570. LightKickback()
  4571. If Not(bLockIsLit) And Not(bMultiBallMode) And Not(bPlayingFinalMission) Then
  4572. FlashEffectMissionTimer.enabled = 1'GI_Flash()
  4573. InterruptDisplay(1200)
  4574. ' D1.FlushQueue()
  4575. ' D2.FlushQueue()
  4576. DisplayB2SText " LOCK IS LIT "
  4577. D1.Text = " LOCK IS LIT "
  4578. 'D1.QueueText " LOCK IS LIT "', seBlinkMask, 400
  4579. 'D2.QueueText " LOCK IS LIT "', seBlinkMask, 400
  4580. FlashAnimate3()
  4581. Playsound "explode5"
  4582. bLockIsLit = TRUE
  4583. 'L1.state = 2
  4584. 'L2.state = 2
  4585. 'L3.state = 2
  4586. 'L4.state = 2
  4587. L1.State = 2
  4588. L2.State = 2
  4589. L3.State = 2
  4590. L4.State = 2
  4591. Marco.State = 0
  4592. Tarma.State = 0
  4593. Eri.State = 0
  4594. Fio.State = 0
  4595. If Not(bPlayingMission) Then Playsound "MSlocklit"
  4596. End If
  4597. If bBallLockedInKicker1 And bBallLockedInKicker2 And bBallLockedInKicker3 And bMissionIsLit And (Mission < 5) Then StartMission(): FlashEffectMissionTimer.enabled = 0
  4598. End If
  4599. End Sub
  4600.  
  4601.  
  4602.  
  4603. ' *** DOCAM OPTIMIZED ***
  4604. '
  4605. Dim FiveBallOverTimerUserData
  4606. Dim FinalMissionShowTimerUserData
  4607. Sub FinalMissionShowTimer_Timer()
  4608. FinalMissionShowTimer.Uservalue = FinalMissionShowTimer.Uservalue + 1
  4609. Select Case FinalMissionShowTimer.Uservalue
  4610. Case 1:
  4611. DisplayB2SText " STARTING 5-BALL MULTIBALL "
  4612. D1.Text = " STARTING 5-BALL MULTIBALL "
  4613. Playsound "explode3"
  4614. ExplodeAnimate()
  4615. ' Cancels regular ball saver.
  4616. bBallSaverIsActive = FALSE
  4617. BallSaverClockTimer.Enabled = FALSE
  4618. BallSaverClockTimer.Uservalue = 1
  4619. ShootAgainLight.State = 0
  4620. ShootAgainLight.BlinkInterval = 150
  4621. Case 2:
  4622. DisplayB2SText " DROP TARGETS SCORE 20,000 EACH "
  4623. D1.Text = " DROP TARGETS SCORE 20,000 EACH "
  4624. Playsound "steel"
  4625. ' Destroy any ball in kickers.
  4626. Kicker1SolenoidPulse
  4627. Kicker2SolenoidPulse()
  4628. Kicker3SolenoidPulse()
  4629. Kicker4SolenoidPulse()
  4630. Case 3:
  4631. DisplayB2SText " POW BONUS IS DOUBLED "
  4632. D1.Text = " POW BONUS IS DOUBLED "
  4633. Playsound "thankyou"
  4634. Case 4:
  4635. DisplayB2SText " KICKERS SCORE 25,000 EACH "
  4636. D1.Text = " KICKERS SCORE 25,000 EACH "
  4637. Playsound "rocket2"
  4638. Case 5:
  4639. DisplayB2SText " CAPTIVE BALL IS LIT "
  4640. D1.Text = " CAPTIVE BALL IS LIT "
  4641. Playsound "ok"
  4642. Case 6:
  4643. DisplayB2SText " JET BUMPERS ARE LIT "
  4644. D1.Text = " JET BUMPERS ARE LIT "
  4645. Playsound "mordenlaugh"
  4646. Case 7:
  4647. DisplayB2SText " JACKPOT IS LIT "
  4648. D1.Text = " JACKPOT IS LIT "
  4649. Playsound "yell6"
  4650. ' Create locked balls in kickers.
  4651. bBallLockedInKicker1 = TRUE
  4652. bBallInKicker1 = TRUE
  4653. Kicker1SolenoidPulse()
  4654. L1.State = 1
  4655. bBallLockedInKicker2 = TRUE
  4656. bBallInKicker2 = TRUE
  4657. Kicker2.CreateBall()
  4658. L2.State = 1
  4659. bBallLockedInKicker3 = TRUE
  4660. bBallInKicker3 = TRUE
  4661. Kicker3.CreateBall()
  4662. L3.State = 1
  4663. bBallLockedInKicker4 = TRUE
  4664. bBallInKicker4 = TRUE
  4665. Kicker4.CreateBall()
  4666. L4.State = 1
  4667. ' Now they're four locked balls.
  4668. BallsOnPlayfield = 4
  4669. BallsLocked = 4
  4670. ' Drop the side targets.
  4671. S1.Isdropped = 1
  4672. S1Light.State = 1
  4673. S2.Isdropped = 1
  4674. S2Light.State = 1
  4675. S3.Isdropped = 1
  4676. S3Light.State = 1
  4677. Case 8:
  4678. DisplayB2SText " EVERYTHING IS LIT "
  4679. D1.Text = " EVERYTHING IS LIT "
  4680. ' D1.QueueText " EVERYTHING IS LIT ", seBlinkMask, 1000
  4681. ' D2.QueueText " EVERYTHING IS LIT ", seBlinkMask, 1000
  4682. Playsound "explode3"
  4683. ExplodeAnimate()
  4684. Case 10:
  4685. FinalMissionShowTimer.Enabled = FALSE
  4686. FinalMissionShowTimer.Uservalue = 0
  4687. ' LookAtPlayfield()
  4688. AutoBall()
  4689. CheckFiveBallTimer.interval = 3000
  4690. ReleaseBallsTimer.Enabled = TRUE
  4691. FiveBallOverTimer.Uservalue = 0
  4692. ' Regardling table setup, ball saver duration is 2 x regular ball saver (except if 15 seconds: 45 seconds).
  4693. Select Case nvR1
  4694. Case 15: FiveBallOverTimer.Interval = 25000 ' 45 seconds
  4695. Case 30: FiveBallOverTimer.Interval = 40000 ' 2 x 30 - 20 = 60 seconds.
  4696. Case 45: FiveBallOverTimer.Interval = 70000 ' 2 x 45 - 20 = 90 seconds.
  4697. Case 60: FiveBallOverTimer.Interval = 100000 ' 2 x 60 - 20 = 120 seconds.
  4698. End Select
  4699. ShootAgainLight.State = 2
  4700. LightJackpot()
  4701. Case 12:
  4702. ' Mission all over.
  4703. DisplayB2SText " MISSION ALL OVER "
  4704. D1.Text = " MISSION ALL OVER "
  4705. Case 13:
  4706. FinalMissionShowTimer.Interval = 700
  4707. DisplayB2SText " MARCO "
  4708. D1.Text = " MARCO "
  4709. Playsound "steel"
  4710. Case 14:
  4711. DisplayB2SText " MARCO, TARMA "
  4712. D1.Text = " MARCO, TARMA "
  4713. Playsound "steel"
  4714. Case 15:
  4715. DisplayB2SText " MARCO, TARMA, ERI "
  4716. D1.Text = " MARCO, TARMA, ERI "
  4717. Playsound "steel"
  4718. Case 16:
  4719. DisplayB2SText " MARCO, TARMA, ERI & FIO "
  4720. D1.Text = " MARCO, TARMA, ERI & FIO "
  4721. Playsound "steel"
  4722. Case 17:
  4723. FinalMissionShowTimer.Interval = 2300
  4724. DisplayB2SText " HAVE DONE IT AGAIN "
  4725. D1.Text = " HAVE DONE IT AGAIN "
  4726. ' D1.QueueText " HAVE DONE IT AGAIN ", seBlinkMask, 2300
  4727. ' D2.QueueText " HAVE DONE IT AGAIN ", seBlinkMask, 2300
  4728. Playsound "explode3"
  4729. Case 18:
  4730. DisplayB2SText " SEE YOU NEXT MISSION "
  4731. D1.Text = " SEE YOU NEXT MISSION "
  4732. ' D1.QueueText " SEE YOU NEXT MISSION ", seBlinkMask, 2300
  4733. ' D2.QueueText " SEE YOU NEXT MISSION ", seBlinkMask, 2300
  4734. Playsound "metalslug1"
  4735. Case 19:
  4736. DisplayB2SText " SEE YOU NEXT MISSION "
  4737. D1.Text = " SEE YOU NEXT MISSION "
  4738. FinalMissionShowTimer.Enabled = FALSE
  4739. FinalMissionShowTimer.Uservalue = 0
  4740. End Select
  4741. End Sub
  4742.  
  4743.  
  4744.  
  4745. ' *** DOCAM OPTIMIZED ****
  4746. '
  4747. Sub StartMissionSoonTimer_Timer()
  4748. StartMissionSoonTimer.Enabled = FALSE
  4749. StartMission()
  4750. End Sub
  4751.  
  4752.  
  4753.  
  4754. ' During 5-ball play (final mission) this timer checks they're five balls on playfield, until the 45 seconds timer over.
  4755. ' Called every second while they're 5 balls on playfield.
  4756. ' Called every 3 seconds if they're are less than 5 balls.
  4757. '
  4758. ' *** DOCAM OPTIMIZED ***
  4759. '
  4760. Sub CheckFiveBallTimer_Timer()
  4761. CheckFiveBallTimer.Enabled = FALSE
  4762. If BallsOnPlayfield = 5 Then
  4763. CheckFiveBallTimer.interval = 1000
  4764. Else
  4765. CheckFiveBallTimer.interval = 3000
  4766. End If
  4767. If BallsOnPlayfield < 5 Then AutoBall()
  4768. End Sub
  4769.  
  4770.  
  4771.  
  4772. ' Called during a total of 45 seconds (from final mission start), this timer works as dedicated ball saver for final mission.
  4773. ' Called first time after 25 seconds, then 10 seconds, then two times 5 seconds. At every call, the 'Shoot Again' blinks more faster.
  4774. '
  4775. ' *** DOCAM OPTIMIZED ***
  4776. '
  4777. Sub FiveBallOverTimer_Timer()
  4778. FiveBallOverTimer.Uservalue = FiveBallOverTimer.Uservalue + 1
  4779. Select Case FiveBallOverTimer.Uservalue
  4780. Case 1:
  4781. ' At this point, remains 20 seconds.
  4782. ShootAgainLight.BlinkInterval = 100
  4783. ShootAgainLight.State = 2
  4784. FiveBallOverTimer.Enabled = FALSE
  4785. FiveBallOverTimer.interval = 10000
  4786. Case 2:
  4787. ' At this point, remains 10 seconds.
  4788. ShootAgainLight.BlinkInterval = 50
  4789. ShootAgainLight.State = 2
  4790. FiveBallOverTimer.Enabled = FALSE
  4791. FiveBallOverTimer.interval = 5000
  4792. Case 3:
  4793. ' At this point, remains 5 seconds.
  4794. ShootAgainLight.BlinkInterval = 25
  4795. ShootAgainLight.State = 2
  4796. FiveBallOverTimer.Enabled = FALSE
  4797. FiveBallOverTimer.interval = 5000
  4798. Case 4:
  4799. ' At this point, cancels the 5-ball mode (disabling ball saver feature).
  4800. FiveBallOverTimer.Enabled = FALSE
  4801. CheckFiveBallTimer.Enabled = FALSE
  4802. ShootAgainLight.State = 0
  4803. ShootAgainLight.BlinkInterval = 150
  4804. FiveBallOverTimer.Uservalue = 0
  4805. End Select
  4806. End Sub
  4807.  
  4808.  
  4809.  
  4810. ' This timer is used to play the correct theme.
  4811. '
  4812. ' *** DOCAM OPTIMIZED ***
  4813. '
  4814. Sub ResetMusicTimer_Timer()
  4815. ResetMusicTimer.Enabled = FALSE
  4816. ' Effectmusic 1, FadeVolume, 1.0, 5000
  4817. ResetMusic()
  4818. End Sub
  4819.  
  4820.  
  4821.  
  4822. ' This timer give some delay before turning off flashers.
  4823. '
  4824. ' *** DOCAM OPTIMIZED ***
  4825. '
  4826. Sub FlashOffTimer_Timer()
  4827. FlashOffTimer.Enabled = FALSE
  4828. FlashEffect 0
  4829. FlashEffectMissionTimer.enabled = 0
  4830. FlashOff()
  4831. End Sub
  4832.  
  4833.  
  4834.  
  4835. ' This timer displays messages at the start of regular 4-ball multi ball.
  4836. '
  4837. ' *** DOCAM OPTIMIZED ***
  4838. '
  4839. Dim MultiballDisplayTimerUserData
  4840. Sub MultiballDisplayTimer_Timer()
  4841. MultiballDisplayTimerUserData = MultiballDisplayTimerUserData + 1
  4842. Select Case MultiballDisplayTimerUserData
  4843. Case 1:
  4844. DisplayB2SText "M U L T I B A L L"
  4845. D1.Text = "M U L T I B A L L"
  4846. ' D1.FlushQueue()
  4847. ' D2.FlushQueue()
  4848. Case 2:
  4849. DisplayB2SText " M U L T I B A L L "
  4850. D1.Text = " M U L T I B A L L "
  4851. Case 3:
  4852. DisplayB2SText " M U L T I B A L L "
  4853. D1.Text = " M U L T I B A L L "
  4854. Case 4:
  4855. DisplayB2SText " M U L T I B A L L "
  4856. D1.Text = " M U L T I B A L L "
  4857. Case 5:
  4858. DisplayB2SText " M U L T I B A L L "
  4859. D1.Text = " M U L T I B A L L "
  4860. Case 6:
  4861. DisplayB2SText " M U L T I B A L L "
  4862. D1.Text = " M U L T I B A L L "
  4863. Case 7:
  4864. DisplayB2SText " M U L T I B A L L "
  4865. D1.Text = " M U L T I B A L L "
  4866. Case 8:
  4867. DisplayB2SText " M U L T I B A L L "
  4868. D1.Text = " M U L T I B A L L "
  4869. Case 9:
  4870. DisplayB2SText " * M U L T I B A L L * "
  4871. D1.Text = " * M U L T I B A L L * "
  4872. Case 10:
  4873. DisplayB2SText " * M U L T I B A L L * "
  4874. D1.Text = " * M U L T I B A L L * "', seBlinkMask, 1000
  4875. Case 14:
  4876. MultiballDisplayTimer.Enabled = FALSE
  4877. MultiballDisplayTimerUserData = 0
  4878. End Select
  4879. End Sub
  4880.  
  4881.  
  4882.  
  4883. ' This timer is used to start multi ball play.
  4884. '
  4885. ' *** DOCAM OPTIMIZED ***
  4886. '
  4887. Sub StartMultiballTimer_Timer()
  4888. StartMultiballTimer.Enabled = FALSE
  4889. If Not(bFinalMissionIsReady) Then
  4890. BallsLocked = 0
  4891. FlashEffectMissionTimer.enabled = 1'GI_Flash()
  4892. If bPlayingMission Then
  4893. ' If required, suspend the current mission (will be resumed at the end of multiball).
  4894. bPlayingMission = FALSE
  4895. bMissionSuspended = TRUE
  4896. MissionTimer.Enabled = FALSE
  4897. Select Case Mission
  4898. Case 2:
  4899. AnimateWeaponTimer.Enabled = FALSE
  4900. DropWeapon()
  4901. Case 3:
  4902. Bumper1L.State = 1
  4903. Bumper2l.State = 1
  4904. Bumper3L.State = 1
  4905. Case 4:
  4906. CaptiveLight.State = 0
  4907. Case 5
  4908. AnimateWeaponTimer.Enabled = FALSE
  4909. DropWeapon()
  4910. End Select
  4911. End If
  4912. MultiballDisplayTimerUserData = 0
  4913. MultiballDisplayTimer.Enabled = TRUE
  4914. bMultiBallMode = TRUE
  4915. bLockIsLit = FALSE
  4916. StopSound Song:Song = "": PlaySong "mu_MSmultiball"
  4917. Playsound "explode5"
  4918. FlashAnimate6()
  4919. ReleaseBallsTimer.Enabled = TRUE
  4920. LightJackpot()
  4921. DropWeapon()
  4922. M1.State = 0
  4923. M2.State = 0
  4924. M3.State = 0
  4925. Else
  4926. StartMission()
  4927. End If
  4928. End Sub
  4929.  
  4930.  
  4931.  
  4932. ' This timer is called at the start of multi ball modes (regular and 5-ball) to eject balls from kickers.
  4933. '
  4934. ' *** DOCAM OPTIMIZED ***
  4935. '
  4936. Dim ReleaseBallsTimerUserData
  4937. Sub ReleaseBallsTimer_Timer()
  4938. ReleaseBallsTimerUserData = ReleaseBallsTimerUserData + 1
  4939. Select Case ReleaseBallsTimerUserData
  4940. Case 1:
  4941. Kicker1Timer.Enabled = TRUE
  4942. bBallLockedInKicker1 = FALSE
  4943. Case 2:
  4944. Kicker2Timer.Enabled = TRUE
  4945. bBallLockedInKicker2 = FALSE
  4946. Case 3:
  4947. Kicker3Timer.Enabled = TRUE
  4948. bBallLockedInKicker3 = FALSE
  4949. Case 4:
  4950. Kicker4Timer.Enabled = TRUE
  4951. bBallLockedInKicker4 = FALSE
  4952. ReleaseBallsTimer.Enabled = FALSE
  4953. ReleaseBallsTimerUserData = 0
  4954. MultiballDisplayTimer.Enabled = FALSE
  4955. End Select
  4956. End Sub
  4957.  
  4958.  
  4959.  
  4960. ' Called at the end of multi ball, this timer resets the side and captive drop targets, and restore WEAPON wall if required.
  4961. '
  4962. ' *** DOCAM OPTIMIZED ***
  4963. '
  4964. Sub EndMultiballTimer_Timer()
  4965. EndMultiballTimer.Enabled = FALSE
  4966. ResetSideTargets()
  4967. ResetCaptiveTargets()
  4968. If Not(bPlayingMission) Then FixWeapon()
  4969. End Sub
  4970.  
  4971.  
  4972.  
  4973. ' This timer is called at the end of final mission.
  4974. '
  4975. ' *** DOCAM CLEANED ***
  4976. '
  4977. Sub MissionAllOverTimer_Timer()
  4978. MissionAllOverTimer.Enabled = FALSE
  4979. ' LookAtPlayfield()
  4980. FlashOff()
  4981. ResetMusic()
  4982. CreateNewBall()
  4983. ingamereset()
  4984. AddScore(0)
  4985. End Sub
  4986.  
  4987.  
  4988.  
  4989. ' This timer displays messages during jackpot award.
  4990. '
  4991. ' *** DOCAM OPTIMIZED ***
  4992. '
  4993. Dim JackpotDisplayTimerUserData
  4994. Sub JackpotDisplayTimer_Timer()
  4995. JackpotDisplayTimerUserData = JackpotDisplayTimerUserData + 1
  4996. Select Case JackpotDisplayTimerUserData
  4997. Case 1:
  4998. D1.Text = " J "
  4999. DisplayB2SText " J "
  5000. bInterruptedDisplay = TRUE
  5001. Playsound "steel"
  5002. ' D1.FlushQueue()
  5003. ' D2.FlushQueue()
  5004. Case 2:
  5005. D1.Text = " J A "
  5006. DisplayB2SText " J A "
  5007. bInterruptedDisplay = TRUE
  5008. Playsound "steel"
  5009. Case 3:
  5010. D1.Text = " J A C "
  5011. DisplayB2SText " J A C "
  5012. bInterruptedDisplay = TRUE
  5013. Playsound "steel"
  5014. Case 4:
  5015. D1.Text = " J A C K "
  5016. DisplayB2SText " J A C K "
  5017. bInterruptedDisplay = TRUE
  5018. Playsound "steel"
  5019. Case 5:
  5020. D1.Text = " J A C K P "
  5021. DisplayB2SText " J A C K P "
  5022. bInterruptedDisplay = TRUE
  5023. Playsound "steel"
  5024. Case 6:
  5025. D1.Text = " J A C K P O "
  5026. DisplayB2SText " J A C K P O "
  5027. bInterruptedDisplay = TRUE
  5028. Playsound "steel"
  5029. Case 7:
  5030. D1.Text = " J A C K P O T "
  5031. DisplayB2SText " J A C K P O T "
  5032. bInterruptedDisplay = TRUE
  5033. Playsound "steel"
  5034. Case 8:
  5035. D1.Text = " * J A C K P O T * "', seBlinkMask, 2000
  5036. DisplayB2SText " * J A C K P O T * "
  5037. bInterruptedDisplay = TRUE
  5038. Playsound "explode5"
  5039. Playsound "Cheers"
  5040. FlashEffectMissionTimer.enabled = 1'GI_Flash()
  5041. If Not(bPlayingFinalMission) Then Playsound "MSJackpot"
  5042. Case 12:
  5043. InterruptDisplayTimer.interval = 2000
  5044. JackpotDisplayTimer.Enabled = FALSE
  5045. JackpotDisplayTimerUserData = 0
  5046. End Select
  5047. End Sub
  5048.  
  5049.  
  5050.  
  5051. ' This timer displays messages during attract mode.
  5052. '
  5053. ' *** DOCAM OPTIMIZED ***
  5054. '
  5055. Dim AttractMessagesTimerUserData
  5056. Sub AttractMessagesTimer_Timer()
  5057. FixTargetTimer.enabled = 1
  5058. AttractMessagesTimerUserData = AttractMessagesTimerUserData + 1
  5059. Select Case AttractMessagesTimerUserData
  5060. Case 1:
  5061. D1.Text = " GAME OVER "
  5062. DisplayB2SText " GAME OVER "
  5063. ' From this point, you can enter in setup mode (by pressing both left & right flipper keys).
  5064. bAllowEnterSetup = TRUE
  5065. Case 2:
  5066. D1.Text = " BAILEY PINBALL PRESENTS "
  5067. DisplayB2SText " BAILEY PINBALL PRESENTS "
  5068. Case 3:
  5069. 'D1.FlushQueue()
  5070. 'D2.FlushQueue()
  5071. D1.Text = " METAL SLUG "', seScrollIn, 1000, 0, TRUE
  5072. DisplayB2SText " METAL SLUG "
  5073. Case 4:
  5074. D1.Text = " BY BRENDAN BAILEY "
  5075. DisplayB2SText " BY BRENDAN BAILEY "
  5076. Case 5:
  5077. D1.Text = " BASED ON THE VIDEO GAMES BY "
  5078. DisplayB2SText " BASED ON THE VIDEO GAMES BY "
  5079. Case 6:
  5080. D1.Text = " NAZCA & SNK "
  5081. DisplayB2SText " NAZCA & SNK "
  5082. Case 7:
  5083. If (Score(1) = 0) And (Credits = 0) Then
  5084. D1.Text = " PLEASE INSERT CREDIT "
  5085. DisplayB2SText " PLEASE INSERT CREDIT "
  5086. ElseIf (Score(1) = 0) And (Credits > 0) Then
  5087. D1.Text = " PUSH START BUTTON TO PLAY "
  5088. DisplayB2SText " PUSH START BUTTON TO PLAY "
  5089. Else
  5090. DisplayB2SText " LAST SCORE WAS " & FormatScore(Score(1)) & String(8 - Int((Len(Score(1)) - 1) / 2), " ")
  5091. D1.Text = " LAST SCORE WAS " & FormatScore(Score(1)) & String(8 - Int((Len(Score(1)) - 1) / 2), " ")
  5092.  
  5093. End If
  5094. Case 8:
  5095. D1.Text = " SPECIAL THANKS TO "
  5096. DisplayB2SText " SPECIAL THANKS TO "
  5097. Case 9:
  5098. D1.Text = " THE METAL SLUG DATABASE "
  5099. DisplayB2SText " THE METAL SLUG DATABASE "
  5100. Case 10:
  5101. D1.Text = " DOMINIQUE CAMUS A.K.A. DOCAM "
  5102. DisplayB2SText " DOMINIQUE CAMUS A.K.A. DOCAM "
  5103. Case 11:
  5104. D1.Text = " COLLECT WEAPONS FOR EXTRA BALL "
  5105. DisplayB2SText " COLLECT WEAPONS FOR EXTRA BALL "
  5106. Case 12:
  5107. D1.Text = " COLLECT POW FOR BONUS "
  5108. DisplayB2SText " COLLECT POW FOR BONUS "
  5109. Case 13:
  5110. D1.Text = " SHOOT KICKERS TO START MISSION "
  5111. DisplayB2SText " SHOOT KICKERS TO START MISSION "
  5112. Case 14:
  5113. D1.Text = "COMPLETE METALSLUG TO LIGHT LOCK"
  5114. DisplayB2SText "COMPLETE METALSLUG TO LIGHT LOCK"
  5115. Case 15:
  5116. D1.Text = "LOCK 4 BALLS TO START MULTI BALL"
  5117. DisplayB2SText "LOCK 4 BALLS TO START MULTI BALL"
  5118. Case 16:
  5119. D1.Text = "** GOOD LUCK ON YOUR MISSIONS **"
  5120. DisplayB2SText "** GOOD LUCK ON YOUR MISSIONS **"
  5121. Case 18:
  5122. If Score(1) Then
  5123. D1.Text = "PLAYER 1"& Score(1)
  5124. DisplayB2SText "PLAYER 1"& Score(1)
  5125. End If
  5126. If Score(2) Then
  5127. D1.Text = "PLAYER 2"& Score(2)
  5128. DisplayB2SText "PLAYER 1"& Score(2)
  5129. End If
  5130. If Score(3) Then
  5131. D1.Text = "PLAYER 3"& Score(3)
  5132. DisplayB2SText "PLAYER 1"& Score(3)
  5133. End If
  5134. If Score(4) Then
  5135. D1.Text = "PLAYER 4"& Score(4)
  5136. DisplayB2SText "PLAYER 1"& Score(4)
  5137. End If
  5138.  
  5139. 'coins or freeplay
  5140. If bFreePlay Then
  5141. D1.Text = "FREE PLAY"
  5142. DisplayB2SText "FREE PLAY"
  5143. Else
  5144. If Credits> 0 Then
  5145. DisplayB2SText " CREDITS " &credits& " PRESS START"
  5146. D1.Text = "CREDITS " &credits& " PRESS START"
  5147. Else
  5148. DisplayB2SText " CREDITS " &credits& " INSERT COIN"
  5149. D1.Text = "CREDITS " &credits& " INSERT COIN"
  5150. End If
  5151. End If
  5152. Case 19:
  5153. DisplayB2SText " HIGHSCORES "& "1> " & HighScoreName(0) & " :" & HighScore(0)', 0, , , -1
  5154. D1.Text = " HIGHSCORES"& " 1> " & HighScoreName(0) & " " & FormatNumber(HighScore(0), 0, , , -1)
  5155. Case 20:
  5156. DisplayB2SText " HIGHSCORES "& "2> " & HighScoreName(1) & " :" & HighScore(1)', 0, , , -1
  5157. D1.Text = " HIGHSCORES"& " 2> " & HighScoreName(1) & " " & FormatNumber(HighScore(1), 0, , , -1)
  5158. Case 21:
  5159. DisplayB2SText " HIGHSCORES "& "3> " & HighScoreName(2) & " :" & HighScore(2)', 0, , , -1
  5160. D1.Text = " HIGHSCORES"& " 3> " & HighScoreName(2) & " " & FormatNumber(HighScore(2), 0, , , -1)
  5161. Case 22:
  5162. DisplayB2SText " HIGHSCORES "& "4> " & HighScoreName(3) & " :" & HighScore(3)', 0, , , -1
  5163. D1.Text = " HIGHSCORES"& " 4> " & HighScoreName(3) & " " & FormatNumber(HighScore(3), 0, , , -1)
  5164. AttractMessagesTimerUserData = 0
  5165. End Select
  5166. End Sub
  5167.  
  5168.  
  5169.  
  5170. ' This timer enables the light sequencer when entering attract mode.
  5171. '
  5172. ' *** DOCAM OPTIMIZED ***
  5173. '
  5174. Sub AttractLightsTimer_Timer()
  5175. ' AttractLightsTimer.Enabled = FALSE
  5176. ' MainSeq.Play SeqUpOn, 80, 4
  5177. End Sub
  5178.  
  5179.  
  5180.  
  5181. ' This timer check if entering setup mode.
  5182. '
  5183. ' *** DOCAM OPTIMIZED ***
  5184. '
  5185. Dim EnteringSetupTimerUserData
  5186. Sub EnteringSetupTimer_Timer()
  5187. EnteringSetupTimer.Enabled = FALSE
  5188. If bLeftFlipPressed And bRightFlipPressed And bAllowEnterSetup And Not(bRunningSetup) Then
  5189. ' Stop the messages during attract mode.
  5190. AttractMessagesTimer.Enabled = FALSE
  5191. AttractMessagesTimerUserData = 0
  5192. ' Set flags.
  5193. bAllowEnterSetup = FALSE
  5194. bRunningSetup = TRUE
  5195. bLeftFlipPressed = FALSE
  5196. bRightFlipPressed = FALSE
  5197. D1.Text = " ENTERING SETUP "
  5198. EnteringSetupTimerUserData = 1
  5199. EnteringSetupTimer.interval = 1100
  5200. Exit Sub
  5201. End If
  5202. If EnteringSetupTimerUserData = 1 Then
  5203. D1.Text = " LEFT FLIP KEY = NEXT PARAMETER "
  5204.  
  5205. EnteringSetupTimerUserData = 2
  5206. EnteringSetupTimer.interval = 1500
  5207. ElseIf EnteringSetupTimerUserData = 2 Then
  5208. D1.Text = " RIGHT FLIP KEY = CHANGE VALUE "
  5209.  
  5210. EnteringSetupTimerUserData = 3
  5211. EnteringSetupTimer.interval = 1500
  5212. ElseIf EnteringSetupTimerUserData = 3 Then
  5213. D1.Text = " "
  5214.  
  5215. SetupMenuEntry()
  5216. EnteringSetupTimerUserData = 4
  5217. EnteringSetupTimer.interval = 800
  5218. ElseIf EnteringSetupTimerUserData = 4 Then
  5219. ' Reset default for this timer.
  5220. EnteringSetupTimer.Interval = 2500
  5221. EnteringSetupTimerUserData = 5
  5222. ' Display first parameter: balls per game
  5223. SetupMenuDisplayCurrentSetting()
  5224. Playsound "steel"
  5225. End If
  5226. End Sub
  5227.  
  5228.  
  5229.  
  5230. ' *********************************************************************
  5231. ' ** **
  5232. ' ** USER DEFINED SPECIFIC SUBROUTINES & FUNCTIONS **
  5233. ' ** **
  5234. ' *********************************************************************
  5235.  
  5236.  
  5237.  
  5238. ' *********************************************************************
  5239. ' ** BALLS AND GAME HANDLING **
  5240. ' *********************************************************************
  5241.  
  5242.  
  5243.  
  5244. ' Initialize the table for a new game.
  5245. '
  5246. ' *** DOCAM MUST BE REWORKED !!! ***
  5247. '
  5248.  
  5249. 'ResetForNewGame
  5250.  
  5251.  
  5252. ' Initialize the table for a new ball (either a new ball after the player has lost one).
  5253. '
  5254. 'Sub ResetForNewPlayerBall()
  5255. ' This flag avoids ball saver restart during play.
  5256. ' bCanActivateBallSaver = TRUE
  5257. ' Assume the player is now playing ball.
  5258. ' bPlayingBall = TRUE
  5259. ' Make sure the correct display is upto date.
  5260. ' AddScore(0)
  5261. 'End Sub
  5262.  
  5263.  
  5264.  
  5265. ' Create a new ball on the playfield (ejected to the plunger lane).
  5266. '
  5267. ' *** DOCAM OPTIMIZED ***
  5268. '
  5269. 'Sub CreateNewBall()
  5270. ' Create a ball in the plunger lane kicker.
  5271. ' PlungerKicker.CreateBall()
  5272. ' There is a (or another) ball on the playfield
  5273. ' BallsOnPlayfield = BallsOnPlayfield + 1
  5274. ' Kick the ball in plunger lane.
  5275. ' PlungerKickerSolenoidPulse()
  5276. 'End Sub
  5277.  
  5278.  
  5279. ' The player has lost his ball (there are no more balls on the playfield).
  5280. '
  5281. ' *** DOCAM OPTIMIZED ***
  5282. '
  5283. 'Sub EndOfBall()
  5284. ' StopMusic 1
  5285. ' PlayMusic 7, "Marcodie", FALSE
  5286. ' PlayMusic 8, "explode3", FALSE
  5287. ' FlashOff()
  5288. ' Assume the player isn't playing a ball.
  5289. ' bPlayingBall = FALSE
  5290. ' D1.QueueText " ", seScrollUpOver, 10
  5291. ' D2.QueueText " ", seScrollUpOver, 10
  5292. ' If bPlayingMission Then EndMission()
  5293. ' If Not(fpTilted) Then
  5294. ' D1.FlushQueue()
  5295. ' D2.FlushQueue()
  5296. ' InterruptDisplay(1600)
  5297. ' D1.Text = " "
  5298. ' D2.Text = " "
  5299. ' D1.QueueText "<<<<++ KILLED IN ACTION ++>>>>", seWipeIn, 800
  5300. ' D2.QueueText "<<<<++ KILLED IN ACTION ++>>>>", seWipeIn, 800
  5301. ' End If
  5302. ' EndOfBallTimer2.Enabled = TRUE
  5303. 'End Sub
  5304.  
  5305.  
  5306.  
  5307. ' This function is called when the end of bonus display (or high score entry finished) and it either end the game or move onto the next ball.
  5308. '
  5309. ' *** DOCAM OPTIMIZED ***
  5310. '
  5311. Sub EndOfBallComplete()
  5312. Dim NextPlayer
  5313. ' Is it the end of the game ? (all balls has been lost for player).
  5314. If BallsRemaining(CurrentPlayer) - Ball < 0 Then
  5315. ' Set the machine into game over/attract mode.
  5316. EndOfGame()
  5317. Else
  5318. ' Make sure the correct display is upto date.
  5319. AddScore 0
  5320. ' Reset the playfield for the new ball.
  5321. ResetForNewPlayerBall()
  5322. ' Create a new ball.
  5323. CreateNewBall()
  5324. LightKickback()
  5325. ResetCaptiveTargets()
  5326. AddScore 0
  5327. ResetMusic()
  5328. LightMission()
  5329. POWLaneLight1.State = 0
  5330. POWLaneLight2.State = 0
  5331. POWLaneLight3.State = 0
  5332. ' Unlit left inlane.
  5333. LeftInLaneLight.State = 0
  5334. bLeftInLaneIsLit = FALSE
  5335. ' Unlit right inlane.
  5336. RightInLaneLight.State = 0
  5337. bRightInLaneIsLit = FALSE
  5338. ' Unlit right outlane.
  5339. RightOutLaneLight.State = 0
  5340. End If
  5341. End Sub
  5342.  
  5343.  
  5344.  
  5345. ' This function is called at the end of the game, and start the attract mode.
  5346. '
  5347. ' *** DOCAM OPTIMIZED ***
  5348. '
  5349. 'Sub EndOfGame()
  5350. ' Dim i, j, iswap
  5351. ' Dim POWNameTemp
  5352. ' Dim Rand(100)
  5353. ' Kicker1.DestroyBall()
  5354. ' Kicker2.DestroyBall()
  5355. ' Kicker3.DestroyBall()
  5356. ' Kicker4.DestroyBall()
  5357. ' bBallLockedInKicker1 = FALSE
  5358. ' bBallLockedInKicker2 = FALSE
  5359. ' bBallLockedInKicker3 = FALSE
  5360. ' bBallLockedInKicker4 = FALSE
  5361. ' bBallInKicker1 = FALSE
  5362. ' bBallInKicker2 = FALSE
  5363. ' bBallInKicker3 = FALSE
  5364. ' bBallInKicker4 = FALSE
  5365. ' BallsLocked = 0
  5366. ' FlashOff()
  5367. ' BallsOnPlayfield = 0
  5368. ' PlayfieldTimer.Enabled = TRUE
  5369. ' Let Future Pinball know that the game has finished. This also clear the fpGameInPlay flag.
  5370. ' EndGame()
  5371. ' LookAtBackbox()
  5372. ' D1.Text = " GAME OVER "
  5373. ' D2.Text = " GAME OVER "
  5374. ' Playsound "msmissioncomplete"
  5375. ' Ensure that the flippers are down.
  5376. 'LeftFlipper.SolenoidOff()
  5377. 'RightFlipper.SolenoidOff()
  5378. ' Entering attract mode (lights and messages).
  5379. ' EnterAttractMode()
  5380. ' Doing POW name table randomly shuffled.
  5381. ' For i = 1 To 100
  5382. ' Rand(i) = Int(Rnd(1) * 10000)
  5383. ' Next
  5384. ' For i = 1 To 99
  5385. ' For j = i + 1 To 100
  5386. ' If Rand(i) > Rand(j) Then
  5387. ' iswap = Rand(i)
  5388. ' Rand(i) = Rand(j)
  5389. ' Rand(j) = iswap
  5390. ' POWNameTemp = POWName(i)
  5391. ' POWName(i) = POWName(j)
  5392. ' POWName(j) = POWNameTemp
  5393. ' End If
  5394. ' Next
  5395. ' Next
  5396. 'End Sub
  5397.  
  5398.  
  5399.  
  5400. ' *********************************************************************
  5401. ' ** SCORING FUNCTIONS **
  5402. ' *********************************************************************
  5403.  
  5404.  
  5405.  
  5406. ' Add points to the score.
  5407. '
  5408. Sub AddScore(points)
  5409. If Not(Tilted) Then
  5410. ' Add the points to the current players score variable.
  5411. Score(CurrentPlayer) = Score(CurrentPlayer) + points
  5412. If Not(bInterruptedDisplay) And (Not(bPlayingMission) Or bPlayingFinalMission) Then
  5413. ' Display score and ball in play.
  5414. If Score(1) < 1000000 Then
  5415. DisplayScore
  5416. D1.Text = FormatScore(Score(1)) & " BALL " & Ball
  5417. Else
  5418. DisplayScore
  5419. D1.Text = FormatScore(Score(1)) & String(25 - Len(Score(1)), " ")
  5420. End If
  5421. Exit Sub
  5422. End If
  5423. If Not(bInterruptedDisplay) And bPlayingMission And Not(bMissionSuspended) And Not(bPlayingFinalMission) Then
  5424. If bPlayingMission3 Then
  5425. ' Specific display for mission 3 (Super Jets).
  5426. If Score(1) < 1000000 Then
  5427. DisplayB2SText (cstr(FormatScore(Score(1)))) & " REMAINING JETS " & Right("0" & RemainingJets, 2)
  5428. D1.Text = FormatScore(Score(1)) & " REMAINING JETS " & Right("0" & RemainingJets, 2)
  5429. Else
  5430. DisplayB2SText (cstr(FormatScore(Score(1)))) & String(14 - Len(Score(1)), " ") & "REMAINING JETS " & Right("0" & RemainingJets, 2)
  5431. D1.Text = FormatScore(Score(1)) & String(14 - Len(Score(1)), " ") & "REMAINING JETS " & Right("0" & RemainingJets, 2)
  5432. End If
  5433. ElseIf bPlayingMission4 Then
  5434. ' Specific display for mission 4 (POW).
  5435. If Score(1) < 1000000 Then
  5436. DisplayB2SText (cstr(FormatScore(Score(1))))
  5437. D1.Text = FormatScore(Score(1)) & " REMAINING POW " & RemainingPOW
  5438. Else
  5439. DisplayB2SText (cstr(FormatScore(Score(1)))) & String(16 - Len(Score(1)), " ") & "REMAINING POW " & RemainingPOW
  5440. D1.Text = FormatScore(Score(1)) & String(16 - Len(Score(1)), " ") & "REMAINING POW " & RemainingPOW
  5441. End If
  5442. ElseIf bPlayingMission5 Then
  5443. ' Specific display for mission 5 (Defeat Allen O'Neill).
  5444. If Score(1) < 1000000 Then
  5445. DisplayB2SText (cstr(FormatScore(Score(1)))) & " ALLEN'S ENERGY " & RemainingAllen
  5446. D1.Text = FormatScore(Score(1)) & " ALLEN'S ENERGY " & RemainingAllen
  5447. Else
  5448. DisplayB2SText (cstr(FormatScore(Score(1)))) & String(15 - Len(Score(1)), " ") & "ALLEN'S ENERGY " & RemainingAllen
  5449. D1.Text = FormatScore(Score(1)) & String(15 - Len(Score(1)), " ") & "ALLEN'S ENERGY " & RemainingAllen
  5450. End If
  5451. End If
  5452. End If
  5453. End If
  5454.  
  5455. End Sub
  5456.  
  5457.  
  5458.  
  5459. ' This function add a comma as separator for three digits groups (useful for best score legibility).
  5460. '
  5461. ' *** DOCAM OPTIMIZED ***
  5462. '
  5463. Function FormatScore(ByVal sc)
  5464. Dim fsc
  5465. Dim fdone
  5466. fdone = ""
  5467. While Len(sc) > 3
  5468. fsc = Right(sc, 3)
  5469. If fdone = "" Then
  5470. fdone = "," & fsc
  5471. Else
  5472. fdone = "," & fsc & fdone
  5473. End If
  5474. sc = Left(sc, Len(sc)-3)
  5475. Wend
  5476. fdone = sc & fdone
  5477. FormatScore = fdone
  5478. End Function
  5479.  
  5480.  
  5481.  
  5482. ' Scoring during mission 1, when hitting any target.
  5483. '
  5484. ' *** DOCAM OPTIMIZED ***
  5485. '
  5486. Sub ScoreMission1()
  5487. Playsound "ok"
  5488. InterruptDisplay(600)
  5489. AddScore(20000)
  5490. 'D1.FlushQueue()
  5491. 'D2.FlushQueue()
  5492. DisplayB2SText " * 20,000 * "
  5493. D1.Text = " * 20,000 * "
  5494. ' D1.QueueText " 20,000 "', seBlinkMask, 300
  5495. ' D2.QueueText " 20,000 ", seBlinkMask, 300
  5496. Playsound "explode3"
  5497. End Sub
  5498.  
  5499.  
  5500.  
  5501. ' This subroutine add 40,000 points when a WEAPON target is hit during mission 2.
  5502. '
  5503. ' *** DOCAM OPTIMIZED ***
  5504. '
  5505. Sub ScoreMission2()
  5506. Playsound "Gun4"
  5507. InterruptDisplay(600)
  5508. AddScore(40000)
  5509. ' D1.FlushQueue()
  5510. ' D2.FlushQueue()
  5511. DisplayB2SText " * 40,000 * "
  5512. D1.Text = " * 40,000 * "
  5513. ' D1.QueueText " 40,000 ", seBlinkMask, 300
  5514. ' D2.QueueText " 40,000 ", seBlinkMask, 300
  5515. End Sub
  5516.  
  5517.  
  5518.  
  5519. ' This subroutine checks the remaining jets during mission 3.
  5520. '
  5521. ' *** DOCAM OPTIMIZED ***
  5522. '
  5523. Sub CheckJets()
  5524. AddScore(4500)
  5525. Playsound "Rocket1"
  5526. If RemainingJets = 0 Then CompleteMission()
  5527. End Sub
  5528.  
  5529.  
  5530.  
  5531. ' This subroutine decrements remaining POW during mission 4.
  5532. '
  5533. ' *** DOCAM OPTIMIZED ***
  5534. '
  5535. Sub ScoreMission4()
  5536. RemainingPOW = RemainingPOW - 1
  5537. InterruptDisplay(600)
  5538. ' D1.FlushQueue()
  5539. ' D2.FlushQueue()
  5540. DisplayB2SText " * POW SAVED * "
  5541. D1.Text = " * POW SAVED * "
  5542. ' D1.QueueText " POW SAVED ", seBlinkMask, 300
  5543. ' D2.QueueText " POW SAVED ", seBlinkMask, 300
  5544. AddScore(15000)
  5545. Playsound "thankyou"
  5546. Playsound "chopper"
  5547. If RemainingPOW = 0 Then CompleteMission()
  5548. End Sub
  5549.  
  5550.  
  5551.  
  5552. ' This subroutine decrements Allen's health during mission 5.
  5553. '
  5554. ' *** DOCAM OPTIMIZED ***
  5555. '
  5556. Sub ScoreMission5()
  5557. RemainingAllen = RemainingAllen - 1
  5558. AddScore(7500)
  5559. Playsound "gun9", FALSE
  5560. If RemainingAllen = 0 Then CompleteMission()
  5561. End Sub
  5562.  
  5563.  
  5564.  
  5565. ' *********************************************************************
  5566. ' ** MUSIC & SOUND FUNCTIONS **
  5567. ' *********************************************************************
  5568.  
  5569.  
  5570.  
  5571. ' This subroutine restarts the correct theme.
  5572. '
  5573. ' *** DOCAM OPTIMIZED ***
  5574. '
  5575. Sub ResetMusic()
  5576. If bPlayingMission Then
  5577. Select Case Mission
  5578. Case 1: StopSound Song:Song = "": PlaySong "mu_MSMode1"' Playsound "MSMode1"
  5579. Case 2: StopSound Song:Song = "": PlaySong "mu_MSMode2"'Playsound "MSMode2"
  5580. Case 3: StopSound Song:Song = "": PlaySong "mu_MSMode3"'Playsound "MSMode3"
  5581. Case 4: StopSound Song:Song = "": PlaySong "mu_MSMode2"'Playsound "MSMode2"
  5582. Case 5: StopSound Song:Song = "": PlaySong "mu_MSMode1"'Playsound "MSMode1"
  5583. Case 6: StopSound Song:Song = "": PlaySong "mu_MSmultiball"'Playsound "MSmultiball"
  5584. End Select
  5585. Else
  5586. If bLockIsLit Then
  5587. Playsound "MSLocklit2"
  5588. Else
  5589. If bJackpotScored Then
  5590. Playsound "MSjackpot"
  5591. Else
  5592. StopSound Song:Song = "": PlaySong "mu_MSMain"'
  5593. 'Playsound "MSMain"
  5594. End If
  5595. End If
  5596. End If
  5597. End Sub
  5598.  
  5599.  
  5600.  
  5601. ' This subroutine selects next sound and play it on SLUG target hit.
  5602. '
  5603. ' *** DOCAM OPTIMIZED ***
  5604. '
  5605. Sub PlaySlugSound()
  5606. SlugSound = SlugSound + 1
  5607. Select Case SlugSound
  5608. Case 1: Playsound "yell1"
  5609. Case 2: Playsound "yell2"
  5610. Case 3: Playsound "yell3"
  5611. Case 4: Playsound "yell4"
  5612. Case 5: Playsound "yell5"
  5613. Case 6:
  5614. Playsound "yell6"
  5615. SlugSound = 0
  5616. End Select
  5617. End Sub
  5618.  
  5619.  
  5620.  
  5621. ' Play different sound when the ball roll on outlane/inlane.
  5622. '
  5623. ' *** DOCAM OPTIMIZED ***
  5624. '
  5625. Sub PlayOutLaneSound()
  5626. OutLaneSound = OutLaneSound + 1
  5627. FlashAnimate1()
  5628. Select Case OutLaneSound
  5629. Case 1: Playsound "mordenlaugh"
  5630. Case 2: Playsound "yell7"
  5631. Case 3:
  5632. Playsound "allenlaugh"
  5633. OutLaneSound = 0
  5634. End Select
  5635. End Sub
  5636.  
  5637.  
  5638.  
  5639. ' *********************************************************************
  5640. ' ** ATTRACT MODE SPECIFIC FUNCTIONS **
  5641. ' *********************************************************************
  5642.  
  5643.  
  5644.  
  5645. ' Entering the attract mode.
  5646. '
  5647. ' *** DOCAM OPTIMIZED ***
  5648. '
  5649. Sub EnterAttractMode()
  5650. StartAttractMode
  5651. 'AttractLightsTimer.Enabled = TRUE
  5652. AttractMessagesTimer.Enabled = TRUE
  5653. End Sub
  5654.  
  5655.  
  5656.  
  5657. ' Prepare the lights for the attract mode.
  5658. '
  5659. ' *** DOCAM OPTIMIZED ***
  5660. '
  5661. Sub SetupLightsAttract()
  5662. ' Characters.
  5663. Marco.state = 2
  5664. Tarma.state = 2
  5665. Eri.state = 2
  5666. Fio.state = 2
  5667. ' Missions.
  5668. Mission1Light.state = 2
  5669. Mission2Light.state = 2
  5670. Mission3Light.state = 2
  5671. Mission4Light.state = 2
  5672. Mission5Light.state = 2
  5673. Mission6Light.state = 2
  5674. ' Weapons and ExtraBall lights.
  5675. Weapon1.state = 2
  5676. Weapon2.state = 2
  5677. Weapon3.state = 2
  5678. Weapon4.state = 2
  5679. Weapon5.state = 2
  5680. Weapon6.state = 2
  5681. ExtraBall.state = 2
  5682. ' WEAPON target lights.
  5683. W1Light.Set 2, "100100100100", 75
  5684. W2Light.Set 2, "010010010010", 75
  5685. W3Light.Set 2, "001001001001", 75
  5686. W4Light.Set 2, "100100100100", 75
  5687. W5Light.Set 2, "010010010010", 75
  5688. W6Light.Set 2, "001001001001", 75
  5689. ' METALSLUG target lights.
  5690. Slug1Light.Set 2, "1000011111", 50
  5691. Slug2Light.Set 2, "1100001111", 50
  5692. Slug3Light.Set 2, "1110000111", 50
  5693. Slug4Light.Set 2, "1111000011", 50
  5694. Slug5Light.Set 2, "1111100001", 50
  5695. Slug6Light.Set 2, "1111100001", 50
  5696. Slug7Light.Set 2, "1111000011", 50
  5697. Slug8Light.Set 2, "1110000111", 50
  5698. Slug9Light.Set 2, "1100001111", 50
  5699. ' Side target lights.
  5700. S1Light.Set 2, "1000011000", 75
  5701. S2Light.Set 2, "1100001100", 75
  5702. S3Light.Set 2, "0110000110", 75
  5703. L4.Set 2, "0011000011", 75
  5704. JackpotLight.Set 2, "1001100001", 75
  5705. ' POW lanes.
  5706. POWLaneLight1.Set 2, "1000001010", 75
  5707. POWLaneLight2.Set 2, "0010001010", 75
  5708. POWLaneLight3.Set 2, "0000101010", 75
  5709. ' Outlanes and inlanes lights.
  5710. RightOutLaneLight.Set 2, "100100100", 75
  5711. RightInLaneLight.Set 2, "010010010", 75
  5712. ShootAgainLight.Set 2, "001001001", 75
  5713. LeftInLaneLight.Set 2, "100100100", 75
  5714. KickbackLight.Set 2, "010010010", 75
  5715. ' Kicker lights.
  5716. L1.Set 2, "10101111111101010000", 75
  5717. M1.Set 2, "10101111111101010000", 75
  5718. L2.Set 2, "00001010111111101010", 75
  5719. M2.Set 2, "00001010111111101010", 75
  5720. L3.Set 2, "01000000101011111101", 75
  5721. M3.Set 2, "01000000101011111101", 75
  5722. ' Captive ball.
  5723. C1Light.Set 2, "10000010100000", 75
  5724. C2Light.Set 2, "00100010100010", 75
  5725. C3Light.Set 2, "00001010101000", 75
  5726. CaptiveLight.Set 2, "00000010100000", 75
  5727. ' Loop.
  5728. LoopLight.Set 2, "0101010100101", 75
  5729. End Sub
  5730.  
  5731.  
  5732.  
  5733. ' Called when the light sequencer queue is empty to repeat the attract mode sequence (lights only).
  5734. '
  5735. ' *** DOCAM OPTIMIZED ***
  5736. '
  5737. Sub MainSeq_Empty()
  5738. ' If Not(bGameInPlay) Then
  5739. ' SetupLightsAttract()
  5740. ' AttractLightsTimer.Enabled = TRUE
  5741. ' End If
  5742. End Sub
  5743.  
  5744.  
  5745.  
  5746. ' End the attract mode.
  5747. '
  5748. ' *** DOCAM OPTIMIZED ***
  5749. '
  5750. Sub EndAttractMode()
  5751. AllLightsOff()
  5752. StopAttractMode
  5753. ' LightSeqAttract.StopPlay
  5754. ' LightSeqFlasher.StopPlay
  5755. AttractLightsTimer.Enabled = FALSE
  5756. AttractMessagesTimer.Enabled = FALSE
  5757. AttractMessagesTimerUserData = 0
  5758. End Sub
  5759.  
  5760.  
  5761.  
  5762.  
  5763.  
  5764.  
  5765.  
  5766.  
  5767.  
  5768.  
  5769.  
  5770.  
  5771.  
  5772.  
  5773. Sub AllLightsOff()
  5774. Marco.State = 0
  5775. Tarma.State = 0
  5776. Eri.State = 0
  5777. Fio.State = 0
  5778. Mission1Light.State = 0
  5779. Mission2Light.State = 0
  5780. Mission3Light.State = 0
  5781. Mission4Light.State = 0
  5782. Mission5Light.State = 0
  5783. Mission6Light.State = 0
  5784. Weapon1.State = 0
  5785. Weapon2.State = 0
  5786. Weapon3.State = 0
  5787. Weapon4.State = 0
  5788. Weapon5.State = 0
  5789. Weapon6.State = 0
  5790. ExtraBall.State = 0
  5791. W1Light.State = 0
  5792. W2Light.State = 0
  5793. W3Light.State = 0
  5794. W4Light.State = 0
  5795. W5Light.State = 0
  5796. W6Light.State = 0
  5797. Slug1Light.State = 0
  5798. Slug2Light.State = 0
  5799. Slug3Light.State = 0
  5800. Slug4Light.State = 0
  5801. Slug5Light.State = 0
  5802. Slug6Light.State = 0
  5803. Slug7Light.State = 0
  5804. Slug8Light.State = 0
  5805. Slug9Light.State = 0
  5806. S1Light.State = 0
  5807. S2Light.State = 0
  5808. S3Light.State = 0
  5809. L4.State = 0
  5810. JackpotLight.State = 0
  5811. POWLaneLight1.State = 0
  5812. POWLaneLight2.State = 0
  5813. POWLaneLight3.State = 0
  5814. RightOutLaneLight.State = 0
  5815. RightInLaneLight.State = 0
  5816. bRightInLaneIsLit = FALSE
  5817. ShootAgainLight.State = 0
  5818. LeftInLaneLight.State = 0
  5819. bLeftInLaneIsLit = FALSE
  5820. KickbackLight.State = 0
  5821. L1.State = 0
  5822. M1.State = 0
  5823. L2.State = 0
  5824. M2.State = 0
  5825. L3.State = 0
  5826. M3.State = 0
  5827. C1Light.State = 0
  5828. C2Light.State = 0
  5829. C3Light.State = 0
  5830. CaptiveLight.State = 0
  5831. LoopLight.State = 0
  5832. End Sub
  5833.  
  5834.  
  5835.  
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.  
  5842. ' *** DOCAM OPTIMIZED ***
  5843. '
  5844. Sub ResetSLUGTargets()
  5845. DOF 123, DOFPulse
  5846. Slug1Light.State = 2', "1000011111", 50
  5847. Slug2Light.State = 2', "1100001111", 50
  5848. Slug3Light.State = 2', "1110000111", 50
  5849. Slug4Light.State = 2', "1111000011", 50
  5850. Slug5Light.State = 2', "1111100001", 50
  5851. Slug6Light.State = 2', "1111100001", 50
  5852. Slug7Light.State = 2', "1111000011", 50
  5853. Slug8Light.State = 2', "1110000111", 50
  5854. Slug9Light.State = 2', "1100001111", 50
  5855. Slug1.Isdropped = 0
  5856. Slug2.Isdropped = 0
  5857. Slug3.Isdropped = 0
  5858. Slug4.Isdropped = 0
  5859. Slug5.Isdropped = 0
  5860. Slug6.Isdropped = 0
  5861. Slug7.Isdropped = 0
  5862. Slug8.Isdropped = 0
  5863. Slug9.Isdropped = 0
  5864. End Sub
  5865.  
  5866.  
  5867.  
  5868. ' This subroutine activate the kickback.
  5869. '
  5870. ' *** DOCAM OPTIMIZED ***
  5871. '
  5872. Sub LightKickback()
  5873. ' Enable (arm) the kickback.
  5874. KickbackLight.State = 1
  5875. bKickbackIsLit = TRUE
  5876. ' Blocks the left outlane (raise the invisible guide, useful to guide the ball correctly prior to kickback).
  5877. KickbackGuide.isDropped = FALSE
  5878. End Sub
  5879.  
  5880.  
  5881.  
  5882. ' This subroutine lits every red arrow(s) - for free kicker(s) - means ready for playing mission.
  5883. '
  5884. ' *** DOCAM OPTIMIZED ***
  5885. '
  5886. Sub LightMission()
  5887. If Not(bMissionIsLit) And Not(bPlayingMission) And Not(bMissionSuspended) Then
  5888. bMissionIsLit = TRUE
  5889. If bBallLockedInKicker1 And bBallLockedInKicker2 And bBallLockedInKicker3 Then
  5890. M1.State = 0
  5891. M2.State = 0
  5892. M3.State = 0
  5893. End If
  5894. CaptiveLight.State = 0
  5895. If Not(bMultiBallMode) Then
  5896. M1.State = 2', "10", 100
  5897. M2.State = 2', "10", 100
  5898. M3.State = 2', "10", 100
  5899. End If
  5900. If bBallLockedInKicker1 Then
  5901. M1.State = 1
  5902. Else
  5903. M1.State = 2
  5904. End If
  5905. If bBallLockedInKicker2 Then
  5906. M2.State = 1
  5907. Else
  5908. M2.State = 2
  5909. End If
  5910. If bBallLockedInKicker3 Then
  5911. M3.State = 1
  5912. Else
  5913. M3.State = 2
  5914. End If
  5915. End If
  5916. End Sub
  5917.  
  5918.  
  5919.  
  5920. ' *** DOCAM CLEANED ***
  5921. '
  5922. Dim MissionTimerUserData
  5923. Sub StartMission()
  5924. If Not(bMultiBallMode) Then
  5925. AddScore(5000)
  5926. bMissionIsLit = FALSE
  5927. Mission = Mission + 1
  5928. M1.State = 1
  5929. M2.State = 1
  5930. M3.State = 1
  5931. LoopLight.State = 0
  5932. bPlayingMission = TRUE
  5933. Select Case Mission
  5934. Case 1:
  5935. ' Starting mission 1 (any targets).
  5936. Mission1Light.State = 1
  5937. bPlayingMission1 = TRUE
  5938. StopSound Song:Song = "": PlaySong "mu_MSMode1"'Playsound "MSMode1"
  5939. 'Playsound "Mission1"
  5940. DMDFLush
  5941. DMD "Mision1Start.wmv", "", "", 3950
  5942. 'StopMusic 4
  5943. KickOutBallTimer.Enabled = TRUE
  5944. CaptiveLight.state = 0
  5945. FlashAnimate5()
  5946. MissionTimerUserData = 35
  5947. MissionTimer.Enabled = TRUE
  5948. NextMessage = 1
  5949. bCanDisplayMessage = TRUE
  5950. DisplayB2SText " MISSION 1 START "
  5951. D1.text = " MISSION 1 START "', seScrollUp, 500, 0, TRUE
  5952. Case 2:
  5953. ' Starting mission 2 (weapon practice).
  5954. Mission2Light.State = 1
  5955. bPlayingMission2 = TRUE
  5956. StopSound Song:Song = "": PlaySong "mu_MSMode2"'Playsound "MSMode2"
  5957. 'Playsound "Mission2"
  5958. DMDFLush
  5959. DMD "Mision2Start.wmv", "", "", 3950
  5960. 'StopMusic 4
  5961. FlashAnimate5()
  5962. MissionTimerUserData = 35
  5963. MissionTimer.Enabled = TRUE
  5964. DropWeapon()
  5965. AnimateWeaponTimer.Uservalue = 0
  5966. AnimateWeaponTimer.enabled = 1
  5967. NextMessage = 5
  5968. bCanDisplayMessage = TRUE
  5969. DisplayB2SText " MISSION 2 START "
  5970. D1.text = " MISSION 2 START "', seScrollUp, 500, 0, TRUE
  5971. Case 3:
  5972. ' Starting mission 3 (super jets).
  5973. Mission3Light.State = 1
  5974. bPlayingMission3 = TRUE
  5975. StopSound Song:Song = "": PlaySong "mu_MSMode3"'Playsound "MSMode3"
  5976. 'Playsound "Mission3"
  5977. DMDFLush
  5978. DMD "Mision3Start.wmv", "", "", 3950
  5979. FlashAnimate5()
  5980. Bumper1l.State = 2
  5981. Bumper2l.State = 2
  5982. Bumper3l.State = 2
  5983. NextMessage = 6
  5984. bCanDisplayMessage = TRUE
  5985. DisplayB2SText " MISSION 3 START "
  5986. D1.text = " MISSION 3 START "', seScrollUp, 500, 0, TRUE
  5987. RemainingJets = 20
  5988. Case 4:
  5989. ' Starting mission 4 (POW).
  5990. Mission4Light.State = 1
  5991. bPlayingMission4 = TRUE
  5992. StopSound Song:Song = "": PlaySong "mu_MSMode2"'Playsound "MSMode2"
  5993. 'Playsound "Mission4"
  5994. DMDFLush
  5995. DMD "Mision4Start.wmv", "", "", 3950
  5996. FlashAnimate5()
  5997. CaptiveLight.State = 2
  5998. DisplayB2SText " MISSION 4 START "
  5999. D1.text = " MISSION 4 START "', seScrollUp, 500, 0, TRUE
  6000. RemainingPOW = 3
  6001. NextMessage = 7
  6002. bCanDisplayMessage = TRUE
  6003. Playsound "chopper"
  6004. Case 5:
  6005. ' Starting mission 5 (defeat Allen O'Neill).
  6006. Mission5Light.State = 1
  6007. bPlayingMission5 = TRUE
  6008. StopSound Song:Song = "": PlaySong "mu_MSMode1"'Playsound "MSMode1"
  6009. 'Playsound "Mission5"
  6010. 'DMDFLush
  6011. DMD "", "", "Mission 5 Start", 3950
  6012. DropWeapon()
  6013. FlashAnimate5()
  6014. DisplayB2SText " MISSION 5 START "
  6015. D1.text = " MISSION 5 START "', seScrollUp, 500, 0, TRUE
  6016. RemainingAllen = 5
  6017. WeaponTargetsMove = 0
  6018. DropWeapon()
  6019. AnimateWeaponTimer.Uservalue = 0
  6020. AnimateWeaponTimer.enabled = 1
  6021. NextMessage = 8
  6022. bCanDisplayMessage = TRUE
  6023. Case 6:
  6024. ' Starting mission 6 (final mission).
  6025. Mission6Light.State = 1
  6026. bFinalMissionIsReady = FALSE
  6027. bPlayingFinalMission = TRUE
  6028. bPlayingMission1 = TRUE
  6029. ' LookAtBackbox()
  6030. FinalMissionShowTimer.Interval 1300
  6031. DMDFLush
  6032. DMD "FinalMision.wmv", "", "", 3950
  6033. NextMessage = 10
  6034. bCanDisplayMessage = TRUE
  6035. StopSound Song:Song = "": PlaySong "mu_MSWizard"'Playsound "MSWizard"
  6036. 'D1.FlushQueue()
  6037. 'D2.FlushQueue()
  6038. DisplayB2SText " FINAL MISSION "
  6039. D1.text = " FINAL MISSION "', seScrollUp, 500, 0, TRUE
  6040. FlashAnimate5()
  6041. bLockIsLit = FALSE
  6042. End Select
  6043. End If
  6044. End Sub
  6045.  
  6046.  
  6047.  
  6048. ' Terminates any mission (silent).
  6049. '
  6050. ' *** DOCAM OPTIMIZED ***
  6051. '
  6052. Sub EndMission()
  6053. bPlayingMission = FALSE
  6054. bPlayingMission1 = FALSE
  6055. bPlayingMission2 = FALSE
  6056. bPlayingMission3 = FALSE
  6057. bPlayingMission4 = FALSE
  6058. bPlayingMission5 = FALSE
  6059. bPlayingFinalMission = FALSE
  6060. M1.State = 0
  6061. M2.State = 0
  6062. M3.State = 0
  6063. EndCurrentMission()
  6064. If Not(Tilted) Then FixWeapon()
  6065. CaptiveLight.State = 2
  6066. FlashOff()
  6067. If bWallIsDown Then LoopLight.State = 2
  6068. End Sub
  6069.  
  6070.  
  6071.  
  6072. ' Mission is completed.
  6073. '
  6074. ' *** DOCAM OPTIMIZED ***
  6075. '
  6076. Sub CompleteMission()
  6077. AddScore(5000)
  6078. bPlayingMission = FALSE
  6079. bPlayingMission1 = FALSE
  6080. bPlayingMission2 = FALSE
  6081. bPlayingMission3 = FALSE
  6082. bPlayingMission4 = FALSE
  6083. bPlayingMission5 = FALSE
  6084. bPlayingFinalMission = FALSE
  6085. FlashEffectMissionTimer.enabled = 1'GI_Flash()
  6086. Playsound "MSMissioncomplete"
  6087. If Mission < 5 Then
  6088. Playsound "MissionComplete"
  6089. ElseIf Mission = 5 Then
  6090. Playsound "seeyouinhell"
  6091. End If
  6092. bInterruptedDisplay = FALSE
  6093. NextMessage = 3
  6094. bCanDisplayMessage = TRUE
  6095. ShowNextMessage()
  6096. ' EffectMusic 1, SetVolume, 0.0
  6097. ResetMusicTimer.Enabled = TRUE
  6098. M1.State = 0
  6099. M2.State = 0
  6100. M3.State = 0
  6101. EndCurrentMission()
  6102. FixWeapon()
  6103. CaptiveLight.State = 2
  6104. FlashOff()
  6105. If bWallIsDown Then LoopLight.State = 2
  6106. End Sub
  6107.  
  6108.  
  6109.  
  6110. ' Terminates a specific mission.
  6111. '
  6112. ' *** DOCAM OPTIMIZED ***
  6113. '
  6114. Sub EndCurrentMission()
  6115. Select Case Mission
  6116. Case 1:
  6117. CaptiveLight.State = 0
  6118. Mission2Light.State = 2
  6119. MissionTimer.Enabled = FALSE
  6120. Case 2:
  6121. AnimateWeaponTimer.Enabled = FALSE
  6122. Mission3Light.State = 2
  6123. MissionTimer.Enabled = FALSE
  6124. If bWallIsDown Then
  6125. DropWeapon()
  6126. Else
  6127. FixWeapon()
  6128. End If
  6129. Case 3:
  6130. Bumper1l.State = 1
  6131. Bumper2l.State = 1
  6132. Bumper3l.State = 1
  6133. Mission4Light.State = 2
  6134. Case 4:
  6135. Mission5Light.State = 2
  6136. CaptiveLight.State = 0
  6137. Case 5:
  6138. AnimateWeaponTimer.Enabled = FALSE
  6139. Mission6Light.State = 2
  6140. bFinalMissionIsReady = TRUE
  6141. LightMission()
  6142. End Select
  6143. End Sub
  6144.  
  6145.  
  6146.  
  6147. ' *** DOCAM CLEANED ****
  6148. '
  6149. Sub StartMissionSoon()
  6150. If Not(bBallLockedInKicker1) Or Not(bBallLockedInKicker2) Or Not(bBallLockedInKicker3) Or Not(bBallLockedInKicker4) Then StartMissionSoonTimer.Enabled = TRUE
  6151. End Sub
  6152.  
  6153.  
  6154.  
  6155. ' *** DOCAM OPTIMIZED ****
  6156. '
  6157. Sub LockBall()
  6158. 'LightSeqAttract.Play SeqUpOn, 80
  6159. LightEffect 3
  6160. If bBallInKicker1 Then
  6161. bBallLockedInKicker1 = TRUE
  6162. L1.State = 1
  6163. End If
  6164. If bBallInKicker2 Then
  6165. bBallLockedInKicker2 = TRUE
  6166. L2.State = 1
  6167. End If
  6168. If bBallInKicker3 Then
  6169. bBallLockedInKicker3 = TRUE
  6170. L3.State = 1
  6171. End If
  6172. If bBallInKicker4 Then
  6173. bBallLockedInKicker4 = TRUE
  6174. L4.State = 1
  6175. End If
  6176. BallsLocked = BallsLocked + 1
  6177. If BallsLocked = 1 Then
  6178. DisplayBallLocked()
  6179. AutoBall()
  6180. Playsound "Marco"
  6181. DMDFLush
  6182. DMD "Marco.jpg", "", "", 2000
  6183. Marco.State = 1
  6184. Tarma.State = 0
  6185. Eri.State = 0
  6186. Fio.State = 0
  6187. ElseIf BallsLocked = 2 Then
  6188. DisplayBallLocked()
  6189. AutoBall()
  6190. Playsound "Tarma"
  6191. DMDFLush
  6192. DMD "Tarma.jpg", "", "", 2000
  6193. Marco.State = 1
  6194. Tarma.State = 1
  6195. Eri.State = 0
  6196. Fio.State = 0
  6197. ElseIf BallsLocked = 3 Then
  6198. DisplayBallLocked()
  6199. AutoBall()
  6200. Playsound "Eri"
  6201. DMDFLush
  6202. DMD "Eri.jpg", "", "", 2000
  6203. Marco.State = 1
  6204. Tarma.State = 1
  6205. Eri.State = 1
  6206. Fio.State = 0
  6207. ElseIf BallsLocked = 4 Then
  6208. DisplayBallLocked()
  6209. StartMultiballTimer.Enabled = TRUE
  6210. Playsound "Fio"
  6211. DMDFLush
  6212. DMD "Fio.jpg", "", "", 2000
  6213. Marco.State = 1
  6214. Tarma.State = 1
  6215. Eri.State = 1
  6216. Fio.State = 1
  6217. End If
  6218. End Sub
  6219.  
  6220.  
  6221.  
  6222. Sub AutoBall()
  6223. CreateNewBall()
  6224. AutoBallTimer.Enabled = TRUE
  6225. End Sub
  6226.  
  6227.  
  6228.  
  6229.  
  6230. Sub LightJackpot()
  6231. bJackpotIsLit = TRUE
  6232. JackpotLight.State = 2
  6233. End Sub
  6234.  
  6235.  
  6236.  
  6237. Sub UnLightJackpot()
  6238. bJackpotIsLit = FALSE
  6239. If bJackpotScored Then
  6240. JackpotLight.State = 1
  6241. Else
  6242. JackpotLight.State = 0
  6243. End If
  6244. End Sub
  6245.  
  6246.  
  6247.  
  6248. Sub EndMultiball()
  6249. If Not(bJackpotScored) Then ResetMusic()
  6250. bMultiBallMode = FALSE
  6251. UnLightJackpot()
  6252. FlashOff()
  6253. ' This timer add delay to reset side and captive drop targets.
  6254. EndMultiballTimer.Enabled = TRUE
  6255. If bMissionSuspended Then
  6256. ' Resume the suspended mission, if required.
  6257. bPlayingMission = TRUE
  6258. bMissionSuspended = FALSE
  6259. ResetMusic()
  6260. FlashAnimate5()
  6261. Select Case Mission
  6262. Case 1:
  6263. MissionTimer.Enabled = TRUE
  6264. Case 2:
  6265. MissionTimer.Enabled = TRUE
  6266. AnimateWeaponTimer.Enabled = TRUE
  6267. Case 3:
  6268. Bumper1l.State = 2
  6269. Bumper2l.State = 2
  6270. Bumper3l.State = 2
  6271. 'D1.FlushQueue())
  6272. 'DisplayUpdate
  6273. AddScore(0)
  6274. Case 4:
  6275. CaptiveLight.State = 2
  6276. 'D1.FlushQueue()
  6277. 'DisplayUpdate
  6278. AddScore(0)
  6279. Case 5:
  6280. AnimateWeaponTimer.Enabled = TRUE
  6281. 'D1.FlushQueue()
  6282. 'DisplayUpdate
  6283. AddScore(0)
  6284. End Select
  6285. End If
  6286. ResetSLUGTargets()
  6287. ResetSideTargets()
  6288. Marco.State = 0
  6289. Tarma.State = 0
  6290. Eri.State = 0
  6291. Fio.State = 0
  6292. L1.State = 0
  6293. L2.State = 0
  6294. L3.State = 0
  6295. L4.State = 0
  6296. If bMissionIsLit Then
  6297. M1.State = 2
  6298. M2.State = 2
  6299. M3.State = 2
  6300. Else
  6301. CaptiveLight.State = 2
  6302. End If
  6303. End Sub
  6304.  
  6305.  
  6306.  
  6307. Sub ResetCaptiveTargets()
  6308. DOF 121, DOFPulse
  6309. C1.Isdropped = 0'()
  6310. C2.Isdropped = 0'()
  6311. C3.Isdropped = 0'()
  6312. C1Light.State = 0
  6313. C2Light.State = 0
  6314. C3Light.State = 0
  6315. If bMissionIsLit Then
  6316. CaptiveLight.State = 0
  6317. Else
  6318. CaptiveLight.State = 2
  6319. End If
  6320. End Sub
  6321.  
  6322.  
  6323.  
  6324. Sub ResetSideTargets()
  6325. DOF 120, DOFPulse
  6326. S1.Isdropped = 0'()
  6327. S2.Isdropped = 0'()
  6328. S3.Isdropped = 0'()
  6329. S1Light.State = 0
  6330. S2Light.State = 0
  6331. S3Light.State = 0
  6332. End Sub
  6333.  
  6334.  
  6335.  
  6336. ' *** DOCAM OPTIMIZED ***
  6337. '
  6338. Sub CheckWeapon()
  6339. If bW1TargetIsDown And bW2TargetIsDown And bW3TargetIsDown And bW4TargetIsDown And bW5TargetIsDown And bW6TargetIsDown Then
  6340. FlashEffectMissionTimer.enabled = 1'GI_Flash()
  6341. CurrentWeapon = CurrentWeapon + 1
  6342. Select Case CurrentWeapon
  6343. Case 1:
  6344. Weapon1.State = 1
  6345. Weapon2.State = 2
  6346. PlaySound "Heavymachinegun"
  6347. InterruptDisplay(1000)
  6348. 'D1.FlushQueue()
  6349. 'D2.FlushQueue()
  6350. DisplayB2SText " WEAPON IS HEAVY MACHINE GUN "
  6351. DisplayB2SText " HEAVY MACHINE GUN "
  6352. D1.Text = " WEAPON IS HEAVY MACHINE GUN "
  6353. D1.Text = " HEAVY MACHINE GUN "', seBlinkMask, 400
  6354. AddScore(1000)
  6355. Case 2:
  6356. Weapon2.State = 1
  6357. Weapon3.State = 2
  6358. PlaySound "Flameshot"
  6359. InterruptDisplay(1000)
  6360. ' D1.FlushQueue()
  6361. ' D2.FlushQueue()
  6362. DisplayB2SText " WEAPON IS FLAME SHOT "
  6363. DisplayB2SText " FLAME SHOT "
  6364. D1.Text = " WEAPON IS FLAME SHOT "
  6365. D1.Text = " FLAME SHOT "', seBlinkMask, 400
  6366. AddScore(2000)
  6367. Case 3:
  6368. Weapon3.State = 1
  6369. Weapon4.State = 2
  6370. PlaySound "Rocketlauncher"
  6371. InterruptDisplay(1000)
  6372. ' D1.FlushQueue()
  6373. ' D2.FlushQueue()
  6374. DisplayB2SText " WEAPON IS ROCKER LAUNCHER "
  6375. DisplayB2SText " ROCKET LAUNCHER "
  6376. D1.Text = " WEAPON IS ROCKER LAUNCHER "
  6377. D1.Text = " ROCKET LAUNCHER "', seBlinkMask, 400
  6378. AddScore(3000)
  6379. Case 4:
  6380. Weapon4.State = 1
  6381. Weapon5.State = 2
  6382. PlaySound "Shotgun"
  6383. InterruptDisplay(1000)
  6384. ' D1.FlushQueue()
  6385. ' D2.FlushQueue()
  6386. DisplayB2SText " WEAPON IS SHOTGUN "
  6387. DisplayB2SText " SHOTGUN "
  6388. D1.Text = " WEAPON IS SHOTGUN "
  6389. D1.Text = " SHOTGUN "', seBlinkMask, 400
  6390. AddScore(4000)
  6391. Case 5:
  6392. Weapon5.State = 1
  6393. Weapon6.State = 2
  6394. PlaySound "EnemyChaser"
  6395. InterruptDisplay(1000)
  6396. ' D1.FlushQueue()
  6397. ' D2.FlushQueue()
  6398. DisplayB2SText " WEAPON IS ENEMY CHASER "
  6399. DisplayB2SText " ENEMY CHASER "
  6400. D1.Text = " WEAPON IS ENEMY CHASER "
  6401. D1.Text = " ENEMY CHASER "', seBlinkMask, 400
  6402. AddScore(5000)
  6403. Case 6:
  6404. Weapon6.State = 1
  6405. ExtraBall.State = 2
  6406. PlaySound "Lasergun"
  6407. InterruptDisplay(1000)
  6408. ' D1.FlushQueue()
  6409. ' D2.FlushQueue()
  6410. DisplayB2SText " WEAPON IS LASER GUN "
  6411. DisplayB2SText " LASER GUN "
  6412. D1.Text = " WEAPON IS LASER GUN "
  6413. D1.Text = " LASER GUN "', seBlinkMask, 400
  6414. AddScore(6000)
  6415. Case 7:
  6416. ExtraBall.State = 1
  6417. PlaySound SoundFXDOF("knocker",131,DOFPulse,DOFKnocker)
  6418. DOF 114, DOFPulse
  6419. PlaySound "cheers"
  6420. bExtraBallAward = TRUE
  6421. InterruptDisplay(1000)
  6422. ' D1.FlushQueue()
  6423. ' D2.FlushQueue()
  6424. DisplayB2SText " * E X T R A B A L L * "
  6425. D1.Text = " * E X T R A B A L L * "
  6426. ' D1.QueueText " * E X T R A B A L L * ", seBlinkMask, 600
  6427. Case 8:
  6428. CurrentWeapon = 7
  6429. PlaySound "ok"
  6430. InterruptDisplay(1000)
  6431. AddScore(40000)
  6432. ' D1.FlushQueue()
  6433. ' D2.FlushQueue()
  6434. DisplayB2SText " * 40,000 * "
  6435. D1.Text = " * 40,000 * "
  6436. ' D1.QueueText " 40,000 ", seBlinkMask, 300
  6437. End Select
  6438. FlashAnimate1()
  6439. bWallIsDown = TRUE
  6440. 'LoopLight.state = 2
  6441. LoopLight.State = 2
  6442. End If
  6443. End Sub
  6444.  
  6445.  
  6446.  
  6447. ' *** DOCAM OPTIMIZED ***
  6448. '
  6449. Sub DropWeapon()
  6450. W1.Isdropped = 1
  6451. W2.Isdropped = 1
  6452. W3.Isdropped = 1
  6453. W4.Isdropped = 1
  6454. W5.Isdropped = 1
  6455. W6.Isdropped = 1
  6456. W1Light.State = 0
  6457. W2Light.State = 0
  6458. W3Light.State = 0
  6459. W4Light.State = 0
  6460. W5Light.State = 0
  6461. W6Light.State = 0
  6462. End Sub
  6463.  
  6464.  
  6465.  
  6466. ' *** DOCAM OPTIMIZED ***
  6467. '
  6468. Sub FixWeapon()
  6469. LoopLight.State = 0
  6470. If bW1TargetIsDown Then
  6471. W1.Isdropped = 1
  6472. W1Light.State = 1
  6473. Else
  6474. W1.Isdropped = 0
  6475. W1Light.State = 0
  6476. End If
  6477. If bW2TargetIsDown Then
  6478. W2.Isdropped = 1
  6479. W2Light.State = 1
  6480. Else
  6481. W2.Isdropped = 0
  6482. W2Light.State = 0
  6483. End If
  6484. If bW3TargetIsDown Then
  6485. W3.Isdropped = 1
  6486. W3Light.State = 1
  6487. Else
  6488. W3.Isdropped = 0
  6489. W3Light.State = 0
  6490. End If
  6491. If bW4TargetIsDown Then
  6492. W4.Isdropped = 1
  6493. W4Light.State = 1
  6494. Else
  6495. W4.Isdropped = 0
  6496. W4Light.State = 0
  6497. End If
  6498. If bW5TargetIsDown Then
  6499. W5.Isdropped = 1
  6500. W5Light.State = 1
  6501. Else
  6502. W5.Isdropped = 0
  6503. W5Light.State = 0
  6504. End If
  6505. If bW6TargetIsDown Then
  6506. W6.Isdropped = 1
  6507. W6Light.State = 1
  6508. Else
  6509. W6.Isdropped = 0
  6510. W6Light.State = 0
  6511. End If
  6512. If bW1TargetIsDown And bW2TargetIsDown And bW3TargetIsDown And bW4TargetIsDown And bW5TargetIsDown And bW6TargetIsDown Then
  6513. bWallIsDown = TRUE
  6514. LoopLight.State = 2
  6515. End If
  6516. End Sub
  6517.  
  6518.  
  6519.  
  6520. ' *** DOCAM CHECKED ***
  6521. '
  6522. Sub ResetWEAPONTargets()
  6523. If Not(bMultiBallMode) And Not(bPlayingMission) And bWallIsDown Then
  6524. DOF 135, DOFPulse
  6525. W1.Isdropped = 0
  6526. W1Light.State = 0
  6527. bW1TargetIsDown = FALSE
  6528. W2.Isdropped = 0
  6529. W2Light.State = 0
  6530. bW2TargetIsDown = FALSE
  6531. W3.Isdropped = 0
  6532. W3Light.State = 0
  6533. bW3TargetIsDown = FALSE
  6534. W4.Isdropped = 0
  6535. W4Light.State = 0
  6536. bW4TargetIsDown = FALSE
  6537. W5.Isdropped = 0
  6538. W5Light.State = 0
  6539. bW5TargetIsDown = FALSE
  6540. W6.Isdropped = 0
  6541. W6Light.State = 0
  6542. bW6TargetIsDown = FALSE
  6543. LoopLight.State = 0
  6544. bWallIsDown = FALSE
  6545. End If
  6546. End Sub
  6547.  
  6548.  
  6549.  
  6550. Sub CheckPOWLanes()
  6551. If (POWLaneLight1.State = 1) And (POWLaneLight2.State = 1) And (POWLaneLight3.State = 1) Then
  6552. AdvancePOW()
  6553. AddScore(7000)
  6554. POWLaneLight1.State = 0
  6555. POWLaneLight2.State = 0
  6556. POWLaneLight3.State = 0
  6557. Playsound "ThankYou"
  6558. If bPlayingMission And (Mission = 4) Then ScoreMission4()
  6559. End If
  6560. End Sub
  6561.  
  6562.  
  6563.  
  6564. Sub AdvancePOW()
  6565. Dim POWRankRnd
  6566. FlashEffectMissionTimer.enabled = 1'GI_Flash()
  6567. ' Add a POW bonus.
  6568. POWBonus = POWBonus + 1
  6569. POWBonusBall = POWBonusBall + 1
  6570. ' Next POW name (if > 100, return to first).
  6571. POWNamePtr = POWNamePtr + 1
  6572. If POWNamePtr > 100 Then POWNamePtr = 1
  6573. ' Pick a random value (from 0 to 99).
  6574. POWRankRnd = Int(Rnd(1) * 100)
  6575. ' Then convert to rank.
  6576. If POWRankRnd < 25 Then
  6577. POWRankRnd = 1 ' PVT.
  6578. ElseIf POWRankRnd < 40 Then
  6579. POWRankRnd = 2 ' PFC.
  6580. ElseIf POWRankRnd < 50 Then
  6581. POWRankRnd = 3 ' CPL.
  6582. ElseIf POWRankRnd < 60 Then
  6583. POWRankRnd = 4 ' SGT.
  6584. ElseIf POWRankRnd < 70 Then
  6585. POWRankRnd = 5 ' FSG.
  6586. ElseIf POWRankRnd < 75 Then
  6587. POWRankRnd = 6 ' SMA.
  6588. ElseIf POWRankRnd < 80 Then
  6589. POWRankRnd = 7 ' 2LT.
  6590. ElseIf POWRankRnd < 85 Then
  6591. POWRankRnd = 8 ' LT.
  6592. ElseIf POWRankRnd < 90 Then
  6593. POWRankRnd = 9 ' CPT.
  6594. ElseIf POWRankRnd < 94 Then
  6595. POWRankRnd = 10 ' LCL.
  6596. ElseIf POWRankRnd < 98 Then
  6597. POWRankRnd = 11 ' COL.
  6598. Else
  6599. POWRankRnd = 12 ' GEN.
  6600. End If
  6601. ' Add another POW bonus during final mission (because POW is double).
  6602. If bPlayingFinalMission Then
  6603. POWBonus = POWBonus + 1
  6604. POWBonusBall = POWBonusBall + 1
  6605. End If
  6606. ' Maximise POW bonus at... 9999 !!!
  6607. If POWBonus > 9999 Then POWBonus = 9999
  6608. If POWBonusBall > 9999 Then POWBonusBall = 9999
  6609. FlashAnimate2()
  6610. InterruptDisplay(1200)
  6611. ' Display collected POW bonus.
  6612. DisplayB2SText (POWBonus) & " POW SAVED " & String(Len(POWRank(POWRankRnd)), " ") & " " & String(Len(POWName(POWNamePtr)), " ") & String(Int((18 - Len(POWBonus) - Len(POWRank(POWRankRnd)) - Len(POWName(POWNamePtr))) / 2), " ")
  6613. D1.Text = FormatScore(POWBonus) & " POW SAVED " & String(Len(POWRank(POWRankRnd)), " ") & " " & String(Len(POWName(POWNamePtr)), " ") & String(Int((18 - Len(POWBonus) - Len(POWRank(POWRankRnd)) - Len(POWName(POWNamePtr))) / 2), " ")
  6614. ' D1.QueueText FormatScore(POWBonus) & " POW SAVED - " & POWRank(POWRankRnd) & ". " & POWName(POWNamePtr) & String(Int((18 - Len(POWBonus) - Len(POWRank(POWRankRnd)) - Len(POWName(POWNamePtr))) / 2), " ")', seBlinkMask, 300
  6615. ' D2.QueueText FormatScore(POWBonus) & " POW SAVED - " & POWRank(POWRankRnd) & ". " & POWName(POWNamePtr) & String(Int((18 - Len(POWBonus) - Len(POWRank(POWRankRnd)) - Len(POWName(POWNamePtr))) / 2), " ")', seBlinkMask, 300
  6616. End Sub
  6617.  
  6618.  
  6619.  
  6620. Sub FlashAnimate1()
  6621. FlashEffect 3
  6622. End Sub
  6623.  
  6624.  
  6625.  
  6626. Sub FlashAnimate2()
  6627. FlashEffect 3
  6628. End Sub
  6629.  
  6630.  
  6631.  
  6632. Sub FlashAnimate3()
  6633. FlashEffect 3
  6634. End Sub
  6635.  
  6636.  
  6637.  
  6638. Sub FlashAnimate4()
  6639. FlashEffect 3
  6640. End Sub
  6641.  
  6642.  
  6643.  
  6644. Sub FlashAnimate5()
  6645. FlashEffect 3
  6646.  
  6647. End Sub
  6648.  
  6649.  
  6650.  
  6651. Sub FlashAnimate6()
  6652. FlashEffect 3
  6653.  
  6654. End Sub
  6655.  
  6656.  
  6657.  
  6658.  
  6659. Sub FlashOff()
  6660. F1.State = 0
  6661. F2.State = 0
  6662. F3.State = 0
  6663. F4.State = 0
  6664. F5.State = 0
  6665. F6.State = 0
  6666. F7.State = 0
  6667. F8.State = 0
  6668. F9.State = 0
  6669. F10.State = 0
  6670. If bPlayingMission Or bMultiBallMode Then FlashAnimate5()
  6671. End Sub
  6672.  
  6673.  
  6674.  
  6675. ' *** DOCAM CLEANED ***
  6676. '
  6677. Sub D1_Empty()
  6678. If bGameInPlay Then
  6679. If bPlayingMission And bCanDisplayMessage Then
  6680. ShowNextMessage()
  6681. End If
  6682. If bPlayingBall Then AddScore(0)
  6683. End If
  6684. End Sub
  6685.  
  6686.  
  6687.  
  6688. ' *** DOCAM CLEANED ***
  6689. '
  6690. Sub ShowNextMessage()
  6691. bCanDisplayMessage = FALSE
  6692. If Not(bInterruptedDisplay) Then
  6693. Select Case NextMessage
  6694. Case 1:
  6695. ' Starting mission 1.
  6696. D1.Text = " ANY DROP TARGET SCORES 20,000 "', seScrollUp, 1300, 0, TRUE
  6697. DisplayB2SText " ANY DROP TARGET SCORES 20,000 "', seScrollUp, 1300, 0, TRUE
  6698. Case 2:
  6699. ' Remaining time for mission 1.
  6700. D1.Text = "SHOOT ANY DROP TARGET TIME " & Right("0" & MissionTimerUserData, 2)
  6701. DisplayB2SText "SHOOT ANY DROP TARGET TIME " & Right("0" & MissionTimerUserData, 2)
  6702. Case 3:
  6703. ' Mission completed.
  6704. D1.Text = " MISSION COMPLETE "', seScrollUp, 2000, 0, TRUE
  6705. DisplayB2SText " MISSION COMPLETE "', seScrollUp, 2000, 0, TRUE
  6706. Case 4:
  6707. ' Remaining time for mission 2.
  6708. D1.Text = "WEAPON PRACTICE TIME " & Right("0" & MissionTimerUserData, 2)
  6709. DisplayB2SText "WEAPON PRACTICE TIME " & Right("0" & MissionTimerUserData, 2)
  6710. Case 5:
  6711. ' Starting mission 2.
  6712. D1.Text = "SHOOT WEAPON TARGETS FOR 40,000 "', seScrollUp, 2000, 0, TRUE
  6713. DisplayB2SText "SHOOT WEAPON TARGETS FOR 40,000 "', seScrollUp, 2000, 0, TRUE
  6714. Case 6:
  6715. ' Starting mission 3.
  6716. D1.Text = " SUPER JET BUMPERS "', seScrollUp, 2000, 0, TRUE
  6717. DisplayB2SText " SUPER JET BUMPERS "', seScrollUp, 2000, 0, TRUE
  6718. Case 7:
  6719. ' Starting mission 4.
  6720. D1.Text = "SHOOT CAPTIVE BALL OR POW LANES "', seScrollUp, 2000, 0, TRUE
  6721. DisplayB2SText "SHOOT CAPTIVE BALL OR POW LANES "', seScrollUp, 2000, 0, TRUE
  6722. Case 8:
  6723. ' Starting mission 5.
  6724. D1.Text = " DEFEAT ALLEN O'NEIL "', seScrollUp, 2000, 0, TRUE
  6725. DisplayB2SText " DEFEAT ALLEN O'NEIL "', seScrollUp, 2000, 0, TRUE
  6726. Case 9:
  6727. ' End of final mission.
  6728. D1.Text = " SEE YOU NEXT MISSION "
  6729. DisplayB2SText " SEE YOU NEXT MISSION "
  6730. Case 10:
  6731. ' Starting final mission.
  6732. D1.Text = " FINAL MISSION "', seScrollUp, 1300, 0, TRUE
  6733. DisplayB2SText " FINAL MISSION "', seScrollUp, 1300, 0, TRUE
  6734. End Select
  6735. End If
  6736. End Sub
  6737.  
  6738.  
  6739.  
  6740. '*** DOCAM OPTIMIZED ***
  6741. '
  6742. Sub InterruptDisplay(aDelay)
  6743. bInterruptedDisplay = TRUE
  6744. InterruptDisplayTimer.enabled = TRUE
  6745. End Sub
  6746.  
  6747.  
  6748.  
  6749. ' This subroutine display the number of locked ball(s) (from 1 to 4).
  6750. '
  6751. ' *** DOCAM OPTIMIZED ***
  6752. '
  6753. Sub DisplayBallLocked()
  6754. InterruptDisplay(800)
  6755. ' D1.FlushQueue()
  6756. ' D2.FlushQueue()
  6757. DisplayB2SText " BALL " & BallsLocked & " LOCKED "
  6758. D1.Text = " BALL " & BallsLocked & " LOCKED "
  6759. ' D1.QueueText " " & BallsLocked & " ", seBlinkMask, 400
  6760. ' D2.QueueText " " & BallsLocked & " ", seBlinkMask, 400
  6761. End Sub
  6762.  
  6763.  
  6764.  
  6765. Sub ExplodeAnimate()
  6766. exp1.frame 1, 26
  6767. exp2.frame 1, 26
  6768. exp3.frame 1, 26
  6769. exp4.frame 1, 26
  6770. exp5.frame 1, 26
  6771. exp6.frame 1, 26
  6772. exp7.frame 1, 26
  6773. exp8.frame 1, 26
  6774. exp9.frame 1, 26
  6775. exp10.frame 1, 26
  6776. exp11.frame 1, 26
  6777. exp12.frame 1, 26
  6778. exp13.frame 1, 26
  6779. exp14.frame 1, 26
  6780. exp15.frame 1, 26
  6781. End Sub
  6782.  
  6783.  
  6784.  
  6785. Sub ingamereset()
  6786. Mission = 0
  6787. ResetCaptiveTargets()
  6788. ResetSideTargets()
  6789. ResetSLUGTargets()
  6790. bLockIsLit = FALSE
  6791. LightMission()
  6792. bWallIsDown = TRUE
  6793. ResetWEAPONTargets()
  6794. bWallIsDown = FALSE
  6795. UnLightJackpot()
  6796. Mission1Light.State = 2
  6797. Mission2Light.State = 0
  6798. Mission3Light.State = 0
  6799. Mission4Light.State = 0
  6800. Mission5Light.State = 0
  6801. Mission6Light.State = 0
  6802. End Sub
  6803.  
  6804.  
  6805.  
  6806. ' *** DOCAM OPTIMIZED ***
  6807. '
  6808. Sub GI_Flash()
  6809.  
  6810. 'GiEffect 3
  6811. ' Bulb1.FlashForMs 1000, 100, 1
  6812. ' Bulb2.FlashForMs 1000, 100, 1
  6813. ' Bulb3.FlashForMs 1000, 100, 1
  6814. ' Bulb4.FlashForMs 1000, 100, 1
  6815. ' Bulb5.FlashForMs 1000, 100, 1
  6816. ' Bulb6.FlashForMs 1000, 100, 1
  6817. ' Bulb7.FlashForMs 1000, 100, 1
  6818. ' Bulb8.FlashForMs 1000, 100, 1
  6819. ' Bulb9.FlashForMs 1000, 100, 1
  6820. ' Bulb10.FlashForMs 1000, 100, 1
  6821. ' Bulb11.FlashForMs 1000, 100, 1
  6822. ' Bulb12.FlashForMs 1000, 100, 1
  6823. ' Bulb13.FlashForMs 1000, 100, 1
  6824. ' Bulb14.FlashForMs 1000, 100, 1
  6825. ' Bulb15.FlashForMs 1000, 100, 1
  6826. ' Bulb16.FlashForMs 1000, 100, 1
  6827. ' Bulb17.FlashForMs 1000, 100, 1
  6828. ' Bulb18.FlashForMs 1000, 100, 1
  6829. ' Bulb19.FlashForMs 1000, 100, 1
  6830. ' Bulb20.FlashForMs 1000, 100, 1
  6831. ' Bulb21.FlashForMs 1000, 100, 1
  6832. ' Bulb22.FlashForMs 1000, 100, 1
  6833. ' Bulb23.FlashForMs 1000, 100, 1
  6834. ' Bulb24.FlashForMs 1000, 100, 1
  6835. ' Bulb25.FlashForMs 1000, 100, 1
  6836. ' Bulb26.FlashForMs 1000, 100, 1
  6837. ' Bulb28.FlashForMs 1000, 100, 1
  6838. ' Bulb29.FlashForMs 1000, 100, 1
  6839. ' Bulb30.FlashForMs 1000, 100, 1
  6840. ' Bulb31.FlashForMs 1000, 100, 1
  6841. ' Bulb32.FlashForMs 1000, 100, 1
  6842. ' Bulb33.FlashForMs 1000, 100, 1
  6843. ' Bulb34.FlashForMs 1000, 100, 1
  6844. ' Bulb35.FlashForMs 1000, 100, 1
  6845. ' Bulb36.FlashForMs 1000, 100, 1
  6846. ' Bulb37.FlashForMs 1000, 100, 1
  6847. ' Bulb38.FlashForMs 1000, 100, 1
  6848. ' Bulb39.FlashForMs 1000, 100, 1
  6849. ' Bulb40.FlashForMs 1000, 100, 1
  6850. ' Bulb41.FlashForMs 1000, 100, 1
  6851. ' Bulb42.FlashForMs 1000, 100, 1
  6852. ' Bulb43.FlashForMs 1000, 100, 1
  6853. ' Bulb44.FlashForMs 1000, 100, 1
  6854. If Not(bPlayingMission3) Then
  6855. FlashForMs Bumper1l, 1000, 100, 1
  6856. FlashForMs Bumper2l, 1000, 100, 1
  6857. FlashForMs Bumper3l, 1000, 100, 1
  6858. End If
  6859. End Sub
  6860.  
  6861.  
  6862.  
  6863. ' *** DOCAM OPTIMIZED ***
  6864. '
  6865. Sub GI_Off()
  6866. GiOff
  6867.  
  6868. ' Bulb1.State = 0
  6869. ' Bulb2.State = 0
  6870. ' Bulb3.State = 0
  6871. ' Bulb4.State = 0
  6872. ' Bulb5.State = 0
  6873. ' Bulb6.State = 0
  6874. ' Bulb7.State = 0
  6875. ' Bulb8.State = 0
  6876. ' Bulb9.State = 0
  6877. ' Bulb10.State = 0
  6878. ' Bulb11.State = 0
  6879. ' Bulb12.State = 0
  6880. ' Bulb13.State = 0
  6881. ' Bulb14.State = 0
  6882. ' Bulb15.State = 0
  6883. ' Bulb16.State = 0
  6884. ' Bulb17.State = 0
  6885. ' Bulb18.State = 0
  6886. ' Bulb19.State = 0
  6887. ' Bulb20.State = 0
  6888. ' Bulb21.State = 0
  6889. ' Bulb22.State = 0
  6890. ' Bulb23.State = 0
  6891. ' Bulb24.State = 0
  6892. ' Bulb25.State = 0
  6893. ' Bulb26.State = 0
  6894. ' Bulb28.State = 0
  6895. ' Bulb29.State = 0
  6896. ' Bulb30.State = 0
  6897. ' Bulb31.State = 0
  6898. ' Bulb32.State = 0
  6899. ' Bulb33.State = 0
  6900. ' Bulb34.State = 0
  6901. ' Bulb35.State = 0
  6902. ' Bulb36.State = 0
  6903. ' Bulb37.State = 0
  6904. ' Bulb38.State = 0
  6905. ' Bulb39.State = 0
  6906. ' Bulb40.State = 0
  6907. ' Bulb41.State = 0
  6908. ' Bulb42.State = 0
  6909. ' Bulb43.State = 0
  6910. ' Bulb44.State = 0
  6911. Bumper1l.State = 0
  6912. Bumper2l.State = 0
  6913. Bumper3l.State = 0
  6914. End Sub
  6915.  
  6916.  
  6917.  
  6918. ' *** DOCAM OPTIMIZED ***
  6919. '
  6920. Sub GI_On()
  6921. GiOn
  6922. ' Bulb1.State = 1
  6923. ' Bulb2.State = 1
  6924. ' Bulb3.State = 1
  6925. ' Bulb4.State = 1
  6926. ' Bulb5.State = 1
  6927. ' Bulb6.State = 1
  6928. ' Bulb7.State = 1
  6929. ' Bulb8.State = 1
  6930. ' Bulb9.State = 1
  6931. ' Bulb10.State = 1
  6932. ' Bulb11.State = 1
  6933. ' Bulb12.State = 1
  6934. ' Bulb13.State = 1
  6935. ' Bulb14.State = 1
  6936. ' Bulb15.State = 1
  6937. ' Bulb16.State = 1
  6938. ' Bulb17.State = 1
  6939. ' Bulb18.State = 1
  6940. ' Bulb19.State = 1
  6941. ' Bulb20.State = 1
  6942. ' Bulb21.State = 1
  6943. ' Bulb22.State = 1
  6944. ' Bulb23.State = 1
  6945. ' Bulb24.State = 1
  6946. ' Bulb25.State = 1
  6947. ' Bulb26.State = 1
  6948. ' Bulb28.State = 1
  6949. ' Bulb29.State = 1
  6950. ' Bulb30.State = 1
  6951. ' Bulb31.State = 1
  6952. ' Bulb32.State = 1
  6953. ' Bulb33.State = 1
  6954. ' Bulb34.State = 1
  6955. ' Bulb35.State = 1
  6956. ' Bulb36.State = 1
  6957. ' Bulb37.State = 1
  6958. ' Bulb38.State = 1
  6959. ' Bulb39.State = 1
  6960. ' Bulb40.State = 1
  6961. ' Bulb41.State = 1
  6962. ' Bulb42.State = 1
  6963. ' Bulb43.State = 1
  6964. ' Bulb44.State = 1
  6965. Bumper1l.State = 1
  6966. Bumper2l.State = 1
  6967. Bumper3l.State = 1
  6968. End Sub
  6969.  
  6970.  
  6971.  
  6972. ' *********************************************************************
  6973. ' ** SETUP MENU SPECIFIC FUNCTIONS **
  6974. ' *********************************************************************
  6975.  
  6976.  
  6977.  
  6978. ' This subroutine initializes variables and parameters on setup menu entry.
  6979. '
  6980. ' *** DOCAM OPTIMIZED ***
  6981. '
  6982. Sub SetupMenuEntry()
  6983. ' Always select first setting (number of balls) on setup menu entry.
  6984. stCurrentParam = 1
  6985. ' Parameter 1: Number of balls per game.
  6986. stParam(1) = "BALLS PER GAME"
  6987. stNumberValues(1) = 4
  6988. stValue(1, 1) = "3"
  6989. stValue(1, 2) = "5"
  6990. stValue(1, 3) = "7"
  6991. stValue(1, 4) = "9"
  6992. Select Case BallsPerGame
  6993. Case 3: stCurrentValue(stCurrentParam) = 1
  6994. Case 5: stCurrentValue(stCurrentParam) = 2
  6995. Case 7: stCurrentValue(stCurrentParam) = 3
  6996. Case 9: stCurrentValue(stCurrentParam) = 4
  6997. End Select
  6998. ' Parameter 2: ball saver duration.
  6999. stParam(2) = "BALL SAVER"
  7000. stNumberValues(2) = 4
  7001. stValue(2, 1) = "15 SECONDS"
  7002. stValue(2, 2) = "30 SECONDS"
  7003. stValue(2, 3) = "45 SECONDS"
  7004. stValue(2, 4) = "60 SECONDS"
  7005. Select Case nvR1
  7006. Case 15: stCurrentValue(2) = 1
  7007. Case 30: stCurrentValue(2) = 2
  7008. Case 45: stCurrentValue(2) = 3
  7009. Case 60: stCurrentValue(2) = 4
  7010. End Select
  7011. ' Parameter 3: POW bonus value.
  7012. stParam(3) = "POW BONUS VALUE"
  7013. stNumberValues(3) = 6
  7014. stValue(3, 1) = "5,000"
  7015. stValue(3, 2) = "10,000"
  7016. stValue(3, 3) = "15,000"
  7017. stValue(3, 4) = "20,000"
  7018. stValue(3, 5) = "25,000"
  7019. stValue(3, 6) = "50,000"
  7020. Select Case nvR2
  7021. Case 5: stCurrentValue(3) = 1
  7022. Case 10: stCurrentValue(3) = 2
  7023. Case 15: stCurrentValue(3) = 3
  7024. Case 20: stCurrentValue(3) = 4
  7025. Case 25: stCurrentValue(3) = 5
  7026. Case 50: stCurrentValue(3) = 6
  7027. End Select
  7028. ' Parameter 4: POW bonus hold.
  7029. stParam(4) = "POW BONUS HOLD"
  7030. stNumberValues(4) = 3
  7031. stValue(4, 1) = "NEVER"
  7032. stValue(4, 2) = "X-BALL ONLY"
  7033. stValue(4, 3) = "ALWAYS"
  7034. stCurrentValue(4) = nvR3
  7035. ' Parameter 5: jackpot value.
  7036. stParam(5) = "JACKPOT VALUE"
  7037. stNumberValues(5) = 4
  7038. stValue(5, 1) = "100,000"
  7039. stValue(5, 2) = "300,000"
  7040. stValue(5, 3) = "500,000"
  7041. stValue(5, 4) = "1,000,000"
  7042. Select Case nvR4
  7043. Case 1: stCurrentValue(5) = 1
  7044. Case 3: stCurrentValue(5) = 2
  7045. Case 5: stCurrentValue(5) = 3
  7046. Case 10: stCurrentValue(5) = 4
  7047. End Select
  7048. ' Parameter 6: Tilt.
  7049. stParam(6) = "TILT SENSITIVITY"
  7050. stNumberValues(6) = 4
  7051. stValue(6, 1) = "NEVER TILT"
  7052. stValue(6, 2) = "LOW"
  7053. stValue(6, 3) = "REGULAR"
  7054. stValue(6, 4) = "HIGH"
  7055. stCurrentValue(6) = nvR5
  7056. ' Parameter 7: Reset settings/high scores.
  7057. stParam(7) = "RESET"
  7058. stNumberValues(7) = 4
  7059. stValue(7, 1) = "NO"
  7060. stValue(7, 2) = "TABLE SETTINGS ONLY"
  7061. stValue(7, 3) = "HIGH SCORES ONLY"
  7062. stValue(7, 4) = "ALL (FACTORY)"
  7063. stCurrentValue(7) = 1
  7064. ' Parameter 8: Exit/Save.
  7065. stParam(8) = "EXIT"
  7066. stNumberValues(8) = 3
  7067. stValue(8, 1) = "NO"
  7068. stValue(8, 2) = "YES & SAVE"
  7069. stValue(8, 3) = "YES, BUT DON'T SAVE"
  7070. stCurrentValue(8) = 1
  7071. End Sub
  7072.  
  7073.  
  7074.  
  7075. ' This subroutine saves settings when exiting the setup menu.
  7076. '
  7077. ' *** DOCAM OPTIMIZED ***
  7078. '
  7079. Sub SetupMenuSaveExit()
  7080. ' Saving parameter 1: balls per game.
  7081. BallsPerGame = stCurrentValue(1) * 2 + 1
  7082. ' Saving parameter 2: ball saver duration.
  7083. Select Case stCurrentValue(2)
  7084. Case 1: nvR1 = 15
  7085. Case 2: nvR1 = 30
  7086. Case 3: nvR1 = 45
  7087. Case 4: nvR1 = 60
  7088. End Select
  7089. ' Saving parameter 3: POW bonus value.
  7090. Select Case stCurrentValue(3)
  7091. Case 1: nvR2 = 5
  7092. Case 2: nvR2 = 10
  7093. Case 3: nvR2 = 15
  7094. Case 4: nvR2 = 20
  7095. Case 5: nvR2 = 25
  7096. Case 6: nvR2 = 50
  7097. End Select
  7098. ' Saving parameter 4: POW bonus hold.
  7099. nvR3 = stCurrentValue(4)
  7100. ' Saving parameter 5: jackpot value.
  7101. Select Case stCurrentValue(5)
  7102. Case 1: nvR4 = 1
  7103. Case 2: nvR4 = 3
  7104. Case 3: nvR4 = 5
  7105. Case 4: nvR4 = 10
  7106. End Select
  7107. ' Saving parameter 6: Tilt sensitivity.
  7108. nvR5 = stCurrentValue(6)
  7109. Select Case stCurrentValue(6)
  7110. Case 1: TiltWarnings = 9
  7111. Case 2: TiltWarnings = 4
  7112. Case 3: TiltWarnings = 2
  7113. Case 4: TiltWarnings = 0
  7114. End Select
  7115. End Sub
  7116.  
  7117.  
  7118.  
  7119. ' This subroutine reset to default (factory) settings.
  7120. ' Note: High score table isn't altered, however.
  7121. '
  7122. ' *** DOCAM OPTIMIZED ***
  7123. '
  7124. Sub SetupMenuResetSettings()
  7125. ' Reset default settings and clear the highscore table.
  7126. stCurrentValue(1) = 2
  7127. BallsPerGame = 5
  7128. stCurrentValue(2) = 1
  7129. nvR1 = 15
  7130. stCurrentValue(3) = 2
  7131. nvR2 = 10
  7132. stCurrentValue(4) = 3
  7133. nvR3 = 3
  7134. stCurrentValue(5) = 2
  7135. nvR4 = 3
  7136. stCurrentValue(6) = 3
  7137. nvR5 = 3
  7138. TiltWarnings = 2
  7139. stCurrentValue(7) = 1
  7140. End Sub
  7141.  
  7142.  
  7143.  
  7144. ' This subroutine reset (clean) the high score table.
  7145. '
  7146. ' *** DOCAM OPTIMIZED ***
  7147. '
  7148. Sub SetupMenuResetHighScores()
  7149. ' Reset the high scores table.
  7150. HighScore(1) = 0
  7151. HighScoreName(1) = "..."
  7152. HighScore(2) = 0
  7153. HighScoreName(2) = "..."
  7154. HighScore(3) = 0
  7155. HighScoreName(3) = "..."
  7156. HighScore(4) = 0
  7157. HighScoreName(4) = "..."
  7158. HighScore(5) = 0
  7159. HighScoreName(5) = "..."
  7160. HighScore(6) = 0
  7161. HighScoreName(6) = "..."
  7162. HighScore(7) = 0
  7163. HighScoreName(7) = "..."
  7164. HighScore(8) = 0
  7165. HighScoreName(8) = "..."
  7166. HighScore(9) = 0
  7167. HighScoreName(9) = "..."
  7168. HighScore(10) = 0
  7169. HighScoreName(10) = "..."
  7170. End Sub
  7171.  
  7172.  
  7173.  
  7174. ' This subroutine select the next item (in list) for a specific settings.
  7175. '
  7176. ' *** DOCAM OPTIMIZED ***
  7177. '
  7178. Sub SetupMenuNextValue()
  7179. Dim i
  7180. Dim LenParam, LenValue
  7181. stCurrentValue(stCurrentParam) = stCurrentValue(stCurrentParam) + 1
  7182. If stCurrentValue(stCurrentParam) > stNumberValues(stCurrentParam) Then stCurrentValue(stCurrentParam) = 1
  7183. LenParam = 0
  7184. For i = 1 To Len(stParam(stCurrentParam))
  7185. If (Mid(stParam(stCurrentParam), i, 1) <> ".") And (Mid(stParam(stCurrentParam), i, 1) <> ",") Then LenParam = LenParam + 1
  7186. Next
  7187. LenValue = 0
  7188. For i = 1 To Len(stValue(stCurrentParam, stCurrentValue(stCurrentParam)))
  7189. If (Mid(stValue(stCurrentParam, stCurrentValue(stCurrentParam)), i, 1) <> ".") And (Mid(stValue(stCurrentParam, stCurrentValue(stCurrentParam)), i, 1) <> ",") Then LenValue = LenValue + 1
  7190. Next
  7191. 'D1.FlushQueue()
  7192. D1.Text = " " & stParam(stCurrentParam) & String(30 - LenParam - LenValue, " ") & stValue(stCurrentParam, stCurrentValue(stCurrentParam)) & " "
  7193. D1.QueueText " " & String(30 - LenValue, " ") & stValue(stCurrentParam, stCurrentValue(stCurrentParam)) & " ", seBlinkMask, 500
  7194. Playsound "Lane1", FALSE
  7195. End Sub
  7196.  
  7197.  
  7198.  
  7199. ' This subroutine display the current setting.
  7200. '
  7201. ' *** DOCAM OPTIMIZED ***
  7202. '
  7203. Sub SetupMenuDisplayCurrentSetting()
  7204. Dim i
  7205. Dim LenParam, LenValue
  7206. LenParam = 0
  7207. For i = 1 To Len(stParam(stCurrentParam))
  7208. If (Mid(stParam(stCurrentParam), i, 1) <> ".") And (Mid(stParam(stCurrentParam), i, 1) <> ",") Then LenParam = LenParam + 1
  7209. Next
  7210. LenValue = 0
  7211. For i = 1 To Len(stValue(stCurrentParam, stCurrentValue(stCurrentParam)))
  7212. If (Mid(stValue(stCurrentParam, stCurrentValue(stCurrentParam)), i, 1) <> ".") And (Mid(stValue(stCurrentParam, stCurrentValue(stCurrentParam)), i, 1) <> ",") Then LenValue = LenValue + 1
  7213. Next
  7214. D1.Text = " " & stParam(stCurrentParam) & String(30 - LenParam - LenValue, " ") & stValue(stCurrentParam, stCurrentValue(stCurrentParam)) & " "
  7215. End Sub
  7216.  
  7217.  
  7218. Dim FlashEffectMissionTimerUserData
  7219. Sub FlashEffectMissionTimer_Timer
  7220.  
  7221. FlashEffectMissionTimerUserData = FlashEffectMissionTimerUserData + 1
  7222. FlashEffectMissionTimer.interval = 800
  7223. FlashEffectMissionTimer.enabled = 1
  7224. Select Case FlashEffectMissionTimerUserData
  7225.  
  7226. Case 1: FlashEffect 3
  7227.  
  7228. Case 2: FlashEffect 2
  7229.  
  7230. Case 3: FlashEffect 3
  7231.  
  7232. Case 4: FlashEffect 4
  7233.  
  7234. Case 5: FlashEffect 2
  7235.  
  7236. Case 6: FlashEffect 3
  7237.  
  7238. Case 7: FlashEffect 4
  7239. FlashEffectMissionTimer.enabled = 0
  7240.  
  7241. End Select
  7242.  
  7243.  
  7244. End Sub
  7245.  
  7246.  
  7247.  
  7248.  
  7249.  
  7250.  
  7251.  
  7252.  
  7253.  
  7254.  
  7255.  
  7256.  
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.  
  7268.  
  7269.  
  7270.  
  7271.  
  7272.  
  7273.  
  7274.  
  7275.  
  7276.  
  7277.  
  7278.  
  7279.  
  7280.  
  7281.  
  7282.  
  7283.  
  7284.  
  7285.  
  7286.  
  7287.  
  7288.  
  7289.  
  7290.  
  7291.  
  7292.  
  7293.  
  7294.  
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.  
  7301. '-----------------------------
  7302. '----- FS Display Code -----
  7303. '-----------------------------
  7304.  
  7305. 'If You want to hide a display, set the reel value of every reel to 44. This picture is transparent
  7306. 'This is best done using collection:
  7307. '
  7308. ' If HideDisplay then
  7309. ' For Each obj in ReelsCollection:obj.setvalue(44):next
  7310. ' end if
  7311.  
  7312.  
  7313. Dim Char(32),i,TempText 'increase dimension if You need larger displays
  7314.  
  7315.  
  7316.  
  7317. '-----------------------------------------------
  7318. '----- B2S section, not used in the demo -----
  7319. '-----------------------------------------------
  7320.  
  7321. Sub DisplayB2SText(TextPar) 'Procedure to display Text on a 30 digit B2S LED reel. Assuming that it is display 1 with internal digit numbers 1-30
  7322. TempText = TextPar
  7323. for i = 1 to 32
  7324. if i <= len(TextPar) then
  7325. Char(i) = left(TempText,1)
  7326. TempText = right(Temptext,len(TempText)-1)
  7327. else
  7328. Char(i) = " "
  7329. end if
  7330. next
  7331. if B2SOn Then
  7332. for i = 1 to 32
  7333. controller.B2SSetLED i,B2SLEDValue(Char(i))
  7334. next
  7335. end if
  7336. End Sub
  7337.  
  7338. Function B2SLEDValue(CharPar) 'to be used with dB2S 15-segments-LED used in Herweh's Designer
  7339. B2SLEDValue = 0 'default for unknown characters
  7340. select case CharPar
  7341. Case "","": B2SLEDValue = 0
  7342. Case "0": B2SLEDValue = 63
  7343. Case "1": B2SLEDValue = 8704
  7344. Case "2": B2SLEDValue = 2139
  7345. Case "3": B2SLEDValue = 2127
  7346. Case "4": B2SLEDValue = 2150
  7347. Case "5": B2SLEDValue = 2157
  7348. Case "6": B2SLEDValue = 2172
  7349. Case "7": B2SLEDValue = 7
  7350. Case "8": B2SLEDValue = 2175
  7351. Case "9": B2SLEDValue = 2159
  7352. Case "A": B2SLEDValue = 2167
  7353. Case "B": B2SLEDValue = 10767
  7354. Case "C": B2SLEDValue = 57
  7355. Case "D": B2SLEDValue = 8719
  7356. Case "E": B2SLEDValue = 121
  7357. Case "F": B2SLEDValue = 2161
  7358. Case "G": B2SLEDValue = 2109
  7359. Case "H": B2SLEDValue = 2166
  7360. Case "I": B2SLEDValue = 8713
  7361. Case "J": B2SLEDValue = 31
  7362. Case "K": B2SLEDValue = 5232
  7363. Case "L": B2SLEDValue = 56
  7364. Case "M": B2SLEDValue = 1334
  7365. Case "N": B2SLEDValue = 4406
  7366. Case "O": B2SLEDValue = 63
  7367. Case "P": B2SLEDValue = 2163
  7368. Case "Q": B2SLEDValue = 4287
  7369. Case "R": B2SLEDValue = 6259
  7370. Case "S": B2SLEDValue = 2157
  7371. Case "T": B2SLEDValue = 8705
  7372. Case "U": B2SLEDValue = 62
  7373. Case "V": B2SLEDValue = 17456
  7374. Case "W": B2SLEDValue = 20534
  7375. Case "X": B2SLEDValue = 21760
  7376. Case "Y": B2SLEDValue = 9472
  7377. Case "Z": B2SLEDValue = 17417
  7378. Case "<": B2SLEDValue = 5120
  7379. Case ">": B2SLEDValue = 16640
  7380. Case "^": B2SLEDValue = 17414
  7381. Case ".": B2SLEDValue = 8
  7382. Case "!": B2SLEDValue = 0
  7383. Case ".": B2SLEDValue = 128
  7384. Case "*": B2SLEDValue = 32576
  7385. Case "/": B2SLEDValue = 17408
  7386. Case "\": B2SLEDValue = 4352
  7387. Case "|": B2SLEDValue = 8704
  7388. Case "=": B2SLEDValue = 2120
  7389. Case "+": B2SLEDValue = 10816
  7390. Case "-": B2SLEDValue = 2112
  7391. end select
  7392. B2SLEDValue = cint(B2SLEDValue)
  7393. End Function
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.  
  7400.  
  7401.  
  7402. Sub DisplayScore
  7403. If Score(1) < 1000000 Then
  7404. DisplayB2SText (cstr(Score(1))) & "" & " BALL " & Ball
  7405. Else
  7406. DisplayB2SText (cstr(Score(1))) & (Score(1)) & String(32 - Len(Score(1)), " ")
  7407. End If
  7408. End Sub
  7409.  
  7410.  
  7411. Sub DisplayUpdate
  7412. TempText = TextPar
  7413. for i = 1 to 32
  7414. if i <= len(TextPar) then
  7415. Char(i) = left(TempText,1)
  7416. TempText = right(Temptext,len(TempText)-1)
  7417. else
  7418. Char(i) = " "
  7419. end if
  7420. next
  7421.  
  7422. if B2SOn Then
  7423. for i = 1 to 32
  7424. controller.B2SSetLED i,B2SLEDValue(Char(i))
  7425. next
  7426. end if
  7427. End Sub
Add Comment
Please, Sign In to add comment