Dim XDIRECTION(3),STATE(25,3),OBJECTNAME$(15),OBJECTLOC(15)
Dim INVENTORY(14),NPCNAME$(6),NPCLOC(6),OBX(14),OBY(14)
Dim NPCX(6),NPCY(6),BEEN(25),YAP(6),ALIVE(6)
Global COMMAND#,XDIRECTION(),CURRENTROOM$,GOING,XDOOR
Global STATE(),OBJECTNAME$(),OBJECTLOC(),INVENTORY(),NPCNAME$()
Global NPCLOC(),OBX(),OBY(),CURRENTOB,IPOINT,NPCX(),NPCY()
Global CURRENTNPC,PX,PY,INVENTPOINT,EX,EY,TASK,BEEN(),YAP()
Global ALIVE()
Break Off
Get Rom Fonts
Randomize Timer
On Error Proc OHSHIT
Screen Hide 0 : Auto View Off
Screen Open 0,320,200,32,LORES
Screen Display 0,112,40,320,200
Wait Vbl : Double Buffer
Show : Flash Off : Curs Off : Cls 0
Get Sprite Palette
Unpack 5,0,120
Screen Show 0 : Auto View On
Limit Mouse 112,40 To 432,240
'* Create the necessary zones
Reserve Zone 46
BUTTNO=1
For X=8 To 80 Step 72
For Y=135 To 183 Step 12
Set Zone BUTTNO,X,Y To X+7,Y+7
Inc BUTTNO
Next Y
Next X
'* and now the zones for the doors
Set Zone 11,225,43 To 257,81
Set Zone 12,288,72 To 304,104
Set Zone 13,58,82 To 90,120
Set Zone 14,16,72 To 40,104
'* Zones for the inventory
Set Zone 37,306,129 To 314,153
Set Zone 38,306,167 To 314,191
BUTTNO=39
For N=128 To 184 Step 8
Set Zone BUTTNO,168,N To 296,N+8
Inc BUTTNO
Next N
INITIALISE
'* The serious stuff!
CURRENTROOM$='room1'
INITOBJECTS
INITNPCS
IPOINT=0
INVENTPOINT=0
INVENTPRINT[INVENTPOINT]
TASK=0
'* Where the player starts from in a room
EX=100 : EY=80
'*********************
'* *
'* Going into a room *
'* *
'*********************
ENTER:
PX=EX : PY=EY
If CURRENTROOM$='room26' Then SUCKER
If CURRENTROOM$='room27' Then CONGRATS
COMMAND#=1 : COMMAND[1]
WRITE[' ',2]
GOING=0
CURRENTOB=-1 : CURRENTNPC=-1
Restore CURRENTROOM$
For N=0 To 3
Read XDIRECTION(N)
Next N
Read PIC$
Change Mouse 3
Load Iff PIC$,1
Change Mouse 1
Screen Hide 1
Screen Copy 1,0,0,320,120 To Logic(0),0,0
Screen Copy 1,0,0,320,120 To Physic(0),0,0
Screen 0 : Screen Close 1
Screen Show 0
Bob 22,PX,PY,23
CHECKITEMS[Val(Mid$(CURRENTROOM$,5,2))]
CHECKNPCS[Val(Mid$(CURRENTROOM$,5,2))]
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]
PROFOUND[Rnd(1000)]
COMMENT[Val(Mid$(CURRENTROOM$,5,2))]
While GOING<>1
' * Main program loop
If Mouse Click=1 Then CLICK
If Mouse Click=0 Then NOCLICK
Wend
'* Go to the next room, do some garbage collection first
Bob Off
Goto ENTER
End
Procedure CLICK
'* speed things up a bit
'* There was a little bug here, after moving to a door, the bob
'* would then walk to the current mouse position. Hence the pop
'* proc in the next line. Maybe they should be present in all the procedures
If Mouse Zone<>0 Then USER[Mouse Zone] : Pop Proc
If Mouse Zone=0 and COMMAND#=1 Then WALK[X Mouse-112,Y Mouse-40]
End Proc
Procedure NOCLICK
'* speedy
If Mouse Zone=>15 and Mouse Zone<=29 Then MZ=Mouse Zone : CHOOSEOBJECT[MZ-15]
If Mouse Zone=>30 and Mouse Zone<=36 Then MZ=Mouse Zone : CHOOSENPC[MZ-30]
If Mouse Zone=0 Then CURRENTOB=-1 : CURRENTNPC=-1 : WRITE[' ',2]
End Proc
Procedure INITIALISE
'* Initialises many of the required variables to their original state
'* Nothing held
For N=0 To 14
INVENTORY(N)=15
Next N
'* Haven't been anywhere yet
For N=0 To 25
BEEN(N)=False
Next N
'* Haven't spoken to anyone yet, and their all alive
For N=0 To 6
YAP(N)=False : ALIVE(N)=True
Next N
'* Initialise the doors
For N=1 To 25
For X=0 To 3
STATE(N,X)=0
Next X
Next N
STATE(2,1)=1 : STATE(4,0)=2 : STATE(22,0)=2
End Proc
Procedure USER[BUTTON]
'* This procedure processes the users input, anything from 1-8 means
'* a command
If BUTTON=>1 and BUTTON<=10 Then COMMAND[BUTTON]
If BUTTON=>11 and BUTTON<=14 Then MOVE[BUTTON-11]
If BUTTON=>15 and BUTTON<=36 Then OBEY
If BUTTON=>37 and BUTTON<=46 Then INVENT[BUTTON-37]
End Proc
Procedure COMMAND[BUTTON]
'* Returns the command
If BUTTON=1 Then WRITE['Walk to',1]
If BUTTON=2 Then WRITE['Give',1]
If BUTTON=3 Then WRITE['Open',1]
If BUTTON=4 Then WRITE['Close',1]
If BUTTON=5 Then WRITE['Pick up',1]
If BUTTON=6 Then WRITE['Drop',1]
If BUTTON=7 Then WRITE['Examine',1]
If BUTTON=8 Then WRITE['Talk to',1]
If BUTTON=9 Then WRITE['Use',1]
If BUTTON=10 Then WRITE['Stab repeatedly',1]
COMMAND#=BUTTON
End Proc
Procedure MOVE[XDOOR]
'* Things to do with doors!
'* Check if door exists...
'* Xdoor is door number
Locate 0,0 : Paper 0 : Pen 1
If XDIRECTION(XDOOR)=0 Then Pop Proc
LOC=Val(Mid$(CURRENTROOM$,5,2))
WRITE['Door',2]
'* Check if you can go into the swamp
'* Perhaps check if carrying???
If(CURRENTROOM$='room5') and(XDOOR=0) and(OBJECTNAME$(1)<>'Funky shoes') Then TALK[PX,PY,'Ill sink!'] : Pop Proc
If(CURRENTROOM$='room22') and(XDOOR=0) and(TASK<>4) Then TALK[PX,PY,'Ill drown'] : Pop Proc
'* Ok, back to business
If XDOOR=0 Then WALK[225,81] : EX=58 : EY=120
If XDOOR=1 Then WALK[288,104] : EX=16 : EY=104
If XDOOR=2 Then WALK[58,120] : EX=225 : EY=81
If XDOOR=3 Then WALK[16,104] : EX=288 : EY=104
If COMMAND#=1 and STATE(LOC,XDOOR)=0 Then CURRENTROOM$='room'+Str$(XDIRECTION(XDOOR))-' ' : GOING=1 : Pop Proc
If COMMAND#=1 and STATE(LOC,XDOOR)=1 Then TALK[PX,PY,'The door is closed (petty huh?)']
If COMMAND#=1 and STATE(LOC,XDOOR)=2 Then TALK[PX,PY,'It is locked']
If COMMAND#=2 Then TALK[PX,PY,'To whom?']
If COMMAND#=3 and STATE(LOC,XDOOR)=1 Then TALK[PX,PY,'Ok, opening door'] : STATE(LOC,XDOOR)=0
If COMMAND#=4 and STATE(LOC,XDOOR)=0 Then TALK[PX,PY,'Ok, closing door'] : STATE(LOC,XDOOR)=1
If COMMAND#=5 Then TALK[PX,PY,'Hey maybe I can surf!']
If COMMAND#=6 Then TALK[PX,PY,'I never had it in the first place']
If COMMAND#=7 Then TALK[PX,PY,'Its a hole in the wall']
If COMMAND#=8 Then TALK[PX,PY,'What are you smoking?']
If COMMAND#=9 Then TALK[PX,PY,'its already open, its a hole.']
If COMMAND#=10 Then TALK[PX,PY,'Stab, stab....']
End Proc
Procedure WRITE[COMMENT$,NO]
'* Writes the users input to the screen
Ink 1,0
Set Font 2
If NO=1 Then Text 0,126,' ' : Text 0,126,COMMENT$
If NO=2 Then Text 160,126,' ' : Text 160,126,COMMENT$
End Proc
Procedure INVENT[BUTTON]
'* Does something with carried objects
If BUTTON=0 Then Dec INVENTPOINT : INVENTPRINT[INVENTPOINT]
If BUTTON=1 Then Inc INVENTPOINT : INVENTPRINT[INVENTPOINT]
If BUTTON=>2 and BUTTON<=9 Then CURRENTOB=INVENTORY(BUTTON-2+INVENTPOINT) : WRITE[OBJECTNAME$(CURRENTOB),2] : OBEY
End Proc
Procedure INVENTPRINT[PSTART]
'* print the inventory
'* I had the idea for this from a lab I did in Uni
If PSTART<0 Then INVENTPOINT=1 : Pop Proc
If PSTART>6 Then INVENTPOINT=6 : Pop Proc
Writing 0
Paper 0 : Pen 1
YPOS=16
For N=PSTART To PSTART+7
Locate 21,YPOS
NAME$=OBJECTNAME$(INVENTORY(N))
If INVENTORY(N)=15 Then Print ' ' Else Print NAME$;Space$(16-Len(NAME$))
Inc YPOS
Next N
'* put cursor back at top
Home
End Proc
Procedure INITOBJECTS
'* Loads in all the object data
'* The name of the object, all indexed by the object number
OBJECTNAME$(0)='Golden key'
OBJECTNAME$(1)='Palm leaves'
OBJECTNAME$(2)='Two carrots'
OBJECTNAME$(3)='Coconut'
OBJECTNAME$(4)='Mints'
OBJECTNAME$(5)='Switch'
OBJECTNAME$(6)='Iron filings'
OBJECTNAME$(7)='Dynamite'
OBJECTNAME$(8)='Goggles'
OBJECTNAME$(9)='Nails'
OBJECTNAME$(10)='Bottle'
OBJECTNAME$(11)='Toxic waste'
OBJECTNAME$(12)='Fish'
OBJECTNAME$(13)='Magnet'
OBJECTNAME$(14)='Dog'
'* the room number of each object, a 0 means it is hidden
OBJECTLOC(0)=0
OBJECTLOC(1)=10
OBJECTLOC(2)=7
OBJECTLOC(3)=20
OBJECTLOC(4)=0
OBJECTLOC(5)=13
OBJECTLOC(6)=14
OBJECTLOC(7)=0
OBJECTLOC(8)=0
OBJECTLOC(9)=19
OBJECTLOC(10)=0
OBJECTLOC(11)=18
OBJECTLOC(12)=11
OBJECTLOC(13)=13
OBJECTLOC(14)=6
'* Object 15 doesn't exist, it is used in the inventory to represent
'* nothing held.
OBJECTNAME$(15)='' : OBJECTLOC(15)=0
'* the x and y positions of the object, again indexed by the object #
OBX(0)=100 : OBY(0)=100
OBX(1)=271 : OBY(1)=37
OBX(2)=110 : OBY(2)=42
OBX(3)=179 : OBY(3)=98
OBX(4)=100 : OBY(4)=100
OBX(5)=306 : OBY(5)=81
OBX(6)=277 : OBY(6)=102
OBX(7)=100 : OBY(7)=100
OBX(8)=217 : OBY(8)=88
OBX(9)=100 : OBY(9)=100
OBX(10)=143 : OBY(10)=36
OBX(11)=91 : OBY(11)=104
OBX(12)=180 : OBY(12)=94
OBX(13)=51 : OBY(13)=25
OBX(14)=204 : OBY(14)=94
End Proc
Procedure INITNPCS
'* Initialises the non player characters
NPCNAME$(0)='Scantily clad babe'
NPCNAME$(1)='Old dude'
NPCNAME$(2)='Orc type dude'
NPCNAME$(3)='Hermit dude'
NPCNAME$(4)='Sun bather dude'
NPCNAME$(5)='Little girl dudette'
NPCNAME$(6)='Teleview salesman dude'
NPCLOC(0)=25
NPCLOC(1)=16
NPCLOC(2)=19
NPCLOC(3)=3
NPCLOC(4)=10
NPCLOC(5)=24
NPCLOC(6)=21
NPCX(0)=97 : NPCY(0)=72
NPCX(1)=137 : NPCY(1)=78
NPCX(2)=162 : NPCY(2)=63
NPCX(3)=166 : NPCY(3)=63
NPCX(4)=200 : NPCY(4)=50
NPCX(5)=200 : NPCY(5)=50
NPCX(6)=134 : NPCY(6)=55
End Proc
Procedure CHECKITEMS[ROOMNO]
'* Check a room for the items present, and if they are set up the necessary
'* graphics and zones
For N=0 To 14
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
If OBJECTLOC(N)<>ROOMNO Then Reset Zone 15+N
Next N
End Proc
Procedure CHECKNPCS[ROOMNO]
'* Check a room for the people present
For N=0 To 6
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
If NPCLOC(N)<>ROOMNO Then Reset Zone 30+N
Next N
End Proc
Procedure SUCKER
'* Ha ha ha!
Change Mouse 3
Load Iff 'sys:pictures/sucker.iff',1
Change Mouse 1
While Mouse Click=0
Wend
'* Be really patronising
For N=0 To 14
INVENTORY(N)=15
Next N
INITOBJECTS
INVENTPOINT=0
Screen Close 1
CURRENTROOM$='room4'
INVENTPRINT[INVENTPOINT]
TALK[PX,PY,'I feel a complete prat now']
End Proc
Procedure CHOOSEOBJECT[OBJECTNO]
'* The user points to something on the screen
If CURRENTOB=OBJECTNO or OBJECTNO<0 Then Pop Proc
CURRENTOB=OBJECTNO
WRITE[OBJECTNAME$(OBJECTNO),2]
CURRENTNPC=-1
End Proc
Procedure CHOOSENPC[NPCNO]
'* select a person
If CURRENTNPC=NPCNO or NPCNO<0 Then Pop Proc
CURRENTNPC=NPCNO
WRITE[NPCNAME$(NPCNO),2]
CURRENTOB=-1
End Proc
Procedure OBEY
'* Actually do something
If COMMAND#=1 Then TALK[PX,PY,'Walking to'] : Pop Proc
If COMMAND#=2 and CURRENTNPC=-1 Then GIVE[CURRENTOB] : Pop Proc
If COMMAND#=3 Then TALK[PX,PY,'I cant open that'] : Pop Proc
If COMMAND#=4 Then TALK[PX,PY,'I cant close that'] : Pop Proc
If COMMAND#=5 and CURRENTNPC=-1 Then PICKUP[CURRENTOB] : Pop Proc
If COMMAND#=5 and CURRENTOB=-1 Then PICKUP[CURRENTNPC+15] : Pop Proc
If COMMAND#=6 Then DROP[CURRENTOB] : Pop Proc
If COMMAND#=7 Then EXAMINE[CURRENTOB] : Pop Proc
If COMMAND#=8 Then TALKTO[CURRENTNPC] : Pop Proc
If COMMAND#=9 and CURRENTNPC=-1 Then USE[CURRENTOB] : Pop Proc
If COMMAND#=9 and CURRENTOB=-1 Then USE[CURRENTNPC+15] : Pop Proc
If COMMAND#=10 and CURRENTNPC=-1 Then MURDER[CURRENTOB] : Pop Proc
If COMMAND#=10 and CURRENTOB=-1 Then MURDER[CURRENTNPC+15] : Pop Proc
End Proc
Procedure WALK[TX,TY]
'* Make Edd walk around the scenary
'* Uses RA and RB to calculate the distance,RC is pythag
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'
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'
Amal 0,Z$
Amal On 0
While Chanmv(0)=True and Mouse Click<>2
'* Do nothing
Wend
Amal Off 0
'* Update edd's position
PX=X Bob(22) : PY=Y Bob(22)
End Proc
Procedure TALK[X,Y,SPEECH$]
'* Speech bubbles above edd's head
Screen Open 2,320,16,4,LORES
Screen Display 2,112,40,320,16
Flash Off : Curs Off : Paper 0 : Cls 0
If X=PX Then Pen 1 Else Pen 2
Centre SPEECH$
Wait Len(SPEECH$)*6
Screen Close 2
End Proc
Procedure GIVE[FIRSTOBJECT]
'* Give an item to an NPC
LOC=Val(Mid$(CURRENTROOM$,5,2))
WRITE['Give '+OBJECTNAME$(FIRSTOBJECT)+' to ',1]
While Mouse Click=0
NOCLICK
Wend
MZ=Mouse Zone
If MZ=>30 and MZ<=36 Then CHOOSENPC[MZ-30] Else TALK[PX,PY,'I cant do that'] : Pop Proc
If Not ALIVE(CURRENTNPC) Then TALK[PX,PY,'Thats a bit cold'] : Pop Proc
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
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]
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
INVENTPRINT[INVENTPOINT]
End Proc
Procedure PICKUP[OBJECT]
'* Add an object to the inventory
If OBJECT=>15 Then TALK[PX,PY,'I dont think they would like that'] : Pop Proc
If OBJECTLOC(OBJECT)=0 Then TALK[PX,PY,'I already have that'] : Pop Proc
If OBJECT=11 Then TALK[PX,PY,'Ow! I cant pick that up, Im stumped'] : Pop Proc
If OBJECT=5 or OBJECT=12 or OBJECT=13 Then TALK[PX,PY,'I cant pick that up'] : Pop Proc
WALK[OBX(OBJECT),OBY(OBJECT)]
INVENTORY(IPOINT)=OBJECT
INVENTPRINT[INVENTPOINT]
'* This object does not exist any more
Bob Off OBJECT
OBJECTLOC(OBJECT)=0
Inc IPOINT
Reset Zone OBJECT+15
End Proc
Procedure DROP[OBJECT]
'* Drop an object, obviously from the inventory
If OBJECT=15 or OBJECT=-1 Then Pop Proc
'* Check if actually carrying
If OBJECTLOC(OBJECT)<>0 Then TALK[PX,PY,'I cant drop that'] : Pop Proc
'* Now find that object in the inventory
N=0
While OBJECT<>INVENTORY(N)
Inc N
Wend
INVENTORY(N)=15
If N=IPOINT-1 Then IPOINT=IPOINT-1
OBJECTLOC(OBJECT)=Val(Mid$(CURRENTROOM$,5,2))
OBX(OBJECT)=PX : OBY(OBJECT)=PY-16
Bob OBJECT,OBX(OBJECT),OBY(OBJECT),OBJECT+1
Set Zone OBJECT+15,OBX(OBJECT),OBY(OBJECT) To OBX(OBJECT)+16,OBY(OBJECT)+16
Wait Vbl
INVENTPRINT[INVENTPOINT]
End Proc
Procedure LOST[ITEM]
'* An item is lost to this world. Who cares?
N=0
While ITEM<>INVENTORY(N)
Inc N
Wend
INVENTORY(N)=15
If N=IPOINT-1 Then Dec IPOINT
OBJECTLOC(ITEM)=0
End Proc
Procedure EXAMINE[OBJECT]
'* Examine all objects
Locate 0,0
If OBJECT=0 Then TALK[PX,PY,'It has a label - Key to exit. Wow!']
If OBJECT=1 Then TALK[PX,PY,'Two common palm leaves']
If OBJECT=2 Then TALK[PX,PY,'Two carotts']
If OBJECT=3 Then TALK[PX,PY,'MMmmm.. A whole yummy coconut, yum, yum!']
If OBJECT=4 Then TALK[PX,PY,'Some mints, hey hold on, they are oxygen tablets.'] : OBJECTNAME$(4)='Oxygen tablets' : INVENTPRINT[INVENTPOINT]
If OBJECT=5 Then TALK[PX,PY,'Obviously some switch of some kind']
If OBJECT=6 Then TALK[PX,PY,'Who would leave a load of iron filings? Mr. Ellwood?']
If OBJECT=7 Then TALK[PX,PY,'Zen, 3 sticks of dynamite!']
If OBJECT=8 Then TALK[PX,PY,'Cool goggles, just like they ones prats wear']
If OBJECT=9 Then TALK[PX,PY,'9 inch nails']
If OBJECT=10 Then TALK[PX,PY,'A rather empty bottle']
If OBJECT=11 Then TALK[PX,PY,'Wahey, some Toxic waste, probably from Aberavon']
If OBJECT=12 Then TALK[PX,PY,'A fish, a red herring perhaps?']
If OBJECT=13 Then TALK[PX,PY,'I feel sort of attracted']
If OBJECT=14 Then TALK[PX,PY,'I dont like the look of that mutt, shotgun blues.']
End Proc
Procedure TALKTO[PERSON]
'* Yap to someone
If PERSON=-1 Then TALK[PX,PY,'Talking to inanimate objects now eh?'] : Pop Proc
If Not ALIVE(PERSON) Then TALK[PX,PY,'That is very sick'] : Pop Proc
If YAP(PERSON) Then TALKAGAIN[PERSON] : Pop Proc
If PERSON=0 Then TALK[NPCX(0),NPCY(0),'Hi dude, fancy a quick one?'] : TALK[PX,PY,'You tuppeny whore!']
If PERSON=1 Then TALK[NPCX(1),NPCY(1),'Excuse me have you seen my dog?']
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.']
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']
If PERSON=4 Then TALK[NPCX(4),NPCY(4),'Go away, Im trying to get a tan. Hey, have to got any lotion?']
If PERSON=5 Then TALK[PX,PY,'Hello little girl'] : TALK[NPCX(5),NPCX(5),'Why dont you sod off?']
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']
YAP(PERSON)=True
End Proc
Procedure TALKAGAIN[PERSON]
'* Yap to someone for the second time
LOCATION=Val(Mid$(CURRENTROOM$,5,2))
If PERSON=0 Then TALK[NPCX(0),NPCY(0),'Look, you missed your chance.'] : TALK[PX,PY,'Good, I havent had my shots yet.']
If PERSON=1 Then TALK[NPCX(1),NPCY(1),'Oh dear, I hope that fido isnt lost.']
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']
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
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?']
If PERSON=5 Then TALK[PX,PY,'Horrible little mite'] : TALK[NPCX(5),NPCX(5),'You still here?']
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']
End Proc
Procedure USE[FIRSTOBJECT]
'* Use a singular object first
ICKY=INVENTPOINT
LOC=Val(Mid$(CURRENTROOM$,5,2))
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
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
If FIRSTOBJECT=1 and(OBJECTNAME$(1)='Manky leaves') Then TALK[PX,PY,'These leaves are good for nothing'] : Pop Proc
If FIRSTOBJECT=4 and(OBJECTNAME$(4)='Mints') Then TALK[PX,PY,'Yum,Yum '] : LOST[4] : INVENTPRINT[INVENTPOINT] : Pop Proc
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
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
If FIRSTOBJECT=15 Then TALK[PX,PY,'groan,groan, this is really sad'] : Pop Proc
'* Use an object on something else, quite trick as 2 objects are needed
If FIRSTOBJECT>15 Then TALK[PX,PY,'I have a feeling that they wouldnt like that'] : Pop Proc
TDOOR=-1
WRITE['Use '+OBJECTNAME$(FIRSTOBJECT)+' on ',1]
While Mouse Click=0
NOCLICK
Wend
MZ=Mouse Zone
If MZ=>11 and MZ<=14 Then TDOOR=MZ-11
If MZ=>15 and MZ<=29 Then CHOOSEOBJECT[MZ-15]
If MZ=>30 and MZ<=36 Then CHOOSENPC[MZ-30]
If MZ=>37 and MZ<=46 Then USEINVENT[MZ-37]
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
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
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
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
If(FIRSTOBJECT=6) and(CURRENTOB=12) Then TALK[PX,PY,'Here, fish, fishy'] : OBJECTNAME$(12)='Well fed fish' : LOST[6] : INVENTPRINT[INVENTPOINT] : Pop Proc
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
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
TALK[PX,PY,'I cant do that']
End Proc
Procedure USEINVENT[BUTTON]
'* Does something with carried objects
If BUTTON=0 Then Dec INVENTPOINT : INVENTPRINT[INVENTPOINT]
If BUTTON=1 Then Inc INVENTPOINT : INVENTPRINT[INVENTPOINT]
If BUTTON=>2 and BUTTON<=9 Then CURRENTOB=INVENTORY(BUTTON-2+INVENTPOINT) : WRITE[OBJECTNAME$(CURRENTOB),2]
End Proc
Procedure MURDER[OBJECT]
'* Do some killing
'* Check if it's something that he can kill
LOC=Val(Mid$(CURRENTROOM$,5,2))
If OBJECT=>0 and OBJECT<=11 or OBJECT=13 Then TALK[PX,PY,'How am I supposed to kill that'] : Pop Proc
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
If(OBJECT=12) and(LOC=13) and(OBJECTNAME$(12)='Gutted fish') Then TALK[PX,PY,'Killing again?'] : Pop Proc
If(OBJECT=12) and(CURRENTROOM$<>'room13') Then TALK[PX,PY,'I cant reach it'] : Pop Proc
If Not ALIVE(OBJECT-15) Then TALK[PX,PY,'Not even I can do that!'] : Pop Proc
If OBJECT=15 Then NPCNAME$(0)='Dead Woman'
If OBJECT=16 Then NPCNAME$(1)='Old stiff'
If OBJECT=17 Then TALK[PX,P,'Argh! This guy is too solid'] : End
If OBJECT=18 Then NPCNAME$(3)='Dead hermit'
If OBJECT=19 Then NPCNAME$(4)='Dead sun bather'
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
If OBJECT=21 Then TALK[PX,PY,'I wont bother, hes clinically dead anyway']
TALK[PX,PY,'Scree,scree,scree']
ALIVE(OBJECT-15)=False
End Proc
Procedure CONGRATS
'* Wahey! Completion of the whole thing!
Screen Open 0,320,200,4096,LORES
Change Mouse 3
Load 'sys:music/magiciansquarter.abk',3
Load Iff 'sys:pictures/nicepic.iff',0
Change Mouse 1
Music 1
While Mouse Click=0
Wend
Paper 0 : Pen 1 : Cls 0
Print 'Well done! You actually managed to'
Print 'complete the whole game.'
Print 'Well done, you have indeed done'
Print 'good......'
Print
Print 'Have you found all the hidden'
Print 'features?'
While Mouse Click=0
Wend
Music Off
End
End Proc
Procedure KABOOM
'* Bounce the screen a bit.
For N=1 To 5
Screen Display 0,114,50,320,200 : Wait Vbl
Screen Display 0,114,40,320,200 : Wait Vbl
Next N
End Proc
Procedure PROFOUND[NO]
'* Utter a profound statement!
If NO=>500 Then Pop Proc
If NO=1 Then TALK[PX,PY,'Hey, youre taking your time with this game']
If NO=13 Then TALK[PX,PY,'Drink pepsi']
If NO=115 Then TALK[PX,PY,'Kill your family']
If NO=146 Then TALK[PX,PY,'Blow up a rave']
If NO=223 Then TALK[PX,PY,'Go out and brain a faggot']
If NO=299 Then TALK[PX,PY,'Worship Satan!']
If NO=321 Then TALK[PX,PY,'Eat at the pizza hut, great food!']
If NO=339 Then TALK[PX,PY,'Smoke pot']
If NO=441 Then TALK[PX,PY,'Listen to loud music']
If NO=477 Then TALK[PX,PY,'Are you doing this right?']
End Proc
Procedure COMMENT[ROOM]
'* Say something when going into a room for the first time
If BEEN(ROOM) Then Pop Proc
If ROOM=1 Then TALK[PX,PY,'Oh no, how am I going to get out?']
If ROOM=6 Then TALK[PX,PY,'Whos that yappin?']
If ROOM=17 Then TALK[PX,PY,'This must be the Thames']
If ROOM=18 Then TALK[PX,PY,'Hey, HR Giger or what?']
If ROOM=19 Then TALK[PX,PY,'Cosmic thang']
If ROOM=21 Then TALK[PX,PY,'OH no!!!!!!!!']
BEEN(ROOM)=True
End Proc
Procedure OHSHIT
'* Something bad has happenned....
Cls 0
Bell
Print 'Something wonderful has happenned....'
Print 'You have managed to crash this game.'
Print 'Actually this isnt that difficult'
Print 'Please send a note to us telling us what went wrong.'
Print 'That way we could perfect the game engine.'
Print 'Press a key - going back, may cause something'
Print 'strange to happen.'
Wait Key
Resume
End Proc
'* Data for the rooms
'* The first 4 are N,E,S,W locations, 0 denotes not valid.