Outhere

Argosy

May 12th, 2021 (edited)
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.27 KB | None | 0 0
  1. Option Explicit
  2.  
  3. '*****************************************************************************************************
  4. ' CREDITS
  5. ' Initial table created by fuzzel, jimmyfingers, jpsalas, toxie & unclewilly (in alphabetical order)
  6. ' Flipper primitives by zany
  7. ' Ball rolling sound script by jpsalas
  8. ' Ball shadow by ninuzzu
  9. ' Ball control & ball dropping sound by rothbauerw
  10. ' DOF by arngrim
  11. ' Positional sound helper functions by djrobx
  12. ' Plus a lot of input from the whole community (sorry if we forgot you :/)
  13. '*****************************************************************************************************
  14.  
  15. 'DOF Updated by outhere
  16. '101 Left Flipper
  17. '102 Right Flipper
  18. '103 left slingshot
  19. '104 right slingshot
  20. '105 right bumper
  21. '106 left Bumper
  22. '107 Kicker
  23. '108 Reset drop Targets
  24. '109 upper left singshot
  25. '110 Spinner
  26. '111 ballrelease
  27.  
  28.  
  29. 'First, try to load the Controller.vbs (DOF), which helps controlling additional hardware like lights, gears, knockers, bells and chimes (to increase realism)
  30. 'This table uses DOF via the 'SoundFX' calls that are inserted in some of the PlaySound commands, which will then fire an additional event, instead of just playing a sample/sound effect
  31. On Error Resume Next
  32. ExecuteGlobal GetTextFile("controller.vbs")
  33. If Err Then MsgBox "You need the Controller.vbs file in order to run this table (installed with the VPX package in the scripts folder)"
  34. On Error Goto 0
  35.  
  36. Dim EnableBallControl
  37. EnableBallControl = false 'Change to true to enable manual ball control (or press C in-game) via the arrow keys and B (boost movement) keys
  38.  
  39. Const BallSize = 25 'Ball radius
  40.  
  41. Const cGameName = "Argosy_1977"
  42.  
  43.  
  44. Dim Desktop : Desktop = Table1.ShowDT
  45.  
  46.  
  47.  
  48. Dim ScoreObj
  49. For Each ScoreObj in BackglassObjs
  50. If Desktop=True Then
  51. ScoreObj.visible = True
  52. Else
  53. ScoreObj.visible = False
  54. End If
  55. Next
  56.  
  57. Sub Table1_KeyDown(ByVal keycode)
  58.  
  59. If Inprogress=True And Tilted=False Then
  60. If keycode = LeftFlipperKey Then
  61. LeftFlipper.RotateToEnd
  62. PlaySound SoundFXDOF("fx_flipperup", 101, DOFOn, DOFFlippers), 0, .67, AudioPan(LeftFlipper), 0.05,0,0,1,AudioFade(LeftFlipper)
  63. PlaySound "buzz_left", -1, 1.0, AudioPan(LeftFlipper)
  64. End If
  65.  
  66. If keycode = RightFlipperKey Then
  67. RightFlipper.RotateToEnd
  68. PlaySound SoundFXDOF("fx_flipperup", 102, DOFOn, DOFFlippers), 0, .67, AudioPan(RightFlipper), 0.05,0,0,1,AudioFade(RightFlipper)
  69. PlaySound "buzz_right", -1, 1.0, AudioPan(RightFlipper)
  70. End If
  71.  
  72. If keycode = LeftTiltKey Then
  73. Nudge 90, 2
  74. CheckTilt
  75. End If
  76.  
  77. If keycode = RightTiltKey Then
  78. Nudge 270, 2
  79. CheckTilt
  80. End If
  81.  
  82. If keycode = CenterTiltKey Then
  83. Nudge 0, 2
  84. CheckTilt
  85. End If
  86. End If
  87.  
  88. If keycode = LeftFlipperKey Then
  89. VRFlipperButtonLeft.X = VRFlipperButtonLeft.X + 9
  90. End If
  91.  
  92. If keycode = RightFlipperKey Then
  93. VRFlipperButtonRight.X = VRFlipperButtonRight.X - 9
  94. End If
  95.  
  96. If keycode = PlungerKey Then
  97. Plunger.PullBack
  98. PlaySound "plungerpull",0,1,AudioPan(Plunger),0.25,0,0,1,AudioFade(Plunger)
  99. TimerVRPlunger.enabled = true ' We enable the plunger timer below.. look for the TimerVPlunger Sub.
  100. TimerVRPlunger2.enabled = False' We disaable the plunger2 timer below.. look for the TimerVPlunger2 Sub.
  101. End If
  102.  
  103. ' Manual Ball Control
  104. If keycode = 46 Then ' C Key
  105. If EnableBallControl = 1 Then
  106. EnableBallControl = 0
  107. Else
  108. EnableBallControl = 1
  109. End If
  110. End If
  111. If EnableBallControl = 1 Then
  112. If keycode = 48 Then ' B Key
  113. If BCboost = 1 Then
  114. BCboost = BCboostmulti
  115. Else
  116. BCboost = 1
  117. End If
  118. End If
  119. If keycode = 203 Then BCleft = 1 ' Left Arrow
  120. If keycode = 200 Then BCup = 1 ' Up Arrow
  121. If keycode = 208 Then BCdown = 1 ' Down Arrow
  122. If keycode = 205 Then BCright = 1 ' Right Arrow
  123. End If
  124.  
  125. If Keycode=AddCreditKey Then
  126. PlaySound"Coin3"
  127.  
  128. Credit.TimerEnabled=True
  129. End If
  130.  
  131. If Keycode=StartGameKey And Credits>0 And Plunger.TimerEnabled=False Then StartGame
  132. If keycode=23 Then MsgBox Msg(0),," Instructions and Rule Card"
  133. End Sub
  134.  
  135. Sub Table1_KeyUp(ByVal keycode)
  136. If Inprogress=True And Tilted=False Then
  137. If keycode = LeftFlipperKey Then
  138. LeftFlipper.RotateToStart
  139. PlaySound SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), 0, 1, AudioPan(LeftFlipper), 0.05,0,0,1,AudioFade(LeftFlipper)
  140. End If
  141.  
  142. If keycode = RightFlipperKey Then
  143. RightFlipper.RotateToStart
  144. PlaySound SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), 0, 1, AudioPan(RightFlipper), 0.05,0,0,1,AudioFade(RightFlipper)
  145. End If
  146. End If
  147.  
  148. If keyCode = LeftFlipperKey Then
  149. VRFlipperButtonLeft.X = VRFlipperButtonLeft.X - 9
  150. StopSound "buzz_left"
  151. End If
  152.  
  153. If keycode = RightFlipperKey Then
  154. VRFlipperButtonRight.X = VRFlipperButtonRight.X + 9
  155. StopSound "buzz_right"
  156. End If
  157.  
  158. If keycode = PlungerKey Then
  159. Plunger.Fire
  160. PlaySound "plunger",0,1,AudioPan(Plunger),0.25,0,0,1,AudioFade(Plunger)
  161. TimerVRPlunger.enabled = false 'Disabling the plungertimer.. this is used to animate the plunger
  162. TimerVRPlunger2.enabled = true 'enabling the plungertimer.. this is used to animate the plunger
  163. End If
  164.  
  165. 'Manual Ball Control
  166. If EnableBallControl = 1 Then
  167. If keycode = 203 Then BCleft = 0 ' Left Arrow
  168. If keycode = 200 Then BCup = 0 ' Up Arrow
  169. If keycode = 208 Then BCdown = 0 ' Down Arrow
  170. If keycode = 205 Then BCright = 0 ' Right Arrow
  171. End If
  172. End Sub
  173.  
  174.  
  175. '**********Sling Shot Animations
  176. ' Rstep and Lstep are the variables that increment the animation
  177. '****************
  178. Dim RStep, Lstep
  179.  
  180. Sub RightSlingShot_Slingshot
  181. PlaySound SoundFXDOF("right_slingshot", 104, DOFPulse, DOFContactors), 0,1, 0.05,0.05 '0,1, AudioPan(RightSlingShot), 0.05,0,0,1,AudioFade(RightSlingShot)
  182. RSling.Visible = 0
  183. RSling1.Visible = 1
  184. sling1.rotx = 20
  185. RStep = 0
  186. RightSlingShot.TimerEnabled = 1
  187. Light8.State=Not Light8.State
  188. AddScore 10
  189. End Sub
  190.  
  191. Sub RightSlingShot_Timer
  192. Select Case RStep
  193. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.rotx = 10
  194. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.rotx = 0:RightSlingShot.TimerEnabled = 0
  195. End Select
  196. RStep = RStep + 1
  197. End Sub
  198.  
  199. Sub LeftSlingShot_Slingshot
  200. PlaySound SoundFXDOF("left_slingshot", 103, DOFPulse, DOFContactors), 0,1, -0.05,0.05 '0,1, AudioPan(LeftSlingShot), 0.05,0,0,1,AudioFade(LeftSlingShot)
  201. LSling.Visible = 0
  202. LSling1.Visible = 1
  203. sling2.rotx = 20
  204. LStep = 0
  205. LeftSlingShot.TimerEnabled = 1
  206. Light8.State=Not Light8.State
  207. AddScore 10
  208. End Sub
  209.  
  210. Sub LeftSlingShot_Timer
  211. Select Case LStep
  212. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.rotx = 10
  213. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.rotx = 0:LeftSlingShot.TimerEnabled = 0
  214. End Select
  215. LStep = LStep + 1
  216. End Sub
  217.  
  218.  
  219. '************************************************************************************************
  220. ' Below is the code needed to run the plungers. Both analog and button press...*****************
  221. '************************************************************************************************
  222.  
  223. TimerVRPlunger2.enabled = true ' This sits outside of a sub, and tells the timer2 to be enabled at table load
  224.  
  225. Sub TimerVRPlunger_Timer
  226. if VRPlunger.Y < 2358 then VRPlunger.Y = VRPlunger.y + 4 'If the plunger is not fully extend it, then extend it by 4 coordinates in the Y,
  227. End Sub
  228.  
  229. Sub TimerVRPlunger2_Timer
  230. VRPlunger.Y = 2285 + (5 * Plunger.Position) - 20 ' This follows our dummy plunger position for analog plunger hardware users.
  231. end sub
  232.  
  233. '*********************************************************************
  234. ' Positional Sound Playback Functions
  235. '*********************************************************************
  236.  
  237. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  238. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  239. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  240. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  241. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  242. End Sub
  243.  
  244. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  245. Sub PlaySoundAt(soundname, tableobj)
  246. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  247. End Sub
  248.  
  249. Sub PlaySoundAtBall(soundname)
  250. PlaySoundAt soundname, ActiveBall
  251. End Sub
  252.  
  253.  
  254. '*********************************************************************
  255. ' Supporting Ball & Sound Functions
  256. '*********************************************************************
  257.  
  258. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  259. Dim tmp
  260. tmp = tableobj.y * 2 / table1.height-1
  261. If tmp > 0 Then
  262. AudioFade = Csng(tmp ^10)
  263. Else
  264. AudioFade = Csng(-((- tmp) ^10) )
  265. End If
  266. End Function
  267.  
  268. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  269. Dim tmp
  270. tmp = tableobj.x * 2 / table1.width-1
  271. If tmp > 0 Then
  272. AudioPan = Csng(tmp ^10)
  273. Else
  274. AudioPan = Csng(-((- tmp) ^10) )
  275. End If
  276. End Function
  277.  
  278. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  279. Vol = Csng(BallVel(ball) ^2 / 2000)
  280. End Function
  281.  
  282. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  283. Pitch = BallVel(ball) * 20
  284. End Function
  285.  
  286. Function BallVel(ball) 'Calculates the ball speed
  287. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  288. End Function
  289.  
  290.  
  291. '*****************************************
  292. ' rothbauerw's Manual Ball Control
  293. '*****************************************
  294.  
  295. Dim BCup, BCdown, BCleft, BCright
  296. Dim ControlBallInPlay, ControlActiveBall
  297. Dim BCvel, BCyveloffset, BCboostmulti, BCboost
  298.  
  299. BCboost = 1 'Do Not Change - default setting
  300. BCvel = 4 'Controls the speed of the ball movement
  301. BCyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
  302. BCboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)
  303.  
  304. ControlBallInPlay = false
  305.  
  306. Sub StartBallControl_Hit()
  307. Set ControlActiveBall = ActiveBall
  308. ControlBallInPlay = true
  309. End Sub
  310.  
  311. Sub StopBallControl_Hit()
  312. ControlBallInPlay = false
  313. End Sub
  314.  
  315. Sub BallControlTimer_Timer()
  316. If EnableBallControl and ControlBallInPlay then
  317. If BCright = 1 Then
  318. ControlActiveBall.velx = BCvel*BCboost
  319. ElseIf BCleft = 1 Then
  320. ControlActiveBall.velx = -BCvel*BCboost
  321. Else
  322. ControlActiveBall.velx = 0
  323. End If
  324.  
  325. If BCup = 1 Then
  326. ControlActiveBall.vely = -BCvel*BCboost
  327. ElseIf BCdown = 1 Then
  328. ControlActiveBall.vely = BCvel*BCboost
  329. Else
  330. ControlActiveBall.vely = bcyveloffset
  331. End If
  332. End If
  333. End Sub
  334.  
  335.  
  336. '********************************************************************
  337. ' JP's VP10 Rolling Sounds (+rothbauerw's Dropping Sounds)
  338. '********************************************************************
  339.  
  340. Const tnob = 5 ' total number of balls
  341. ReDim rolling(tnob)
  342. InitRolling
  343.  
  344. Sub InitRolling
  345. Dim i
  346. For i = 0 to tnob
  347. rolling(i) = False
  348. Next
  349. End Sub
  350.  
  351. Sub RollingTimer_Timer()
  352. Dim BOT, b
  353. BOT = GetBalls
  354.  
  355. ' stop the sound of deleted balls
  356. For b = UBound(BOT) + 1 to tnob
  357. rolling(b) = False
  358. StopSound("fx_ballrolling" & b)
  359. Next
  360.  
  361. ' exit the sub if no balls on the table
  362. If UBound(BOT) = -1 Then Exit Sub
  363.  
  364. For b = 0 to UBound(BOT)
  365. ' play the rolling sound for each ball
  366. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  367. rolling(b) = True
  368. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  369. Else
  370. If rolling(b) = True Then
  371. StopSound("fx_ballrolling" & b)
  372. rolling(b) = False
  373. End If
  374. End If
  375.  
  376. ' play ball drop sounds
  377. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  378. PlaySound "fx_ball_drop" & b, 0, ABS(BOT(b).velz)/17, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  379. End If
  380. Next
  381. End Sub
  382.  
  383. '**********************
  384. ' Ball Collision Sound
  385. '**********************
  386.  
  387. Sub OnBallBallCollision(ball1, ball2, velocity)
  388. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  389. End Sub
  390.  
  391.  
  392. '*****************************************
  393. ' ninuzzu's FLIPPER SHADOWS
  394. '*****************************************
  395.  
  396. sub FlipperTimer_Timer()
  397. FlipperLSh.RotZ = LeftFlipper.currentangle
  398. FlipperRSh.RotZ = RightFlipper.currentangle
  399.  
  400. End Sub
  401.  
  402. '*****************************************
  403. ' ninuzzu's BALL SHADOW
  404. '*****************************************
  405. Dim BallShadow
  406. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  407.  
  408. Sub BallShadowUpdate_timer()
  409. Dim BOT, b
  410. BOT = GetBalls
  411. ' hide shadow of deleted balls
  412. If UBound(BOT)<(tnob-1) Then
  413. For b = (UBound(BOT) + 1) to (tnob-1)
  414. BallShadow(b).visible = 0
  415. Next
  416. End If
  417. ' exit the Sub if no balls on the table
  418. If UBound(BOT) = -1 Then Exit Sub
  419. ' render the shadow for each ball
  420. For b = 0 to UBound(BOT)
  421. If BOT(b).X < Table1.Width/2 Then
  422. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 6
  423. Else
  424. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 6
  425. End If
  426. ballShadow(b).Y = BOT(b).Y + 12
  427. If BOT(b).Z > 20 Then
  428. BallShadow(b).visible = 1
  429. Else
  430. BallShadow(b).visible = 0
  431. End If
  432. Next
  433. End Sub
  434.  
  435.  
  436.  
  437. '************************************
  438. ' What you need to add to your table
  439. '************************************
  440.  
  441. ' a timer called RollingTimer. With a fast interval, like 10
  442. ' one collision sound, in this script is called fx_collide
  443. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  444. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  445.  
  446.  
  447. '******************************************
  448. ' Explanation of the rolling sound routine
  449. '******************************************
  450.  
  451. ' sounds are played based on the ball speed and position
  452.  
  453. ' the routine checks first for deleted balls and stops the rolling sound.
  454.  
  455. ' The For loop goes through all the balls on the table and checks for the ball speed and
  456. ' if the ball is on the table (height lower than 30) then then it plays the sound
  457. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  458.  
  459. ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
  460. ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
  461. ' according to the position of the ball on the table.
  462.  
  463.  
  464. '**************************************
  465. ' Explanation of the collision routine
  466. '**************************************
  467.  
  468. ' The collision is built in VP.
  469. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  470. ' will call this routine. What you add in the sub is up to you. As an example is a simple Playsound with volume and paning
  471. ' depending of the speed of the collision.
  472.  
  473.  
  474. Sub Pins_Hit (idx)
  475. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  476. End Sub
  477.  
  478. Sub Targets_Hit (idx)
  479. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  480. End Sub
  481.  
  482. Sub Metals_Thin_Hit (idx)
  483. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  484. End Sub
  485.  
  486. Sub Metals_Medium_Hit (idx)
  487. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  488. End Sub
  489.  
  490. Sub Metals2_Hit (idx)
  491. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  492. End Sub
  493.  
  494. Sub Gates_Hit (idx)
  495. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  496. End Sub
  497.  
  498. Sub Rubbers_Hit(idx)
  499. dim finalspeed
  500. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  501. If finalspeed > 20 then
  502. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  503. End if
  504. If finalspeed >= 6 AND finalspeed <= 20 then
  505. RandomSoundRubber()
  506. End If
  507. End Sub
  508.  
  509. Sub Posts_Hit(idx)
  510. dim finalspeed
  511. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  512. If finalspeed > 16 then
  513. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  514. End if
  515. If finalspeed >= 6 AND finalspeed <= 16 then
  516. RandomSoundRubber()
  517. End If
  518. End Sub
  519.  
  520. Sub RandomSoundRubber()
  521. Select Case Int(Rnd*3)+1
  522. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  523. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  524. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  525. End Select
  526. End Sub
  527.  
  528. Sub LeftFlipper_Collide(parm)
  529. RandomSoundFlipper()
  530. End Sub
  531.  
  532. Sub RightFlipper_Collide(parm)
  533. RandomSoundFlipper()
  534. End Sub
  535.  
  536. Sub RandomSoundFlipper()
  537. Select Case Int(Rnd*3)+1
  538. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  539. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  540. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  541. End Select
  542. End Sub
  543.  
  544.  
  545.  
  546.  
  547.  
  548. '***** Using a merged EXTERNAL SCRIPT FOR TEMPLATE 6 from Bendigos starter set*****
  549. 'Original Williams Pinball Sounds recorded onsite editted and reprocessed for size for VP
  550. 'all graphics modified and created with Paint Shop Pro 7
  551. 'redrawn playfield and backglass courtesy of Brettski .. many thanks!
  552. 'Luvthatapex Sept, 28 2003
  553. '*****
  554.  
  555. Dim TableName 'For defining the table name used when saving credits/highscore
  556. Dim InProgress 'TRUE while game is in progress, FALSE otherwise
  557. Dim Tilted 'TRUE when tilted, FALSE otherwise
  558. Dim TiltSensitivity 'Obvious
  559. Dim State 'Used for playfield objects that can be disabled during TILT
  560. Dim BallInPlay 'Tracks the ball in play
  561. Dim BallsPerGame '3 or 5
  562. Dim CreditsPerCoin '1 to 5
  563. Dim Score(4) 'The score itself for up to 4 players
  564. Dim ScoreToAdd 'Used in the AddScore sub
  565. Dim HighScore 'Holds previous high score value
  566. Dim HighScorePaid(4) 'Set to TRUE after any player beats the high score
  567. Dim HighScoreReward 'Set to the number of replays awarded when HIGH SCORE is beaten
  568. Dim ShootAgain 'FALSE to count ball in drain, TRUE not to count
  569. Dim Credits 'Keeps track of the credits
  570. Dim Reset 'Used in Plunger_Timer for reset sequence
  571. Dim Count 'Used in Credit_Timer
  572. Dim Count1 'Used in Tilt_Timer for tilt sensitivity
  573. Dim Count2 'Used in Score1_Timer for number match
  574. Dim Match 'The match number
  575. Dim MatchEnabled 'TRUE to enable number match, FALSE otherwise
  576. Dim MatchDigits 'Determines if match number is 1 or 2 digits e.g 5 or 50
  577. Dim X 'Generic variable used in for-next loops
  578. Dim Replay1 'The scores needed for a replay are held in these 3 variables
  579. Dim Replay2
  580. Dim Replay3
  581. Dim Replay1Paid(4) 'Holds TRUE when each replay has been paid, FALSE otherwise
  582. Dim Replay2Paid(4)
  583. Dim Replay3Paid(4)
  584. Dim Alt 'Used in the alternate sub to alternate light states
  585. Dim AltScore 'Holds the value used to alternate playfield lights
  586. Dim Ones 'These 5 are used in the score motor simulator
  587. Dim Tens
  588. Dim Hundreds
  589. Dim Thousands
  590. Dim TenThousands
  591. Dim ValueP
  592. Dim Player 'The current player number
  593. Dim Players 'The number of players
  594. Dim MaxPlayers 'Determines if table is 1,2 or 4 player
  595. Dim DisplayHighScore 'Don't display high score if there is no saved value
  596. Dim ReelSpeed 'Holds a value to determine the score reel speed
  597. Dim Bells 'Determines if bell sounds are to be played
  598. Dim CountBonus 'Holds TRUE if game has bonus, FALSE otherwise
  599. Dim Msg(12) 'Used to display the rules
  600. Dim aball
  601.  
  602. Dim Controller
  603.  
  604. Const NumEMReelsPerPlayer = 6
  605.  
  606. Dim TValue : TValue = 1
  607. Dim Hole,Section,GWire 'Extra variables needed for gate
  608.  
  609. ' Gate
  610. Const GateClosing = 0
  611. Const GateOpening = 1
  612. Const GateClosed = 2
  613. Const GateOpen = 3
  614.  
  615. Dim GateState: GateState = GateOpen
  616.  
  617. '***** Main program code *****
  618.  
  619. Sub Initialize()
  620.  
  621. If B2SOn Then
  622. Controller.B2SName = "Argosy"
  623. End If
  624.  
  625. Randomize
  626. Match=Int(Rnd*10) 'Generate a random number for the match counter to start with
  627. Count=0 'Set variables to a known state
  628. Count1=0
  629. Count2=0
  630. Reset=0
  631. Hole=0
  632. Player=1
  633. BallInPlay=0 'Reset ball counter
  634.  
  635. If B2SOn Then
  636. Controller.B2SSetBallInPlay 32, 0
  637. End If
  638.  
  639. Ball_1.Visible = False
  640. Ball_2.Visible = False
  641. Ball_3.Visible = False
  642. Ball_4.Visible = False
  643. Ball_5.Visible = False
  644.  
  645. vrReelsReset
  646. SetReel 0, -1, 0 ' Init credits to zero
  647.  
  648. InProgress=False 'Game not started
  649. ShootAgain=False 'Make sure we count the balls
  650.  
  651. On Error Resume Next 'Needed if this table has never been saved
  652.  
  653. Credits=LoadValue(TableName,"Credits") 'Load CREDITS from previous save
  654. If Credits="" Then Credits=0 'If there was no entry, then set to default value
  655.  
  656. Credit.Text=Credits 'Place the credits in the display box
  657.  
  658. If Int(Credits) > 0 Then
  659. Light76.State = 1
  660. End If
  661.  
  662. SetReel 0, -1, Int(Credits) ' Set the VR credit reel. Force to int as VBScript can think Credits is a string here because it was read in
  663.  
  664. If B2SOn Then
  665. Controller.B2SSetCredits Credits
  666. End If
  667.  
  668. HighScore=Cdbl(LoadValue(TableName,"HighScore")) 'Load HIGHSCORE from previous save
  669. If HighScore="" Then HighScore=0 'If there was no entry, then set to default value
  670.  
  671. For X=1 To MaxPlayers
  672. Score(X)=(LoadValue(TableName,"Player"&X)) 'Load scores from previous save game
  673. If Score(X)="" Then Score(X)=400+(X*10) 'If there was no entry, use default value
  674.  
  675. If B2SOn Then
  676. Controller.B2SSetScore 1,Score(1)
  677. Controller.B2SSetScore 2,Score(2)
  678. Controller.B2SSetScore 3,Score(3)
  679. Controller.B2SSetScore 4,Score(4)
  680. End If
  681.  
  682. Eval("Score"&X).SetValue Score(X) 'Set score reels to highscore value
  683. Eval("Score"&X).UpdateInterval=200\ReelSpeed 'Set the speed of the reels
  684. Next
  685.  
  686. Shield.TimerInterval=540\ReelSpeed 'Set the score motor speed
  687. End Sub
  688.  
  689. '***** Hit Subs *****
  690.  
  691. Sub BallCount_Hit() 'Trigger to count the balls
  692. PlaySound"FlipperUp"
  693. Disable False 'Enable any disabled playfield object
  694.  
  695. 'If BallInPlay<>0 Then Eval("BC"&BallInPlay).Text="" 'Turn off ball-in-play display
  696.  
  697. If ShootAgain=False Then CountBall 'Increment ball count unless extra ball
  698. ShootAgain=False 'Make sure we count the next ball
  699. Me.Enabled=False 'Disable this trigger
  700. End Sub
  701.  
  702. Sub TroughSwitch_Hit() 'Prevents the ball being counted if it
  703. BallCount.Enabled=True 'rolls back from the plunger to the drain
  704. End Sub 'through the cover (accidents DO happen)
  705.  
  706. Sub TroughSwitch_Unhit() 'Only used for the ball launch sound
  707. PlaySound"LaunchBall"
  708. End Sub
  709.  
  710. Sub Gate_Hit() 'Just for the sound
  711. PlaySound"Click"
  712. End Sub
  713.  
  714. Sub InPlay_Hit() 'Ball is on playfield,
  715. BallCount.Enabled=True 'so enable BallCount trigger
  716. End Sub
  717.  
  718. '***** Scoring and credits *****
  719.  
  720. '********************************VR DRUM SCORING ROUTINES
  721. '*********************************
  722. ' ***************************************************************************
  723. ' BASIC FSS(EM) 1-4 player 6x drums, 1 credit drum CORE CODE
  724. ' ****************************************************************************
  725.  
  726. Dim ix, nxp, npp, reels(5, 7), scores(6,2)
  727. Dim drumObjects
  728. Dim p1Drums, p2Drums, p3Drums, p4Drums
  729.  
  730. 'reset scores to defaults
  731. for nxp =0 to 6
  732. scores(nxp,0 ) = 0
  733. scores(nxp,1 ) = 0
  734. Next
  735.  
  736. 'reset EM drums to defaults
  737. For nxp =0 to 3
  738. For npp = 0 to 6
  739. reels(nxp, npp) = 0 ' default to zero
  740. Next
  741. Next
  742.  
  743. Sub vrReelsReset()
  744. dim nxp, npp
  745.  
  746. ZeroReels
  747.  
  748. 'reset scores to defaults
  749. for nxp =0 to 5
  750. scores(nxp,0 ) = 0
  751. scores(nxp,1 ) = 0
  752. Next
  753.  
  754. 'reset EM drums to defaults
  755. For nxp = 0 to 3
  756. For npp = 1 to 6 ' reel 0 is credits so don't nuke that
  757. reels(nxp, npp) = 0 ' default to zero
  758. next
  759. next
  760. End Sub
  761.  
  762. Sub ZeroReels
  763. Dim i, j
  764. For i = 0 to 3
  765. For j = 1 to 6
  766. SetReel i, j, 0
  767. Next
  768. Next
  769. End Sub
  770.  
  771. Sub SetScore(player, ndx , val)
  772. Dim ncnt
  773.  
  774. If val > 0 Then
  775. If(ndx = 0)then ncnt = val * 100000
  776. If(ndx = 1)then ncnt = val * 10000
  777. If(ndx = 2)then ncnt = val * 1000
  778. If(ndx = 3)Then ncnt = val * 100
  779. If(ndx = 4)Then ncnt = val * 10
  780. If(ndx = 5)Then ncnt = val
  781.  
  782. scores(player, 0) = scores(player, 0) + ncnt
  783. End If
  784. End Sub
  785.  
  786. Sub SetDrum(player, drum, val)
  787. Dim i
  788.  
  789. if player > 3 Then Exit Sub
  790.  
  791. If val = 0 then
  792. If drum = 0 Then ' credit drum
  793. emp1r25.ObjRotX = 0
  794. Else
  795. For i = 0 to 5
  796. drumObjects(player)(i).ObjRotX = 0
  797. Next
  798. End If
  799. ElseIf drum = 0 Then
  800. emp1r25.ObjRotX = emp1r25.ObjRotX + val
  801. Debug.Print "Setting credit reel, val: " & val & ", rot now " & emp1r25.ObjRotX
  802. Else
  803. drumObjects(player)(drum - 1).ObjRotX = drumObjects(player)(drum - 1).ObjRotX + val
  804. End If
  805. End Sub
  806.  
  807. Sub SetReel(player, drum, val)
  808. Dim inc , cur, dif, fix, fval, drumPlayer
  809.  
  810. inc = 33.5
  811. fval = -5 ' graphic seam between 5 & 6 fix value, easier to fix here than photoshop
  812.  
  813. If (player <= 3) or (drum = -1) then
  814. drumPlayer = player
  815.  
  816. If drum = -1 Then
  817. drum = 0
  818. drumPlayer = 0
  819. End If
  820.  
  821. cur = reels(drumPlayer, drum)
  822.  
  823. If val <> cur then ' something has changed
  824. If val > cur Then
  825. dif = val - cur
  826. fix = 0
  827.  
  828. If cur < 5 and cur + dif > 5 Then
  829. fix = fix - fval
  830. End if
  831.  
  832. dif = dif * inc
  833. dif = dif - fix
  834.  
  835. if drum = 0 Then
  836. Debug.Print "Incrementing credit reel from " & cur & " to " & val & ", dif: " & -dif
  837. End If
  838.  
  839. SetDrum drumPlayer, drum, -dif
  840. Else
  841. If val = 0 Then
  842. SetDrum player, drum, 0 ' reset the drum to abs. zero
  843. Else
  844. dif = val - cur
  845. fix = 0
  846.  
  847. If cur > 5 and cur + dif < 5 Then
  848. fix = fval
  849. End if
  850.  
  851. dif = dif * inc
  852. dif = dif - fix
  853.  
  854. if drum = 0 Then
  855. Debug.Print "Decrementing credit reel from " & cur & " to " & val & ", dif: " & -dif
  856. End If
  857.  
  858. SetDrum drumPlayer, drum, -dif
  859. End if
  860. End if
  861.  
  862. reels(player, drum) = val
  863. End if
  864. End if
  865. End Sub
  866.  
  867. Dim vScore1, vScore10, vScore100, vScore1000, vScore10000, vScore100000, Scoreimage
  868. Dim ActiveVRPlayer, nplayer, playr, vrvalue, stemp, cred
  869.  
  870. Sub AddPointsVR(Points)
  871.  
  872. ActiveVRPlayer = Player - 1
  873.  
  874. vScore100000 = 0
  875. vScore10000 = 0
  876. vScore1000 = 0
  877. vScore100 = 0
  878. vScore10 = 0
  879. vScore1 = 0
  880.  
  881. vrvalue = Score(ActiveVRPlayer + 1)
  882.  
  883. If vrvalue >= 100000 Then
  884. vScore100000 = (vrValue - (vrvalue Mod 100000)) / 100000
  885. vrvalue = vrvalue - (vScore100000 * 100000)
  886. End If
  887.  
  888. If vrvalue >= 10000 Then
  889. vScore10000 = (vrValue - (vrvalue Mod 10000)) / 10000
  890. vrvalue = vrvalue - (vScore10000 * 10000)
  891. End If
  892.  
  893. If vrvalue >= 1000 Then
  894. vScore1000 = (vrValue - (vrvalue Mod 1000)) / 1000
  895. vrvalue = vrvalue - (vScore1000 * 1000)
  896. End If
  897.  
  898. If vrvalue >= 100 Then
  899. vScore100 = (vrValue - (vrvalue Mod 100)) / 100
  900. vrvalue = vrvalue - (vScore100 * 100)
  901. End If
  902.  
  903. If vrvalue >= 10 Then
  904. vScore10 = (vrValue - (vrvalue Mod 10)) / 10
  905. vrvalue = vrvalue - (vScore10 * 10)
  906. End If
  907.  
  908. vScore1 = vrValue
  909.  
  910. scores(ActiveVRPlayer, 1) = scores(ActiveVRPlayer, 0)
  911. scores(ActiveVRPlayer, 0) = 0
  912.  
  913. For ix = 1 to 6
  914. reels(ActiveVRPlayer, ix) = 0
  915. Next
  916.  
  917. For ix = 1 to 6
  918. SetDrum ActiveVRPlayer, ix, 0
  919. Next
  920.  
  921. SetReel ActiveVRPlayer, 1, vScore100000 : SetScore ActiveVRPlayer,0,vScore100000
  922. SetReel ActiveVRPlayer, 2, vScore10000 : SetScore ActiveVRPlayer,1,vScore10000
  923. SetReel ActiveVRPlayer, 3, vScore1000 : SetScore ActiveVRPlayer,2,vScore1000
  924. SetReel ActiveVRPlayer, 4, vScore100 : SetScore ActiveVRPlayer,3,vScore100
  925. SetReel ActiveVRPlayer, 5, vScore10 : SetScore ActiveVRPlayer,4,vScore10
  926. SetReel ActiveVRPlayer, 6, vScore1 : SetScore ActiveVRPlayer,5,vScore1
  927. End Sub
  928.  
  929. Sub AddScore(ScoreToAdd) 'The usual method of adding the score
  930. If InProgress=False Or Tilted=True Then Exit Sub 'Disable score when TILTed or not started
  931. Score(Player)=Score(Player)+ScoreToAdd 'Total of current players score
  932. If ScoreToAdd=AltScore Then Alternate 'Make lights alternate, change match no.
  933.  
  934. Eval("Score"&Player).AddValue ScoreToAdd 'Display the score in the correct box
  935. PlaySound"Cluper" 'Reel advance sound
  936.  
  937. AddPointsVR ScoreToAdd
  938.  
  939. If B2SOn Then
  940. Controller.B2SSetScore 1,Score(1)
  941. Controller.B2SSetScore 2,Score(2)
  942. Controller.B2SSetScore 3,Score(3)
  943. Controller.B2SSetScore 4,Score(4)
  944. End If
  945.  
  946. '***** The following lines check if a replay has been won and then mark it as paid. *****
  947.  
  948. If Score(Player)=>Replay1 And Replay1Paid(Player)=False Then
  949. AddReplay
  950. Replay1Paid(Player)=True
  951. End If
  952.  
  953. If Score(Player)=>Replay2 And Replay2Paid(Player)=False Then
  954. AddReplay
  955. Replay2Paid(Player)=True
  956. End If
  957.  
  958. If Score(Player)=>Replay3 And RePlay3Paid(Player)=False Then
  959. AddReplay
  960. Replay3Paid(Player)=True
  961. End If
  962.  
  963. If Score(Player)>HighScore And HighScorePaid(Player)=False Then
  964. PayHigh
  965. HighScorePaid(Player)=True
  966. End If
  967.  
  968. If Bells=True Then PlaySound ScoreToAdd 'Play sounds if turned on
  969. On Error Resume Next 'Needed if the used sub is deleted
  970. ScoreSounds ScoreToAdd 'Call the user defined score sounds
  971. End Sub
  972.  
  973. Sub ScoreSounds(ScoreToAdd)
  974. If ScoreToAdd=10000 then playsound "1000"
  975. If ScoreToAdd=20000 then playsound "2000"
  976. End Sub
  977. '***** If AddScore value IS NOT 1/10/100/1000 then use 'MotorScore value' instead *****
  978. '***** e.g. MotorScore 500 to add 500 using the score motor simulator *****
  979.  
  980. Sub MotorScore(Value) 'Simulates a score motor
  981. If Shield.TimerEnabled Then Exit Sub 'Acts like a real score motor
  982. If Value<10 Then Ones=Ones+Value 'Adds the ones
  983. If Value>9 And Value<100 Then Tens=Tens+(Value\10) 'Adds the 10's
  984. If Value>99 And Value<1000 Then Hundreds=Hundreds+(Value\100) 'Adds the 100's
  985. If Value>999 Then Thousands=Thousands+(Value\1000) 'Adds the 1000's
  986. If Value>9999 Then TenThousands=TenThousands+(Value\10000) 'Adds the 1000's
  987.  
  988. PlaySound"Motor"
  989. Shield.TimerEnabled=True 'Start the scoring
  990. End Sub
  991.  
  992. '***** Sometimes a lot if triggers will be hit in quick succession, causing the EM Reels *****
  993. '***** to fall behind in the counting, so we use a faster method of updating the reels. *****
  994.  
  995. Sub FastScore(ScoreToAdd)
  996. If Tilted=True Then Exit Sub 'Dont score if tilted
  997. If Bells=True Then PlaySound ScoreToAdd 'Play sounds if turned on
  998.  
  999. Score(Player)=Score(Player)+ScoreToAdd 'Add the points to the score
  1000.  
  1001. Eval("Score"&Player).SetValue Score(Player) 'Update the reels
  1002.  
  1003. AddScore 0 'Check if replay has been won
  1004. Alternate 'Change the lights
  1005. End Sub
  1006.  
  1007. Sub AddReplay()
  1008. PlaySound "Knocker" 'Play the sound
  1009. AddCredit false
  1010. End Sub
  1011.  
  1012. Sub PayHigh() 'When HIGH SCORE is beaten, go here
  1013. AddReplay 'Always add at least 1 replay
  1014. If HighScoreReward>1 Then
  1015. Hi.TimerEnabled=True 'Enable the timer for more than 1 replay
  1016. End If
  1017. End Sub
  1018.  
  1019. Sub AddCredit(playAudio) 'Called by Credit_Timer
  1020. Credits = Credits + 1 'Add a credit to the counter
  1021. SetReel 0, -1, Int(Credits)
  1022.  
  1023. Light76.State = 1
  1024.  
  1025. Credit.Text=Credits 'Update the display
  1026.  
  1027. If B2SOn Then
  1028. Controller.B2SSetCredits Credits
  1029. End If
  1030.  
  1031. If playAudio Then
  1032. PlaySound"StepUp" 'Play stepping sound
  1033. End If
  1034. End Sub
  1035.  
  1036. Sub SubtractCredit()
  1037. Credits=Credits-1 'Subtract a credit
  1038. PlaySound "Cluper"
  1039.  
  1040. If Credits <= 0 Then
  1041. Light76.State = 0
  1042. End If
  1043.  
  1044. SetReel 0, -1, Int(Credits)
  1045.  
  1046. Credit.Text=Credits 'Update the credit display
  1047. Players=Players+1 'Add a player to current game
  1048.  
  1049. Dim i
  1050. For i = 1 To 6
  1051. Eval("emp" & Players & "r" & i).image = "ScoreReelOn"
  1052. Next
  1053.  
  1054. If B2SOn Then
  1055. Controller.B2SSetCredits Credits
  1056. Controller.B2SSetCanPlay 31, Players
  1057. End If
  1058.  
  1059. ' If MaxPlayers>1 Then 'If game is not single player then
  1060. ' Eval("Play"&Players).State=LightStateOn 'Light the number of players lights
  1061. ' End If
  1062. End Sub
  1063.  
  1064. 'NOTE: The "Tilt_Timer" subtracts .25 from the "Count1" variable every 250ms
  1065.  
  1066. Sub CheckTilt() 'Called when table is nudged
  1067. Count1=Count1+TiltSensitivity 'Add to tilt count
  1068.  
  1069. If Count1>15 Then 'If more that 15 then TILTED
  1070. Tilted=True 'Stop game
  1071.  
  1072. Tilt.Text="TILT" 'Display TILT message
  1073.  
  1074. If B2SOn Then
  1075. Controller.B2SSetTilt 33,1
  1076. Controller.B2ssetdata 1, 0
  1077. End If
  1078.  
  1079. Disable True 'Disable slings, bumpers etc
  1080.  
  1081. Dim i,j
  1082. For j=1 To MaxPlayers
  1083. For i=1 to NumEMReelsPerPlayer
  1084. Eval("emp" & j & "r" & i).image = "ScoreReel"
  1085. Next
  1086. Next
  1087.  
  1088. End If
  1089. End Sub
  1090.  
  1091. '***** Other subs *****
  1092.  
  1093. Sub StartGame()
  1094. If InProgress = False Then 'If game is NOT being played
  1095. Plunger.TimerEnabled=True 'then start a game
  1096. ElseIf BallInPlay = 1 And Players < MaxPlayers Then 'If game IS being played and it's the first ball
  1097. PlaySound"Motor"
  1098. Player1.TimerEnabled=True 'then add a player
  1099. End If
  1100. End Sub
  1101.  
  1102. Sub NextBall() 'Prepare the next ball, if any left
  1103. Tilted=False 'Reset TILT
  1104. Count1=0 'Reset TILT counter
  1105.  
  1106. Tilt.Text="" 'Get rid of the TILT display
  1107.  
  1108. If B2SOn Then
  1109. Controller.B2SSetTilt 33,0
  1110. Controller.B2ssetdata 1, 1
  1111. End If
  1112.  
  1113. If Bottom4.IsDropped=False then FreeBallGate(GateClosing) ' Reset the outlane ball gate
  1114.  
  1115. If BallInPlay=BallsPerGame And ShootAgain=False And Player=Players Then
  1116. Score1.TimerEnabled=True 'Game is over
  1117. Else 'Deliver the next ball
  1118. Bonus=1 'Bonus should start at 1
  1119. BonusLights 'Now setup the first Bonus Light
  1120. BallRelease.CreateBall
  1121. BallRelease.Kick 90, 7
  1122. PlaySound "ballrelease" 'Play the appropriate sound
  1123.  
  1124. If B2SOn Then
  1125. Controller.B2SSetShootAgain 36, 0
  1126. End If
  1127. End If
  1128. End Sub
  1129.  
  1130. Sub CountBall()
  1131. Player=Player+1 'Next player
  1132.  
  1133. If B2SOn Then
  1134. Controller.B2SSetPlayerUp 30,Player
  1135. End If
  1136.  
  1137. If MaxPlayers>1 Then 'If this is a multi-player game
  1138. If Player>Players Then 'Go back to first player
  1139. Player=1
  1140. BallInPlay=BallInPlay+1 'Next ball
  1141. If B2SOn Then
  1142. Controller.B2SSetPlayerUp 30,Player
  1143. End If
  1144. End If
  1145.  
  1146. if Desktop Then
  1147. Player1.Text = ""
  1148. Player2.Text = ""
  1149. Player3.Text = ""
  1150. Player4.Text = ""
  1151.  
  1152. Eval("Player"&Player).Text = Player 'Turn on player counter
  1153. End If
  1154. End If
  1155.  
  1156. If Desktop Then
  1157. Eval("BC" & BallInPlay).Text = BallInPlay 'Turn on ball-in-play display
  1158.  
  1159. If BallInPlay > 1 Then
  1160. Eval("BC" & (BallInPlay - 1)).Text = "" 'Turn off previous ball-in-play display
  1161. End If
  1162. End If
  1163.  
  1164. If B2SOn Then
  1165. Controller.B2SSetBallInPlay 32, Ballinplay
  1166. End If
  1167.  
  1168. Ball_1.Visible = False
  1169. Ball_2.Visible = False
  1170. Ball_3.Visible = False
  1171. Ball_4.Visible = False
  1172. Ball_5.Visible = False
  1173. Eval("Ball_" & BallInPlay).Visible = True
  1174. End Sub
  1175.  
  1176. '***** Timers *****
  1177.  
  1178. Sub Plunger_Timer() 'Used for the reset sequence
  1179. Reset=Reset+1 'Add 1 every time the counter cycles
  1180. Select Case Reset
  1181. Case 1,7:
  1182. PlaySound"Motor" 'Start the motor sound
  1183. Disable True 'Disable playfield objects
  1184.  
  1185. Case 2:
  1186. PlaySound"TargetUp" 'Sound of relay bank resetting
  1187. Players=0 'Reset the number of players]
  1188.  
  1189. vrReelsReset
  1190.  
  1191. If B2SOn Then
  1192. Controller.B2SSetCanPlay 31, 0
  1193. End If
  1194.  
  1195. SubtractCredit
  1196.  
  1197. GOver.Text="" 'Clear GAME OVER message
  1198.  
  1199. If B2SOn Then
  1200. Controller.B2SSetGameOver 35,0
  1201. End If
  1202.  
  1203. For X=1 To MaxPlayers
  1204. Score(X)=0 'Reset SCORE for all players
  1205.  
  1206. If B2SOn Then
  1207. Controller.B2SSetScore 1,Score(1)
  1208. Controller.B2SSetScore 2,Score(2)
  1209. Controller.B2SSetScore 3,Score(3)
  1210. Controller.B2SSetScore 4,Score(4)
  1211. End If
  1212.  
  1213. Replay1Paid(X)=False
  1214. Replay2Paid(X)=False
  1215. Replay3Paid(X)=False
  1216. HighScorePaid(X)=False
  1217.  
  1218. If X>1 And MaxPlayers>1 Then
  1219. 'Eval("Play"&X).State=LightStateOff 'Turn off player lights 2,3,4
  1220.  
  1221. If B2SOn Then
  1222. Controller.B2SSetPlayerUp 30,0
  1223. End If
  1224. End If
  1225. Next
  1226.  
  1227. Tilt.Text="" 'Clear TILT message
  1228.  
  1229. If B2SOn Then
  1230. Controller.B2SSetTilt 33,0
  1231. Controller.B2ssetdata 1, 1
  1232. End If
  1233.  
  1234. BallInPlay=0 'Reset ball counter
  1235.  
  1236. If B2SOn Then
  1237. Controller.B2SSetBallInPlay 32, 0
  1238. End If
  1239.  
  1240. Ball_1.Visible = False
  1241. Ball_2.Visible = False
  1242. Ball_3.Visible = False
  1243. Ball_4.Visible = False
  1244. Ball_5.Visible = False
  1245.  
  1246. InProgress=True 'Game has started
  1247. ShootAgain=False 'Make sure we count the balls
  1248. Tilted=False 'Reset TILT
  1249.  
  1250. If HighScore=0 Then 'There was no saved value, so
  1251. DisplayHighScore=False 'DON'T display the highscore
  1252. For X=1 To MaxPlayers
  1253. HighScorePaid(X)=True 'Make sure we don't pay if there is no highscore
  1254. Next
  1255. End If
  1256.  
  1257. For X=0 To 9 'Turn off match numbers
  1258. Eval("M"&X).Text=""
  1259.  
  1260. If B2SOn Then
  1261. Controller.B2SSetMatch 34,0
  1262. End If
  1263. Next
  1264.  
  1265. For X=1 To 5 'Turn off ball count numbers
  1266. Eval("BC"&X).Text=""
  1267. Next
  1268.  
  1269. For X=1 To 4 'Turn off player numbers
  1270. Eval("Player"&X).Text=""
  1271. Next
  1272.  
  1273. Case 5:
  1274. For X=1 To MaxPlayers
  1275. Eval("Score"&X).ResetToZero 'Reset score counters
  1276. Next
  1277.  
  1278. If DisplayHighScore=True Then
  1279. Hi.Text=HighScore 'Display highscore
  1280. HSBox.Text="High Score" 'Display "High Score" in the box
  1281. End If
  1282.  
  1283. Case 13:
  1284. Reset=0 'Reset this variable for next time
  1285. PlaySound"Motor" 'Continue with motor sound
  1286.  
  1287. If Desktop Then
  1288. BIP.Text = "Ball In Play" 'Display "Ball in play"
  1289. PlayerLabel.Text = "Player"
  1290. End If
  1291.  
  1292. Drain.TimerEnabled=1 'Ready to kick the ball out
  1293. Alternate 'Light the alternating lights
  1294. On Error Resume Next 'If "Table_Reset" sub in missing
  1295. Table_Reset 'Go to the user defined reset sub
  1296. Me.TimerEnabled=False 'Disable this timer
  1297. End Select
  1298. End Sub
  1299.  
  1300. Sub Player1_Timer() 'Slight delay when adding players
  1301. SubtractCredit
  1302. Me.TimerEnabled=False
  1303. End Sub
  1304.  
  1305. Sub Drain_Timer()
  1306. If DisplayHighScore=True Then
  1307. Hi.Text=HighScore 'Display the current HIGH SCORE
  1308. End If
  1309.  
  1310. NextBall 'Reset tilt, continue game
  1311. Me.TimerEnabled=0
  1312. End Sub
  1313.  
  1314. Sub Credit_Timer() 'When a coin is inserted, go here
  1315. Count=Count+1
  1316. Select Case Count
  1317. Case 7:PlaySound"Motor"
  1318. Case 8:If CreditsPerCoin>1 Then AddCredit true
  1319. Case 9:If CreditsPerCoin>2 Then AddCredit true
  1320. Case 10:If CreditsPerCoin=5 Then AddCredit true
  1321. Case 11:AddCredit true 'Always add at least 1 credit
  1322. Case 12:If CreditsPerCoin>3 Then AddCredit true
  1323. Count=0
  1324. Me.TimerEnabled=False
  1325. End Select
  1326. End Sub
  1327.  
  1328. Sub Hi_Timer() 'Pay any HIGHSCORE award greater than 1
  1329. Count=Count+1
  1330. Select Case Count
  1331. Case 1:AddReplay
  1332. Case 2:If HighScoreReward>2 Then AddReplay
  1333. Case 3:If HighScoreReward>3 Then AddReplay
  1334. Case 4:If HighScoreReward=5 Then AddReplay
  1335. Count=0
  1336. Me.TimerEnabled=False
  1337. End Select
  1338. End Sub
  1339.  
  1340. Sub Tilt_Timer() 'Used to simulate a tilt bob
  1341. If Count1>0 Then Count1=Count1-0.25 'Subtract .25 every 250ms
  1342. End Sub
  1343.  
  1344. Sub Score1_Timer() 'Used for GAME OVER sequence
  1345. Count2=Count2+1 'Increment the counter
  1346. Select Case Count2
  1347. Case 1:PlaySound"Motor" 'Play the score motor sound
  1348. Case 2:If MatchEnabled=True And Players>1 Then 'If the match feature is enabled
  1349. If MatchDigits=1 Then 'and is only 1 digit then for player 2
  1350. If Match=Score(2) Mod 10 Then AddReplay 'If numbers match, give a replay
  1351. Else 'Match is 2 digits
  1352. If Match=Score(2)\10 Mod 10 Then AddReplay
  1353. End If
  1354. End If
  1355.  
  1356. Case 4:If MatchEnabled=True Then 'If the match feature is enabled
  1357. If MatchDigits=1 Then 'and is only 1 digit then for player 1
  1358. If Match=Score(1) Mod 10 Then AddReplay 'If numbers match, give a replay
  1359. Eval("M"&Match).Text=Match 'Turn on the match number display
  1360. Else 'Match is 2 digits
  1361. If Match=Score(1)\10 Mod 10 Then AddReplay
  1362. Eval("M"&Match).Text=(Match&"0") 'Turn on the match number display
  1363. End If
  1364. End If
  1365.  
  1366. Case 6:If MatchEnabled=True And Players>2 Then 'If the match feature is enabled
  1367. If MatchDigits=1 Then 'and is only 1 digit then for player 3
  1368. If Match=Score(3) Mod 10 Then AddReplay 'If numbers match, give a replay
  1369. Else 'Match is 2 digits
  1370. If Match=Score(3)\10 Mod 10 Then AddReplay
  1371. End If
  1372. End If
  1373.  
  1374. Case 8:If MatchEnabled=True And Players>3 Then 'If the match feature is enabled
  1375. If MatchDigits=1 Then 'and is only 1 digit then for player 4
  1376. If Match=Score(4) Mod 10 Then AddReplay 'If numbers match, give a replay
  1377. Else 'Match is 2 digits
  1378. If Match=Score(4)\10 Mod 10 Then AddReplay
  1379. End If
  1380. End If
  1381.  
  1382. Eval("BC" & BallInPlay).Text = "" 'Turn off ball in play numbers
  1383. Eval("Player" & Player).Text = "" 'Turn off ball in play numbers
  1384. GOver.Text="Game Over" 'Display GAME OVER
  1385.  
  1386. If B2SOn Then
  1387. Controller.B2SSetGameOver 35,1
  1388. Controller.B2SSetmatch 34,match
  1389. End If
  1390.  
  1391. BIP.Text="" ' Turn off BALL IN PLAY
  1392. PlayerLabel.Text = "" ' Turn off PLAYERS
  1393.  
  1394. If B2SOn Then
  1395. Controller.B2SSetBallInPlay 32, 0
  1396. End If
  1397.  
  1398. Ball_1.Visible = False
  1399. Ball_2.Visible = False
  1400. Ball_3.Visible = False
  1401. Ball_4.Visible = False
  1402. Ball_5.Visible = False
  1403.  
  1404. Case 9:SaveValue TableName,"Credits",Credits 'Save the credits
  1405. If B2SOn Then
  1406. Controller.B2SSetPlayerUp 30,0
  1407. End If
  1408.  
  1409. For X=1 To Players
  1410. If Score(X)>HighScore Then
  1411. SaveValue TableName,"HighScore",Score(X)'Save the HighScore
  1412. HighScore=Score(X)
  1413. Hi.Text=HighScore
  1414. HSBox.Text="High Score"
  1415. End If
  1416. SaveValue TableName,"Player"&X,Score(X) 'Save scores for next game
  1417. Next
  1418. InProgress=False 'Game is finished
  1419. Count2=0 'Reset the counter for next time
  1420.  
  1421. Dim i,j
  1422. For j=1 To MaxPlayers
  1423. For i=1 to NumEMReelsPerPlayer
  1424. Eval("emp" & j & "r" & i).image = "ScoreReel"
  1425. Next
  1426. Next
  1427.  
  1428. On Error Resume Next 'If "Game_Over" sub is missing
  1429. Game_Over 'Call user code
  1430. Me.TimerEnabled=False 'Disable this timer
  1431. End Select
  1432. End Sub
  1433.  
  1434. Sub Shield_Timer() 'Timer used for the motor simulator. I am using the built-in timer for a wall.
  1435. If Ones>0 Then AddScore 1:Ones=Ones-1 'Add 1 to score, subtract 1 from counter
  1436. If Tens>0 Then AddScore 10:Tens=Tens-1 'The same for 10's, etc
  1437. If Hundreds>0 Then AddScore 100:Hundreds=Hundreds-1
  1438. If Thousands>0 Then AddScore 1000:Thousands=Thousands-1
  1439. If TenThousands>0 Then AddScore 10000:TenThousands=TenThousands-1
  1440. If Ones+Tens+Hundreds+Thousands+TenThousands=0 Then
  1441. StopSound"Motor"
  1442. Me.TimerEnabled=False 'If nothing left, then exit timer
  1443. End If
  1444. End Sub
  1445.  
  1446. Sub Table1_Init()
  1447. LoadEM
  1448. TableName="Argosy" 'Place your table name here
  1449. MaxPlayers=4 '4 for 4 player, 2 for 2 player, 1 for single player game
  1450. BallsPerGame=5 '3 or 5 balls per game
  1451. CreditsPerCoin=1 '1 to 5 credits per coin
  1452. HighScoreReward=3 'The number of replays to award when HIGH SCORE is beaten (1-5)
  1453. MatchEnabled=True 'TRUE for match feature enabled, FALSE otherwise
  1454. MatchDigits=2 'Set the number of match digits to 1 for "0" or to 2 for "00"
  1455. Bells=True 'TRUE to play bell sounds, FALSE for no bells
  1456. CountBonus=True 'TRUE to count bonus at drain, FALSE otherwise
  1457. DisplayHighScore=True 'Display the high score if it has been saved
  1458. AltScore=1 'The score value needed to alternate the lights, 0=disabled
  1459. TiltSensitivity=6 '0-15, 6=normal - a higher number is more sensitive, 0=disabled
  1460. ReelSpeed=3 'Defines the speed of the reels, 1=slow, 9=fast, 3=default
  1461. Replay1=430000 'Place the score needed for replays in these 3 variables
  1462. Replay2=640000
  1463. Replay3=750000
  1464. PrepareRules 'Prepare the rule card
  1465.  
  1466. p1Drums = Array(emp1r1, emp1r2, emp1r3, emp1r4, emp1r5, emp1r6)
  1467. p2Drums = Array(emp2r1, emp2r2, emp2r3, emp2r4, emp2r5, emp2r6)
  1468. p3Drums = Array(emp3r1, emp3r2, emp3r3, emp3r4, emp3r5, emp3r6)
  1469. p4Drums = Array(emp4r1, emp4r2, emp4r3, emp4r4, emp4r5, emp4r6)
  1470.  
  1471. drumObjects = Array(p1Drums, p2Drums, p3Drums, p4Drums)
  1472.  
  1473. Initialize 'Call main Init sub in the external script
  1474. LightsOut 'NEW
  1475. ' ShootAgain=False
  1476. End Sub
  1477.  
  1478. 'Calls to the following 4 subs are error checked, so the subs can be deleted if not needed
  1479.  
  1480. Sub UserKeyUp(ByVal Keycode) 'Custom "KeyUp" for this table can be placed here
  1481. End Sub
  1482.  
  1483. Sub UserKeyDown(ByVal Keycode) 'Custom "KeyDown" for this table can be placed here
  1484. End Sub
  1485.  
  1486. Sub Table_Reset() 'User defined reset code can be placed here
  1487. End Sub
  1488.  
  1489. Sub Game_Over() 'User defined game over code can be placed here
  1490. End Sub
  1491.  
  1492. Sub Drain_Hit()
  1493. PlaySoundAt "Drain", Drain
  1494. Drain.DestroyBall
  1495.  
  1496. ' if NoPointsScored and (Tilt = 0) Then
  1497. ' Playsound "FD_DrainwithBallrelease"
  1498. ' ReleaseSameBallTimer.enabled = True
  1499. ' Else
  1500. ' AwardBonus
  1501. ' End If
  1502.  
  1503. X2.TimerEnabled=True '_Timer
  1504. End Sub
  1505.  
  1506.  
  1507. '***** Object and light control *****
  1508. '***** Any lights that need to be extinguished when tilted should be placed in the collection
  1509. '***** "TiltLights". They will be set back to the previous state for the next ball.
  1510. Sub Disable(State) 'Disable or enable objects when TILTed
  1511. 'LeftSlingShot.Disabled=State
  1512. 'RightSlingShot.Disabled=State
  1513. 'Put bumpers etc here. If the object supports ".Disabled" then use "Object.Disabled=State"
  1514. 'Or if the object instead supports ".Enabled" then use "Object.Enabled=Not State"
  1515. If State=True Then
  1516. LeftFlipper.RotateToStart 'Move flippers to start position
  1517. RightFlipper.RotateToStart
  1518. LightSeq.Play SeqAllOff 'Extinguish lights when tilted
  1519. StopSound "buzz_left"
  1520. StopSound "buzz_right"
  1521. Else
  1522. LightSeq.StopPlay 'Turn lights back on
  1523. End If
  1524. End Sub
  1525.  
  1526. Sub Alternate() 'Alternates playfield lights
  1527. If Shield.TimerEnabled Then Exit Sub 'Exit if motor is running
  1528. If AltScore=0 Then Exit Sub 'If disabled then exit
  1529. Match=(Match+1) Mod 10 'Cycle the match number (0-9)
  1530. Alt=Match Mod 2 'Is it an odd or even number
  1531. If LeftOutLane.State=1 or RightOutLane.State=1 then LeftOutLane.State=Alt
  1532. ' Add lights above here which are on when number is ODD
  1533. ' As NOT returns -1 or -2, we need to subtract 2 to get 0(off) or 1(on)
  1534. Alt=Not Alt-2 'Invert the state for the next lot of lights
  1535. ' Add lights below here which are on when number is EVEN
  1536. If LeftOutLane.State=1 or RightOutLane.State=1 then RightOutLane.State=Alt
  1537. End Sub
  1538.  
  1539. '***** Rules *****
  1540. Sub PrepareRules() 'The table rules should be placed in these lines
  1541. Msg(0)=TableName&Chr(10)&Chr(10)
  1542. Msg(1)="________________________________________________________________"
  1543. Msg(2)=" Top Center Rollover Lane Opens Gate and Scores 10,000 When Lit."
  1544. Msg(3)=" Lane Lites for 10,000 When Bonus Is At Top."
  1545. Msg(4)=" Making All Four Drop Targets Scores Lit Value And Advances "
  1546. Msg(5)=" Value Of Drop Targets And Eject Hole To Next Highest Value."
  1547. Msg(6)=" Scoring Special Resets Drop Target value to 30,000 and "
  1548. Msg(7)=" Eject Hold Value to Double Bonus."
  1549. Msg(8)=" Special Scores 1 Credit"
  1550. Msg(9)=" Matching Last Two Numbers Of Score To Number That Appears"
  1551. Msg(10)=" On Back Glass After Game Is Over Scores 1 Credit."
  1552. Msg(11)="________________________________________________________________"
  1553. End Sub
  1554.  
  1555. '***** Demo of how to do BONUS LIGHTS ****** To remove this demo, just remove all the script from
  1556. '***** here to "END OF BONUS DEMO", remove the collections TENSLIGHTS, HUNDREDSLIGHTS and
  1557. '***** TRIGGERS, the 6 lower playfield triggers, the top trigger and the bonus lights and
  1558. '***** their decals, and set "CountBonus=False" in Sub Table_Init
  1559.  
  1560. Dim Bonus,Multiplier,Counter,FastBonus 'The variables used in the demo
  1561.  
  1562. FastBonus=True 'Set to FALSE to count by 10's
  1563. Counter=0 'Set to a known state
  1564. Multiplier=1 'Set to 1 when the table loads - this
  1565. 'would normally go in "Sub Table_Init", but is put here so it is removed with the demo
  1566.  
  1567. Sub Trigger1_Hit() 'The top trigger
  1568. If Multiplier=2 Then Exit Sub 'restrict to 2x highest multiplier
  1569. ' If Multiplier>1 Then Eval("X"&Multiplier).State=LightstateOff
  1570.  
  1571. ' Free double bonus on last ball
  1572. ' If ballinplay=BallsPerGame then
  1573. ' Multiplier=Multiplier+1
  1574. ' Eval("X"&Multiplier).State=LightStateOn
  1575. ' End If
  1576. End Sub
  1577.  
  1578. Sub AddBonus
  1579. If Bonus < 10 Then
  1580. PlaySound "FlipperUp"
  1581. Bonus = Bonus+1 'Add 1 to BONUS counter
  1582. BonusLights 'Process the bonus lights
  1583.  
  1584. If Bonus = 10 then
  1585. BonusLight10.State = 1
  1586. Top3.State = 1
  1587. End If
  1588. Else
  1589. 'Force last bonus light on and previous off, then lite
  1590. 'the center rollover for 10k pts
  1591. Bonus = 10: BonusLight10.State = 1: BonusLight9.State = 0: Top3.state = 1
  1592. End If
  1593. End Sub
  1594.  
  1595. REM The bonus lights are in 2 collections called TENS
  1596. Sub BonusLights()
  1597. For X=1 To TensLights.Count 'Scan the TENS lights and compare them to the
  1598. If Bonus Mod 10=X Then 'tens digit of the BONUS variable to
  1599. TensLights(X-1).State=LightStateOn 'determine if the light should be ON or OFF
  1600. Else
  1601. TensLights(X-1).State=LightStateOff
  1602. End If
  1603. Next
  1604. End Sub
  1605.  
  1606. Sub X2_Timer() 'Bonus score timer(X2 light)
  1607. Counter=Counter+1
  1608. Select Case Counter
  1609. Case 1:If Bonus>10 And FastBonus=True Then
  1610. MotorScore 100*Multiplier
  1611. Bonus=Bonus-10 'Subtract 10 from bonus left
  1612. Else
  1613. 'MotorScore 10000*Multiplier
  1614. AddScore 10000*Multiplier
  1615. Bonus=Bonus-1 'Subtract 1 from bonus left
  1616. Bonuslights
  1617. End If
  1618.  
  1619. Case 6:'BonusLights 'Change the bonus lights
  1620. Counter=0 'Reset the counter for the next count
  1621. If Bonus<1 Then 'If all paid then -
  1622. X2.State=LightStateOff 'Turn off the multiplier lights
  1623. Multiplier=1 'Set multiplier to 1
  1624. PlaySound"Motor" 'Play the sound once
  1625. Drain.TimerEnabled=True 'Call the timer to create the next ball
  1626. Lightsout 'NEW! Turn off playfield
  1627. ResetTargets 'NEW! reset targets
  1628. Bonus=1 'Bonus should start at 1
  1629. TValue=1
  1630. TValueLights
  1631. BonusLights
  1632. Me.TimerEnabled=False 'And disable this timer
  1633. End If
  1634. End Select
  1635. End Sub
  1636.  
  1637. Sub PopBumper_Init()
  1638. 'Ring.IsDropped=True 'Raise the ring
  1639. 'SkirtDark.IsDropped=False 'Use the dark skirt because
  1640. 'Me.State=LightStateOn 'the light is OFF
  1641. End Sub
  1642.  
  1643. Sub PopBumper_Hit()
  1644. DOF 105, DOFPulse
  1645. ' PlaySound"Bumper"
  1646. Alternate
  1647. AddScore 100
  1648. 'Ring.IsDropped=False 'Drop the ring (wall is upside down)
  1649. Me.TimerEnabled=true 'Call the timer to raise the ring
  1650. End Sub
  1651.  
  1652. Sub PopBumper_Timer()
  1653. 'Ring.IsDropped=True 'Raise the ring
  1654. Me.TimerEnabled=False 'Disable the timer
  1655. End Sub
  1656.  
  1657. Sub Bumper1_Init()
  1658. 'Ring2.IsDropped=True 'Raise the ring
  1659. 'SkirtDark2.IsDropped=False 'Use the dark skirt because
  1660. 'Me.State=LightStateOn 'the light is OFF 'because the light is off
  1661. End Sub
  1662.  
  1663. Sub Bumper1_Hit()
  1664. DOF 106, DOFPulse
  1665. ' PlaySound"Bumper"
  1666. Alternate
  1667. AddScore 100
  1668. 'Ring2.IsDropped=False 'Drop the ring (wall is upside down)
  1669. Me.TimerEnabled=true 'Call the timer to raise the ring
  1670. End Sub
  1671.  
  1672. Sub Bumper1_Timer()
  1673. 'Ring2.IsDropped=True 'Raise the ring
  1674. Me.TimerEnabled=False 'Disable the timer
  1675. End Sub
  1676.  
  1677. Dim Target,BCount
  1678. BCount=0
  1679.  
  1680. Sub T1_Dropped()
  1681. MotorScore 1000
  1682. AddBonus
  1683. PlaySound"Reels"
  1684. CheckTargets
  1685. End Sub
  1686.  
  1687. Sub T2_Dropped()
  1688. MotorScore 1000
  1689. AddBonus
  1690. PlaySound"Reels"
  1691. CheckTargets
  1692. End Sub
  1693.  
  1694. Sub T3_Dropped()
  1695. MotorScore 1000
  1696. AddBonus
  1697. PlaySound"Reels"
  1698. CheckTargets
  1699. End Sub
  1700.  
  1701. Sub T4_Dropped()
  1702. MotorScore 1000
  1703. AddBonus
  1704. PlaySound"Reels"
  1705. CheckTargets
  1706. End Sub
  1707.  
  1708. Sub CheckTargets()
  1709. If T1.IsDropped=1 and T2.IsDropped=1 and T3.IsDropped=1 and T4.IsDropped=1 then
  1710. 'Increment the target value
  1711. If light1.state=1 then AddScore 10000 'Score 10k
  1712. If light2.state=1 then AddScore 30000 'Score 30k
  1713. If light3.state=1 then AddScore 50000 'Score 50k
  1714. If light4.state=1 then AddReplay 'Score Replay
  1715.  
  1716. AddTvalue
  1717. ResetTargets
  1718. End If
  1719. End Sub
  1720.  
  1721. Sub AddTValue()
  1722. Tvalue=Tvalue+1
  1723. If Tvalue=2 then light5.state=1:light6.state=0:light7.state=0 'increment Hole Value for Double Bonus
  1724. If Tvalue=3 then light6.state=1:light5.state=0:light7.state=0 'increment Hole Value for Extra Ball Lane
  1725. If Tvalue=4 then light7.state=1:light5.state=0:light6.state=0 'increment Hole Value for Special
  1726. TValueLights
  1727. End Sub
  1728.  
  1729. Sub TValueLights()
  1730. If Tvalue=1 then light1.state=1 'increment Target Light
  1731. If Tvalue=2 then light2.state=1:light1.state=0
  1732. If Tvalue=3 then light3.state=1:light2.state=0:light1.state=0
  1733. If Tvalue=4 then light4.state=1:light3.state=0:light2.state=0:light1.state=0
  1734. End Sub
  1735.  
  1736. Sub T1_Timer()
  1737. LeftSpecial.State=1:LeftOutLane.State=1:top1.state=1:top2.state=1
  1738. BCount=Bcount+1 'Count from 0 to 25
  1739. If Bcount>25 Then PlaySound"StepUp"
  1740.  
  1741. Select Case BCount
  1742. Case 15:PlaySound"Motor",-1 'After delay start motor
  1743. Case 18,19,20:AddScore 1000 'Score 300 for all targets down
  1744. Case 21:T1.IsDropped=False 'Raise the targets in sequence
  1745. Case 22:T2.IsDropped=False
  1746. Case 23:T3.IsDropped=False
  1747. Case 24:T4.IsDropped=False
  1748. Case 25:BCount=0 'reset the counter and
  1749. StopSound"Motor"
  1750. Me.TimerEnabled=False 'disable the timer
  1751. End Select
  1752. End Sub
  1753.  
  1754. Sub ResetTargets()
  1755. 'PlaySound"Motor" 'After delay start motor
  1756. PlaySound SoundFXDOF("Motor", 108, DOFPulse, DOFContactors)
  1757. T1.IsDropped=False:T2.IsDropped=False:T3.IsDropped=False:T4.IsDropped=False
  1758. 'The last target is up, so
  1759. BCount=0 'reset the counter and
  1760. StopSound"Motor"
  1761. End Sub
  1762.  
  1763. '**********************************************************************
  1764. 'Argosy Specific Stuff
  1765. '**********************************************************************
  1766. Sub Lightsout
  1767. For X=1 To PlayfieldLights.Count 'Scan the TENS lights and compare them to the
  1768. PlayfieldLights(X-1).State=LightStateOff
  1769. Next
  1770.  
  1771. For X=1 To TensLights.Count 'Scan the TENS lights and compare them to the
  1772. TensLights(X-1).State=LightStateOff
  1773. Next
  1774. End Sub
  1775.  
  1776. Sub Trigger5_Hit() 'LeftOutLane
  1777. MotorScore 5000
  1778. If LeftOutLane.State=1 then
  1779. ShootAgain=true:Shoot.State=1
  1780. If B2SOn Then
  1781. Controller.B2SSetShootAgain 36, 1
  1782. End If
  1783. End If
  1784. End Sub
  1785.  
  1786. Sub Trigger6_Hit():AddScore 1000:AddBonus:End Sub 'LeftInLane
  1787. Sub Trigger2_Hit():AddScore 1000:AddBonus:End Sub 'RightInLane
  1788.  
  1789. Sub Trigger3_Hit() 'RightOutLane
  1790. MotorScore 5000
  1791. If RightOutLane.State=1 then
  1792. ShootAgain=true:Shoot.State=1
  1793.  
  1794. If B2SOn Then
  1795. Controller.B2SSetShootAgain 36, 1
  1796. End If
  1797. End If
  1798. End Sub
  1799.  
  1800. Sub Trigger9_Hit()
  1801. MotorScore 500
  1802. If RightSpecial.State=1 then AddReplay
  1803. End Sub
  1804.  
  1805. Sub Trigger13_Hit()
  1806. MotorScore 500
  1807. If LeftSpecial.State=1 then ShootAgain=true
  1808. End Sub
  1809.  
  1810. Sub Wall132_Slingshot()
  1811. AddBonus:MotorScore 500
  1812. End Sub
  1813.  
  1814. Sub BallKicker_Hit
  1815. Set aBall=ActiveBall
  1816. LiftBall.Enabled=1
  1817. If Bonus>0 Then
  1818. ' PlaySound"Motor",-1 'Play continuous motor sound and,
  1819. ' X2.TimerEnabled=True
  1820. Else
  1821. BallKicker.TimerEnabled=1 'Call the timer to drop the guide
  1822. End If
  1823. End Sub
  1824.  
  1825. Sub Spinner1_Spin()
  1826. If Not Light8.State=0 then
  1827. PlaySound SoundFXDOF("spinner2", 110, DOFPulse, DOFContactors)
  1828. playsound "spinner2"
  1829. motorscore 1000
  1830. Else
  1831. motorscore 100
  1832. End If
  1833. End Sub
  1834.  
  1835. Sub Wall019_Slingshot()
  1836. PlaySound SoundFXDOF("bumper", 109, DOFPulse, DOFContactors)
  1837. 'playsound"bumper"
  1838. Motorscore 10
  1839. Light8.State=Not Light8.State
  1840. End Sub
  1841.  
  1842. Sub top2trigger_Hit()
  1843. AddBonus:Motorscore 500
  1844. Wall_Top2.isdropped=true:playsound "buzz"
  1845. End Sub
  1846.  
  1847. Sub top2trigger_UnHit()
  1848. Wall_Top2.isdropped=false
  1849. End Sub
  1850.  
  1851. Sub top1trigger_Hit()
  1852. AddBonus:Motorscore 500
  1853. Wall_Top1.isdropped=true:playsound"buzz"
  1854. End Sub
  1855.  
  1856. Sub top1trigger_UnHit()
  1857. Wall_Top1.isdropped=false
  1858. End Sub
  1859.  
  1860. Sub Toptrigger_Hit() 'Top Mid Rollover
  1861. ' Gate always opens when hit!
  1862. FreeBallGate(GateOpening)
  1863.  
  1864. If Top3.State=1 then
  1865. AddScore 10000
  1866. Else
  1867. AddScore 1000:AddBonus
  1868. End If
  1869.  
  1870. ' Skill shot - first time the lane is hit, advance the target bank reward
  1871. If Light1.State = 1 Then
  1872. AddTValue
  1873. End If
  1874.  
  1875. End Sub
  1876.  
  1877. Sub Wall031_Slingshot()
  1878. Motorscore 10
  1879. Light8.State=Not Light8.State
  1880. End Sub
  1881.  
  1882. Sub wire2_Hit()
  1883. playsound"click"
  1884. End Sub
  1885.  
  1886. Sub Wire5_Hit()
  1887. playsound"click"
  1888. End Sub
  1889.  
  1890. Sub Kicker1_Init
  1891. FreeBallGate(GateClosing) 'Call this to remove the unused parts
  1892. End Sub
  1893.  
  1894. Sub Kicker1_Hit
  1895. If light5.state=1 then x2.state=1:Multiplier=2 'award double bonus
  1896. If light6.state=1 then LeftOutLane.State=1 ':RightOutLane.State=1 'award Extra Ball Lane
  1897. If light7.state=1 then AddReplay 'award Special
  1898.  
  1899. PlaySound"Motor"
  1900. MotorScore 5000 'Score 5000
  1901. Me.TimerEnabled=True 'Call Kicker1_Timer
  1902. End Sub
  1903.  
  1904. Sub Kicker1_Timer
  1905. Kicker1.Kick 230,10
  1906. PlaySound SoundFXDOF("Kicker", 107, DOFPulse, DOFContactors) 'Kick the ball out after a delay
  1907. ' PlaySound"Kicker"
  1908. Me.TimerEnabled=False
  1909. End Sub
  1910.  
  1911. Sub FreeBallGate(gateDir) 'Determine which direction the gate has to move
  1912.  
  1913. If (GateState = GateClosed and gateDir = GateOpening) Or (GateState = GateOpen and gateDir = GateClosing) Then
  1914. GateState = gateDir
  1915.  
  1916. If GateState = GateClosing Then
  1917. Section = 4
  1918. Else
  1919. Section = 1
  1920. End If
  1921.  
  1922. Pin.TimerEnabled=True
  1923. End If
  1924. End Sub
  1925.  
  1926. Sub Bottom4_Hit
  1927. Me.TimerEnabled = True
  1928. End Sub
  1929.  
  1930. Sub Bottom4_Timer
  1931. FreeBallGate(GateClosing)
  1932. Me.TimerEnabled = False
  1933. End Sub
  1934.  
  1935. Sub bottom1_Slingshot
  1936. If GateState = GateClosed Then
  1937. FreeBallGate GateOpening
  1938. End If
  1939. End Sub
  1940.  
  1941. Sub bottom1_Hit
  1942. If GateState = GateClosed Then
  1943. 'FreeBallGate GateOpening
  1944. End If
  1945. End Sub
  1946.  
  1947. Sub Pin_Timer 'Used to make the gate sections visible
  1948. For Each GWire In BallGate 'Drop all walls that make up the gate
  1949. GWire.IsDropped=1
  1950. Next
  1951.  
  1952. Eval("Bottom"&Section).IsDropped=False
  1953.  
  1954. If GateState = GateClosing Then 'Gate is closing
  1955. Section = Section-1 'Subtract 1 from variable
  1956.  
  1957. If Section < 1 Then
  1958. GateState = GateClosed ' Done, gate is closed
  1959. Me.TimerEnabled = False
  1960. Light9.State = 0
  1961. End If
  1962. Else 'Gate is opening
  1963. Section = Section + 1 'Add 1 to variable
  1964.  
  1965. If Section > 4 Then
  1966. GateState = GateOpen ' Done, gate is open
  1967. Me.TimerEnabled = False
  1968. Light9.State = 1
  1969. End If
  1970. End If
  1971. End Sub
  1972.  
  1973. Sub Table1_Exit
  1974.  
  1975. If B2SOn Then Controller.Stop
  1976.  
  1977. End Sub
Advertisement
Add Comment
Please, Sign In to add comment