Arngrim

Aztec

Mar 25th, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.04 KB | None | 0 0
  1. Const cGameName = "aztec_1976"
  2. 'Const ReflectionMod=True 'enable JPJ reflection mod
  3.  
  4. Dim Score(4)
  5. dim truesc(4)
  6. dim ballrelenabled
  7. dim state
  8. dim playno
  9. dim credit
  10. dim eg
  11. dim hisc1
  12. dim hisc2
  13. dim currpl
  14. dim plno(4)
  15. dim play(4)
  16. dim rst
  17. dim ballinplay
  18. dim match(10)
  19. dim tilt
  20. dim tiltsens
  21. dim rep(4)
  22. dim plm(4)
  23. dim matchnumb
  24. dim cred
  25. dim scn
  26. dim scn1
  27. dim bell
  28. dim points
  29. dim tempscore
  30. dim digit
  31. dim update
  32. dim reel(4)
  33. dim replay1
  34. dim replay2
  35. dim replay3
  36. dim up(4)
  37. dim bl(10)
  38. dim bv
  39. dim balls
  40. dim azlet(5)
  41. dim az1(5)
  42. dim az2(5)
  43. dim sm
  44. dim br
  45. dim bumperchoice
  46. dim rstep, rstepa, rstepb, rstepc, rstepd, rstepe, lstep, lstepa, lstepb, lstepc, lstepd
  47. Dim GlobalSoundLevel
  48. Dim coin, coinc
  49.  
  50. GlobalSoundLevel = 2
  51.  
  52. On Error Resume Next
  53. ExecuteGlobal GetTextFile("controller.vbs")
  54. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  55. On Error Goto 0
  56.  
  57. '************************ Table ini ****************************
  58. sub table1_init
  59.  
  60. '*********** JPJ's automatic random rotation of screws *******
  61. dim z
  62. For Each x in AutomaticRot
  63. z = Int(Rnd*360)+1
  64. x.RotZ = z
  65. Next
  66. For Each x in AutomaticRot2
  67. z = Int(Rnd*360)+1
  68. x.RotY = z
  69. Next
  70. '**************************************************************
  71.  
  72. LoadEM
  73. ' If ShowDT=false Then
  74. ' for each obj in DTItems
  75. ' obj.visible=False
  76. ' Next
  77. ' Primitive78.visible = 0
  78. ' Primitive77.visible = 0
  79. ' Primitive81.visible = 0
  80. ' Primitive82.visible = 0
  81. ' Primitive83.visible = 0
  82. ' Primitive84.visible = 0
  83. ' RampLBlack.visible = 1
  84. ' RampRBlack.visible = 1
  85. ' RampLBlack1.visible = 1
  86. ' RampRBlack1.visible = 1
  87. ' Else
  88. '
  89. ' RampLBlack.visible = 0
  90. ' RampRBlack.visible = 0
  91. ' RampLBlack1.visible = 0
  92. ' RampRBlack1.visible = 0
  93. '
  94. ' end If
  95.  
  96. set plno(1)=plno1
  97. set plno(2)=plno2
  98. set plno(3)=plno3
  99. set plno(4)=plno4
  100. set play(1)=up1
  101. set play(2)=up2
  102. set play(3)=up3
  103. set play(4)=up4
  104. set match(0)=m0
  105. set match(1)=m1
  106. set match(2)=m2
  107. set match(3)=m3
  108. set match(4)=m4
  109. set match(5)=m5
  110. set match(6)=m6
  111. set match(7)=m7
  112. set match(8)=m8
  113. set match(9)=m9
  114. set up(1)=up1
  115. set up(2)=up2
  116. set up(3)=up3
  117. set up(4)=up4
  118. set bl(1)=b5k
  119. set bl(2)=b10k
  120. set bl(3)=b15k
  121. set bl(4)=b20k
  122. set bl(5)=b25k
  123. set bl(6)=b30k
  124. set bl(7)=b35k
  125. set bl(8)=b40k
  126. set bl(9)=b45k
  127. set bl(10)=b50k
  128. set azlet(1)=upcl
  129. set azlet(2)=midll
  130. set azlet(3)=midrl
  131. set azlet(4)=lowll
  132. set azlet(5)=lowrl
  133. set az1(1)=al1
  134. set az1(2)=zl1
  135. set az1(3)=tl1
  136. set az1(4)=el1
  137. set az1(5)=cl1
  138. set az2(1)=al2
  139. set az2(2)=zl2
  140. set az2(3)=tl2
  141. set az2(4)=el2
  142. set az2(5)=cl2
  143. set reel(1)=reel1
  144. set reel(2)=reel2
  145. set reel(3)=reel3
  146. set reel(4)=reel4
  147. credtimer.enabled=true
  148. loadhs
  149. if hisc1="" then hisc1=300250
  150. if hisc2="" then hisc2=450250
  151. if credit="" then credit=0
  152. credtxt.text=credit
  153.  
  154. balls=3
  155. apron3d.image = "apron01"
  156. ballstxt.text=balls
  157. if balls=3 then
  158. replay1=300000
  159. replay2=450000
  160. replay3=575000
  161. if balls=3 then hstxt.text=hisc1
  162. else
  163. replay1=450000
  164. replay2=600000
  165. replay3=850000
  166. if balls=5 then hstxt.text=hisc2
  167. end if
  168. rep1.text=replay1
  169. rep2.text=replay2
  170. rep3.text=replay3
  171. select case(matchnumb)
  172. case 0:
  173. m0.text="00"
  174. case 1:
  175. m1.text="10"
  176. case 2:
  177. m2.text="20"
  178. case 3:
  179. m3.text="30"
  180. case 4:
  181. m4.text="40"
  182. case 5:
  183. m5.text="50"
  184. case 6:
  185. m6.text="60"
  186. case 7:
  187. m7.text="70"
  188. case 8:
  189. m8.text="80"
  190. case 9:
  191. m9.text="90"
  192. end select
  193. for i=1 to 4
  194. currpl=i
  195. reel(currpl).setvalue(score(currpl))
  196. next
  197. currpl=0
  198.  
  199. coin = 1
  200. '******** lights Ini ***********
  201. bv=1
  202. turnoff
  203. gioff
  204.  
  205. end sub
  206. '**********************************************************
  207.  
  208. Sub Table1_KeyDown(ByVal keycode)
  209. if keycode=50 then dbl.state=lightstateon
  210. If keycode = PlungerKey Then
  211. Plunger.PullBack
  212. End If
  213.  
  214. if keycode = leftmagnasave then
  215. If ballinplay<1 or ballinplay>balls then
  216. ' if keycode=59 and state=false then
  217. if balls=3 then
  218. balls=5
  219. apron3d.image = "apron02"
  220. ballstxt.text=balls
  221. replay1=450000
  222. replay2=600000
  223. replay3=850000
  224. rep1.text=replay1
  225. rep2.text=replay2
  226. rep3.text=replay3
  227. hstxt.text=hisc2
  228. else
  229. balls=3
  230. apron3d.image = "apron01"
  231. ballstxt.text=balls
  232. replay1=300000
  233. replay2=450000
  234. replay3=575000
  235. rep1.text=replay1
  236. rep2.text=replay2
  237. rep3.text=replay3
  238. hstxt.text=hisc1
  239. end if
  240. end if
  241. end if
  242.  
  243. if keycode = addcreditkey then
  244. playsound "coin3"
  245. coindelay.enabled=true
  246. end if
  247.  
  248. if keycode = AddCreditKey2 then
  249. playsound "coin3"
  250. coindelay2.enabled=true
  251. end if
  252.  
  253. if keycode = StartGameKey and credit>0 and state=false and playno=0 then
  254. credit=credit-1
  255. If credit < 1 Then DOF 128, DOFOff
  256. credtxt.text=credit
  257. GION
  258. eg=0
  259. playno=1
  260. currpl=1
  261. plno(playno).state=lightstateon
  262. play(currpl).state=lightstateon
  263. playsound "click"
  264. playsound "initialize"
  265. rst=0
  266. ballinplay=1
  267. resettimer.enabled=true
  268. end if
  269.  
  270. if keycode = StartGameKey and credit>0 and state=true and playno>0 and playno<4 and ballinplay<2 then
  271. credit=credit-1
  272. If credit < 1 Then DOF 128, DOFOff
  273. credtxt.text=credit
  274. plno(playno).state=lightstateoff
  275. playno=playno+1
  276. plno(playno).state=lightstateon
  277. playsound "click"
  278. end if
  279.  
  280. if state=true and tilt=false then
  281. If keycode = LeftFlipperKey Then
  282. LeftFlipper.RotateToEnd
  283. PlaySound SoundFXDOF("FlipperUp",101,DOFOn,DOFFlippers)
  284. End If
  285.  
  286. If keycode = RightFlipperKey Then
  287. RightFlipper.RotateToEnd
  288. PlaySound SoundFXDOF("FlipperUp",102,DOFOn,DOFFlippers)
  289. End If
  290.  
  291. If keycode = LeftTiltKey Then
  292. Nudge 90, 2
  293. checktilt
  294. End If
  295.  
  296. If keycode = RightTiltKey Then
  297. Nudge 270, 2
  298. checktilt
  299. End If
  300.  
  301. If keycode = CenterTiltKey Then
  302. Nudge 0, 2
  303. checktilt
  304. End If
  305. end if
  306.  
  307. End Sub
  308.  
  309. Sub Table1_KeyUp(ByVal keycode)
  310.  
  311. If keycode = PlungerKey Then
  312. Plunger.Fire
  313. playsound "plunger"
  314. End If
  315.  
  316. If keycode = LeftFlipperKey Then
  317. LeftFlipper.RotateToStart
  318. if tilt=false and state=true then PlaySound SoundFXDOF("FlipperDown",101,DOFOff,DOFFlippers)
  319. End If
  320.  
  321. If keycode = RightFlipperKey Then
  322. RightFlipper.RotateToStart
  323. if tilt=false and state=true then PlaySound SoundFXDOF("FlipperDown",102,DOFOff,DOFFlippers)
  324. End If
  325.  
  326. End Sub
  327.  
  328. sub coindelay_timer
  329. playsound "click"
  330. credit=credit+1
  331. DOF 128, DOFOn
  332. if credit>25 then credit=25
  333. credtxt.text=credit
  334. coindelay.enabled=false
  335. end sub
  336.  
  337. sub coindelay2_timer
  338. playsound "click"
  339. credit=credit+1
  340. DOF 128, DOFOn
  341. if credit>25 then credit=25
  342. coindelay3.enabled=true
  343. coindelay2.enabled=false
  344. end sub
  345.  
  346. sub coindelay3_timer
  347. playsound "click"
  348. credit=credit+1
  349. DOF 128, DOFOn
  350. if credit>25 then credit=25
  351. coindelay4.enabled=true
  352. coindelay3.enabled=false
  353. end sub
  354.  
  355. sub coindelay4_timer
  356. playsound "click"
  357. credit=credit+1
  358. DOF 128, DOFOn
  359. if credit>25 then credit=25
  360. coindelay4.enabled=false
  361. end sub
  362.  
  363. sub resettimer_timer
  364. rst=rst+1
  365. for i=1 to 4
  366. reel(i).resettozero
  367. next
  368. if rst=20 then
  369. playsound "kickerkick"
  370. end if
  371. if rst=24 then
  372. newgame
  373. resettimer.enabled=false
  374. end if
  375. end sub
  376.  
  377. sub newgame
  378. credtimer.enabled=false
  379. credittxt.text="Ported To VP By Leon Spalding"
  380. state=true
  381. for i=1 to 4
  382. score(i)=0
  383. truesc(i)=0
  384. rep(i)=0
  385. next
  386. eg=0
  387. sm=0
  388. bip5.text=" "
  389. bip1.text="1"
  390. for i=0 to 9
  391. match(i).text=" "
  392. next
  393. tilttxt.text=" "
  394. gamov.text=" "
  395. bv=1
  396. bl(bv).state=lightstateon
  397. for i=1 to 5
  398. azlet(i).state=lightstateon
  399. az1(i).state=lightstateoff
  400. az2(i).state=lightstateoff
  401. next
  402. sp1.state=lightstateoff
  403. sp2.state=lightstateoff
  404. ebl.state=lightstateoff
  405. spinl.state=lightstateoff
  406. leftsidel.state=lightstateoff
  407. topl.state=lightstateoff
  408. lanekl.state=lightstateoff
  409. Bumper3l.state = 0
  410. Bumper2l.state = 0
  411. Bumper1l.state = 1
  412. uprl.state = 1
  413. upll.state = 0
  414. dbl.state=lightstateoff
  415. tilt=false
  416. tiltsens=0
  417. ballinplay=1
  418. nb.CreateBall.image="ballimage7"
  419. nb.kick 135,4
  420. DOF 113, DOFPulse
  421. end sub
  422.  
  423. Sub Drain_Hit()
  424. Drain.DestroyBall
  425. DOF 114, DOFPulse
  426. if tilt=false then
  427. br=1
  428. for i=0 to 13
  429. StopSound("fx_ballrolling" & (i))
  430. Next
  431. bonuscount.interval=200
  432. bonuscount.enabled=true
  433. else
  434. for i=0 to 13
  435. StopSound("fx_ballrolling" & (i))
  436. Next
  437. nextball
  438. end if
  439. end sub
  440.  
  441. sub bonuscount_timer
  442. if (dbl.state)=lightstateoff then bonuscount.interval=500
  443. if bv>0 then
  444. if (dbl.state)=lightstateon then
  445. addscore 10000
  446. else
  447. addscore 5000
  448. end if
  449. end if
  450. if bv=<0 then
  451. nextball
  452. br=0
  453. bonuscount.enabled=false
  454. end if
  455. end sub
  456.  
  457. sub bld
  458. bl(bv).state=lightstateoff
  459. if bv>1 then bl(bv-1).state=lightstateon
  460. bv=bv-1
  461. end sub
  462.  
  463. sub nextball
  464. if tilt=true then
  465. tilt=false
  466. tilttxt.text=" "
  467. ' bumper1.force=7
  468. ' bumper2.force=7
  469. ' bumper3.force=7
  470. leftsling.slingshotstrength=6
  471. rightsling.slingshotstrength=6
  472. end if
  473. if (shootagain.state)=lightstateon then
  474. shootagain.state=lightstateoff
  475. playsound "kickerkick"
  476. newball
  477. ballreltimer.enabled=true
  478. else
  479. currpl=currpl+1
  480. end if
  481. if currpl>playno then
  482. ballinplay=ballinplay+1
  483. if ballinplay>balls then
  484. GIOFF
  485. playsound "motorleer"
  486. eg=1
  487. ballreltimer.enabled=true
  488. else
  489. if state=true and tilt=false then
  490. play(currpl-1).state=lightstateoff
  491. currpl=1
  492. play(currpl).state=lightstateon
  493. newball
  494. playsound "kickerkick"
  495. ballreltimer.enabled=true
  496. end if
  497. select case (ballinplay)
  498. case 1:
  499. bip1.text="1"
  500. case 2:
  501. bip1.text=" "
  502. bip2.text="2"
  503. case 3:
  504. bip2.text=" "
  505. bip3.text="3"
  506. case 4:
  507. bip3.text=" "
  508. bip4.text="4"
  509. case 5:
  510. bip4.text=" "
  511. bip5.text="5"
  512. end select
  513. end if
  514. end if
  515. if currpl>1 and currpl<(playno+1) then
  516. if state=true and tilt=false then
  517. play(currpl-1).state=lightstateoff
  518. play(currpl).state=lightstateon
  519. newball
  520. playsound "kickerkick"
  521. ballreltimer.enabled=true
  522. end if
  523. end if
  524. end Sub
  525.  
  526. sub ballreltimer_timer
  527. if eg=1 then
  528. matchnum
  529. bip3.text=" "
  530. bip5.text=" "
  531. state=false
  532. plno(playno).state=lightstateoff
  533. play(currpl-1).state=lightstateoff
  534. playno=0
  535. gamov.text="GAME OVER"
  536. for i=1 to 4
  537. if balls=3 and truesc(i)>hisc1 then
  538. hisc1=truesc(i)
  539. hstxt.text=hisc1
  540. end if
  541. if balls=5 and truesc(i)>hisc2 then
  542. hisc2=truesc(i)
  543. hstxt.text=hisc2
  544. end if
  545. next
  546. savehs
  547. cred=0
  548. credtimer.enabled=true
  549. ballreltimer.enabled=false
  550. else
  551. nb.CreateBall.image="ballimage7"
  552. nb.kick 135,4
  553. DOF 113, DOFPulse
  554. ballreltimer.enabled=false
  555. end if
  556. end sub
  557.  
  558. sub newball
  559. bv=1
  560. sm=0
  561. bl(bv).state=lightstateon
  562. for i=1 to 5
  563. azlet(i).state=lightstateon
  564. az1(i).state=lightstateoff
  565. az2(i).state=lightstateoff
  566. next
  567. Bumper3l.state = 0
  568. Bumper2l.state = 0
  569. Bumper1l.state = 1
  570. uprl.state = 1
  571. upll.state = 0
  572. topl.state=lightstateoff
  573. sp1.state=lightstateoff
  574. sp2.state=lightstateoff
  575. ebl.state=lightstateoff
  576. spinl.state=lightstateoff
  577. leftsidel.state=lightstateoff
  578. lanekl.state=lightstateoff
  579. dbl.state=lightstateoff
  580. end sub
  581.  
  582. sub addscore(points)
  583. if tilt=false then
  584. bell=0
  585. ' bb2.isdropped=true
  586. if points=100 or points=10 then
  587. matchnumb=matchnumb+1
  588. if matchnumb=10 then matchnumb=0
  589. end if
  590. if points = 10 or points = 100 or points = 1000 or points=10000 then scn=1
  591. if points = 100 then
  592. reel(currpl).addvalue(100)
  593. bell=100
  594. end if
  595. if points = 10 then
  596. reel(currpl).addvalue(10)
  597. bell=10
  598. end if
  599. if points = 1000 then
  600. reel(currpl).addvalue(1000)
  601. bell=1000
  602. end if
  603. if points = 10000 then
  604. reel(currpl).addvalue(10000)
  605. bell=10000
  606. end if
  607. if points = 500 then
  608. reel(currpl).addvalue(500)
  609. scn=5
  610. bell=100
  611. end if
  612. if points = 20000 then
  613. reel(currpl).addvalue(20000)
  614. scn=2
  615. bell=10000
  616. end if
  617. if points=2000 then
  618. reel(currpl).addvalue(2000)
  619. scn=2
  620. bell=1000
  621. end if
  622. if points = 30000 then
  623. reel(currpl).addvalue(30000)
  624. scn=3
  625. bell=10000
  626. end if
  627. if points=3000 then
  628. reel(currpl).addvalue(3000)
  629. scn=3
  630. bell=1000
  631. end if
  632. if points = 40000 then
  633. reel(currpl).addvalue(40000)
  634. scn=4
  635. bell=10000
  636. end if
  637. if points=4000 then
  638. reel(currpl).addvalue(4000)
  639. scn=4
  640. bell=1000
  641. end if
  642. if points=50000 then
  643. reel(currpl).addvalue(50000)
  644. scn=5
  645. bell=10000
  646. end if
  647. if points=5000 then
  648. reel(currpl).addvalue(5000)
  649. scn=5
  650. bell=1000
  651. end if
  652. scn1=0
  653. scntimer.enabled=true
  654. score(currpl)=score(currpl)+points
  655. truesc(currpl)=truesc(currpl)+points
  656. if score(currpl)=>1000000 then
  657. score(currpl)=score(currpl)-1000000
  658. rep(currpl)=0
  659. end if
  660. if score(currpl)=>replay1 and rep(currpl)=0 then
  661. credit=credit+1
  662. DOF 128, DOFOn
  663. playsound SoundFXDOF("knocker",126,DOFPulse,DOFKnocker)
  664. DOF 127, DOFPulse
  665. if credit>25 then credit=25
  666. credtxt.text=credit
  667. rep(currpl)=1
  668. playsound "click"
  669. end if
  670. if score(currpl)=>replay2 and rep(currpl)=1 then
  671. credit=credit+1
  672. DOF 128, DOFOn
  673. playsound SoundFXDOF("knocker",126,DOFPulse,DOFKnocker)
  674. DOF 127, DOFPulse
  675. if credit>25 then credit=25
  676. credtxt.text=credit
  677. rep(currpl)=2
  678. playsound "click"
  679. end if
  680. if score(currpl)=>replay3 and rep(currpl)=2 then
  681. credit=credit+1
  682. DOF 128, DOFOn
  683. playsound SoundFXDOF("knocker",126,DOFPulse,DOFKnocker)
  684. DOF 127, DOFPulse
  685. if credit>25 then credit=25
  686. credtxt.text=credit
  687. rep(currpl)=3
  688. playsound "click"
  689. end if
  690. end if
  691. end sub
  692.  
  693. sub scntimer_timer
  694. scn1=scn1 + 1
  695. if bell=10 then playsound SoundFXDOF("bell10",141,DOFPulse,DOFChimes)
  696. if bell=100 then playsound SoundFXDOF("bell100",142,DOFPulse,DOFChimes)
  697. if bell=1000 then playsound SoundFXDOF("bell1000",143,DOFPulse,DOFChimes)
  698. if bell=10000 then playsound SoundFXDOF("bell1000low",144,DOFPulse,DOFChimes)
  699. if scn1=scn then
  700. if br=1 then bld
  701. scntimer.enabled=false
  702. end if
  703. end sub
  704.  
  705. sub matchnum
  706. select case(matchnumb)
  707. case 0:
  708. m0.text="00"
  709. case 1:
  710. m1.text="10"
  711. case 2:
  712. m2.text="20"
  713. case 3:
  714. m3.text="30"
  715. case 4:
  716. m4.text="40"
  717. case 5:
  718. m5.text="50"
  719. case 6:
  720. m6.text="60"
  721. case 7:
  722. m7.text="70"
  723. case 8:
  724. m8.text="80"
  725. case 9:
  726. m9.text="90"
  727. end select
  728. for i=1 to playno
  729. if (matchnumb*10)=(score(i) mod 100) then
  730. credit=credit+1
  731. DOF 128, DOFOn
  732. playsound SoundFXDOF("knocker",126,DOFPulse,DOFKnocker)
  733. DOF 127, DOFPulse
  734. if credit>25 then credit=25
  735. credtxt.text=credit
  736. playsound "click"
  737. end if
  738. next
  739. end sub
  740.  
  741. sub credtimer_timer
  742. cred=cred+1
  743. if cred=1 then credittxt.text="Ported To VP By Leon Spalding"
  744. if cred=2 then credittxt.text="At The Request Of Bogy"
  745. if cred=3 then credittxt.text="'F1' 3 or 5 Ball Game"
  746. if cred=4 then credittxt.text="'5' Add Coin : 'S' Start game"
  747. if cred=5 then credittxt.text="Thanx To Black (load&save)"
  748. if cred=6 then credittxt.text="Thanx To Randy Davis (guess)"
  749. if cred=7 then credittxt.text="Thanx To All At Shivas VP Forum"
  750. if cred=8 then credittxt.text="'F1' 3 or 5 Ball Game"
  751. if cred=9 then credittxt.text="'5' Add Coin : 'S' Start game"
  752. if cred=10 then credittxt.text="An 'IR Pinball' Preserved Classic"
  753. if cred=11 then credittxt.text="'IR Pinball' Are...."
  754. if cred=12 then credittxt.text="Steveir, Duglis, Danz,"
  755. if cred=13 then credittxt.text="Robair, Jay & Leon."
  756. if cred=14 then credittxt.text="www.hippie.net/shivasite/irpinball"
  757. if cred=14 then cred=0
  758. end sub
  759.  
  760.  
  761. '**************** Bonus 10 lights ***************
  762. sub bonadv
  763. bl(bv).state=lightstateoff
  764. bv=bv+1
  765. if bv>10 then bv=10
  766. bl(bv).state=lightstateon
  767. playsound "clerker"
  768. end sub
  769. '************************************************
  770.  
  771.  
  772. '************** Slingshots ***********************
  773.  
  774. Sub RightSling_Slingshot
  775. light
  776. playsound SoundFXDOF("rightsling",104,DOFPulse,DOFContactors)
  777. DOF 106, DOFPulse
  778. ' if tilt=false then PlaySound "Bumper"
  779. addscore 10
  780. Rubber3.Visible = 0
  781. Rubber3a.Visible = 1
  782. slingR.objroty = -15
  783. RStep = 2
  784. RightSling.TimerEnabled = 1
  785. End Sub
  786.  
  787. Sub RightSling_Timer
  788. Select Case RStep
  789. Case 3:Rubber3a.Visible = 0:Rubber3b.Visible = 1:slingR.objroty = -7
  790. Case 4: slingR.objroty = 0:Rubber3b.Visible = 0:Rubber3.Visible = 1:RightSling.TimerEnabled = 0
  791. End Select
  792. RStep = RStep + 1
  793. End Sub
  794.  
  795. Sub LeftSling_Slingshot
  796. light
  797. playsound SoundFXDOF("leftslingshot",103,DOFPulse,DOFContactors)
  798. DOF 105, DOFPulse
  799. ' if tilt=false then PlaySound "Bumper"
  800. addscore 10
  801. Rubber2.Visible = 0
  802. Rubber2a.Visible = 1
  803. slingL.objroty = 15
  804. LStep = 2
  805. LeftSling.TimerEnabled = 1
  806. End Sub
  807.  
  808. Sub LeftSling_Timer()
  809. Select Case LStep
  810. Case 3:Rubber2a.Visible = 0:Rubber2b.Visible = 1:slingL.objroty = 7
  811. Case 4:slingL.objroty = 0:Rubber2b.Visible = 0:Rubber2.Visible = 1:LeftSling.TimerEnabled = 0
  812. End Select
  813. LStep = LStep + 1
  814. End Sub
  815.  
  816. Sub topSling_Slingshot
  817. light
  818. playsound SoundFXDOF("leftslingshot",103,DOFPulse,DOFContactors)
  819. DOF 105, DOFPulse
  820. addscore 10
  821. LStepa = 2
  822. topSling.TimerEnabled = 1
  823. End Sub
  824.  
  825. Sub topSling_Timer()
  826. Select Case LStepa
  827. Case 2:Rubber12.Visible = 0:Rubber12a.Visible = 1
  828. Case 3:Rubber12a.Visible = 0:Rubber12b.Visible = 1
  829. Case 4:Rubber12b.Visible = 0:Rubber12c.Visible = 1
  830. Case 5:Rubber12c.Visible = 0:Rubber12b.Visible = 1
  831. Case 6:Rubber12b.Visible = 0:Rubber12c.Visible = 1
  832. Case 7:Rubber12c.Visible = 0:Rubber12.Visible = 1:topSling.TimerEnabled = 0
  833. End Select
  834. LStepa = LStepa + 1
  835. End Sub
  836.  
  837. sub topslingL_slingshot
  838. light
  839. playsound SoundFXDOF("leftslingshot",103,DOFPulse,DOFContactors)
  840. addscore 10
  841. end sub
  842.  
  843. Sub topslingL2_Slingshot
  844. light
  845. playsound SoundFXDOF("leftslingshot",103,DOFPulse,DOFContactors)
  846. DOF 105, DOFPulse
  847. addscore 10
  848. LStepb = 2
  849. topslingL2.TimerEnabled = 1
  850. End Sub
  851.  
  852. Sub topslingL2_Timer()
  853. Select Case LStepb
  854. Case 2:Rubber8.Visible = 0:Rubber8a.Visible = 1
  855. Case 3:Rubber8a.Visible = 0:Rubber8b.Visible = 1
  856. Case 4:Rubber8b.Visible = 0:Rubber8c.Visible = 1
  857. Case 5:Rubber8c.Visible = 0:Rubber8b.Visible = 1
  858. Case 6:Rubber8b.Visible = 0:Rubber8c.Visible = 1
  859. Case 7:Rubber8c.Visible = 0:Rubber8.Visible = 1:topslingL2.TimerEnabled = 0
  860. End Select
  861. LStepb = LStepb + 1
  862. End Sub
  863.  
  864.  
  865. sub topslingR_slingshot
  866. light
  867. playsound SoundFXDOF("rightslingshot",103,DOFPulse,DOFContactors)
  868. addscore 10
  869. end sub
  870.  
  871.  
  872. Sub sideSling_Slingshot
  873. light
  874. playsound SoundFXDOF("leftslingshot",103,DOFPulse,DOFContactors)
  875. DOF 105, DOFPulse
  876. addscore 10
  877. RStepa = 2
  878. sideSling.TimerEnabled = 1
  879. End Sub
  880.  
  881. Sub sideSling_Timer()
  882. Select Case RStepa
  883. Case 2:Rubber22.Visible = 0:Rubber22a.Visible = 1
  884. Case 3:Rubber22a.Visible = 0:Rubber22b.Visible = 1
  885. Case 4:Rubber22b.Visible = 0:Rubber22c.Visible = 1
  886. Case 5:Rubber22c.Visible = 0:Rubber22b.Visible = 1
  887. Case 6:Rubber22b.Visible = 0:Rubber22c.Visible = 1
  888. Case 7:Rubber22c.Visible = 0:Rubber22.Visible = 1:sideSling.TimerEnabled = 0
  889. End Select
  890. RStepa = RStepa + 1
  891. End Sub
  892.  
  893. Sub sideSlingR1_Slingshot
  894. light
  895. playsound SoundFXDOF("Rightslingshot",103,DOFPulse,DOFContactors)
  896. DOF 105, DOFPulse
  897. addscore 10
  898. RStepb = 2
  899. sideSlingR1.TimerEnabled = 1
  900. End Sub
  901.  
  902. Sub sideSlingR1_Timer()
  903. Select Case RStepb
  904. Case 2:Rubber23.Visible = 0:Rubber23a.Visible = 1
  905. Case 3:Rubber23a.Visible = 0:Rubber23b.Visible = 1
  906. Case 4:Rubber23b.Visible = 0:Rubber23c.Visible = 1
  907. Case 5:Rubber23c.Visible = 0:Rubber23b.Visible = 1
  908. Case 6:Rubber23b.Visible = 0:Rubber23c.Visible = 1
  909. Case 7:Rubber23c.Visible = 0:Rubber23.Visible = 1:sideSlingR1.TimerEnabled = 0
  910. End Select
  911. RStepb = RStepb + 1
  912. End Sub
  913.  
  914. Sub sideSlingR2_Slingshot
  915. RStepc = 2
  916. sideSlingR2.TimerEnabled = 1
  917. End Sub
  918.  
  919. Sub sideSlingR2_Timer()
  920. Select Case RStepc
  921. Case 2:Rubber19.Visible = 0:Rubber19a.Visible = 1
  922. Case 3:Rubber19a.Visible = 0:Rubber19b.Visible = 1
  923. Case 4:Rubber19b.Visible = 0:Rubber19c.Visible = 1
  924. Case 5:Rubber19c.Visible = 0:Rubber19b.Visible = 1
  925. Case 6:Rubber19b.Visible = 0:Rubber19c.Visible = 1
  926. Case 7:Rubber19c.Visible = 0:Rubber19.Visible = 1:sideSlingR2.TimerEnabled = 0
  927. End Select
  928. RStepc = RStepc + 1
  929. End Sub
  930.  
  931. Sub sideSlingL1_Slingshot
  932. LStepc = 2
  933. sideSlingL1.TimerEnabled = 1
  934. End Sub
  935.  
  936. Sub sideSlingL1_Timer()
  937. Select Case LStepc
  938. Case 2:Rubber5.Visible = 0:Rubber5a.Visible = 1
  939. Case 3:Rubber5a.Visible = 0:Rubber5b.Visible = 1
  940. Case 4:Rubber5b.Visible = 0:Rubber5c.Visible = 1
  941. Case 5:Rubber5c.Visible = 0:Rubber5b.Visible = 1
  942. Case 6:Rubber5b.Visible = 0:Rubber5c.Visible = 1
  943. Case 7:Rubber5c.Visible = 0:Rubber5.Visible = 1:sideSlingL1.TimerEnabled = 0
  944. End Select
  945. LStepc = LStepc + 1
  946. End Sub
  947.  
  948. '******************************************************************************
  949.  
  950. sub rbut_hit
  951. lbutt01.state = 1
  952. addscore 100
  953. butt03.z=-1.5
  954. end sub
  955. sub rbut_unhit
  956. 'butt03.z=0.5
  957. cc=0
  958. rbut0.Enabled = 1
  959. lbutt01.state = 0
  960. end sub
  961.  
  962. dim cc
  963. cc=0
  964.  
  965. sub rbut0_Timer()
  966. Select Case cc
  967. Case 0:butt03.z=-1.3
  968. Case 1:butt03.z=-0.8
  969. Case 2:butt03.z=-0.3
  970. Case 3:butt03.z=0.2
  971. Case 4:butt03.z=0.4
  972. Case 5:butt03.z=0.5:rbut0.enabled = 0
  973. End Select
  974. CC=cc+1
  975. end sub
  976.  
  977. sub lbut_hit
  978. lbutt03.state = 1
  979. addscore 100
  980. butt01.z=-1.5
  981. end sub
  982. sub lbut_unhit
  983. ' butt01.z=0.5
  984. ccc=0
  985. rbut00.Enabled = 1
  986. lbutt03.state = 0
  987. end sub
  988.  
  989. dim ccc
  990. ccc=0
  991.  
  992. sub rbut00_Timer()
  993. Select Case ccc
  994. Case 0:butt01.z=-1.3
  995. Case 1:butt01.z=-0.8
  996. Case 2:butt01.z=-0.3
  997. Case 3:butt01.z=0.2
  998. Case 4:butt01.z=0.4
  999. Case 5:butt01.z=0.5:rbut00.enabled = 0
  1000. End Select
  1001. CCC=ccc+1
  1002. end sub
  1003.  
  1004.  
  1005. sub leftin_hit
  1006. DOF 119, DOFPulse
  1007. addscore 5000
  1008. end sub
  1009.  
  1010. sub rightin_hit
  1011. DOF 120, DOFPulse
  1012. addscore 5000
  1013. end sub
  1014.  
  1015. sub rightout_hit
  1016. DOF 121, DOFPulse
  1017. if (sp2.state)=lightstateon then
  1018. credit=credit+1
  1019. DOF 128, DOFOn
  1020. playsound SoundFXDOF("knocker",126,DOFPulse,DOFKnocker)
  1021. DOF 127, DOFPulse
  1022. if credit>25 then credit=25
  1023. credtxt.text=credit
  1024. playsound "click"
  1025. else
  1026. addscore 10000
  1027. bonadv
  1028. end if
  1029. end sub
  1030.  
  1031. sub leftout_hit
  1032. DOF 118, DOFPulse
  1033. if (sp1.state)=lightstateon then
  1034. credit=credit+1
  1035. DOF 128, DOFOn
  1036. playsound SoundFXDOF("knocker",126,DOFPulse,DOFKnocker)
  1037. DOF 127, DOFPulse
  1038. if credit>25 then credit=25
  1039. credtxt.text=credit
  1040. playsound "click"
  1041. else
  1042. addscore 10000
  1043. bonadv
  1044. end if
  1045. end sub
  1046.  
  1047. sub spinner1_spin
  1048. DOF 129, DOFPulse
  1049. PlaySound "spinner", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1050. if (spinl.state)=lightstateon then
  1051. addscore 1000
  1052. else
  1053. addscore 100
  1054. end if
  1055. end sub
  1056.  
  1057. sub cbut_hit
  1058. lbutt02.state = 1
  1059. bonadv
  1060. butt02.z=-1.5
  1061. end sub
  1062. sub cbut_unhit
  1063. lbutt02.state = 0
  1064. ' butt02.z=0.5
  1065. cccc=0
  1066. rbut000.Enabled = 1
  1067. end sub
  1068.  
  1069. dim cccc
  1070. cccc=0
  1071.  
  1072. sub rbut000_Timer()
  1073. Select Case cccc
  1074. Case 0:butt02.z=-1.3
  1075. Case 1:butt02.z=-0.8
  1076. Case 2:butt02.z=-0.3
  1077. Case 3:butt02.z=0.2
  1078. Case 4:butt02.z=0.4
  1079. Case 5:butt02.z=0.5:rbut000.enabled = 0
  1080. End Select
  1081. CCCC=cccc+1
  1082. end sub
  1083.  
  1084.  
  1085. sub laneK_hit
  1086. if (lanekl.state)=lightstateon then dbl.state=lightstateon
  1087. if sm>0 then
  1088. addscore (10000*sm)
  1089. else
  1090. addscore 1000
  1091. end if
  1092. playsound "kickerkick"
  1093. kickertimer.enabled=true
  1094. end sub
  1095.  
  1096. sub kickertimer_timer
  1097. lanek.kick 0,18
  1098. kickertimer.enabled=false
  1099. end sub
  1100.  
  1101. sub leftside_hit
  1102. if (leftsidel.state)=lightstateon then dbl.state=lightstateon
  1103. bonadv
  1104. end sub
  1105.  
  1106. sub bumper1_hit
  1107. if tilt=false then playsound SoundFXDOF("jet2",109,DOFPulse,DOFContactors)
  1108. DOF 110, DOFPulse
  1109. if (Bumper1l.state)=lightstateon then
  1110. addscore 1000
  1111. else
  1112. addscore 100
  1113. end if
  1114. end sub
  1115.  
  1116. sub bumper2_hit
  1117. if tilt=false then playsound SoundFXDOF("jet2",107,DOFPulse,DOFContactors)
  1118. DOF 108, DOFPulse
  1119. if (bumper2l.state)=lightstateon then
  1120. addscore 1000
  1121. else
  1122. addscore 100
  1123. end if
  1124. end sub
  1125.  
  1126. sub bumper3_hit
  1127. if tilt=false then playsound SoundFXDOF("jet2",111,DOFPulse,DOFContactors)
  1128. DOF 112, DOFPulse
  1129. if (bumper3l.state)=lightstateon then
  1130. addscore 1000
  1131. else
  1132. addscore 100
  1133. end if
  1134. end sub
  1135.  
  1136. sub top_hit
  1137. topt.transx = -10:Me.TimerEnabled = 1:PlaySound SoundFXDOF("target",125,DOFPulse,DOFTargets)
  1138. if (topl.state)=lightstateon then bonadv
  1139. addscore 1000
  1140. end sub
  1141. Sub top_Timer():topt.transx = 0:Me.TimerEnabled = 0:End Sub
  1142.  
  1143.  
  1144. sub upl_hit
  1145. DOF 115, DOFPulse
  1146. if (upll.state)=lightstateon then bonadv
  1147. addscore 1000
  1148. end sub
  1149.  
  1150. sub upr_hit
  1151. DOF 117, DOFPulse
  1152. if (uprl.state)=lightstateon then bonadv
  1153. addscore 1000
  1154. end sub
  1155.  
  1156. sub upc_hit
  1157. DOF 116, DOFPulse
  1158. addscore 1000
  1159. ' bumper1.state=lightstateon
  1160. spinl.state=lightstateon
  1161. if (upcl.state)=lightstateon then
  1162. ' upll.state=lightstateon
  1163. upcl.state=lightstateoff
  1164. al1.state=lightstateon
  1165. al2.state=lightstateon
  1166. sm=sm+1
  1167. end if
  1168. checkaward
  1169. end sub
  1170.  
  1171. sub midl_hit
  1172. midlt.transx = -10:Me.TimerEnabled = 1:PlaySound SoundFXDOF("target",122,DOFPulse,DOFTargets)
  1173. addscore 1000
  1174. ' bumper2.state=lightstateon
  1175. if (midll.state)=lightstateon then
  1176. uprl.state=lightstateon
  1177. midll.state=lightstateoff
  1178. zl1.state=lightstateon
  1179. zl2.state=lightstateon
  1180. sm=sm+1
  1181. end if
  1182. checkaward
  1183. end sub
  1184. Sub midl_Timer():midlt.transx = 0:Me.TimerEnabled = 0:End Sub
  1185.  
  1186. sub midr_hit
  1187. midrt.transx = -10:Me.TimerEnabled = 1:PlaySound SoundFXDOF("target",124,DOFPulse,DOFTargets)
  1188. addscore 1000
  1189. ' bumper3.state=lightstateon
  1190. if (midrl.state)=lightstateon then
  1191. topl.state=lightstateon
  1192. midrl.state=lightstateoff
  1193. tl1.state=lightstateon
  1194. tl2.state=lightstateon
  1195. sm=sm+1
  1196. end if
  1197. checkaward
  1198. end sub
  1199. Sub midr_Timer():midrt.transx = 0:Me.TimerEnabled = 0:End Sub
  1200.  
  1201. sub lowl_hit
  1202. lowlt.transx = -10:Me.TimerEnabled = 1:PlaySound SoundFXDOF("target",122,DOFPulse,DOFTargets)
  1203. addscore 1000
  1204. if (lowll.state)=lightstateon then
  1205. lowll.state=lightstateoff
  1206. el1.state=lightstateon
  1207. el2.state=lightstateon
  1208. sm=sm+1
  1209. end if
  1210. checkaward
  1211. end sub
  1212. Sub lowl_Timer():lowlt.transx = 0:Me.TimerEnabled = 0:End Sub
  1213.  
  1214. sub lowr_hit
  1215. lowrt.transx = -10:Me.TimerEnabled = 1:PlaySound SoundFXDOF("target",124,DOFPulse,DOFTargets)
  1216. addscore 1000
  1217. if (lowrl.state)=lightstateon then
  1218. lowrl.state=lightstateoff
  1219. cl1.state=lightstateon
  1220. cl2.state=lightstateon
  1221. sm=sm+1
  1222. end if
  1223. checkaward
  1224. end sub
  1225. Sub lowr_Timer():lowrt.transx = 0:Me.TimerEnabled = 0:End Sub
  1226.  
  1227. sub midc_hit
  1228. midct.transx = -10:Me.TimerEnabled = 1:PlaySound SoundFXDOF("target",123,DOFPulse,DOFTargets)
  1229. if (ebl.state)=lightstateon then
  1230. shootagain.state=lightstateon
  1231. ebl.state=lightstateoff
  1232. end if
  1233. if sm>0 then
  1234. addscore (1000*sm)
  1235. else
  1236. addscore 500
  1237. end if
  1238. bonadv
  1239. end sub
  1240. Sub midc_Timer():midct.transx = 0:Me.TimerEnabled = 0:End Sub
  1241.  
  1242.  
  1243. sub checkaward
  1244. if (al1.state)=lightstateon and (zl1.state)=lightstateon and (tl1.state)=lightstateon then
  1245. ebl.state=lightstateon
  1246. end if
  1247. if (al1.state)=lightstateon and (zl1.state)=lightstateon and (tl1.state)=lightstateon and bv=10 then
  1248. sp1.state=lightstateon
  1249. sp2.state=lightstateon
  1250. end if
  1251. if (zl1.state)=lightstateon and (tl1.state)=lightstateon then
  1252. leftsidel.state=lightstateon
  1253. lanekl.state=lightstateon
  1254. end if
  1255. end sub
  1256.  
  1257. Sub CheckTilt
  1258. If Tilttimer.Enabled = True Then
  1259. TiltSens = TiltSens + 1
  1260. if TiltSens = 10 Then
  1261. Tilt = True
  1262. tilttxt.text="TILT"
  1263. playsound "tilt"
  1264. savehs
  1265. turnoff
  1266. End If
  1267. Else
  1268. TiltSens = 0
  1269. Tilttimer.Enabled = True
  1270. End If
  1271. End Sub
  1272.  
  1273. Sub Tilttimer_Timer()
  1274. Tilttimer.Enabled = False
  1275. End Sub
  1276.  
  1277. sub turnoff
  1278. bl(bv).state=lightstateoff
  1279. for i=1 to 5
  1280. azlet(i).state=lightstateoff
  1281. az1(i).state=lightstateoff
  1282. az2(i).state=lightstateoff
  1283. next
  1284. sp1.state=lightstateoff
  1285. sp2.state=lightstateoff
  1286. ebl.state=lightstateoff
  1287. spinl.state=lightstateoff
  1288. leftsidel.state=lightstateoff
  1289. topl.state=lightstateoff
  1290. lanekl.state=lightstateoff
  1291. Bumper3l.state = 0
  1292. Bumper2l.state = 0
  1293. Bumper1l.state = 0
  1294. uprl.state = 0
  1295. upll.state = 0
  1296. dbl.state=lightstateoff
  1297. leftsling.slingshotstrength=0
  1298. rightsling.slingshotstrength=0
  1299. end sub
  1300.  
  1301. sub savehs
  1302. ' Based on Black's Highscore routines
  1303. Dim FileObj
  1304. Dim ScoreFile
  1305. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1306. If Not FileObj.FolderExists(UserDirectory) then
  1307. Exit Sub
  1308. End if
  1309. Set ScoreFile=FileObj.CreateTextFile(UserDirectory & "aztec.txt",True)
  1310. ScoreFile.WriteLine credit
  1311. ScoreFile.WriteLine score(1)
  1312. ScoreFile.WriteLine matchnumb
  1313. scorefile.writeline balls
  1314. scorefile.writeline score(2)
  1315. scorefile.writeline score(3)
  1316. scorefile.writeline score(4)
  1317. scorefile.writeline hisc1
  1318. scorefile.writeline hisc2
  1319. ScoreFile.Close
  1320. Set ScoreFile=Nothing
  1321. Set FileObj=Nothing
  1322. end sub
  1323.  
  1324. sub loadhs
  1325. ' Based on Black's Highscore routines
  1326. Dim FileObj
  1327. Dim ScoreFile
  1328. dim temp1
  1329. dim temp2
  1330. dim temp3
  1331. dim temp4
  1332. dim temp5
  1333. dim temp6
  1334. dim temp7
  1335. dim temp8
  1336. dim temp9
  1337. Set FileObj=CreateObject("Scripting.FileSystemObject")
  1338. If Not FileObj.FolderExists(UserDirectory) then
  1339. Exit Sub
  1340. End if
  1341. If Not FileObj.FileExists(UserDirectory & "aztec.txt") then
  1342. Exit Sub
  1343. End if
  1344. Set ScoreFile=FileObj.GetFile(UserDirectory & "aztec.txt")
  1345. Set TextStr=ScoreFile.OpenAsTextStream(1,0)
  1346. If (TextStr.AtEndOfStream=True) then
  1347. Exit Sub
  1348. End if
  1349. temp1=TextStr.ReadLine
  1350. temp2=Textstr.ReadLine
  1351. temp3=Textstr.ReadLine
  1352. temp4=textstr.readline
  1353. temp5=textstr.readline
  1354. temp6=Textstr.ReadLine
  1355. temp7=textstr.readline
  1356. temp8=textstr.readline
  1357. temp9=textstr.readline
  1358. TextStr.Close
  1359. credit = CDbl(temp1)
  1360. If credit > 0 Then DOF 128, DOFOn
  1361. score(1) = CDbl(temp2)
  1362. matchnumb=cdbl(temp3)
  1363. balls=cdbl(temp4)
  1364. score(2)=cdbl(temp5)
  1365. score(3)=cdbl(temp6)
  1366. score(4)=cdbl(temp7)
  1367. hisc1=cdbl(temp8)
  1368. hisc2=cdbl(temp9)
  1369. Set ScoreFile=Nothing
  1370. Set FileObj=Nothing
  1371. end sub
  1372.  
  1373. sub ballrel_hit
  1374. if ballrelenabled=1 then
  1375. playsound "launchball"
  1376. ballrelenabled=0
  1377. end if
  1378. end sub
  1379.  
  1380. sub ballhome_hit
  1381. ballrelenabled=1
  1382. end sub
  1383.  
  1384. sub test_timer
  1385. 'LightSeq1.play seqalloff
  1386. end Sub
  1387.  
  1388.  
  1389.  
  1390. '********************** Backglass script *****************
  1391.  
  1392. sub Scoreb2s_timer()
  1393.  
  1394. '********** Scores B2S ************
  1395. if B2SOn Then
  1396. Controller.B2SSetScore 1, Score(1)
  1397. Controller.B2SSetScore 2, Score(2)
  1398. Controller.B2SSetScore 3, Score(3)
  1399. Controller.B2SSetScore 4, Score(4)
  1400. Controller.B2SSetCredits credit
  1401. Controller.B2SSetCanPlay playno
  1402. if ballinplay>0 and ballinplay<(balls+1) then
  1403. Controller.B2SSetPlayerUp currpl
  1404. Controller.B2SSetBallInPlay ballinplay
  1405. end if
  1406.  
  1407. '********** active PLayer's light in game ************
  1408. if currpl=0 Then
  1409. if ballinplay>0 and ballinplay<(balls+1) then
  1410. Controller.B2SSetData 25, 1
  1411. end if
  1412. else
  1413. Controller.B2SSetData 25, 0
  1414. end If
  1415. if currpl=1 Then
  1416. if ballinplay>0 and ballinplay<(balls+1) then
  1417. Controller.B2SSetData 26, 1
  1418. end if
  1419. else
  1420. Controller.B2SSetData 26, 0
  1421. end If
  1422. if currpl=2 Then
  1423. if ballinplay>0 and ballinplay<(balls+1) then
  1424. Controller.B2SSetData 27, 1
  1425. end if
  1426. else
  1427. Controller.B2SSetData 27, 0
  1428. end If
  1429. if currpl=3 Then
  1430. if ballinplay>0 and ballinplay<(balls+1) then
  1431. Controller.B2SSetData 28, 1
  1432. end if
  1433. else
  1434. Controller.B2SSetData 28, 0
  1435. end If
  1436.  
  1437. '********** Tilt & ball in pley ************
  1438.  
  1439. if Tilt = True then
  1440. Controller.B2SSetTilt 33, 1
  1441. Else
  1442. Controller.B2SSetTilt 33, 0
  1443. end If
  1444. End If
  1445.  
  1446. '********** Game Over ************
  1447. If ballinplay<1 or ballinplay>balls then
  1448. Controller.B2SSetBallInPlay 0
  1449. If B2SOn Then Controller.B2SSetData 35, 1: Controller.B2SSetPlayerUp 0
  1450.  
  1451. Else
  1452. If B2SOn Then
  1453. Controller.B2SSetData 35, 0
  1454. Controller.B2SSetData 10, 0
  1455. Controller.B2SSetData 11, 0
  1456. End If
  1457.  
  1458. end If
  1459. end Sub
  1460. '**************************************************
  1461.  
  1462.  
  1463.  
  1464. '***************** Light routine ******************
  1465. sub light
  1466. if Uprl.state = 1 then
  1467. Bumper3l.state = 1
  1468. Bumper2l.state = 1
  1469. Bumper1l.state = 0
  1470. uprl.state = 0
  1471. upll.state = 1
  1472. else
  1473. Bumper3l.state = 0
  1474. Bumper2l.state = 0
  1475. Bumper1l.state = 1
  1476. uprl.state = 1
  1477. upll.state = 0
  1478. end if
  1479. end Sub
  1480.  
  1481. '*********************** GI **************************
  1482. sub GIOFF
  1483. shadows.visible = 0
  1484. For each xx in GI:xx.state=0:next
  1485. end Sub
  1486.  
  1487. sub GION
  1488. shadows.visible = 1
  1489. For each xx in GI:xx.state=1:next
  1490. end Sub
  1491.  
  1492. '************ Flipper Shadows from Ninuzzu ************
  1493. Sub flippers_Timer()
  1494. RollingSoundUpdate
  1495. BallShadowUpdate
  1496. LeftFlipperSh.RotZ = leftflipper.currentangle
  1497. RightFlipperSh.RotZ = RightFlipper.currentangle
  1498. if credit = 0 then
  1499. creditlight.state = 0
  1500. Else
  1501. creditlight.state = 1
  1502. end if
  1503. rmupdate
  1504. end Sub
  1505.  
  1506.  
  1507.  
  1508. ' *********************************************************************
  1509. ' Supporting Ball & Sound Functions
  1510. ' *********************************************************************
  1511.  
  1512. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1513. Vol = Csng(BallVel(ball) ^2 / 2)
  1514. End Function
  1515.  
  1516. Function Vol2(ball1, ball2) ' Calculates the Volume of the sound based on the speed of two balls
  1517. Vol2 = (Vol(ball1) + Vol(ball2) ) / 2
  1518. End Function
  1519.  
  1520. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1521. Dim tmp
  1522. tmp = ball.x * 2 / table1.width-1
  1523. If tmp> 0 Then
  1524. Pan = Csng(tmp ^10)
  1525. Else
  1526. Pan = Csng(-((- tmp) ^10) )
  1527. End If
  1528. End Function
  1529.  
  1530. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1531. Pitch = BallVel(ball) * 20
  1532. End Function
  1533.  
  1534. Function BallVel(ball) 'Calculates the ball speed
  1535. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ))
  1536. End Function
  1537.  
  1538.  
  1539. '**************************************************************
  1540. '************************ Sounds ************************
  1541. '**************************************************************
  1542.  
  1543. 'Sounds
  1544. dim rt, rb 'ramp top and ramp bottom
  1545.  
  1546. dim speedx
  1547. dim speedy
  1548. dim finalspeed
  1549. Sub RHSND_Hit(IDX)
  1550. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1551. if finalspeed > 11 then PlaySound "rubber" else PlaySound "rubberFlipper":end if
  1552. End Sub
  1553. Sub Gates_Hit(IDX):RandomSoundGates():End Sub
  1554. Sub LeftFlipper_Collide(parm)
  1555. RandomSoundRubber()
  1556. End Sub
  1557. Sub RightFlipper_Collide(parm)
  1558. RandomSoundRubber()
  1559. End Sub
  1560.  
  1561. Sub Ramp42_hit()
  1562. RandomSoundMetal()
  1563. End Sub
  1564. Sub Ramp5_hit()
  1565. RandomSoundMetal()
  1566. End Sub
  1567.  
  1568.  
  1569. ' sub trigentreerampebefore_unHit()
  1570. '
  1571. ' if rb=1 then
  1572. ' rb=0
  1573. ' stopsound "sramp2"
  1574. ' playsound "launchballreturn01"
  1575. ' end if
  1576. ' end Sub
  1577. '
  1578. ' sub trigentreerampe_unHit()
  1579. ' if plb=1 and rb = 0 Then
  1580. ' plb=0
  1581. ' stopsound "launchball01"
  1582. ' end If
  1583. '
  1584. ' if rb=0 then
  1585. ' PlaySound "sramp2"
  1586. ' rb=1
  1587. ' end if
  1588. ' end Sub
  1589. '
  1590. ' sub sortierampe1_unHit()
  1591. ' PlaySound "DROP_RIGHT"
  1592. ' stopsound "sramp2"
  1593. '
  1594. ' rb=0
  1595. ' end Sub
  1596.  
  1597. ' sub Ramp1_unhit()
  1598. ' StopSound "sramp2"
  1599. ' PlaySound"DROP_RIGHT"
  1600. ' end Sub
  1601. '
  1602. ' Sub RampHelp_Hit():PlaySound"rail":End Sub
  1603. ' Sub RampHelp1_Hit():PlaySound"DROP_RIGHT":End Sub
  1604. ' Sub RampHelp2_Hit():stopsound "ramp":PlaySound"DROP_LEFT":End Sub
  1605. ' Sub RampHelp3_Hit():stopsound "ramp":PlaySound"DROP_RIGHT":End Sub
  1606. '
  1607. ' Sub RampHelp3_UnHit(): PlaySound"DROP_LEFT":End Sub
  1608. '
  1609. ' sub trigger1_hit()
  1610. ' playsound "sramp2", 0, Vol(activeball)*0.005*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball)*25, 0, 0
  1611. ' end sub
  1612. '
  1613. ' sub Trigger1_unhit()
  1614. ' stopsound "sramp2"
  1615. ' end sub
  1616. '
  1617. ' sub trigger2_hit()
  1618. ' playsound "sramp2", 0, Vol(activeball)*0.005*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball)*22, 0, 0
  1619. ' end sub
  1620. '
  1621. ' sub Trigger2_unhit()
  1622. ' stopsound "sramp2"
  1623. ' end sub
  1624.  
  1625.  
  1626. Sub Metal_Hit (idx)
  1627. RandomSoundMetal()
  1628. End Sub
  1629.  
  1630. Sub plastic_Hit (idx)
  1631. PlaySound "plastic", 0, Vol(activeball), Pan(activeball), 0, Pitch(activeball), 1, 0
  1632. End Sub
  1633.  
  1634. Sub Gates_Hit(IDX):RandomSoundGates():End Sub
  1635.  
  1636.  
  1637. Sub Rubber_Hit(idx)
  1638. dim finalspeed
  1639. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1640. If finalspeed > 20 then
  1641. PlaySound "rubber_hit_1", 0, Vol(activeball)*20*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1642. End if
  1643. If finalspeed >= 1 AND finalspeed <= 20 then
  1644. RandomSoundRubber()
  1645. End If
  1646. End Sub
  1647.  
  1648. sub Triggermetal1_hit()
  1649. PlaySound "metalhit2", 0, Vol(activeball)*10*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1650. end sub
  1651. sub Triggermetal2_hit()
  1652. PlaySound "metalhit3", 0, Vol(activeball)*10*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1653. end sub
  1654.  
  1655. Sub RandomSoundMetal()
  1656. Select Case Int(Rnd*3)+1
  1657. Case 1 : PlaySound "metalhit1", 0, Vol(activeball)*10*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1658. Case 2 : PlaySound "metalhit2", 0, Vol(activeball)*10*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1659. Case 3 : PlaySound "metalhit3", 0, Vol(activeball)*10*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1660. End Select
  1661. End Sub
  1662.  
  1663. Sub RandomSoundRubber()
  1664. Select Case Int(Rnd*3)+1
  1665. Case 1 : PlaySound "rubber_hit_1", 0, Vol(activeball)*13*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1666. Case 2 : PlaySound "rubber_hit_2", 0, Vol(activeball)*11*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1667. Case 3 : PlaySound "rubber_hit_3", 0, Vol(activeball)*12*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1668. End Select
  1669. End Sub
  1670.  
  1671. Sub RandomSoundGates()
  1672. Select Case Int(Rnd*2)+1
  1673. Case 1 : PlaySound "Gate", 0, Vol(activeball)*10*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1674. Case 2 : PlaySound "Gate4", 0, Vol(activeball)*10*GlobalSoundLevel , pan(activeball), 0, Pitch(activeball), 0, 0
  1675. End Select
  1676. End Sub
  1677.  
  1678. Sub RandomSoundFlipper()
  1679. Select Case Int(Rnd*3)+1
  1680. Case 1 :PlaySound "flip_hit_1", 0, GlobalSoundLevel * ballvel(activeball) / 50, -0.1, 0.25
  1681. Case 2 :PlaySound "flip_hit_2", 0, GlobalSoundLevel * ballvel(activeball) / 50, -0.1, 0.25
  1682. Case 3 :PlaySound "flip_hit_3", 0, GlobalSoundLevel * ballvel(activeball) / 50, -0.1, 0.25
  1683. End Select
  1684. End Sub
  1685.  
  1686. '*******************************************************************************************
  1687.  
  1688. '*********** ROLLING SOUND *********************************
  1689. ReDim rolling(tnob)
  1690. InitRolling
  1691. Sub InitRolling:Dim i:For i=0 to (tnob-1):rolling(i) = False:Next:End Sub
  1692.  
  1693. Sub RollingSoundUpdate
  1694. Dim BOT, b
  1695. BOT = GetBalls
  1696. ' stop the sound of deleted balls
  1697. If UBound(BOT)<(tnob-1) Then
  1698. For b = (UBound(BOT) + 1) to (tnob-1)
  1699. rolling(b) = False
  1700. StopSound("fx_ballrolling" & (b+1))
  1701. Next
  1702. End If
  1703. ' exit the Sub if no balls on the table
  1704. If UBound(BOT) = -1 Then Exit Sub
  1705. ' play the rolling sound for each ball
  1706. For b = 0 to UBound(BOT)
  1707. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1708. rolling(b) = True
  1709. PlaySound "fx_ballrolling" & (b+1), -1, Vol(BOT(b)), Pan(BOT(b)), 0, Pitch(BOT(b)), 1, 0
  1710. Else
  1711. If rolling(b) = True Then
  1712. StopSound("fx_ballrolling" & (b+1))
  1713. rolling(b) = False
  1714. End If
  1715. End If
  1716. Next
  1717. End Sub
  1718.  
  1719.  
  1720. '*********** BALL SHADOW *********************************
  1721. Const tnob = 1 ' total number of balls for this table (at the same time)
  1722. ReDim BallShadow(tnob-1)
  1723. InitBallShadow
  1724.  
  1725. Sub InitBallShadow
  1726. Dim i:For i = 0 to tnob-1
  1727. ExecuteGlobal "Set BallShadow(" & i & ") = BallShadow" & (i+1) & " :"
  1728. Next
  1729. End Sub
  1730.  
  1731. Sub BallShadowUpdate
  1732. Dim BOT, b
  1733. BOT = GetBalls
  1734. ' hide shadow of deleted balls
  1735. If UBound(BOT)<(tnob-1) Then
  1736. For b = (UBound(BOT) + 1) to (tnob-1)
  1737. BallShadow(b).visible = 0
  1738. Next
  1739. End If
  1740. ' exit the Sub if no balls on the table
  1741. If UBound(BOT) = -1 Then Exit Sub
  1742. ' render the shadow for each ball
  1743. For b = 0 to UBound(BOT)
  1744. If BOT(b).X < Table1.Width/2 Then
  1745. BallShadow(b).X = ((BOT(b).X))+10' - (50/6) + ((BOT(b).X - (Table1.Width/2))/7)) -2'+ 10
  1746. Else
  1747. BallShadow(b).X = ((BOT(b).X))-10' + (50/6) + ((BOT(b).X - (Table1.Width/2))/7)) +2'- 10
  1748. End If
  1749. ballShadow(b).Y = BOT(b).Y + 20
  1750. If BOT(b).Z > 20 Then
  1751. BallShadow(b).visible = 1
  1752. Else
  1753. BallShadow(b).visible = 0
  1754. End If
  1755. Next
  1756. End Sub
  1757.  
  1758. '************************ Reflection Mod ***************************
  1759.  
  1760. Sub RMUpdate
  1761. if shootagain.state = 1 then shootagainz.state = 1 else shootagainz.state = 0:end If
  1762. if sp1.state = 1 then sp1z.state = 1 else sp1z.state = 0:end If
  1763. if Lowll.state = 1 then Lowllz.state = 1 else Lowllz.state = 0:end If
  1764. if midll.state = 1 then midllz.state = 1 else midllz.state = 0:end If
  1765. if spinl.state = 1 then spinlz.state = 1 else spinlz.state = 0:end If
  1766. if b5k.state = 1 then b5kz.state = 1 else b5kz.state = 0:end If
  1767. if b10k.state = 1 then b10kz.state = 1 else b10kz.state = 0:end If
  1768. if b15k.state = 1 then b15kz.state = 1 else b15kz.state = 0:end If
  1769. if b20k.state = 1 then b20kz.state = 1 else b20kz.state = 0:end If
  1770. if b25k.state = 1 then b25kz.state = 1 else b25kz.state = 0:end If
  1771. if dbl.state = 1 then dblz.state = 1 else dblz.state = 0:end If
  1772. if b30k.state = 1 then b30kz.state = 1 else b30kz.state = 0:end If
  1773. if b35k.state = 1 then b35kz.state = 1 else b35kz.state = 0:end If
  1774. if b40k.state = 1 then b40kz.state = 1 else b40kz.state = 0:end If
  1775. if b45k.state = 1 then b45kz.state = 1 else b45kz.state = 0:end If
  1776. if b50k.state = 1 then b50kz.state = 1 else b50kz.state = 0:end If
  1777. if sp2.state = 1 then sp2z.state = 1 else sp2z.state = 0:end If
  1778. if lowrl.state = 1 then lowrlz.state = 1 else lowrlz.state = 0:end If
  1779. if midrl.state = 1 then midrlz.state = 1 else midrlz.state = 0:end If
  1780. if ebl.state = 1 then eblz.state = 1 else eblz.state = 0:end If
  1781. if al1.state = 1 then al1z.state = 1 else al1z.state = 0:end If
  1782. if zl1.state = 1 then zl1z.state = 1 else zl1z.state = 0:end If
  1783. if tl1.state = 1 then tl1z.state = 1 else tl1z.state = 0:end If
  1784. if el1.state = 1 then el1z.state = 1 else el1z.state = 0:end If
  1785. if cl1.state = 1 then cl1z.state = 1 else cl1z.state = 0:end If
  1786. if leftsidel.state = 1 then leftsidelz.state = 1 else leftsidelz.state = 0:end If
  1787. if topl.state = 1 then toplz.state = 1 else toplz.state = 0:end If
  1788. if upll.state = 1 then upllz.state = 1 else upllz.state = 0:end If
  1789. if upcl.state = 1 then upclz.state = 1 else upclz.state = 0:end If
  1790. if uprl.state = 1 then uprlz.state = 1 else uprlz.state = 0:end If
  1791. if lbutt03.state = 1 then lbutt03z.state = 1 else lbutt03z.state = 0:end If
  1792. if lbutt02.state = 1 then lbutt02z.state = 1 else lbutt02z.state = 0:end If
  1793. if lbutt01.state = 1 then lbutt01z.state = 1 else lbutt01z.state = 0:end If
  1794. if lanekl.state = 1 then laneklz.state = 1 else laneklz.state = 0:end If
  1795. if al2.state = 1 then al2z.state = 1 else al2z.state = 0:end If
  1796. if zl2.state = 1 then zl2z.state = 1 else zl2z.state = 0:end If
  1797. if tl2.state = 1 then tl2z.state = 1 else tl2z.state = 0:end If
  1798. if el2.state = 1 then el2z.state = 1 else el2z.state = 0:end If
  1799. if cl2.state = 1 then cl2z.state = 1 else cl2z.state = 0:end If
  1800. End Sub
Advertisement
Add Comment
Please, Sign In to add comment