Arngrim

Untitled

Mar 18th, 2020
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.12 KB | None | 0 0
  1. '############################################################################################
  2. '############################################################################################
  3. '####### ########
  4. '####### Batman Forever ########
  5. '####### (Sega 1995) ########
  6. '####### ########
  7. '############################################################################################
  8. '############################################################################################
  9.  
  10. 'VP9 Version 1.2 Desktop mfuegemann 2014
  11.  
  12. ' Thanks to:
  13. ' Fuzzel for providing the images for the playfield lights
  14. ' JPSalas for the Flasher fading code
  15.  
  16. 'Crude VPX conversion by DevaL
  17.  
  18. Option Explicit
  19.  
  20. On Error Resume Next
  21. ExecuteGlobal GetTextFile("controller.vbs")
  22. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  23. On Error Goto 0
  24.  
  25. Const cgamename = "batmanf"
  26.  
  27. '-----------------------------------
  28. '------ Global Cofigurations ------
  29. '-----------------------------------
  30. Const DimGI=-25 'set between -100 and 105 to dim or brighten GI lights (minus is darker)
  31. Const DimFlashers=0 'set between -255 and 0 to dim or brighten the Flashers (minus is darker)
  32.  
  33. Const UseSolenoids=2,UseSync=1
  34. Const SSolenoidOn="SolOn",SSolenoidOff="SolOff",SFlipperOn="FlipperUp",SFlipperOff="FlipperDown",SCoin="coin3"
  35.  
  36. LoadVPM "01560000","DE.VBS",3.1
  37.  
  38. '-----------------------------------
  39. '------ Solenoid Assignment ------
  40. '-----------------------------------
  41. SolCallback(1) = "SolTroughBall" 'Trough Lock Ball
  42. SolCallback(2) = "bsBallRelease.SolOut" 'Trough Up-Kicker
  43. SolCallback(3) = "Autoplunger" 'Auto Launch
  44. SolCallback(4) = "SolVUK" 'VUK
  45. SolCallback(5) = "SolTopEject" 'Top Eject
  46. '6 - not used
  47. SolCallback(7) = "DropTargetBank.SolDropUp" 'Drop Target Reset
  48. SolCallback(8) = "vpmSolSound SoundFX(""knocker"",DOFKnocker)," 'KKnocker
  49. SolCallback(9) = "bsBallLock.SolOut" 'Bat Cave Ball Lock
  50. SolCallback(10) = "Sol10" 'Left/Right AB Relay
  51. SolCallback(11) = "SolGI" 'GI
  52. SolCallback(12) = "SolRampDiverter" 'Batwing Ramp Diverter
  53. '13 - not used
  54. 'SolCallback(14) 'Batwing Motor - handled elsewhere
  55. SolCallback(15) = "SolFireBWGun" 'Cannon Launch
  56. SolCallback(16) = "SolBatCaveExit" 'Bat Cave Exit Kicker
  57. 'SolCallback(17) = "vpmSolSound SoundFX(""Bumper"",DOFContactors)," 'Left Bumper
  58. 'SolCallback(18) = "vpmSolSound SoundFX(""Bumper"",DOFContactors)," 'Bottom Bumper
  59. 'SolCallback(19) = "vpmSolSound SoundFX(""Bumper"",DOFContactors)," 'Right Bumper
  60. 'SolCallback(20) = "vpmSolSound SoundFX(""lSling"",DOFContactors)," 'Left Slingshot
  61. 'SolCallback(21) = "vpmSolSound SoundFX(""rSling"",DOFContactors)," 'Right Slingshot
  62. SolCallback(22) = "vpmSolAutoPlunger LaserKick,200," 'Laser Kick
  63. SolCallback(25) = "SolFlasher1R"
  64. SolCallback(26) = "SolFlasher2R"
  65. SolCallback(27) = "SolFlasher3R"
  66. SolCallback(28) = "SolFlasher4R"
  67. SolCallback(29) = "SolFlasher5R"
  68. SolCallback(30) = "SolFlasher6R"
  69. SolCallback(31) = "SolFlasher7R"
  70. SolCallback(32) = "SolFlasher8R"
  71. 'SolCallback(sLRFlipper)="vpmSolFlipper RightFlipper,URightFlipper,"
  72. 'SolCallback(sLLFlipper)="vpmSolFlipper LeftFlipper,nothing,"
  73.  
  74. SolCallback(sLLFlipper) = "SolLFlipper"
  75. SolCallback(sLRFlipper) = "SolRFlipper"
  76.  
  77. Sub SolLFlipper(Enabled)
  78. If Enabled Then
  79. PlaySound SoundFX("FlipperUp",DOFFlippers)
  80. LeftFlipper.RotateToEnd
  81. Else
  82. PlaySound SoundFX("FlipperDown",DOFFlippers)
  83. LeftFlipper.RotateToStart
  84. End If
  85. End Sub
  86.  
  87. Sub SolRFlipper(Enabled)
  88. If Enabled Then
  89. PlaySound SoundFX("FlipperUp",DOFFlippers)
  90. RightFlipper.RotateToEnd
  91. URightFlipper.RotateToEnd
  92. Else
  93. PlaySound SoundFX("FlipperDown",DOFFlippers)
  94. RightFlipper.RotateToStart
  95. URightFlipper.RotateToStart
  96. End If
  97. End Sub
  98.  
  99.  
  100. Sub SolTroughBall(enabled)
  101. if enabled then
  102. bsTrough.ExitSol_On
  103. bsBallRelease.AddBall 0
  104. vpmCreateBall BallRelease
  105. end if
  106. End Sub
  107.  
  108. Sub AutoPlunger(Enabled)
  109. if enabled then
  110. Plunger.Kick 0,35+(Rnd*0.9) '34.4-33.5
  111. Playsound SoundFX("launch",DOFContactors)
  112. end if
  113. End Sub
  114.  
  115. Dim DiverterUp
  116. Sub SolRampDiverter(enabled)
  117. if enabled then
  118. RampDiverter.collidable = false
  119. DiverterUp = True
  120. DiverterTimer.enabled = True
  121. else
  122. RampDiverter.collidable = true
  123. DiverterUp = False
  124. DiverterTimer.enabled = True
  125. end if
  126. end sub
  127.  
  128. Sub DiverterTimer_Timer
  129. if DiverterUp then
  130. pDiverter.Rotx = pDiverter.Rotx + 4
  131. if pDiverter.Rotx >= 50 then
  132. pDiverter.Rotx = 50
  133. DiverterTimer.enabled = False
  134. end if
  135. else
  136. pDiverter.Rotx = pDiverter.Rotx - 1
  137. if pDiverter.Rotx <= 3 then
  138. pDiverter.Rotx = 3
  139. DiverterTimer.enabled = False
  140. end if
  141. end if
  142. End Sub
  143.  
  144. Dim obj,bsTrough,bsTroughKick,bsBallRelease,DropTargetBank,bsBallLock,mBWGun
  145.  
  146. '------------------------
  147. '----- Table Init -----
  148. '------------------------
  149.  
  150. Sub BF_Init
  151. vpmInit Me
  152. vpminit me
  153. On Error Resume Next
  154. With Controller
  155. .GameName = cGameName
  156. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  157. .SplashInfoLine = "Batman Forever (Sega 1995)" & vbNewLine & "created by mfuegemann" & vbNewLine & "crude VPX conversion by DevaL"
  158. .HandleMechanics=0
  159. .HandleKeyboard=0
  160. .ShowDMDOnly=1
  161. .ShowFrame=0
  162. .ShowTitle=0
  163. .hidden = 0
  164. On Error Resume Next
  165. .Run GetPlayerHWnd
  166. If Err Then MsgBox Err.Description
  167. On Error Goto 0
  168. End With
  169. On Error Goto 0
  170.  
  171. ' DMD position for 3 Monitor Setup
  172. 'Controller.Games(cGameName).Settings.Value("dmd_pos_x")=3850
  173. 'Controller.Games(cGameName).Settings.Value("dmd_pos_y")=300
  174. 'Controller.Games(cGameName).Settings.Value("dmd_width")=505
  175. 'Controller.Games(cGameName).Settings.Value("dmd_height")=155
  176. 'Controller.Games(cGameName).Settings.Value("rol")=0
  177.  
  178. PinMAMETimer.Interval = PinMAMEInterval
  179. PinMAMETimer.Enabled = 1
  180.  
  181. vpmNudge.TiltSwitch=1
  182. vpmNudge.Sensitivity=2
  183. vpmNudge.TiltObj=Array(Bumper57,Bumper58,Bumper59,LeftSlingshot,RightSlingshot)
  184.  
  185. vpmMapLights AllLights
  186.  
  187. Set bsTrough = New cvpmBallStack
  188. bsTrough.InitSw 0,14,13,12,11,0,0,0
  189. bsTrough.CreateEvents "bsTrough", Drain
  190. bsTrough.InitAddSnd SSolenoidOn
  191. bsTrough.InitEntrySnd "drain5", SSolenoidOn
  192. bsTrough.Balls=4
  193.  
  194. set bsBallRelease = New cvpmBallStack
  195. bsBallRelease.InitSaucer BallRelease, 15, 90, 5
  196. bsBallRelease.InitExitSnd SoundFX("ballrel",DOFContactors),SoundFX("solenoid",DOFContactors)
  197.  
  198. set DropTargetBank = new cvpmDropTarget
  199. DropTargetBank.InitDrop Array(DropTargetBottom,DropTargetBotMid,DropTargetTopMid,DropTargetTop), Array(18,19,20,21)
  200. DropTargetBank.InitSnd SoundFX("Targetdrop1",DOFDropTargets),SoundFX("TargetBankreset1",DOFContactors)
  201.  
  202. Set bsBallLock = New cvpmBallStack
  203. bsBallLock.InitSw 0,62,61,60,0,0,0,0
  204. bsBallLock.InitKick BallLock, 180, 5
  205. bsBallLock.CreateEvents "bsBallLock", BallLock
  206. bsBallLock.InitEntrySnd "solenoid", SSolenoidOn
  207. bsBallLock.Balls=0
  208.  
  209. Set mBWGun = New cvpmMech
  210. mBWGun.MType = vpmMechOneSol + vpmMechReverse + vpmMechNonLinear
  211. mBWGun.Sol1 = 14
  212. mBWGun.Length = 500
  213. mBWGun.Steps = 200
  214. mBWGun.AddSw 46,0,3
  215. mBWGun.AddSw 46,197,200
  216. mBWGun.Callback = GetRef("UpdateBWGun")
  217. mBWGun.Start
  218.  
  219. LaserKick.pullback
  220.  
  221. RampDiverter.collidable = true
  222. DiverterUp = false
  223. pDiverter.Rotx = 50
  224. DiverterTimer.enabled = true
  225.  
  226. if (DimGI >= -100) and (DimGI <= 105) then
  227. For each obj in GIString1
  228. 'obj.Alpha = obj.Alpha + DimGI
  229. 'obj.isvisible = True
  230. Next
  231. For each obj in GIString2
  232. 'obj.Alpha = obj.Alpha + DimGI
  233. 'obj.isvisible = True
  234. Next
  235. end if
  236. End Sub
  237.  
  238. Sub BF_Exit
  239. Controller.Stop
  240. End Sub
  241.  
  242. Sub TopEjectKicker_Hit
  243. Controller.Switch(41) = True
  244. End Sub
  245.  
  246. Sub SolTopEject(Enabled)
  247. If Enabled Then
  248. If Controller.Switch(41) = True Then
  249. PlaySound SoundFX("Kicker",DOFContactors)
  250. TopEjectKicker.Kick 90,9
  251. Controller.Switch(41) = False
  252. end if
  253. end if
  254. End Sub
  255.  
  256. Sub BatCaveExitKicker_Hit
  257. Controller.Switch(30) = True
  258. End Sub
  259.  
  260. Sub SolBatCaveExit(Enabled)
  261. If Enabled Then
  262. If Controller.Switch(30) = True Then
  263. PlaySound SoundFX("Kicker",DOFContactors)
  264. BatCaveExitKicker.Kick 180,45
  265. Controller.Switch(30) = False
  266. end if
  267. end if
  268. End Sub
  269.  
  270.  
  271. '---------------------------
  272. '------ GI Handling ------
  273. '---------------------------
  274.  
  275. Sub SolGI(enabled)
  276. if enabled then
  277. For each obj in GIString2
  278. 'obj.isvisible = False
  279. 'obj.triggersingleupdate
  280. Next
  281. else
  282. For each obj in GIString2
  283. 'obj.isvisible = True
  284. 'obj.triggersingleupdate
  285. Next
  286. end if
  287. End Sub
  288.  
  289. Sub Sol10(enabled)
  290. if enabled then
  291. For each obj in GIString1
  292. 'obj.isvisible = True
  293. 'obj.triggersingleupdate
  294. Next
  295. else
  296. For each obj in GIString1
  297. 'obj.isvisible = False
  298. 'obj.triggersingleupdate
  299. Next
  300. end if
  301. End Sub
  302.  
  303.  
  304. '--------------------------------
  305. '------ Flasher Handling ------
  306. '--------------------------------
  307.  
  308. Sub SolFlasher1R(enabled)
  309. if enabled then
  310. FLamp1R.state = LightstateOn
  311. Setflash 6, True
  312. else
  313. FLamp1R.state = LightstateOff
  314. Setflash 6, False
  315. end if
  316. End Sub
  317.  
  318. Sub SolFlasher2R(enabled)
  319. if enabled then
  320. FLamp2Ra.state = LightstateOn
  321. FLamp2Rb.state = LightstateOn
  322. Setflash 4, True
  323. else
  324. FLamp2Ra.state = LightstateOff
  325. FLamp2Rb.state = LightstateOff
  326. Setflash 4, False
  327. end if
  328. End Sub
  329.  
  330. Sub SolFlasher3R(enabled)
  331. if enabled then
  332. Setflash 5, True
  333. else
  334. Setflash 5, False
  335. end if
  336. End Sub
  337.  
  338. Sub SolFlasher4R(enabled)
  339. if enabled then
  340. FLamp4R.state = LightstateOn
  341. Setflash 0, True
  342. else
  343. FLamp4R.state = LightstateOff
  344. Setflash 0, False
  345. end if
  346. End Sub
  347.  
  348. Sub SolFlasher5R(enabled)
  349. if enabled then
  350. Setflash 1, True
  351. else
  352. Setflash 1, False
  353. end if
  354. End Sub
  355.  
  356. Sub SolFlasher6R(enabled)
  357. if enabled then
  358. Setflash 2, True
  359. else
  360. Setflash 2, False
  361. end if
  362. End Sub
  363.  
  364. Sub SolFlasher7R(enabled)
  365. if enabled then
  366. Setflash 3, True
  367. else
  368. Setflash 3, False
  369. end if
  370. End Sub
  371.  
  372. Sub SolFlasher8R(enabled)
  373. if enabled then
  374. FLamp8R.state = LightstateOn
  375. Setflash 7, True
  376. else
  377. FLamp8R.state = LightstateOff
  378. Setflash 7, False
  379. end if
  380. End Sub
  381.  
  382.  
  383. '---------------------------
  384. '------ Batwing Gun ------
  385. '---------------------------
  386.  
  387. Sub UpdateBWGun(aNewPos, aSpeed, aLastPos)
  388. if anewpos < 100 then
  389. pBatwing.rotz = -anewpos / 2
  390. pBatwingGun.rotz = anewpos / 2
  391. GunAngle = anewpos / 2
  392. else
  393. pBatwing.rotz = (anewpos - 200) / 2
  394. pBatwingGun.rotz = (200 - anewpos) / 2
  395. GunAngle = (200 - anewpos) / 2
  396. end if
  397. End Sub
  398.  
  399. Sub BWGun_Hit
  400. controller.switch(44) = True
  401. End Sub
  402.  
  403. Dim GunAngle
  404. Sub SolFireBWGun(Enabled)
  405. if enabled then
  406. BWGun.kick GunAngle, 50
  407. controller.switch(44) = False
  408. vpmTimer.PulseSw 45
  409. end if
  410. End Sub
  411.  
  412.  
  413. '-----------------------------
  414. '------ VUK animation ------
  415. '-----------------------------
  416. Sub VUK_Bottom_Hit
  417. Controller.Switch(32) = True
  418. End Sub
  419.  
  420. Sub SolVUK(Enabled)
  421. If Enabled Then
  422. If Controller.Switch(32) = True Then
  423. PlaySound SoundFX("Kicker",DOFContactors)
  424. VUK_Bottom.destroyball
  425. VUK1.CreateBall
  426. vpmTimer.AddTimer 70,"VUKLevel1"
  427. end if
  428. end if
  429. end sub
  430.  
  431. Sub VUKLevel1(swNo)
  432. Controller.Switch(32) = False
  433. VUK1.DestroyBall
  434. VUK2.CreateBall
  435. vpmTimer.AddTimer 70,"VUKLevel2"
  436. End Sub
  437.  
  438. Sub VUKLevel2(swNo)
  439. VUK2.DestroyBall
  440. VUK3.CreateBall
  441. vpmTimer.AddTimer 70,"VUKLevel3"
  442. End Sub
  443.  
  444. Sub VUKLevel3(swNo)
  445. VUK3.DestroyBall
  446. VUK4.CreateBall
  447. vpmTimer.AddTimer 70,"VUKLevel4"
  448. End Sub
  449.  
  450. Sub VUKLevel4(swNo)
  451. VUK4.DestroyBall
  452. VUK_Top.CreateBall
  453. VUK_Top.Kick 330,15
  454. End Sub
  455.  
  456.  
  457. '-------------------------------
  458. '------ Keybord Handler ------
  459. '-------------------------------
  460.  
  461. Sub BF_KeyDown(ByVal keycode)
  462. If keycode = LeftFlipperKey Then Controller.Switch(63) = True
  463. If keycode = RightFlipperKey Then Controller.Switch(64) = True
  464. If KeyDownHandler(keycode) Then Exit Sub
  465. If keycode=PlungerKey Then
  466. Controller.Switch(49) = 1 'Auto Launch
  467. End if
  468. End Sub
  469.  
  470. Sub BF_KeyUp(ByVal keycode)
  471. If keycode = LeftFlipperKey Then Controller.Switch(63) = False
  472. If keycode = RightFlipperKey Then Controller.Switch(64) = False
  473. If KeyUpHandler(keycode) Then Exit Sub
  474. If keycode=PlungerKey Then
  475. Controller.Switch(49) = 0 'Auto Launch
  476. End if
  477. End Sub
  478.  
  479.  
  480. '---------------------------------
  481. '------ Switch Assignment ------
  482. '---------------------------------
  483.  
  484. '1 Tilt - handled elsewhere
  485. '2 Coin4 - handled elsewhere
  486. '3 Start - handled elsewhere
  487. '4 Coin1 - handled elsewhere
  488. '5 Coin2 - handled elsewhere
  489. '6 Coin3 - handled elsewhere
  490. '7 Slam Tilt - handled elsewhere
  491. '8 Buy In - handled elsewhere
  492. '9 not used
  493. '10 not used
  494. '11 Ball1 - handled elsewhere
  495. '12 Ball2 - handled elsewhere
  496. '13 Ball3 - handled elsewhere
  497. '14 Ball4 - handled elsewhere
  498. '15 Trough Opto - handled elsewhere
  499. Sub Trigger16_Hit:Controller.switch(16) = True:end sub '16 Shooter Lane
  500. Sub Trigger16_Unhit:Controller.switch(16) = False:end sub
  501. '17 not used
  502. Sub DropTargetBottom_Hit:vpmTimer.pulseSwitch(18),0,"":End Sub '18 L4Bank Bottom
  503. Sub DropTargetBotMid_Hit:vpmTimer.pulseSwitch(19),0,"":End Sub '19 L4Bank MidBottom
  504. Sub DropTargetTopMid_Hit:vpmTimer.pulseSwitch(20),0,"":End Sub '20 L4Bank TopBottom
  505. Sub DropTargetTop_Hit:vpmTimer.pulseSwitch(21),0,"":End Sub '21 L4Bank Top
  506. Sub DropTargetBottom_Hit:DropTargetBank.Hit 1:DropTargetBottom.isdropped=true:End Sub '18 and one for the Queen
  507. Sub DropTargetBotMid_Hit:DropTargetBank.Hit 2:DropTargetBotMid.isdropped=true:End Sub '19
  508. Sub DropTargetTopMid_Hit:DropTargetBank.Hit 3:DropTargetTopMid.isdropped=true:End Sub '20
  509. Sub DropTargetTop_Hit:DropTargetBank.Hit 4:DropTargetTop.isdropped=true:End Sub '21
  510. Sub Trigger22_Hit:Controller.Switch(22)=1:End Sub '22 Top Lane Left
  511. Sub Trigger22_Unhit:Controller.Switch(22)=0:End Sub
  512. Sub Trigger23_Hit:Controller.Switch(23)=1:End Sub '23 Top Lane Middle
  513. Sub Trigger23_Unhit:Controller.Switch(23)=0:End Sub
  514. Sub Trigger24_Hit:Controller.Switch(24)=1:End Sub '24 Top Lane Right
  515. Sub Trigger24_Unhit:Controller.Switch(24)=0:End Sub
  516. Sub TargetRampLeft_Hit:vpmTimer.PulseSw 25:Playsound SoundFX("Target1",DOFTargets):End Sub '25 Left Ramp Left
  517. Sub TargetRampRight_Hit:vpmTimer.PulseSw 26:Playsound SoundFX("Target1",DOFTargets):End Sub '26 Left Ramp Right
  518. Sub TargetVUK_Hit:vpmTimer.PulseSw 27:Playsound SoundFX("Target1",DOFTargets):End Sub '27 VUK
  519. Sub TargetRightRampLeft_Hit:vpmTimer.PulseSw 28:Playsound SoundFX("Target1",DOFTargets):End Sub '28 Right Ramp Left Standup
  520. Sub TargetRightRampRight_Hit:vpmTimer.PulseSw 29:Playsound SoundFX("Target1",DOFTargets):End Sub '29 Right Ramp Right ?
  521. '30 Bat Cave Exit Kicker - handled elsewhere
  522. '31 not used
  523. '32 VUK - handled elsewhere
  524. Sub Trigger33_Hit '33 Laser Kick Left Outlane
  525. vpmTimer.Pulsesw 33
  526. if Activeball.vely > 0 then
  527. Activeball.vely = 0.5 * Activeball.vely
  528. end if
  529. End Sub
  530. Sub Trigger33_Unhit:Controller.Switch(33)=0:End Sub
  531. Sub Trigger34_Hit:Controller.Switch(34)=1:End Sub '34 Left Return Lane
  532. Sub Trigger34_Unhit:Controller.Switch(34)=0:End Sub
  533. Sub LeftSlingshot_Slingshot() '35 Left Slingshot
  534. vpmTimer.pulseSwitch(35),0,""
  535. PlaySound SoundFX("Bumper",DOFContactors),0,1,-0.15,0.25
  536. End Sub
  537. Sub RightSlingshot_Slingshot() '36 Right Slingshot
  538. vpmTimer.pulseSwitch(36),0,""
  539. PlaySound SoundFX("Bumper",DOFContactors),0,1,0.15,0.25
  540. End Sub
  541. Sub Trigger37_Hit:Controller.Switch(37)=1:End Sub '37 Right Return Lane inside
  542. Sub Trigger37_Unhit:Controller.Switch(37)=0:End Sub
  543. Sub Trigger38_Hit:Controller.Switch(38)=1:End Sub '38 Right Return Lane outside
  544. Sub Trigger38_Unhit:Controller.Switch(38)=0:End Sub
  545. Sub Trigger39_Hit:Controller.Switch(39)=1:End Sub '39 Right Outlane
  546. Sub Trigger39_Unhit:Controller.Switch(39)=0:End Sub
  547. Sub Trigger40_Hit:Controller.Switch(40)=1:End Sub '40 U-Turn Ramp
  548. Sub Trigger40_Unhit:Controller.Switch(40)=0:End Sub
  549. '41 Top Eject - handled elsewhere
  550. Sub TargetTopGood_Hit:vpmTimer.PulseSw 42:Playsound SoundFX("Target1",DOFTargets):End Sub '42 Top Good Head Standup
  551. Sub TargetTopBad_Hit:vpmTimer.PulseSw 43:Playsound SoundFX("Target1",DOFTargets):End Sub '43 Top Bad Head Standup
  552. '44 Batwing Loaded - handled elsewhere
  553. '45 Batwing Location - handled elsewhere
  554. '46 Batwing Home - handled elsewhere
  555. Sub Trigger47_Hit:Controller.Switch(47)=1:End Sub '47 Left Orbit
  556. Sub Trigger47_Unhit:Controller.Switch(47)=0:End Sub
  557. Sub Trigger48_Hit:Controller.Switch(48)=1:End Sub '48 Right Orbit
  558. Sub Trigger48_Unhit:Controller.Switch(48)=0:End Sub
  559. '49 Gun Trigger (Auto Launch) - handled elsewhere
  560. Sub TargetRightGood_Hit:vpmTimer.PulseSw 50:Playsound SoundFX("Target1",DOFTargets):End Sub '50 Right Good Head Standup
  561. Sub TargetRightBad_Hit:vpmTimer.PulseSw 51:Playsound SoundFX("Target1",DOFTargets):End Sub '51 Right Bad Head Standup
  562. Sub Trigger52_Hit:Controller.Switch(52)=1:End Sub '52 Left Ramp Enter
  563. Sub Trigger52_Unhit:Controller.Switch(52)=0:End Sub
  564. Sub Trigger53_Hit:Controller.Switch(53)=1:End Sub '53 Left Ramp Exit - Manual is wrong
  565. Sub Trigger53_Unhit:Controller.Switch(53)=0:End Sub
  566. Sub Trigger54_Hit:Controller.Switch(54)=1:End Sub '54 Middle Ramp Exit - Manual is wrong
  567. Sub Trigger54_Unhit:Controller.Switch(54)=0:End Sub
  568. Sub Trigger55_Hit:Controller.Switch(55)=1:End Sub '55 Right Ramp Enter
  569. Sub Trigger55_Unhit:Controller.Switch(55)=0:End Sub
  570. Sub Trigger56_Hit:Controller.Switch(56)=1:End Sub '56 Right Ramp Exit
  571. Sub Trigger56_Unhit:Controller.Switch(56)=0:End Sub
  572. Sub Bumper57_Hit() '57 Bumper Left
  573. vpmTimer.pulseSwitch(57),0,""
  574. PlaySound SoundFX("Bumper",DOFContactors),0,1,-0.05,0.25
  575. Bumper57_Dir = -1
  576. Bumper57.Timerenabled = False
  577. Bumper57.Timerenabled = True
  578. End Sub
  579. Sub Bumper58_Hit() '58 Bumper Bottom
  580. vpmTimer.pulseSwitch(58),0,""
  581. PlaySound SoundFX("Bumper",DOFContactors),0,1,0,0.25
  582. Bumper58_Dir = -1
  583. Bumper58.Timerenabled = False
  584. Bumper58.Timerenabled = True
  585. End Sub
  586. Sub Bumper59_Hit() '59 Bumper Right
  587. vpmTimer.pulseSwitch(59),0,""
  588. PlaySound SoundFX("Bumper",DOFContactors),0,1,0.05,0.25
  589. Bumper59_Dir = -1
  590. Bumper59.Timerenabled = False
  591. Bumper59.Timerenabled = True
  592. End Sub
  593. '60 Lock 3 Top - handled elsewhere
  594. '61 Lock 2 Middle - handled elsewhere
  595. '62 Lock 1 Bottom - handled elsewhere
  596. '63 Left Flipper - handled elsewhere
  597. '64 Upper+Lower Right Flipper - handled elsewhere
  598.  
  599. '--------------------------------------------
  600. 'Helper Functions
  601. '--------------------------------------------
  602.  
  603. 'Bumper animation
  604. Dim Bumper57_Dir,Bumper58_Dir,Bumper59_Dir
  605.  
  606. Sub Bumper57_Timer
  607. P_BumperRing57.TransZ = P_BumperRing57.TransZ + Bumper57_Dir * 2.5
  608. if P_BumperRing57.TransZ <= -30 then Bumper57_Dir = 1
  609. if P_BumperRing57.TransZ >= 0 then
  610. Bumper57.Timerenabled = False
  611. Bumper57_Dir = 0
  612. end if
  613. End Sub
  614.  
  615. Sub Bumper58_Timer
  616. P_BumperRing58.TransZ = P_BumperRing58.TransZ + Bumper58_Dir * 2.5
  617. if P_BumperRing58.TransZ <= -30 then Bumper58_Dir = 1
  618. if P_BumperRing58.TransZ >= 0 then
  619. Bumper58.Timerenabled = False
  620. Bumper58_Dir = 0
  621. end if
  622. End Sub
  623.  
  624. Sub Bumper59_Timer
  625. P_BumperRing59.TransZ = P_BumperRing59.TransZ + Bumper59_Dir * 2.5
  626. if P_BumperRing59.TransZ <= -30 then Bumper59_Dir = 1
  627. if P_BumperRing59.TransZ >= 0 then
  628. Bumper59.Timerenabled = False
  629. Bumper59_Dir = 0
  630. end if
  631. End Sub
  632.  
  633.  
  634. Sub RampHelper1_Hit
  635. if Activeball.velz > 1 then Activeball.velz = 0
  636. if abs(Activeball.velx) > 35 then Activeball.velx = 35 * (Activeball.velx/abs(Activeball.velx))
  637. if abs(Activeball.vely) > 35 then Activeball.vely = 35 * (Activeball.vely/abs(Activeball.vely))
  638. End Sub
  639.  
  640. Sub RampHelper2_Hit
  641. Activeball.velz = 0
  642. End Sub
  643.  
  644. Sub RampHelper3_Hit
  645. Activeball.velz = 0
  646. if abs(Activeball.velx) > 15 then Activeball.velx = 15 * (Activeball.velx/abs(Activeball.velx))
  647. if abs(Activeball.vely) > 15 then Activeball.vely = 15 * (Activeball.vely/abs(Activeball.vely))
  648. End Sub
  649.  
  650. Sub RampHelper4_Hit
  651. Activeball.velz = 0.15 * Activeball.velz
  652. if abs(Activeball.velx) > 50 then Activeball.velx = 50 * (Activeball.velx/abs(Activeball.velx))
  653. if abs(Activeball.vely) > 50 then Activeball.vely = 50 * (Activeball.vely/abs(Activeball.vely))
  654. End Sub
  655.  
  656.  
  657. '---------------------------------------
  658. '------ JP's Flasher Fading Sub ------
  659. '---------------------------------------
  660. Dim Flashers
  661. Flashers = Array(Flasher4Ra,Flasher5Ra,Flasher6Ra,Flasher7R,Flasher2Ra,Flasher3R,Flasher1R,Flasher8R,Flasher6Rb,Flasher5Rb,Flasher2Rb,Flasher4Ra1,Flasher4Rb,Flasher4Rb1,Flasher5Rb1,Flasher6Rb1,Flasher7R1,Flasher3R1)
  662.  
  663. Dim FlashMaxAlpha
  664. Dim FlashState(200), FlashLevel(200)
  665. Dim FlashSpeedUp, FlashSpeedDown
  666.  
  667. FlashInit()
  668. FlasherTimer.Interval = 5
  669. FlasherTimer.Enabled = 1
  670.  
  671. Sub FlashInit
  672. Dim i
  673. For i = 0 to 200
  674. FlashState(i) = 0
  675. FlashLevel(i) = 0
  676. Next
  677. FlashSpeedUp = 50 'fast speed when turning on the flasher
  678. FlashSpeedDown = 10 'slow speed when turning off the flasher, gives a smooth fading
  679. ' you could also change the default images for each flasher or leave it as in the editor
  680. ' for example
  681. ' Flasher1.Image = "fr"
  682.  
  683. 'added by mfuegemann to apply Dim settings
  684. FlashMaxAlpha = 255
  685. ' if DimFlashers < 0 then
  686. ' FlashMaxAlpha = FlashMaxAlpha + DimFlashers
  687. ' if FlashMaxAlpha < 0 then
  688. ' FlashMaxAlpha = 0
  689. ' end if
  690. ' end if
  691.  
  692. AllFlashOff()
  693. End Sub
  694.  
  695. Sub AllFlashOff
  696. Dim i
  697. For i = 0 to 200
  698. FlashState(i) = 0
  699. Next
  700. End Sub
  701.  
  702. dim x
  703. Sub FlasherTimer_Timer()
  704. flashm 0, Flasher4Ra1
  705. flashm 0, Flasher4Rb1
  706. flashm 0, Flasher4Rb
  707. flash 0, Flasher4Ra
  708.  
  709. flashm 1, Flasher5Rb1
  710. flashm 1, Flasher5Rb
  711. flash 1, Flasher5Ra
  712.  
  713. flashm 2, Flasher6Rb1
  714. flashm 2, Flasher6Rb
  715. flash 2, Flasher6Ra
  716.  
  717. flashm 3, Flasher7R1
  718. flash 3, Flasher7R
  719.  
  720. flashm 4, Flasher2Rb
  721. flash 4, Flasher2Ra
  722.  
  723. flashm 5, Flasher3R1
  724. flash 5, Flasher3R
  725.  
  726. flash 6, Flasher1R
  727. flash 7, Flasher8R
  728. End Sub
  729.  
  730. Sub SetFlash(nr, stat)
  731. FlashState(nr) = ABS(stat)
  732. End Sub
  733.  
  734. Sub Flash(nr, object)
  735. Select Case FlashState(nr)
  736. Case 0 'off
  737. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown
  738. If FlashLevel(nr) < 0 Then
  739. FlashLevel(nr) = 0
  740. FlashState(nr) = -1 'completely off
  741. End if
  742. 'Object.alpha = FlashLevel(nr)
  743. Case 1 ' on
  744. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp
  745. If FlashLevel(nr) > FlashMaxAlpha Then '255 original JP code
  746. FlashLevel(nr) = FlashMaxAlpha '255 original JP code
  747. FlashState(nr) = -2 'completely on
  748. End if
  749. 'Object.alpha = FlashLevel(nr)
  750. End Select
  751. End Sub
  752.  
  753. Sub Flashm(nr, object) 'multiple flashers, it doesn't change the flashstate
  754. Select Case FlashState(nr)
  755. Case 0 'off
  756. 'Object.alpha = FlashLevel(nr)
  757. Case 1 ' on
  758. 'Object.alpha = FlashLevel(nr)
  759. End Select
  760. End Sub
Advertisement
Add Comment
Please, Sign In to add comment