home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 2: Collection B / 17Bit_Collection_B.iso / files / 2207.dms / in.adf / engine.AMOS / engine.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1992-02-21  |  25.7 KB  |  728 lines

  1. '*********************************************************** 
  2. '*                                                         * 
  3. '* Source for Escape from large cave                       * 
  4. '* Coded 6/92.                                             * 
  5. '* By T.S.Kong                                             * 
  6. '* Game Design by T.S.Kong and D.Harvey                    * 
  7. '* Forget it Dave, this code is totally over your head.... * 
  8. '* This game is shareware, spread it.  You like?           * 
  9. '* You pay...                                              * 
  10. '* 1992 Zen Software Productions                           *   
  11. '*                                                         * 
  12. '*********************************************************** 
  13. Dim XDIRECTION(3),STATE(25,3),OBJECTNAME$(15),OBJECTLOC(15)
  14. Dim INVENTORY(14),NPCNAME$(6),NPCLOC(6),OBX(14),OBY(14)
  15. Dim NPCX(6),NPCY(6),BEEN(25),YAP(6),ALIVE(6)
  16. Global COMMAND#,XDIRECTION(),CURRENTROOM$,GOING,XDOOR
  17. Global STATE(),OBJECTNAME$(),OBJECTLOC(),INVENTORY(),NPCNAME$()
  18. Global NPCLOC(),OBX(),OBY(),CURRENTOB,IPOINT,NPCX(),NPCY()
  19. Global CURRENTNPC,PX,PY,INVENTPOINT,EX,EY,TASK,BEEN(),YAP()
  20. Global ALIVE()
  21. Break Off 
  22. Get Rom Fonts 
  23. Randomize Timer
  24. On Error Proc OHSHIT
  25. Screen Hide 0 : Auto View Off 
  26. Screen Open 0,320,200,32,LORES
  27. Screen Display 0,112,40,320,200
  28. Wait Vbl : Double Buffer 
  29. Show : Flash Off : Curs Off : Cls 0
  30. Get Sprite Palette 
  31. Unpack 5,0,120
  32. Screen Show 0 : Auto View On 
  33. Limit Mouse 112,40 To 432,240
  34. '* Create the necessary zones
  35. Reserve Zone 46
  36. BUTTNO=1
  37. For X=8 To 80 Step 72
  38.    For Y=135 To 183 Step 12
  39.       Set Zone BUTTNO,X,Y To X+7,Y+7
  40.       Inc BUTTNO
  41.    Next Y
  42. Next X
  43. '* and now the zones for the doors 
  44. Set Zone 11,225,43 To 257,81
  45. Set Zone 12,288,72 To 304,104
  46. Set Zone 13,58,82 To 90,120
  47. Set Zone 14,16,72 To 40,104
  48. '* Zones for the inventory 
  49. Set Zone 37,306,129 To 314,153
  50. Set Zone 38,306,167 To 314,191
  51. BUTTNO=39
  52. For N=128 To 184 Step 8
  53.    Set Zone BUTTNO,168,N To 296,N+8
  54.    Inc BUTTNO
  55. Next N
  56. INITIALISE
  57. '* The serious stuff!  
  58. CURRENTROOM$='room1'
  59. INITOBJECTS
  60. INITNPCS
  61. IPOINT=0
  62. INVENTPOINT=0
  63. INVENTPRINT[INVENTPOINT]
  64. TASK=0
  65. '* Where the player starts from in a room  
  66. EX=100 : EY=80
  67. '********************* 
  68. '*                   *   
  69. '* Going into a room * 
  70. '*                   * 
  71. '********************* 
  72. ENTER:
  73. PX=EX : PY=EY
  74. If CURRENTROOM$='room26' Then SUCKER
  75. If CURRENTROOM$='room27' Then CONGRATS
  76. COMMAND#=1 : COMMAND[1]
  77. WRITE['          ',2]
  78. GOING=0
  79. CURRENTOB=-1 : CURRENTNPC=-1
  80. Restore CURRENTROOM$
  81. For N=0 To 3
  82.    Read XDIRECTION(N)
  83. Next N
  84. Read PIC$
  85. Change Mouse 3
  86. Load Iff PIC$,1
  87. Change Mouse 1
  88. Screen Hide 1
  89. Screen Copy 1,0,0,320,120 To Logic(0),0,0
  90. Screen Copy 1,0,0,320,120 To Physic(0),0,0
  91. Screen 0 : Screen Close 1
  92. Screen Show 0
  93. Bob 22,PX,PY,23
  94. CHECKITEMS[Val(Mid$(CURRENTROOM$,5,2))]
  95. CHECKNPCS[Val(Mid$(CURRENTROOM$,5,2))]
  96. If CURRENTROOM$='room8' and(OBJECTNAME$(1)='Funky shoes') Then TALK[PX,PY,'Hey my shoes are disintegrating!'] : OBJECTNAME$(1)='Manky leaves' : OBJECTLOC(0)=0 : INVENTPRINT[INVENTPOINT]
  97. PROFOUND[Rnd(1000)]
  98. COMMENT[Val(Mid$(CURRENTROOM$,5,2))]
  99. While GOING<>1
  100. ' * Main program loop  
  101.    If Mouse Click=1 Then CLICK
  102.    If Mouse Click=0 Then NOCLICK
  103. Wend 
  104. '* Go to the next room, do some garbage collection first 
  105. Bob Off 
  106. Goto ENTER
  107. End 
  108. Procedure CLICK
  109. '* speed things up a bit 
  110. '* There was a little bug here, after moving to a door, the bob  
  111. '* would then walk to the current mouse position.  Hence the pop 
  112. '* proc in the next line.  Maybe they should be present in all the procedures
  113. If Mouse Zone<>0 Then USER[Mouse Zone] : Pop Proc
  114. If Mouse Zone=0 and COMMAND#=1 Then WALK[X Mouse-112,Y Mouse-40]
  115. End Proc
  116. Procedure NOCLICK
  117. '* speedy
  118. If Mouse Zone=>15 and Mouse Zone<=29 Then MZ=Mouse Zone : CHOOSEOBJECT[MZ-15]
  119. If Mouse Zone=>30 and Mouse Zone<=36 Then MZ=Mouse Zone : CHOOSENPC[MZ-30]
  120. If Mouse Zone=0 Then CURRENTOB=-1 : CURRENTNPC=-1 : WRITE['       ',2]
  121. End Proc
  122. Procedure INITIALISE
  123. '* Initialises many of the required variables to their original state
  124. '* Nothing held
  125. For N=0 To 14
  126.    INVENTORY(N)=15
  127. Next N
  128. '* Haven't been anywhere yet 
  129. For N=0 To 25
  130.    BEEN(N)=False
  131. Next N
  132. '* Haven't spoken to anyone yet, and their all alive 
  133. For N=0 To 6
  134.    YAP(N)=False : ALIVE(N)=True
  135. Next N
  136. '* Initialise the doors
  137. For N=1 To 25
  138.    For X=0 To 3
  139.       STATE(N,X)=0
  140.    Next X
  141. Next N
  142. STATE(2,1)=1 : STATE(4,0)=2 : STATE(22,0)=2
  143. End Proc
  144. Procedure USER[BUTTON]
  145. '* This procedure processes the users input, anything from 1-8 means 
  146. '* a command 
  147. If BUTTON=>1 and BUTTON<=10 Then COMMAND[BUTTON]
  148. If BUTTON=>11 and BUTTON<=14 Then MOVE[BUTTON-11]
  149. If BUTTON=>15 and BUTTON<=36 Then OBEY
  150. If BUTTON=>37 and BUTTON<=46 Then INVENT[BUTTON-37]
  151. End Proc
  152. Procedure COMMAND[BUTTON]
  153. '* Returns the command 
  154.    If BUTTON=1 Then WRITE['Walk to',1]
  155.    If BUTTON=2 Then WRITE['Give',1]
  156.    If BUTTON=3 Then WRITE['Open',1]
  157.    If BUTTON=4 Then WRITE['Close',1]
  158.    If BUTTON=5 Then WRITE['Pick up',1]
  159.    If BUTTON=6 Then WRITE['Drop',1]
  160.    If BUTTON=7 Then WRITE['Examine',1]
  161.    If BUTTON=8 Then WRITE['Talk to',1]
  162.    If BUTTON=9 Then WRITE['Use',1]
  163.    If BUTTON=10 Then WRITE['Stab repeatedly',1]
  164.    COMMAND#=BUTTON
  165. End Proc
  166. Procedure MOVE[XDOOR]
  167. '* Things to do with doors!
  168. '* Check if door exists... 
  169. '* Xdoor is door number
  170. Locate 0,0 : Paper 0 : Pen 1
  171. If XDIRECTION(XDOOR)=0 Then Pop Proc
  172. LOC=Val(Mid$(CURRENTROOM$,5,2))
  173. WRITE['Door',2]
  174. '* Check if you can go into the swamp
  175. '* Perhaps check if carrying???
  176. If(CURRENTROOM$='room5') and(XDOOR=0) and(OBJECTNAME$(1)<>'Funky shoes') Then TALK[PX,PY,'Ill sink!'] : Pop Proc
  177. If(CURRENTROOM$='room22') and(XDOOR=0) and(TASK<>4) Then TALK[PX,PY,'Ill drown'] : Pop Proc
  178. '* Ok, back to business
  179. If XDOOR=0 Then WALK[225,81] : EX=58 : EY=120
  180. If XDOOR=1 Then WALK[288,104] : EX=16 : EY=104
  181. If XDOOR=2 Then WALK[58,120] : EX=225 : EY=81
  182. If XDOOR=3 Then WALK[16,104] : EX=288 : EY=104
  183. If COMMAND#=1 and STATE(LOC,XDOOR)=0 Then CURRENTROOM$='room'+Str$(XDIRECTION(XDOOR))-' ' : GOING=1 : Pop Proc
  184. If COMMAND#=1 and STATE(LOC,XDOOR)=1 Then TALK[PX,PY,'The door is closed (petty huh?)']
  185. If COMMAND#=1 and STATE(LOC,XDOOR)=2 Then TALK[PX,PY,'It is locked']
  186. If COMMAND#=2 Then TALK[PX,PY,'To whom?']
  187. If COMMAND#=3 and STATE(LOC,XDOOR)=1 Then TALK[PX,PY,'Ok, opening door'] : STATE(LOC,XDOOR)=0
  188. If COMMAND#=4 and STATE(LOC,XDOOR)=0 Then TALK[PX,PY,'Ok, closing door'] : STATE(LOC,XDOOR)=1
  189. If COMMAND#=5 Then TALK[PX,PY,'Hey maybe I can surf!']
  190. If COMMAND#=6 Then TALK[PX,PY,'I never had it in the first place']
  191. If COMMAND#=7 Then TALK[PX,PY,'Its a hole in the wall']
  192. If COMMAND#=8 Then TALK[PX,PY,'What are you smoking?']
  193. If COMMAND#=9 Then TALK[PX,PY,'its already open, its a hole.']
  194. If COMMAND#=10 Then TALK[PX,PY,'Stab, stab....']
  195. End Proc
  196. Procedure WRITE[COMMENT$,NO]
  197. '* Writes the users input to the screen
  198. Ink 1,0
  199. Set Font 2
  200. If NO=1 Then Text 0,126,'                    ' : Text 0,126,COMMENT$
  201. If NO=2 Then Text 160,126,'                    ' : Text 160,126,COMMENT$
  202. End Proc
  203. Procedure INVENT[BUTTON]
  204. '* Does something with carried objects 
  205. If BUTTON=0 Then Dec INVENTPOINT : INVENTPRINT[INVENTPOINT]
  206. If BUTTON=1 Then Inc INVENTPOINT : INVENTPRINT[INVENTPOINT]
  207. If BUTTON=>2 and BUTTON<=9 Then CURRENTOB=INVENTORY(BUTTON-2+INVENTPOINT) : WRITE[OBJECTNAME$(CURRENTOB),2] : OBEY
  208. End Proc
  209. Procedure INVENTPRINT[PSTART]
  210. '* print the inventory 
  211. '* I had the idea for this from a lab I did in Uni 
  212. If PSTART<0 Then INVENTPOINT=1 : Pop Proc
  213. If PSTART>6 Then INVENTPOINT=6 : Pop Proc
  214. Writing 0
  215. Paper 0 : Pen 1
  216. YPOS=16
  217. For N=PSTART To PSTART+7
  218.    Locate 21,YPOS
  219.    NAME$=OBJECTNAME$(INVENTORY(N))
  220.    If INVENTORY(N)=15 Then Print '                ' Else Print NAME$;Space$(16-Len(NAME$))
  221.    Inc YPOS
  222. Next N
  223. '* put cursor back at top
  224. Home 
  225. End Proc
  226. Procedure INITOBJECTS
  227. '* Loads in all the object data
  228. '* The name of the object, all indexed by the object number
  229. OBJECTNAME$(0)='Golden key'
  230. OBJECTNAME$(1)='Palm leaves'
  231. OBJECTNAME$(2)='Two carrots'
  232. OBJECTNAME$(3)='Coconut'
  233. OBJECTNAME$(4)='Mints'
  234. OBJECTNAME$(5)='Switch'
  235. OBJECTNAME$(6)='Iron filings'
  236. OBJECTNAME$(7)='Dynamite'
  237. OBJECTNAME$(8)='Goggles'
  238. OBJECTNAME$(9)='Nails'
  239. OBJECTNAME$(10)='Bottle'
  240. OBJECTNAME$(11)='Toxic waste'
  241. OBJECTNAME$(12)='Fish'
  242. OBJECTNAME$(13)='Magnet'
  243. OBJECTNAME$(14)='Dog'
  244. '* the room number of each object, a 0 means it is hidden
  245. OBJECTLOC(0)=0
  246. OBJECTLOC(1)=10
  247. OBJECTLOC(2)=7
  248. OBJECTLOC(3)=20
  249. OBJECTLOC(4)=0
  250. OBJECTLOC(5)=13
  251. OBJECTLOC(6)=14
  252. OBJECTLOC(7)=0
  253. OBJECTLOC(8)=0
  254. OBJECTLOC(9)=19
  255. OBJECTLOC(10)=0
  256. OBJECTLOC(11)=18
  257. OBJECTLOC(12)=11
  258. OBJECTLOC(13)=13
  259. OBJECTLOC(14)=6
  260. '* Object 15 doesn't exist, it is used in the inventory to represent   
  261. '* nothing held. 
  262. OBJECTNAME$(15)='' : OBJECTLOC(15)=0
  263. '* the x and y positions of the object, again indexed by the object #
  264. OBX(0)=100 : OBY(0)=100
  265. OBX(1)=271 : OBY(1)=37
  266. OBX(2)=110 : OBY(2)=42
  267. OBX(3)=179 : OBY(3)=98
  268. OBX(4)=100 : OBY(4)=100
  269. OBX(5)=306 : OBY(5)=81
  270. OBX(6)=277 : OBY(6)=102
  271. OBX(7)=100 : OBY(7)=100
  272. OBX(8)=217 : OBY(8)=88
  273. OBX(9)=100 : OBY(9)=100
  274. OBX(10)=143 : OBY(10)=36
  275. OBX(11)=91 : OBY(11)=104
  276. OBX(12)=180 : OBY(12)=94
  277. OBX(13)=51 : OBY(13)=25
  278. OBX(14)=204 : OBY(14)=94
  279. End Proc
  280. Procedure INITNPCS
  281. '* Initialises the non player characters 
  282. NPCNAME$(0)='Scantily clad babe'
  283. NPCNAME$(1)='Old dude'
  284. NPCNAME$(2)='Orc type dude'
  285. NPCNAME$(3)='Hermit dude'
  286. NPCNAME$(4)='Sun bather dude'
  287. NPCNAME$(5)='Little girl dudette'
  288. NPCNAME$(6)='Teleview salesman dude'
  289. NPCLOC(0)=25
  290. NPCLOC(1)=16
  291. NPCLOC(2)=19
  292. NPCLOC(3)=3
  293. NPCLOC(4)=10
  294. NPCLOC(5)=24
  295. NPCLOC(6)=21
  296. NPCX(0)=97 : NPCY(0)=72
  297. NPCX(1)=137 : NPCY(1)=78
  298. NPCX(2)=162 : NPCY(2)=63
  299. NPCX(3)=166 : NPCY(3)=63
  300. NPCX(4)=200 : NPCY(4)=50
  301. NPCX(5)=200 : NPCY(5)=50
  302. NPCX(6)=134 : NPCY(6)=55
  303. End Proc
  304. Procedure CHECKITEMS[ROOMNO]
  305. '* Check a room for the items present, and if they are set up the necessary
  306. '* graphics and zones
  307. For N=0 To 14
  308.    If OBJECTLOC(N)=ROOMNO Then Bob N,OBX(N),OBY(N),N+1 : Set Zone 15+N,OBX(N),OBY(N) To OBX(N)+16,OBY(N)+16
  309.    If OBJECTLOC(N)<>ROOMNO Then Reset Zone 15+N
  310. Next N
  311. End Proc
  312. Procedure CHECKNPCS[ROOMNO]
  313. '* Check a room for the people present 
  314. For N=0 To 6
  315.    If NPCLOC(N)=ROOMNO Then Bob N+15,NPCX(N),NPCY(N),N+16 : Set Zone N+30,NPCX(N),NPCY(N) To NPCX(N)+32,NPCY(N)+32
  316.    If NPCLOC(N)<>ROOMNO Then Reset Zone 30+N
  317. Next N
  318. End Proc
  319. Procedure SUCKER
  320. '* Ha ha ha! 
  321. Change Mouse 3
  322. Load Iff 'sys:pictures/sucker.iff',1
  323. Change Mouse 1
  324. While Mouse Click=0
  325. Wend 
  326. '* Be really patronising 
  327. For N=0 To 14
  328.    INVENTORY(N)=15
  329. Next N
  330. INITOBJECTS
  331. INVENTPOINT=0
  332. Screen Close 1
  333. CURRENTROOM$='room4'
  334. INVENTPRINT[INVENTPOINT]
  335. TALK[PX,PY,'I feel a complete prat now']
  336. End Proc
  337. Procedure CHOOSEOBJECT[OBJECTNO]
  338. '* The user points to something on the screen
  339. If CURRENTOB=OBJECTNO or OBJECTNO<0 Then Pop Proc
  340. CURRENTOB=OBJECTNO
  341. WRITE[OBJECTNAME$(OBJECTNO),2]
  342. CURRENTNPC=-1
  343. End Proc
  344. Procedure CHOOSENPC[NPCNO]
  345. '* select a person 
  346. If CURRENTNPC=NPCNO or NPCNO<0 Then Pop Proc
  347. CURRENTNPC=NPCNO
  348. WRITE[NPCNAME$(NPCNO),2]
  349. CURRENTOB=-1
  350. End Proc
  351. Procedure OBEY
  352. '* Actually do something 
  353. If COMMAND#=1 Then TALK[PX,PY,'Walking to'] : Pop Proc
  354. If COMMAND#=2 and CURRENTNPC=-1 Then GIVE[CURRENTOB] : Pop Proc
  355. If COMMAND#=3 Then TALK[PX,PY,'I cant open that'] : Pop Proc
  356. If COMMAND#=4 Then TALK[PX,PY,'I cant close that'] : Pop Proc
  357. If COMMAND#=5 and CURRENTNPC=-1 Then PICKUP[CURRENTOB] : Pop Proc
  358. If COMMAND#=5 and CURRENTOB=-1 Then PICKUP[CURRENTNPC+15] : Pop Proc
  359. If COMMAND#=6 Then DROP[CURRENTOB] : Pop Proc
  360. If COMMAND#=7 Then EXAMINE[CURRENTOB] : Pop Proc
  361. If COMMAND#=8 Then TALKTO[CURRENTNPC] : Pop Proc
  362. If COMMAND#=9 and CURRENTNPC=-1 Then USE[CURRENTOB] : Pop Proc
  363. If COMMAND#=9 and CURRENTOB=-1 Then USE[CURRENTNPC+15] : Pop Proc
  364. If COMMAND#=10 and CURRENTNPC=-1 Then MURDER[CURRENTOB] : Pop Proc
  365. If COMMAND#=10 and CURRENTOB=-1 Then MURDER[CURRENTNPC+15] : Pop Proc
  366. End Proc
  367. Procedure WALK[TX,TY]
  368. '* Make Edd walk around the scenary
  369. '* Uses RA and RB to calculate the distance,RC is pythag 
  370. If TY<80 Then TY=80
  371. If TY>120 Then TY=120
  372. Channel 0 To Bob 22
  373. Amreg(0)=TX : Amreg(1)=TY
  374. DISTANCEX=TX-PX : DISTANCEY=TY-PY
  375. Amreg(2)=Sqr((DISTANCEX*DISTANCEX)+(DISTANCEY*DISTANCEY))
  376. If TX<PX Then Z$='A RC/5,(24,6)(25,6)(26,6)(27,6)(28,6)(23,1) ; M RA-X,RB-Y,RC'
  377. If TX>PX Then Z$='A RC/5,($8000+24,6)($8000+25,6)($8000+26,6)($8000+27,6)($8000+28,6)($8000+23,1) ; M RA-X,RB-Y,RC'
  378. Amal 0,Z$
  379. Amal On 0
  380. While Chanmv(0)=True and Mouse Click<>2
  381. '* Do nothing
  382. Wend 
  383. Amal Off 0
  384. '* Update edd's position 
  385. PX=X Bob(22) : PY=Y Bob(22)
  386. End Proc
  387. Procedure TALK[X,Y,SPEECH$]
  388. '* Speech bubbles above edd's head 
  389. Screen Open 2,320,16,4,LORES
  390. Screen Display 2,112,40,320,16
  391. Flash Off : Curs Off : Paper 0 : Cls 0
  392. If X=PX Then Pen 1 Else Pen 2
  393. Centre SPEECH$
  394. Wait Len(SPEECH$)*6
  395. Screen Close 2
  396. End Proc
  397. Procedure GIVE[FIRSTOBJECT]
  398. '* Give an item to an NPC
  399. LOC=Val(Mid$(CURRENTROOM$,5,2))
  400. WRITE['Give '+OBJECTNAME$(FIRSTOBJECT)+' to ',1]
  401. While Mouse Click=0
  402.    NOCLICK
  403. Wend 
  404. MZ=Mouse Zone
  405. If MZ=>30 and MZ<=36 Then CHOOSENPC[MZ-30] Else TALK[PX,PY,'I cant do that'] : Pop Proc
  406. If Not ALIVE(CURRENTNPC) Then TALK[PX,PY,'Thats a bit cold'] : Pop Proc
  407. If(FIRSTOBJECT=10) and(OBJECTNAME$(FIRSTOBJECT)='Bottle of Waste') and(CURRENTNPC=4) Then TALK[NPCX(4),NPCY(4),'Thanks, just what I need'] : OBJECTLOC(8)=LOC : LOST[10] : CHECKITEMS[LOC] : Bob 8,OBX(8),OBY(8),9
  408. If(OBJECTNAME$(FIRSTOBJECT)='Dog') and(CURRENTNPC=1) Then TALK[NPCX(1),NPCY(1),'Oh thank you, have this as a token of my gratitiude'] : OBJECTLOC(0)=LOC : Bob 0,OBX(0),OBY(0),1 : LOST[14] : CHECKITEMS[LOC]
  409. If(OBJECTNAME$(FIRSTOBJECT)='Brained dog') and(CURRENTNPC=-1) Then TALK[NPCX(1),NPCY(1),'What the hell have you done to my dog?'] : Pop Proc
  410. INVENTPRINT[INVENTPOINT]
  411. End Proc
  412. Procedure PICKUP[OBJECT]
  413. '* Add an object to the inventory
  414. If OBJECT=>15 Then TALK[PX,PY,'I dont think they would like that'] : Pop Proc
  415. If OBJECTLOC(OBJECT)=0 Then TALK[PX,PY,'I already have that'] : Pop Proc
  416. If OBJECT=11 Then TALK[PX,PY,'Ow! I cant pick that up, Im stumped'] : Pop Proc
  417. If OBJECT=5 or OBJECT=12 or OBJECT=13 Then TALK[PX,PY,'I cant pick that up'] : Pop Proc
  418. WALK[OBX(OBJECT),OBY(OBJECT)]
  419. INVENTORY(IPOINT)=OBJECT
  420. INVENTPRINT[INVENTPOINT]
  421. '* This object does not exist any more 
  422. Bob Off OBJECT
  423. OBJECTLOC(OBJECT)=0
  424. Inc IPOINT
  425. Reset Zone OBJECT+15
  426. End Proc
  427. Procedure DROP[OBJECT]
  428. '* Drop an object, obviously from the inventory
  429. If OBJECT=15 or OBJECT=-1 Then Pop Proc
  430. '* Check if actually carrying
  431. If OBJECTLOC(OBJECT)<>0 Then TALK[PX,PY,'I cant drop that'] : Pop Proc
  432. '* Now find that object in the inventory 
  433. N=0
  434. While OBJECT<>INVENTORY(N)
  435. Inc N
  436. Wend 
  437. INVENTORY(N)=15
  438. If N=IPOINT-1 Then IPOINT=IPOINT-1
  439. OBJECTLOC(OBJECT)=Val(Mid$(CURRENTROOM$,5,2))
  440. OBX(OBJECT)=PX : OBY(OBJECT)=PY-16
  441. Bob OBJECT,OBX(OBJECT),OBY(OBJECT),OBJECT+1
  442. Set Zone OBJECT+15,OBX(OBJECT),OBY(OBJECT) To OBX(OBJECT)+16,OBY(OBJECT)+16
  443. Wait Vbl 
  444. INVENTPRINT[INVENTPOINT]
  445. End Proc
  446. Procedure LOST[ITEM]
  447. '* An item is lost to this world.  Who cares?
  448. N=0
  449. While ITEM<>INVENTORY(N)
  450. Inc N
  451. Wend 
  452. INVENTORY(N)=15
  453. If N=IPOINT-1 Then Dec IPOINT
  454. OBJECTLOC(ITEM)=0
  455. End Proc
  456. Procedure EXAMINE[OBJECT]
  457. '* Examine all objects 
  458. Locate 0,0
  459. If OBJECT=0 Then TALK[PX,PY,'It has a label - Key to exit. Wow!']
  460. If OBJECT=1 Then TALK[PX,PY,'Two common palm leaves']
  461. If OBJECT=2 Then TALK[PX,PY,'Two carotts']
  462. If OBJECT=3 Then TALK[PX,PY,'MMmmm.. A whole yummy coconut, yum, yum!']
  463. If OBJECT=4 Then TALK[PX,PY,'Some mints, hey hold on, they are oxygen tablets.'] : OBJECTNAME$(4)='Oxygen tablets' : INVENTPRINT[INVENTPOINT]
  464. If OBJECT=5 Then TALK[PX,PY,'Obviously some switch of some kind']
  465. If OBJECT=6 Then TALK[PX,PY,'Who would leave a load of iron filings?  Mr. Ellwood?']
  466. If OBJECT=7 Then TALK[PX,PY,'Zen, 3 sticks of dynamite!']
  467. If OBJECT=8 Then TALK[PX,PY,'Cool goggles, just like they ones prats wear']
  468. If OBJECT=9 Then TALK[PX,PY,'9 inch nails']
  469. If OBJECT=10 Then TALK[PX,PY,'A rather empty bottle']
  470. If OBJECT=11 Then TALK[PX,PY,'Wahey, some Toxic waste, probably from Aberavon']
  471. If OBJECT=12 Then TALK[PX,PY,'A fish, a red herring perhaps?']
  472. If OBJECT=13 Then TALK[PX,PY,'I feel sort of attracted']
  473. If OBJECT=14 Then TALK[PX,PY,'I dont like the look of that mutt, shotgun blues.']
  474. End Proc
  475. Procedure TALKTO[PERSON]
  476. '* Yap to someone
  477. If PERSON=-1 Then TALK[PX,PY,'Talking to inanimate objects now eh?'] : Pop Proc
  478. If Not ALIVE(PERSON) Then TALK[PX,PY,'That is very sick'] : Pop Proc
  479. If YAP(PERSON) Then TALKAGAIN[PERSON] : Pop Proc
  480. If PERSON=0 Then TALK[NPCX(0),NPCY(0),'Hi dude, fancy a quick one?'] : TALK[PX,PY,'You tuppeny whore!']
  481. If PERSON=1 Then TALK[NPCX(1),NPCY(1),'Excuse me have you seen my dog?']
  482. If PERSON=2 Then TALK[NPCX(2),NPCY(2),'Rooror!  Im looking for the lost treasure of ASckuban.'] : TALK[NPCX(2),NPCY(2),'So that my people can be freed'] : TALK[PX,PY,'Errm, mate, Youre in the wrong game.']
  483. If PERSON=3 Then TALK[PX,PY,'Hey, are you a hermit?'] : TALK[NPCX(3),NPCY(3),'Yes, Im having a party for all my mates']
  484. If PERSON=4 Then TALK[NPCX(4),NPCY(4),'Go away, Im trying to get a tan. Hey, have to got any lotion?']
  485. If PERSON=5 Then TALK[PX,PY,'Hello little girl'] : TALK[NPCX(5),NPCX(5),'Why dont you sod off?']
  486. If PERSON=6 Then TALK[PX,PY,'Excuse me, have to got a 13Amp plug?'] : TALK[NPCX(6),NPCY(6),'Sorry, I dont but I can order you one']
  487. YAP(PERSON)=True
  488. End Proc
  489. Procedure TALKAGAIN[PERSON]
  490. '* Yap to someone for the second time
  491. LOCATION=Val(Mid$(CURRENTROOM$,5,2))
  492. If PERSON=0 Then TALK[NPCX(0),NPCY(0),'Look, you missed your chance.'] : TALK[PX,PY,'Good, I havent had my shots yet.']
  493. If PERSON=1 Then TALK[NPCX(1),NPCY(1),'Oh dear, I hope that fido isnt lost.']
  494. If PERSON=2 Then TALK[NPCX(2),NPCY(2),'I thought this game looked a bit hi-tech.'] : TALK[PX,PY,'We must be in some kind of time warp space continuim']
  495. If PERSON=3 and OBJECTLOC(10)=0 Then TALK[PX,PY,'Hey, dont you look familiar?'] : TALK[NPCX(3),NPCY(3),'Oh no, no.  Take this bottle, for no apparent reason'] : OBJECTLOC(10)=LOCATION : CHECKITEMS[LOCATION] : Bob 10,OBX(10),OBY(10),11
  496. If PERSON=4 Then TALK[NPCX(4),NPCY(4),'I could really do with some sun-bloc'] : TALK[PX,PY,'Its not exactly ibiza is it?']
  497. If PERSON=5 Then TALK[PX,PY,'Horrible little mite'] : TALK[NPCX(5),NPCX(5),'You still here?']
  498. If PERSON=6 Then TALK[PX,PY,'Do you have Alien killers from Mars?'] : TALK[NPCX(6),NPCY(6),'Sorry, I dont but I can order you one']
  499. End Proc
  500. Procedure USE[FIRSTOBJECT]
  501. '* Use a singular object first 
  502. ICKY=INVENTPOINT
  503. LOC=Val(Mid$(CURRENTROOM$,5,2))
  504. If FIRSTOBJECT=5 and(OBJECTNAME$(12)='Well fed fish') Then TALK[PX,PY,'Boing'] : OBJECTLOC(12)=LOC : OBX(12)=27 : OBY(12)=66 : Bob 12,OBX(12),OBY(12),13 : CHECKITEMS[LOC] : Pop Proc
  505. If FIRSTOBJECT=1 and(OBJECTNAME$(1)<>'Manky leaves') Then TALK[PX,PY,'I know, Ill stick them on my feet'] : OBJECTNAME$(1)='Funky shoes' : INVENTPRINT[INVENTPOINT] : Pop Proc
  506. If FIRSTOBJECT=1 and(OBJECTNAME$(1)='Manky leaves') Then TALK[PX,PY,'These leaves are good for nothing'] : Pop Proc
  507. If FIRSTOBJECT=4 and(OBJECTNAME$(4)='Mints') Then TALK[PX,PY,'Yum,Yum '] : LOST[4] : INVENTPRINT[INVENTPOINT] : Pop Proc
  508. If FIRSTOBJECT=4 and(OBJECTNAME$(4)='Oxygen tablets') Then TALK[PX,PY,'I can breathe really well'] : Inc TASK : LOST[4] : INVENTPRINT[INVENTPOINT] : Pop Proc
  509. If FIRSTOBJECT=8 Then TALK[PX,PY,'I hope I dont take 2 bottles into the shower'] : Inc TASK : LOST[8] : INVENTPRINT[INVENTPOINT] : Pop Proc
  510. If FIRSTOBJECT=15 Then TALK[PX,PY,'groan,groan, this is really sad'] : Pop Proc
  511. '* Use an object on something else, quite trick as 2 objects are needed
  512. If FIRSTOBJECT>15 Then TALK[PX,PY,'I have a feeling that they wouldnt like that'] : Pop Proc
  513. TDOOR=-1
  514. WRITE['Use '+OBJECTNAME$(FIRSTOBJECT)+' on ',1]
  515. While Mouse Click=0
  516.    NOCLICK
  517. Wend 
  518. MZ=Mouse Zone
  519. If MZ=>11 and MZ<=14 Then TDOOR=MZ-11
  520. If MZ=>15 and MZ<=29 Then CHOOSEOBJECT[MZ-15]
  521. If MZ=>30 and MZ<=36 Then CHOOSENPC[MZ-30]
  522. If MZ=>37 and MZ<=46 Then USEINVENT[MZ-37]
  523. If(FIRSTOBJECT=0) and(CURRENTROOM$='room4') and(TDOOR=0) and(STATE(LOC,XDOOR)=2) Then TALK[PX,PY,'OK,unlocking door'] : STATE(LOC,XDOOR)=1 : Pop Proc
  524. If(FIRSTOBJECT=0) and(CURRENTROOM$='room4') and(TDOOR=0) and(STATE(LOC,XDOOR)=1) Then TALK[PX,PY,'Ok,locking door'] : STATE(LOC,XDOOR)=2 : Pop Proc
  525. If(FIRSTOBJECT=3) and(CURRENTOB=14) Then TALK[PX,PY,'Hee Hee wait till the RSPCA hear about this'] : OBJECTNAME$(3)='2 cocunut halves' : OBJECTNAME$(14)='Brained dog' : INVENTPRINT[INVENTPOINT] : Pop Proc
  526. If(FIRSTOBJECT=10) and(CURRENTOB=11) Then TALK[PX,PY,'Ow,its warm'] : OBJECTNAME$(10)='Bottle of Waste' : OBJECTLOC(11)=0 : Bob Off 11 : CHECKITEMS[Val(Mid$(CURRENTROOM$,5,2))] : INVENTPRINT[INVENTPOINT] : Pop Proc
  527. If(FIRSTOBJECT=6) and(CURRENTOB=12) Then TALK[PX,PY,'Here, fish, fishy'] : OBJECTNAME$(12)='Well fed fish' : LOST[6] : INVENTPRINT[INVENTPOINT] : Pop Proc
  528. If(FIRSTOBJECT=2) and(CURRENTOB=3) and(OBJECTNAME$(3)='2 cocunut halves') and(OBJECTLOC(9)<=0) Then TALK[PX,PY,'Ill nail them together!'] : OBJECTLOC(3)=0 : OBJECTNAME$(3)='2 plungers' : Inc TASK : LOST[2] : LOST[9] : INVENTPRINT[ICKY] : Pop Proc
  529. If(FIRSTOBJECT=7) and(CURRENTROOM$='room22') and(TDOOR=0) Then TALK[PX,PY,'Ill blow the chute'] : LOST[7] : INVENTPRINT[INVENTPOINT] : Inc TASK : STATE(LOC,TDOOR)=0 : KABOOM : Pop Proc
  530. TALK[PX,PY,'I cant do that']
  531. End Proc
  532. Procedure USEINVENT[BUTTON]
  533. '* Does something with carried objects 
  534. If BUTTON=0 Then Dec INVENTPOINT : INVENTPRINT[INVENTPOINT]
  535. If BUTTON=1 Then Inc INVENTPOINT : INVENTPRINT[INVENTPOINT]
  536. If BUTTON=>2 and BUTTON<=9 Then CURRENTOB=INVENTORY(BUTTON-2+INVENTPOINT) : WRITE[OBJECTNAME$(CURRENTOB),2]
  537. End Proc
  538. Procedure MURDER[OBJECT]
  539. '* Do some killing 
  540. '* Check if it's something that he can kill
  541. LOC=Val(Mid$(CURRENTROOM$,5,2))
  542. If OBJECT=>0 and OBJECT<=11 or OBJECT=13 Then TALK[PX,PY,'How am I supposed to kill that'] : Pop Proc
  543. If(OBJECT=12) and(LOC=13) and(OBJECTNAME$(12)='Well fed fish') Then TALK[PX,PY,'I feel totally evil'] : OBJECTNAME$(12)='Gutted fish' : OBJECTLOC(7)=Val(Mid$(CURRENTROOM$,5,2)) : CHECKITEMS[OBJECTLOC(7)] : Bob 7,OBX(7),OBY(7),8 : Pop Proc
  544. If(OBJECT=12) and(LOC=13) and(OBJECTNAME$(12)='Gutted fish') Then TALK[PX,PY,'Killing again?'] : Pop Proc
  545. If(OBJECT=12) and(CURRENTROOM$<>'room13') Then TALK[PX,PY,'I cant reach it'] : Pop Proc
  546. If Not ALIVE(OBJECT-15) Then TALK[PX,PY,'Not even I can do that!'] : Pop Proc
  547. If OBJECT=15 Then NPCNAME$(0)='Dead Woman'
  548. If OBJECT=16 Then NPCNAME$(1)='Old stiff'
  549. If OBJECT=17 Then TALK[PX,P,'Argh! This guy is too solid'] : End 
  550. If OBJECT=18 Then NPCNAME$(3)='Dead hermit'
  551. If OBJECT=19 Then NPCNAME$(4)='Dead sun bather'
  552. If OBJECT=20 Then NPCNAME$(5)='Dead girly (ha ha)' : OBJECTLOC(4)=Val(Mid$(CURRENTROOM$,5,2)) : CHECKITEMS[OBJECTLOC(4)] : Bob 4,OBX(4),OBY(4),5
  553. If OBJECT=21 Then TALK[PX,PY,'I wont bother, hes clinically dead anyway']
  554. TALK[PX,PY,'Scree,scree,scree']
  555. ALIVE(OBJECT-15)=False
  556. End Proc
  557. Procedure CONGRATS
  558. '* Wahey! Completion of the whole thing! 
  559. Screen Open 0,320,200,4096,LORES
  560. Change Mouse 3
  561. Load 'sys:music/magiciansquarter.abk',3
  562. Load Iff 'sys:pictures/nicepic.iff',0
  563. Change Mouse 1
  564. Music 1
  565. While Mouse Click=0
  566. Wend 
  567. Paper 0 : Pen 1 : Cls 0
  568. Print 'Well done!  You actually managed to'
  569. Print 'complete the whole game.'
  570. Print 'Well done, you have indeed done'
  571. Print 'good......'
  572. Print 
  573. Print 'Have you found all the hidden'
  574. Print 'features?'
  575. While Mouse Click=0
  576. Wend 
  577. Music Off 
  578. End 
  579. End Proc
  580. Procedure KABOOM
  581. '* Bounce the screen a bit.
  582. For N=1 To 5
  583.    Screen Display 0,114,50,320,200 : Wait Vbl 
  584.    Screen Display 0,114,40,320,200 : Wait Vbl 
  585. Next N
  586. End Proc
  587. Procedure PROFOUND[NO]
  588. '* Utter a profound statement! 
  589. If NO=>500 Then Pop Proc
  590. If NO=1 Then TALK[PX,PY,'Hey, youre taking your time with this game']
  591. If NO=13 Then TALK[PX,PY,'Drink pepsi']
  592. If NO=115 Then TALK[PX,PY,'Kill your family']
  593. If NO=146 Then TALK[PX,PY,'Blow up a rave']
  594. If NO=223 Then TALK[PX,PY,'Go out and brain a faggot']
  595. If NO=299 Then TALK[PX,PY,'Worship Satan!']
  596. If NO=321 Then TALK[PX,PY,'Eat at the pizza hut, great food!']
  597. If NO=339 Then TALK[PX,PY,'Smoke pot']
  598. If NO=441 Then TALK[PX,PY,'Listen to loud music']
  599. If NO=477 Then TALK[PX,PY,'Are you doing this right?']
  600. End Proc
  601. Procedure COMMENT[ROOM]
  602. '* Say something when going into a room for the first time 
  603. If BEEN(ROOM) Then Pop Proc
  604. If ROOM=1 Then TALK[PX,PY,'Oh no, how am I going to get out?']
  605. If ROOM=6 Then TALK[PX,PY,'Whos that yappin?']
  606. If ROOM=17 Then TALK[PX,PY,'This must be the Thames']
  607. If ROOM=18 Then TALK[PX,PY,'Hey, HR Giger or what?']
  608. If ROOM=19 Then TALK[PX,PY,'Cosmic thang']
  609. If ROOM=21 Then TALK[PX,PY,'OH no!!!!!!!!']
  610. BEEN(ROOM)=True
  611. End Proc
  612. Procedure OHSHIT
  613. '* Something bad has happenned.... 
  614. Cls 0
  615. Bell 
  616. Print 'Something wonderful has happenned....'
  617. Print 'You have managed to crash this game.'
  618. Print 'Actually this isnt that difficult'
  619. Print 'Please send a note to us telling us what went wrong.'
  620. Print 'That way we could perfect the game engine.'
  621. Print 'Press a key - going back, may cause something'
  622. Print 'strange to happen.'
  623. Wait Key 
  624. Resume 
  625. End Proc
  626. '* Data for the rooms  
  627. '* The first 4 are N,E,S,W locations, 0 denotes not valid. 
  628. '* Next are door states, opened, locked .. 
  629. ROOM1:
  630. Data 4,2,9,8
  631. Data 'sys:pictures/room1.iff'
  632. Data 0
  633. ROOM2:
  634. Data 11,3,0,1
  635. Data 'sys:pictures/room2.iff'
  636. Data 0
  637. ROOM3:
  638. Data 0,25,0,2
  639. Data 'sys:pictures/room3.iff'
  640. Data 0
  641. ROOM4:
  642. Data 26,0,1,5
  643. Data 'sys:pictures/room4.iff'
  644. Data 0
  645. ROOM5:
  646. Data 6,4,0,0
  647. Data 'sys:pictures/room5.iff'
  648. Data 0
  649. ROOM6:
  650. Data 0,0,0,7
  651. Data 'sys:pictures/room6.iff'
  652. Data 0
  653. ROOM7:
  654. Data 0,0,8,0
  655. Data 'sys:pictures/room7.iff'
  656. Data 0
  657. ROOM8:
  658. Data 0,1,0,0
  659. Data 'sys:pictures/room8.iff'
  660. Data 0
  661. ROOM9:
  662. Data 1,10,0,14
  663. Data 'sys:pictures/room9.iff'
  664. Data 0
  665. ROOM10:
  666. Data 0,0,0,9
  667. Data 'sys:pictures/room10.iff'
  668. Data 0
  669. ROOM11:
  670. Data 0,12,2,0
  671. Data 'sys:pictures/room11.iff'
  672. Data 0
  673. ROOM12:
  674. Data 13,0,0,11
  675. Data 'sys:pictures/room12.iff'
  676. Data 0
  677. ROOM13:
  678. Data 0,23,12,0
  679. Data 'sys:pictures/room13.iff'
  680. Data 0
  681. ROOM14:
  682. Data 9,0,15,0
  683. Data 'sys:pictures/room14.iff'
  684. Data 0
  685. ROOM15:
  686. Data 14,20,18,16
  687. Data 'sys:pictures/room15.iff'
  688. Data 0
  689. ROOM16:
  690. Data 0,15,17,0
  691. Data 'sys:pictures/room16.iff'
  692. Data 0
  693. ROOM17:
  694. Data 16,18,0,0
  695. Data 'sys:pictures/room17.iff'
  696. Data 0
  697. ROOM18:
  698. Data 15,19,0,17
  699. Data 'sys:pictures/room18.iff'
  700. Data 0
  701. ROOM19:
  702. Data 20,0,0,18
  703. Data 'sys:pictures/room19.iff'
  704. Data 0
  705. ROOM20:
  706. Data 0,21,19,15
  707. Data 'sys:pictures/room20.iff'
  708. Data 0
  709. ROOM21:
  710. Data 22,0,20,0
  711. Data 'sys:pictures/room21.iff'
  712. Data 0
  713. ROOM22:
  714. Data 27,0,21,0
  715. Data 'sys:pictures/room22.iff'
  716. Data 0
  717. ROOM23:
  718. Data 0,24,0,13
  719. Data 'sys:pictures/room23.iff'
  720. Data 0
  721. ROOM24:
  722. Data 0,0,0,23
  723. Data 'sys:pictures/room24.iff'
  724. Data 0
  725. ROOM25:
  726. Data 0,0,0,3
  727. Data 'sys:pictures/room25.iff'
  728. Data 0