Outhere

Argosy (Williams 1977) 1.3

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