home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd455 / short_out / short_out.amosSourceCode < prev    next >
AMOS Source Code  |  1992-12-10  |  22KB  |  762 lines

  1. Set Buffer 20
  2. Screen Open 0,340,250,16,Lowres
  3. Screen 0 : Paper 0 : Cls 
  4. '
  5. '
  6. '*****   FOR NON-SHAREWARE VERSION DELETE FROM       *****     HERE  ***** 
  7. '
  8. '
  9. Colour 15,$E3A
  10. Gr Writing 0 : Ink 15
  11. Text 10,10,"This Program is Shareware. If you "
  12. Text 10,20,"decide to keep it, I would be grateful"
  13. Text 10,30,"for any donations. If you send ï¿½2.00"
  14. Text 10,40,"to the address below, with your address,"
  15. Text 10,50,"I will send you a list of solutions and" : Rem      TO  ***** 
  16. Text 10,60,"Access codes to complete the game."
  17. Text 10,70,"Also, I would be interested to hear"
  18. Text 10,80,"any comments you have on the game."
  19. Text 10,98,"Donations or comments to:"
  20. Ink 12 : Text 10,113,"             Dave Cherrington."
  21. Text 10,123,"             13 Maple Road"
  22. Text 10,133,"             Bicester,"
  23. Text 10,143,"             Oxon."
  24. Ink 5 : Text 10,168,"             HAVE FUN !!"
  25. Wait Vbl 
  26. '
  27. '
  28. '***********************************************************    HERE  *****  
  29. '
  30. '
  31. Auto View Off 
  32. Hide On : Curs Off 
  33. Load Iff "Screens/First",5 : Screen Hide 5
  34. Load "FX/Music.abk"
  35. Reserve As Work 10,1772 : Bload "FX/Tick",Start(10)
  36. Reserve As Work 11,6200 : Bload "FX/Alarm",Start(11)
  37. Reserve As Work 12,9728 : Bload "FX/Boom",Start(12)
  38. Reserve As Work 13,7244 : Bload "FX/Start",Start(13)
  39. Limit Mouse 130,45 To 435,275
  40. MXLEVELS=10
  41. Dim CLUE$(10,3) : Rem clues for last level 
  42. Data "RED","RED","BLUE","GREEN","GREEN","GREEN","RED","BLUE","GREEN","YELLOW"
  43. Data "BLUE","GREEN","RED","RED","BLUE","YELLOW","RED","BLUE","GREEN","RED"
  44. Data "counting down two units","counting down ten units","counting down one unit"
  45. Data "counting down four units","counting down six units","counting down three units"
  46. Data "counting down to half it's present value","counting UP three units"
  47. Data "tripping a tamper device, and detonating the bomb"
  48. Data "counting down 11 units"
  49. For A=1 To 10
  50. Read CLUE$(A,1) : Next A
  51. For A=1 To 10
  52. Read CLUE$(A,2) : Next A
  53. For A=1 To 10
  54. Read CLUE$(A,3) : Next A
  55. Dim XZ(11),XB(11),XC(11),ALC(11),CUT$(11),WIRE$(10),WV(10) : Rem for Endgame
  56. Dim CODE$(MXLEVELS) : Rem code for level entry 
  57. Data "RB",-2,"RG",-10,"BR",-1,"GR",-4,"GB",-6,"GY",-3,"YR",-11,"RR",0,"BB",3,"GG",0
  58. Data 191,202,63,210,220,82,226,236,98,244,254,116,261,269,133
  59. Data 278,287,150,297,305,169,311,322,183,329,338,201,346,354,218,364,373,236
  60. For A=1 To 10
  61. Read WIRE$(A),WV(A) : Next A
  62. For A=1 To 11
  63. Read XB(A),XC(A),XZ(A) : Next A
  64. LE1$="768674.78668.8867768.867677.767688.667686.867786.6786878.787788.8768777."
  65. LE2$="69696919375223496652325889741565895757925629794977327534825795290654998"
  66. L=1
  67. For LE=1 To 10
  68. Do 
  69. A$=Chr$(10*(Val(Mid$(LE1$,L,1)))+Val(Mid$(LE2$,L,1)))
  70. If Mid$(LE1$,L,1)="." Then Exit 
  71. C$=C$+A$ : L=L+1
  72. Loop 
  73. CODE$(LE)=C$ : C$="" : L=L+1
  74. Next LE
  75. Dim TIME(MXLEVELS,4) : Rem time limit per level 
  76. Dim USED$(100) : Rem combinations used already
  77. Dim CONNECTIONS(MXLEVELS) : PTR=1 : Rem number of connections per level
  78. MC=25 : Rem Max number of useful Combinations
  79. Dim TEST$(MXLEVELS,MC) : Rem combinations having an effect
  80. Dim HELP$(MXLEVELS,MC) : Rem combinations effect for help option
  81. Dim LIGHT(MXLEVELS,5,MC) : Rem (level,a-e,1-combinations) 
  82. Dim XL(5) : Rem co-ords for lights 
  83. Dim OS(5) : Rem  original state of lights  
  84. Rem ************************ 
  85. Rem
  86. Rem    Level One Data  
  87. Rem
  88. Rem ************************ 
  89. TEST$(1,1)="12" : TEST$(1,2)="21" : TEST$(1,3)="23" : TEST$(1,4)="31"
  90. CONNECTIONS(1)=3
  91. Data 1,0,1,0,0,0,-1,0,0,0,0,-2,0,0,1,0,1,0,1,0
  92. For A=1 To 4 : For B=1 To 5
  93. Read LIGHT(1,B,A)
  94. Next B : Next A
  95. Data 77,107,137,167,197
  96. For A=1 To 5
  97. Read XL(A) : Next A : Rem XL(1),214toxl(1)+19,226  
  98. TIME(1,1)=0 : TIME(1,2)=5 : TIME(1,3)=0 : TIME(1,4)=0
  99. Rem ************************ 
  100. Rem
  101. Rem    Level Two Data    
  102. Rem
  103. Rem ************************ 
  104. TEST$(2,1)="13" : TEST$(2,2)="21" : TEST$(2,3)="23"
  105. TEST$(2,4)="31" : TEST$(2,5)="32"
  106. CONNECTIONS(2)=3
  107. Data 0,-1,0,0,-2,1,-2,0,0,0,0,0,0,0,1,0,1,0,-2,0,0,0,1,0,-2
  108. For A=1 To 5 : For B=1 To 5
  109. Read LIGHT(2,B,A)
  110. Next B : Next A
  111. TIME(2,1)=1 : TIME(2,2)=0 : TIME(2,3)=0 : TIME(2,4)=0
  112. Rem ************************ 
  113. Rem
  114. Rem    Level Three Data  
  115. Rem
  116. Rem ************************ 
  117. TEST$(3,1)="11" : TEST$(3,2)="12" : TEST$(3,3)="13" : TEST$(3,4)="23"
  118. TEST$(3,5)="32" : TEST$(3,6)="41"
  119. CONNECTIONS(3)=3
  120. Data 0,0,0,-2,1,0,1,0,-1,0,1,0,0,0,0,0,0,-2,0,0,0,0,1,0,0,0,0,-1,1,0
  121. For A=1 To 6 : For B=1 To 5
  122. Read LIGHT(3,B,A)
  123. Next B : Next A
  124. Data 77,107,137,167,197
  125. For A=1 To 5
  126. Read XL(A) : Next A : Rem XL(1),214toxl(1)+19,226  
  127. TIME(3,1)=1 : TIME(3,2)=5 : TIME(3,3)=0 : TIME(3,4)=0
  128. Rem ************************ 
  129. Rem
  130. Rem    Level Four Data   
  131. Rem
  132. Rem ************************ 
  133. TEST$(4,1)="11" : TEST$(4,2)="13" : TEST$(4,3)="21"
  134. TEST$(4,4)="33" : TEST$(4,5)="41" : TEST$(4,6)="42"
  135. CONNECTIONS(4)=3
  136. Data 0,0,1,0,0,-1,0,0,-2,0,-2,-2,0,0,0,0,-2,1,0,0,1,1,0,0,0,0,0,-1,0,1
  137. For A=1 To 6 : For B=1 To 5
  138. Read LIGHT(4,B,A)
  139. Next B : Next A
  140. TIME(4,1)=2 : TIME(4,2)=0 : TIME(4,3)=0 : TIME(4,4)=0
  141. Rem ************************ 
  142. Rem
  143. Rem    Level Five Data   
  144. Rem
  145. Rem ************************ 
  146. TEST$(5,1)="12" : TEST$(5,2)="15" : TEST$(5,3)="21" : TEST$(5,4)="24"
  147. TEST$(5,5)="35" : TEST$(5,6)="41" : TEST$(5,7)="43" : TEST$(5,8)="53"
  148. CONNECTIONS(5)=5
  149. Data 1,0,-1,0,0,1,-1,0,0,0,0,-2,0,-2,0,0,0,0,-2,-2
  150. Data 0,0,1,0,-1,-1,0,0,1,0,0,0,0,1,1,0,0,1,-1,0
  151. For A=1 To 8 : For B=1 To 5
  152. Read LIGHT(5,B,A)
  153. Next B : Next A
  154. TIME(5,1)=2 : TIME(5,2)=0 : TIME(5,3)=0 : TIME(5,4)=0
  155. Rem ************************ 
  156. Rem
  157. Rem    Level Six Data    
  158. Rem
  159. Rem ************************ 
  160. TEST$(6,1)="13" : TEST$(6,2)="23" : TEST$(6,3)="25" : TEST$(6,4)="32" : TEST$(6,5)="35"
  161. TEST$(6,6)="42" : TEST$(6,7)="45" : TEST$(6,8)="51" : TEST$(6,9)="62" : TEST$(6,10)="64"
  162. CONNECTIONS(6)=5
  163. Data 1,0,1,0,0,0,-1,0,1,0,-2,0,0,0,-1,0,-1,0,0,1,0,-2,-2,0,0,0,1,-1,0,0
  164. Data -1,0,0,0,1,0,0,-2,1,0,0,-2,0,-1,0,0,0,1,0,0
  165. For A=1 To 10 : For B=1 To 5
  166. Read LIGHT(6,B,A)
  167. Next B : Next A
  168. TIME(6,1)=2 : TIME(6,2)=5 : TIME(6,3)=0 : TIME(6,4)=0
  169. Rem ************************ 
  170. Rem
  171. Rem    Level Seven Data    
  172. Rem
  173. Rem ************************ 
  174. TEST$(7,1)="15" : TEST$(7,2)="23" : TEST$(7,3)="43" : TEST$(7,4)="52" : TEST$(7,5)="71"
  175. CONNECTIONS(7)=5
  176. Data -1,0,0,0,0,1,0,1,-1,0,0,-2,-2,0,0,0,-1,-2,1,0,-2,1,0,0,-2
  177. For A=1 To 5 : For B=1 To 5
  178. Read LIGHT(7,B,A)
  179. Next B : Next A
  180. TIME(7,1)=3 : TIME(7,2)=0 : TIME(7,3)=0 : TIME(7,4)=0
  181. Rem ************************ 
  182. Rem
  183. Rem    Level Eight Data    
  184. Rem
  185. Rem ************************ 
  186. TEST$(8,1)="12" : TEST$(8,2)="25" : TEST$(8,3)="32" : TEST$(8,4)="34" : TEST$(8,5)="53"
  187. TEST$(8,6)="61" : TEST$(8,7)="75"
  188. CONNECTIONS(8)=5
  189. Data 0,-2,1,0,0,0,-2,0,0,-2,-2,0,-2,0,0,0,1,0,-2,-2
  190. Data -2,0,0,-2,1,-2,0,-1,1,0,0,0,0,0,-1
  191. For A=1 To 7 : For B=1 To 5
  192. Read LIGHT(8,B,A)
  193. Next B : Next A
  194. TIME(8,1)=3 : TIME(8,2)=0 : TIME(8,3)=0 : TIME(8,4)=0
  195. Rem ************************ 
  196. Rem
  197. Rem    Level Nine Data     
  198. Rem
  199. Rem ************************ 
  200. TEST$(9,1)="13" : TEST$(9,2)="21" : TEST$(9,3)="33" : TEST$(9,4)="41" : TEST$(9,5)="42"
  201. TEST$(9,6)="51" : TEST$(9,7)="53"
  202. CONNECTIONS(9)=5
  203. Data -1,0,1,-1,-2,0,-1,-1,1,1,1,1,-2,0,1,1,-2,0,0,0,0,-1,0,-2,0
  204. Data -2,-2,0,-2,1,-1,1,-2,-2,0
  205. For A=1 To 7 : For B=1 To 5
  206. Read LIGHT(9,B,A)
  207. Next B : Next A
  208. TIME(9,1)=3 : TIME(9,2)=5 : TIME(9,3)=0 : TIME(9,4)=0
  209. Rem ************************ 
  210. Rem
  211. Rem    Level Ten Data      
  212. Rem
  213. Rem ************************ 
  214. TEST$(10,1)="27" : TEST$(10,2)="35" : TEST$(10,3)="54" : TEST$(10,4)="65"
  215. TEST$(10,5)="72" : TEST$(10,6)="96"
  216. CONNECTIONS(10)=7
  217. Data 0,0,1,0,0,0,0,1,1,-2,0,-2,1,-2,0,0,0,0,-1,-2,0,1,-2,0,-1,1,-2,0,-2,0
  218. For A=1 To 6 : For B=1 To 5
  219. Read LIGHT(10,B,A)
  220. Next B : Next A
  221. TIME(10,1)=3 : TIME(10,2)=5 : TIME(10,3)=0 : TIME(10,4)=0
  222. Data 77,107,137,167,197
  223. For A=1 To 5
  224. Read XL(A) : Next A : Rem XL(1),214toxl(1)+19,226  
  225. Music 1
  226. For A=1 To 300000 : Next A
  227. Screen 0 : Fade 5 : Wait 75 : Screen Close 0
  228. Screen To Front 5 : Screen Show 5 : Hide On : Auto View On : Screen 5 : Load "Bobs/Open.abk"
  229. Music Off 
  230. Wait Vbl 
  231. Sam Loop On 
  232. Wait Vbl 
  233. Sam Raw 15,Start(13),Length(13),10000
  234. For A=1 To 10000 : Next A
  235. Dim N(9)
  236. Data 11,12,13,14,15,16,13,17,15
  237. For A=1 To 9 : Read N(A) : Next A
  238. For B=1 To 9
  239. For C=1 To 2 : For A=1 To 10 : Paste Bob 104+(32*B),47,A
  240. For DE=1 To 600 : Next DE
  241. Next A
  242. Next C
  243. Paste Bob 104+(32*B),47,N(B)
  244. Next B
  245. Sam Raw 15,Start(13),Length(13),12000
  246. For DE=1 To 10000 : Next DE
  247. Screen 5 : Fade 5
  248. For DE=1 To 18000 : Next DE
  249. AFTERDEAD:
  250. Load Iff "Screens/FirstII",5
  251. Screen To Front 5 : Screen Show 5
  252. Clear Key 
  253. Screen 5 : Fade 10 To Logic(5) : Hide On 
  254. Pen 15 : Paper 7 : Locate 38,25 : Curs Off 
  255. PX=38 : PY=25
  256. If GS<1 Then Sam Raw 15,Start(13),Length(13),14000
  257. RBO:
  258. RB=0
  259. Repeat 
  260. K$=Inkey$
  261. Clear Key 
  262. If Key State(68) Then CR=0 : Exit 
  263. If Key State(65) Then RB=1 : TK$="" : Exit 
  264. K$=Upper$(K$)
  265. Locate PX-1-Len(TK$),PY : Print TK$
  266. TK$=TK$+K$
  267. CR=0
  268. For A=1 To MXLEVELS
  269. If TK$=CODE$(A) Then CR=A : Exit 
  270. Next A
  271. Until(CR>0) or(Len(TK$)>10)
  272. If RB=1 Then Ink 7 : Bar 176,199 To 464,207 : RB=0 : Goto RBO
  273. Sam Loop Off : Wait Vbl 
  274. LEVEL=CR : If LEVEL=0 Then LEVEL=1
  275. TK$=""
  276. If GS<1 Then Sam Raw 15,Start(12),Length(12),1000
  277. Paper 15 : Pen 2 : Locate 30,27 : Print "Entering at Level";LEVEL
  278. Screen 5 : Fade 5 : Screen Close 5
  279. Clear Key 
  280. Load "Bobs/UXB.abk"
  281. MAIN:
  282. Auto View Off : Load Iff "Screens/Main",0
  283. Screen 0
  284. Screen To Front 0 : Screen Show 0 : Auto View On : Show On 
  285. Fade 5 To Logic(0)
  286. Wind Save 
  287. Rem for help option: 
  288. For A=1 To MC : For B=1 To 5
  289. If LIGHT(LEVEL,B,A)=1 Then HELP$=HELP$+Chr$(B+64)+"+,"
  290. If LIGHT(LEVEL,B,A)=-1 Then HELP$=HELP$+Chr$(B+64)+"-,"
  291. If LIGHT(LEVEL,B,A)=-2 Then HELP$=HELP$+Chr$(B+64)+"^,"
  292. Next B
  293. HELP$(LEVEL,A)=HELP$ : HELP$=""
  294. Next A
  295. Every 10 Gosub TIMEUPDATE
  296. VM=10 : Rem tick volume
  297. GS=1
  298. Reserve Zone 23
  299. For A=0 To 8
  300. Set Zone A+1,183+(A*22),188 To 188+(A*22),193
  301. Next A
  302. N=150
  303. For A=1 To CONNECTIONS(LEVEL)/2
  304. N=N-30
  305. Z=10
  306. Next A
  307. For A=N To N+(30*(CONNECTIONS(LEVEL)-1)) Step 30
  308. Ink 1 : Bar A,100 To A+10,110
  309. Set Zone Z,A,100 To A+10,110 : Z=Z+1
  310. Next A
  311. BN=3
  312. For B=1 To 3
  313. For A=1 To 10
  314. Get Bob BN,((A-1)*30),80+(30*(B-1)) To 30+((A-1)*30),110+(30*(B-1))
  315. BN=BN+1
  316. Next A : Next B
  317. Set Zone 19,208,203 To 253,215 : Rem connct 
  318. Set Zone 20,270,203 To 310,215 : Rem cncl 
  319. Set Zone 21,175,225 To 193,241 : Rem power
  320. Set Zone 22,267,225 To 285,241 : Rem discnnct all 
  321. Set Zone 23,360,249 To 397,269 : Rem HELP 
  322. SELECT1:
  323. Bob 1,270,145,1 : Channel 1 To Bob 1 : Amal 1,"A0,(1,10)(2,10)" : Amal On 1
  324. Repeat 
  325. Until Mouse Key
  326. T=Zone(X Mouse,Y Mouse)
  327. If T=21 Then Goto POWER
  328. If T=22 Then Goto DISCONN
  329. If T=23 Then Gosub HELP
  330. If(T<1) or(T>9) Then Play 1,10,0 : Goto SELECT1
  331. T1$=Right$(Str$(T),1)
  332. Play 1,50,0
  333. X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse)
  334. For DE=1 To 5000 : Next DE
  335. SELECT2:
  336. Bob 1,300,100,1
  337. Repeat 
  338. Until Mouse Key
  339. T=Zone(X Mouse,Y Mouse)
  340. If T=21 Then Goto POWER
  341. If T=22 Then Gosub DISCONN
  342. If T=23 Then Gosub HELP
  343. X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
  344. T=Zone(X,Y)
  345. If(T<10) or(T>CONNECTIONS(LEVEL)+9) Then Play 1,10,0 : Goto SELECT2
  346. T2$=Right$(Str$(T-9),1)
  347. TT$=T1$+T2$
  348. UC=0
  349. For A=1 To PTR
  350. If TT$=USED$(A) Then UC=1 : Exit 
  351. Next A
  352. If UC=1
  353.  Play 1,10,0
  354.  Wind Open 1,70,110,20,5,1
  355.  Paper 0 : Clw 
  356.  Pen 1 : Print : Print "Already connected"
  357.  For DE=1 To 10000 : Next DE
  358.  Wind Close 
  359.  Goto SELECT1
  360. End If 
  361. Play 1,70,0
  362. For DE=1 To 5000 : Next DE
  363. Goto ILLUMINATE
  364. CONNORCANCL:
  365. Bob 1,270,162,1
  366. Repeat 
  367. Until Mouse Key
  368. T=Zone(X Mouse,Y Mouse)
  369. If T=21 Then Goto POWER
  370. If T=22 Then Goto DISCONN
  371. If T=23 Then Gosub HELP
  372. If(T<19) or(T>20) Then Play 1,10,0 : Goto CONNORCANCL
  373. Play 1,50,0
  374. For DE=1 To 5000 : Next DE
  375. If T=20 Then Goto CANCEL
  376. X2=X : Y2=Y
  377. Ink 8 : Draw X1,Y1 To X2,Y2
  378. Draw X1+1,Y1 To X2+1,Y2
  379. Draw X1+2,Y1 To X2+2,Y2
  380. USED$(PTR)=TT$ : PTR=PTR+1
  381. Goto SELECT1
  382. DISCONN:
  383. BN=3
  384. For B=1 To 3
  385. For A=1 To 10
  386. Paste Bob((A-1)*30),80+(30*(B-1)),BN
  387. BN=BN+1
  388. Next A : Next B
  389. For A=1 To 5
  390. Ink 9 : Bar XL(A),214 To XL(A)+19,226
  391. Next A
  392. For A=1 To PTR : USED$(A)="" : Next A : PTR=1
  393. Goto SELECT1
  394. ILLUMINATE:
  395. Rem show lights
  396. CT=0
  397. For A=1 To MC
  398. If TT$=TEST$(LEVEL,A) Then CT=A : Exit 
  399. Next A
  400. For A=1 To 5
  401. PP=Point(XL(A)+2,215)
  402. If PP=8 Then OS(A)=1
  403. If PP=9 Then OS(A)=0
  404. If LIGHT(LEVEL,A,CT)<>0 Then Gosub LIGHTUP
  405. Next A
  406. If CT=0 Then Goto CONNORCANCL
  407. Goto CONNORCANCL
  408. LIGHTUP:
  409. P=LIGHT(LEVEL,A,CT)
  410. Rem 1=on,-1=off,-2= inverse
  411. If P=1 Then Ink 8 : Bar XL(A),214 To XL(A)+19,226
  412. If P=-1 Then Ink 9 : Bar XL(A),214 To XL(A)+19,226
  413. If(P=-2) and(Point(XL(A),214)=8) Then Ink 9 : Bar XL(A),214 To XL(A)+19,226 : Goto SKP
  414. If(P=-2) and(Point(XL(A),214)=9) Then Ink 8 : Bar XL(A),214 To XL(A)+19,226
  415. SKP:
  416. Return 
  417. CANCEL:
  418. Rem return lights to original state after cancel 
  419. For A=1 To 5
  420. If OS(A)=1 Then Ink 8
  421. If OS(A)=0 Then Ink 9
  422. Bar XL(A),214 To XL(A)+19,226
  423. Next A
  424. Goto SELECT1
  425. TIMEUPDATE:
  426. T1=TIME(LEVEL,1) : T2=TIME(LEVEL,2) : T3=TIME(LEVEL,3) : T4=TIME(LEVEL,4)
  427. T4=T4-1
  428. If T4<0 Then T4=9 : T3=T3-1
  429. If T3<0 Then T3=5 : T2=T2-1 : If VM<=53 Then VM=VM+5
  430. If T2<0 Then T2=9 : T1=T1-1
  431. If(T1=0) and(T2=0) Then VM=63
  432. If T1<0 Then Goto TIMEOUT
  433. If HELP=1 Then Goto MISS : Rem do not print time if window open 
  434. Paste Bob 88,19,33+T1
  435. Paste Bob 104,19,33+T2
  436. Paste Bob 126,19,33+T3
  437. Paste Bob 142,19,33+T4
  438. MISS:
  439. TIME(LEVEL,1)=T1 : TIME(LEVEL,2)=T2 : TIME(LEVEL,3)=T3 : TIME(LEVEL,4)=T4
  440. Volume VM
  441. TD=TD+1 : If TD=2 Then TD=0 : Sam Raw 15,Start(10),Length(10),30000
  442. Every On : Return 
  443. POWER:
  444. Bob Off 
  445. Rem final test here
  446. EX=0
  447. For A=1 To 5
  448. P=Point(XL(A)+2,215) : If P=9 Then EX=1 : Exit 
  449. Next A
  450. If EX=1 Then Goto BLOWUP
  451. Rem correct end to game
  452. Every Off 
  453. For A=1 To 25
  454. Bell : Wait 2
  455. Next A
  456. Sam Loop On 
  457. Sam Raw 15,Start(11),Length(11),19000
  458. Wait 50
  459. Sam Loop Off 
  460. Screen 0 : Fade 5
  461. Screen 0
  462. BN=3
  463. For B=1 To 3
  464. For A=1 To 10
  465. Paste Bob((A-1)*30),80+(30*(B-1)),BN
  466. BN=BN+1
  467. Next A : Next B
  468. For A=1 To 5
  469. Ink 9 : Bar XL(A),214 To XL(A)+19,226
  470. Next A
  471. For A=1 To PTR : USED$(A)="" : Next A : PTR=1
  472. Hide On 
  473. For DE=1 To 55000 : Next DE : Screen Close 0
  474. Load Iff "Screens/Win",5 : Screen To Front 5 : Screen Show 5
  475. If LEVEL=MXLEVELS Then Goto GMOVER
  476. Screen 5
  477. Gr Writing 0 : Paper 0 : Ink 2
  478. Text 10,10,"Congratulations, you managed to"
  479. Text 10,20,"crack the connections, and defuse"
  480. Text 10,30,"the timing mechanism. The access "
  481. Text 10,40,"code for the next level is :"+CODE$(LEVEL+1)
  482. LEVEL=LEVEL+1
  483. Text 10,52,"Your End game clue this round is: "
  484. Text 10,62,"Cutting a "+CLUE$(LEVEL-1,1)+" wire immediately"
  485. Text 10,72,"before a "+CLUE$(LEVEL-1,2)+" wire, will "
  486. Text 10,82,"result in the timer"
  487. Text 10,92,CLUE$(LEVEL-1,3)
  488. Wind Open 1,80,200,20,5,1 : Border 1,13,1 : Paper 1 : Clw 
  489. Pen 15 : Print : Print "Press Mouse Button"; : Curs Off 
  490. Repeat : Until Mouse Key
  491. Play 1,70,0
  492. Screen 5 : Cls 0,0,0 To 600,96
  493. Wind Close 
  494. Screen Close 5
  495. Goto MAIN
  496. HELP:
  497. HELPCOUNT=HELPCOUNT+1
  498. HELP=1
  499. Wind Open 1,0,0,25,16,1
  500. Paper 0 : Clw 
  501. For A=1 To MC
  502. If HELPCOUNT>2 Then Pen 3 : Print "Sorry,I can only help" : Print "you twice." : Print : Print "Otherwise it would" : Print "be too easy !" : Exit 
  503. If TEST$(LEVEL,A)="" Then Exit 
  504. Pen 3 : Print Left$(TEST$(LEVEL,A),1);"/";Right$(TEST$(LEVEL,A),1); : Pen 1 : Print " .. "; : Pen 2 : Print HELP$(LEVEL,A)
  505. Next A
  506. Print : Print : Print "PRESS MOUSE BUTTON"
  507. Curs Off 
  508.    Repeat : Until Mouse Key
  509. Wind Close 
  510. HELP=0
  511. Return 
  512. TIMEOUT:
  513. Bob Off 
  514. Rem out of time
  515. Every Off 
  516. Sam Loop On 
  517. Sam Raw 15,Start(11),Length(11),19000
  518. Wait 50
  519. Sam Loop Off 
  520. Gosub XPLOSION
  521. Screen 5
  522. Ink 2 : Gr Writing 0 : Paper 0
  523. Text 10,10,"Unfortunately, you ran out of time "
  524. Text 10,20,"before you made the correct"
  525. Text 10,30,"connections. Speed can only be "
  526. Text 10,40,"obtained by practice, which you"
  527. Text 10,50,"obviously need lots of !!"
  528. Goto FINALSCREEN
  529. BLOWUP:
  530. Rem powered incorrectly
  531. Every Off 
  532. Gosub XPLOSION
  533. Screen 5
  534. Ink 2 : Gr Writing 0 : Paper 0
  535. Text 10,10,"Unfortunately, you threw the power"
  536. Text 10,20,"switch before all connections"
  537. Text 10,30,"had been correctly made. Thanks to "
  538. Text 10,40,"your incompetence whole buildings"
  539. Text 10,50,"have been flattened."
  540. Text 10,60,"You need practice"
  541. Goto FINALSCREEN
  542. XPLOSION:
  543. For A=1 To PTR : USED$(A)="" : Next A : PTR=1
  544. For A=1 To 11 : ALC(A)=0 : Next A
  545. X=130 : Y=42
  546. Volume 63 : Sam Raw 15,Start(12),Length(12),1000
  547. For A=1 To 65
  548. Screen Display 0,X,Y,340,256
  549. Paste Bob 20+Rnd(280),20+Rnd(180),43
  550. Paste Bob 20+Rnd(280),20+Rnd(180),44
  551. For DE=1 To 1000 : Next DE
  552. XR=Rnd(100) : YR=Rnd(100)
  553. If XR<50 Then DX=-5 Else DX=5
  554. If YR<50 Then DY=-5 Else DY=5
  555. X=X+DX : Y=Y+DY
  556. Screen Display 0,X,Y,340,256
  557. For DE=1 To 1000 : Next DE
  558. X=X-DX : Y=Y-DY
  559. Next A
  560. Screen Display 0,X,Y,340,256
  561. For DE=1 To 125000 : Next DE
  562. Screen 0 : Fade 5
  563. For DE=1 To 55000 : Next DE
  564. Screen Close 0
  565. Auto View Off : Load Iff "Screens/Lose",5
  566. Screen 5 : Fade 5 : For DE=1 To 55000 : Next DE
  567. Screen To Front 5 : Screen Show 5 : Auto View On 
  568. Screen 5 : Fade 10 To Logic(5) : Hide On 
  569. Return 
  570. FINALSCREEN:
  571. Rem reasons have already been displayed for end
  572. Rem display end messages 
  573. Rem score (etc)
  574. Wind Save 
  575. Wind Open 1,80,200,20,5,1 : Border 1,13,1 : Paper 1 : Clw 
  576. Pen 15 : Print : Print : Print "Press Mouse Button"; : Curs Off 
  577. Repeat : Until Mouse Key
  578. Wind Close 
  579. Fade 5
  580. Load Iff "Screens/FirstII",5 : Screen Hide 5
  581. TIME(1,1)=0 : TIME(1,2)=5 : TIME(1,3)=0 : TIME(1,4)=0
  582. TIME(2,1)=1 : TIME(2,2)=0 : TIME(2,3)=0 : TIME(2,4)=0
  583. TIME(3,1)=1 : TIME(3,2)=5 : TIME(3,3)=0 : TIME(3,4)=0
  584. TIME(4,1)=2 : TIME(4,2)=0 : TIME(4,3)=0 : TIME(4,4)=0
  585. TIME(5,1)=2 : TIME(5,2)=0 : TIME(5,3)=0 : TIME(5,4)=0
  586. TIME(6,1)=2 : TIME(6,2)=5 : TIME(6,3)=0 : TIME(6,4)=0
  587. TIME(7,1)=3 : TIME(7,2)=0 : TIME(7,3)=0 : TIME(7,4)=0
  588. TIME(8,1)=3 : TIME(8,2)=0 : TIME(8,3)=0 : TIME(8,4)=0
  589. TIME(9,1)=3 : TIME(9,2)=5 : TIME(9,3)=0 : TIME(9,4)=0
  590. TIME(10,1)=3 : TIME(10,2)=5 : TIME(10,3)=0 : TIME(10,4)=0
  591. Limit Mouse 130,45 To 435,275
  592. Goto AFTERDEAD
  593. GMOVER:
  594. Screen 5
  595. Gr Writing 0 : Paper 0 : Ink 2
  596. Text 0,10,"Congratulations, you managed to crack"
  597. Text 0,20,"the code, and defuse the timing"
  598. Text 0,30,"mechanism, You also managed to beat all"
  599. Text 0,40,"ten levels, you must now defuse the"
  600. Text 0,50,"following circuit, using the information"
  601. Text 0,60,"you have been given at each level,"
  602. Text 0,70,"Your End game clue for this round is: "
  603. Text 0,80,"Cutting a "+CLUE$(10,1)+" wire immediately"
  604. Text 0,90,"before a "+CLUE$(10,2)+" wire, will result"
  605. Text 0,100,"in the timer "+CLUE$(10,3)
  606. Wind Open 1,80,200,20,5,1 : Border 1,13,1 : Paper 1 : Clw 
  607. Pen 15 : Print : Print "Press Mouse Button"; : Curs Off 
  608. Repeat : Until Mouse Key
  609. Screen 5 : Wind Close 
  610. Screen 5 : Fade 5 : Screen Close 5
  611. Load Iff "Screens/Endgame",0 : Screen Hide 0 : Screen 0 : Fade 1 : Wait 15
  612. Screen To Front 0 : Screen Show 0
  613. Screen 0 : Wind Save : Show On 
  614. Fade 5 To Logic(0) : Wait Vbl 
  615. Limit Mouse 190,140 To 439,168
  616. Reserve Zone 12
  617. CUT=1
  618. For A=1 To 11
  619. Set Zone A,XB(A),140 To XC(A),170
  620. Next A
  621. Set Zone 12,391,148 To 437,159
  622. T1=6 : T2=0
  623. TT1=4 : TT2=0
  624. Paste Bob 102,35,33 : Paste Bob 120,35,33 : Paste Bob 141,35,T1+33 : Paste Bob 159,35,T2+33
  625. Paste Bob 118,143,33 : Paste Bob 136,143,33 : Paste Bob 157,143,TT1+33 : Paste Bob 175,143,TT2+33
  626. While T<>12
  627. Repeat 
  628. T=Zone(X Mouse,Y Mouse)
  629. Until Mouse Key
  630. Wend 
  631. For A=1 To 50 : Bell : Wait Vbl : Next A
  632. CUT=1
  633. Every 20 Gosub EGTIMEUPDATE
  634. Do 
  635. While(T<1) or(T>11)
  636. Repeat 
  637. Bob 1,X Screen(X Mouse)-20,Y Screen(Y Mouse),45
  638. Until Mouse Key
  639. T=Zone(X Mouse,Y Mouse)
  640. If T=12 Then Goto JMP
  641. If ALC(T)=1 Then T=0
  642. JMP:
  643. Wend 
  644. X=X Screen(X Mouse)-20 : Y=Y Screen(Y Mouse)
  645. Bob 1,X,Y,46
  646. For A=1 To 6000 : Next A
  647. Bob Off : Wait Vbl 
  648. Ink 15 : Bar XZ(T),104 To XZ(T)+12,120 : Wait Vbl 
  649. If(T=1) or(T=3) or(T=5) or(T=8) or(T=11) Then W$="R"
  650. If(T=2) or(T=4) or(T=7) Then W$="B"
  651. If(T=6) or(T=10) Then W$="G"
  652. If T=9 Then W$="Y"
  653. ALC(T)=1
  654. T=0
  655. CUT$(CUT)=W$
  656. If CUT>1 Then Gosub CALC
  657. CUT=CUT+1
  658. Loop 
  659. CALC:
  660. TV=(10*T1)+T2 : Rem timevalue
  661. TC$=CUT$(CUT-1)+CUT$(CUT)
  662. WV=0
  663. For A=1 To 10
  664. If TC$=WIRE$(A) Then WV=WV(A)
  665. Next A
  666. TV=TV+WV
  667. If TC$="RR" Then TV=TV/2
  668. If TC$="GG" Then TV=-1000 : Rem double green=death 
  669. T1=TV/10 : T2=TV mod(10)
  670. If TV<-800 Then Goto DBLGN
  671. If TV<0 Then Goto PAST
  672. Paste Bob 141,35,T1+33 : Paste Bob 159,35,T2+33
  673. Wind Open 1,0,0,10,10,1 : Paper 1 : Clw 
  674. Pen 15
  675. If CUT$(CUT-1)="G" Then A$="Green"
  676. If CUT$(CUT-1)="R" Then A$="Red"
  677. If CUT$(CUT-1)="B" Then A$="Blue"
  678. If CUT$(CUT-1)="Y" Then A$="Yellow"
  679. Print A$ : Print "before"
  680. If CUT$(CUT)="G" Then A$="Green"
  681. If CUT$(CUT)="R" Then A$="Red"
  682. If CUT$(CUT)="B" Then A$="Blue"
  683. If CUT$(CUT)="Y" Then A$="Yellow"
  684. Print A$
  685. If TC$<>"RR" Then Print : Print "=";WV
  686. If TC$="RR" Then Print "Halves"
  687. Curs Off 
  688. For A=1 To 11000 : Next A : Wind Close 
  689. If TV=0 Then Goto TIMEDOWN
  690. Return 
  691. TIMEDOWN:
  692. Rem time on clock is zero
  693. WC=0
  694. For A=1 To 7
  695. If ALC(A)=0 Then WC=A : Exit 
  696. Next A
  697. If WC=0 Then Goto YOUWIN : Rem all wires were used
  698. Goto NTCUT
  699. EGTIMEUPDATE:
  700. TT2=TT2-1
  701. If TT2<0 Then TT2=9 : TT1=TT1-1
  702. If TT1<0 Then Goto TIMESOUT
  703. Paste Bob 157,143,33+TT1
  704. Paste Bob 175,143,33+TT2
  705. Volume VM
  706. Sam Raw 15,Start(10),Length(10),30000
  707. Every On : Return 
  708. DBLGN:
  709. Rem two greens=death 
  710. Every Off : Gosub XPLOSION
  711. Screen 5
  712. Ink 2 : Gr Writing 0 : Paper 0
  713. Text 10,10,"Unfortunately, you cut two green"
  714. Text 10,20,"wires which is the anti-tamper "
  715. Text 10,30,"device. "
  716. Text 10,40,"Learn your clues first !! "
  717. Goto FINALSCREEN
  718. PAST:
  719. Rem overshot zero
  720. Every Off : Gosub XPLOSION
  721. Screen 5
  722. Ink 2 : Gr Writing 0 : Paper 0
  723. Text 10,10,"Unfortunately, you rewound the "
  724. Text 10,20,"timer to below zero, causing "
  725. Text 10,30,"it to self-destruct. "
  726. Text 10,40,"Try again !!"
  727. Goto FINALSCREEN
  728. NTCUT:
  729. Rem not all wires were cut 
  730. Every Off : Gosub XPLOSION
  731. Screen 5
  732. Ink 2 : Gr Writing 0 : Paper 0
  733. Text 10,10,"Unfortunately, you still had wires"
  734. Text 10,20,"remaining, so you failed to break "
  735. Text 10,30,"the circuit. All wires must be cut"
  736. Text 10,40,"when the timer reads Zero."
  737. Text 10,50,"Try again !!"
  738. Goto FINALSCREEN
  739. TIMESOUT:
  740. Rem out of time
  741. Every Off : Gosub XPLOSION
  742. Screen 5
  743. Ink 2 : Gr Writing 0 : Paper 0
  744. Text 10,10,"Unfortunately, you ran out of time,"
  745. Text 10,20,"A little more planning is needed"
  746. Text 10,30,"before hitting that start button."
  747. Text 10,40,"Try again !!"
  748. Goto FINALSCREEN
  749. YOUWIN:
  750. Every Off 
  751. Fade 5
  752. Wait 75
  753. Screen Close 0
  754. Load "Bobs/Final.abk"
  755. Load Iff "Screens/Final",0 : Screen Hide 0
  756. Screen To Front 0
  757. Screen 0 : Fade 1 : Wait 15
  758. Screen Show 0 : Hide On 
  759. Fade 5 To Logic(0)
  760. Repeat : Until Mouse Key
  761. Fade 5 : Wait 75
  762. End