Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rem /// Sphinx Adventure '/ V1 (Tape for BBC & Electron) '/ V2 (Disc for BBC)
- Rem /// (c) 1982, 1984 Acornsoft & Paul Fellows
- Rem
- Rem /// Sphinx 2 | Converted by ihardcas to QB64 August 2021
- Rem /// Sphinx 2.1 | Added SAVE/LOAD logic - use xsave/xload until I can get filenames into the noun/verb mechanism
- Rem /// Sphinx 2.1a | Working and plays through - few cosmetic glitches to sort.
- Rem /// Sphinx 2.1b | Most old BBC reference code stripped out from comments
- Rem /// Sphinx 2.1c | Properly implemented file names in SAVE/LOAD. xsave and xload removed
- Rem /// Sphinx 2.1d | Moved Responses to subResponse
- Rem /// Sphinx 2.1e | Fixed post DIAXOS movement.
- Rem | Changed some labels/procs etc to something more meaningful
- Rem | Added turnincrementer logic
- Rem | Put the ObjLocs and ExitData to arrays and put in a sub.
- Rem | Removed the initialize sub. Brought code to start of main.
- Rem /// Sphinx 2.1f | appended .sav to files loaded and saved.
- Rem | Some more tidyup of labels etc
- Rem | Added dis/ena dwarf command to disable the fckng dwarf
- Rem | finagled some more variable names
- Rem /// Sphinx 2.1g | fixed bridge printing glitch.
- Rem | Fixed some Dwarf business
- Rem /// Sphinx 2.1h | Added decent wordwrappery sub
- Rem /// Sphinx 2.1i | Moved text output to new wordwrap routing
- Rem | Disabled old text output routines
- Rem | Fixed dwarf fight routine.
- Rem /// Sphinx 2.1j | Some variable tidyup
- Rem | fixed iffy pirate behavior.
- Rem /// Sphinx 2.2 | Release to other platforms -- still need to do a playthrough to make sure it all still works!!
- Rem | Removed all compound statements (:)
- Rem /// Sphinx 2.3 | Removed references to subResponse and statically entered responses
- Rem /// Sphinx 2.4 | Moved reading in of descriptions to own sub
- Rem /// Sphinx 2.5 | Moved reading in of objects to own sub
- Rem | Changed the exit printing a bit since it relied on over-reading the object data (cheeky!)
- Rem /// Sphinx 2.6 | Moved the verb reading bit out to own sub
- Rem | Changed the XOR safe opening logic.
- REM /// Sphinx 2.7 | Amiga HiSoft BASIC port
- ' HB Specific screen setup
- Dim Shared colGreen
- Dim Shared colRed
- Dim Shared colCyan
- colGreen = 10
- colRed = 5
- colCyan = 6
- 'Color colGreen
- 'SCREEN 1,640,512,4,5
- 'WINDOW 1, "Sphinx Adventure for Amiga",(0,0)-(600,400),128+64,1
- ' HB Done
- DECLARE FUNCTION funcTrimSpaces$(STRING)
- DECLARE FUNCTION funcLowerCase$(STRING)
- DIM SHARED varObjectLocations(56)
- DIM SHARED varObjectDesc$(56)
- DIM SHARED varExitArray(6)
- DIM SHARED varExits(143 * 6)
- DIM SHARED varLocationDescription$(143)
- DIM SHARED varVerb$(44)
- DIM SHARED varKilledFlag, varKneelingFlag, varFlamesFlag, varLampLitFlag, varScore, varBearFlag, varRabbitFlag
- DIM SHARED varLampFuel, varScreenWidth, varSafeOpenFlag, varDwarfChance, varDwarfFlag, varTurnIncrement, varGoblinEncounters
- DIM SHARED varCurrentLocation, varTurnCount, varChasmFlag, varCasketOpenFlag, varDwarfEncounters, varMAX
- DIM SHARED varWord1$, varWord2$, varWord1Index, varWord2Index, varGotWaterFlag, varDirections$, varVampireEncounters
- DIM SHARED varTurnLastSeenDwarf, varSuppressDwarf ' varTurnLastSeenDwarf is a counter that resets after meeting the Dwarf. Means we dont see him for 25 turns.
- DIM SHARED X, varCarryingCounter, K, varWavingAtSphinxFlag, M, cn, N, W, Q, varSpacePos, varBridgeFlag, MAP, O$, R$
- 'Set up some variables
- varDirections$ = "nsewud"
- varKneelingFlag = 0
- varWavingAtSphinxFlag = 0
- varTurnLastSeenDwarf = 0
- varGotWaterFlag = 0
- varDwarfChance = 0.97
- varLampFuel = 150 ' put some fuel in t'lamp
- B2$ = " "
- K = 0
- varWord1Index = 0
- I = 0
- X = 0
- varTurnCount = 0
- varChasmFlag = 0
- varBridgeFlag = 0
- varKilledFlag = 0
- varCasketOpenFlag = 0
- varSuppressDwarf = 0
- varDwarfEncounters = 0
- varSafeOpenFlag = 0
- varFlamesFlag = 1
- varLampLitFlag = 0
- varScore = 0
- varCarryingCounter = -3 ' varCarryingCounter is the number of items currently being carried. Wonder why it starts at -3?
- varVampireEncounters = 0
- varGoblinEncounters = 0
- varBearFlag = 0
- varRabbitFlag = 0
- varScreenWidth = 80 ' Set varScreenWidth
- varTurnIncrement = 1 ' Set this flag if the Turn counter is to increment. Some subs will set it to zero so the varTurnCount doesnt increment (inv, save etc)
- Call subReadExits
- Call subReadObjectLocations
- Call subReadLocationDescriptions
- Call subReadObjects
- Call subReadVerbs
- varCurrentLocation = 6 'set starting location
- Print
- Print " W E L C O M E T O "
- Print
- Print " .d8888b. 8888888b. 888 888 8888888 888b 888 Y88b d88P "
- Print "d88P Y88b 888 Y88b 888 888 888 8888b 888 Y88b d88P "
- Print "Y88b. 888 888 888 888 888 88888b 888 Y88o88P "
- Print " `Y888b. 888 d88P 8888888888 888 888Y88b 888 Y888P "
- Print " `Y88b. 8888888P' 888 888 888 888 Y88b888 d888b "
- Print " `888 888 888 888 888 888 Y88888 d88888b "
- Print "Y88b d88P 888 888 888 888 888 Y8888 d88P Y88b "
- Print " `Y8888P' 888 888 888 8888888 888 Y888 d88P Y88b "
- Print
- Print " A D V E N T U R E "
- Print
- Print
- Print " GOOD LUCK IN YOUR EXPLORATIONS HERE!! "
- Print
- Print " Try to find all the treasure and take it to the sphinx. "
- Print
- Print " Original (c) Acornsoft 1982. Dragged into 21st Century by Iain "
- Print
- Print
- Print "Press Enter to continue!"
- Input "", dummy$
- CLS
- Call subPrintLocation(varCurrentLocation)
- labMainLoop: ' Start of main loop
- A$ = " "
- X = 0
- varWord2$ = " "
- varWord1$ = " "
- varOutputString$ = ""
- M = 0
- K = 0
- If varTurnIncrement = 1 Then
- varTurnCount = varTurnCount + 1 ' Increment turn counter
- End If
- 'If Light is lit then decrease fuel
- If varLampLitFlag = 1 And varTurnIncrement = 1 Then
- varLampFuel = varLampFuel - 1
- varWord1Index = 0
- varWord2Index = 0
- End If
- 'Reset the Turn Incrementer thingy flag
- varTurnIncrement = 1
- ' varObjectLocations(31) is the frigging dwarf. This makes the dwarf appear 3% of the time if Turns - s >25. Resets varTurnLastSeenDwarf to turns.
- ' Dwarf might reappear after 25 turns
- ' I replaced RND(1)>0.97 with varDwarfChance. That way I can stop the damn thing killing me while debugging.
- ' Need a better variable name for varTurnLastSeenDwarf
- If Rnd(1) > varDwarfChance And varDwarfFlag = 0 And (varTurnCount - varTurnLastSeenDwarf) > 25 Then
- varObjectLocations(31) = varCurrentLocation 'put the dwarf in this loc
- varDwarfFlag = 1
- varTurnLastSeenDwarf = varTurnCount
- End If
- If varCurrentLocation <> varObjectLocations(31) Or varDwarfChance = 2 Then 'is the Dwarf NOT here or been disabled
- GoTo labNoDwarf
- Else
- ' Assume Dwarf IS here
- varDwarfEncounters = varDwarfEncounters + 1 'increment the dwarf encounter counter.
- Call subPrintText("There is a dwarf here. He throws an axe at you.")
- If varObjectLocations(1) = 0 Then 'we have no axe in inventory
- varObjectLocations(1) = varCurrentLocation 'if no then leave axe here
- End If
- If varDwarfEncounters > 6 Or Rnd(1) > 0.95 Then 'Have we seen the dwarf 6 times or do hit the unlucky 5%? =we die
- Call subPrintText("The axe hits you hard in the chest and you bleed to death.")
- Call subKill
- End If
- If varObjectLocations(1) = varCurrentLocation Then 'do I have axe in inventory (location1)?
- Call subPrintText("The axe misses and lands on the ground next to you.")
- Else
- If varObjectLocations(1) <> varCurrentLocation Then
- Call subPrintText("The axe misses then vanishes into thin air.")
- End If
- END IF
- End If
- 'Reset Dwarf Suppress flag (things like inv, debug etc set this
- varSuppressDwarf = 0
- labNoDwarf:
- ' Lets do the Goblins now.
- R$ = " "
- If varCurrentLocation = 48 And varCurrentLocation = varObjectLocations(33) Then ' Are we in location 48(Hall of the mountain king) and are there goblins here?
- varGoblinEncounters = varGoblinEncounters + 1 'Increment the goblin encounter counTer.
- If varGoblinEncounters >= 5 Then 'kill us if more than 5 encounters
- Call subPrintText("The goblins suddenly leap upon you and tear you limb from limb!")
- Call subKill
- R$ = ""
- End If
- End If
- If varCurrentLocation = varObjectLocations(43) Then 'Test for presence of vampires
- varVampireEncounters = varVampireEncounters + 1 'increment vampire encounter counter
- If varVampireEncounters >= 2 Then 'if more than two encounters then....
- Call subPrintText("The vampire leaps on you and drains your blood.")
- Call subKill ' oh dear...
- End If
- End If
- 'is our location>8 ("inside?"), do we not have a lamp, nor is there a lamp here then...
- If varCurrentLocation > 8 And varObjectLocations(3) <> 1 And varCurrentLocation <> varObjectLocations(3) Then
- Print
- Call subPrintText("IT'S VERY DARK.")
- Call subPrintText("IF YOU MOVE YOU MAY FALL INTO A PIT.")
- GoTo lab200
- End If
- 'Is the lamp out of fuel? is it lit and do we have it?
- If varLampFuel <= 0 And varLampLitFlag = 1 And varObjectLocations(3) = 1 Then
- Print
- Call subPrintText("Your lamp has run out.")
- varLampLitFlag = 0
- Else
- If varLampFuel < 10 And varLampLitFlag = 1 And varObjectLocations(3) = 1 Then 'same tests but for dimming light.
- Print
- Call subPrintText("Your lamp is getting dim.")
- End If
- End If
- If varLampLitFlag = 0 And varCurrentLocation > 8 Then
- Print
- Call subPrintText("It's very dark.")
- CALL subPrintText("If you move, you may fall into a pit.")
- End If
- lab200: 'Get user input and parse it.
- Print
- Input "Command "; A$
- Print
- IF LEN(A$) = 0 THEN
- Call subPrintText("What?")
- GoTo lab200
- END IF
- A$ = funcLowerCase$(A$)
- If Left$(A$, 3) = "inv" Then
- varTurnIncrement = 0 'Tell the turnIncrementer not to increment
- Call subPrintLocation(1)
- GoTo labMainLoop
- End If
- If A$ = "disdwarf" Then
- Call subPrintText("Dwarf disabled")
- varTurnIncrement = 0
- varDwarfChance = 2
- varDwarfFlag = 0
- varDwarfIncrement = 0
- varTurnLastSeenDwarf = 0
- varObjectLocations(31) = 0
- GOTO lab200
- End If
- If A$ = "enadwarf" Then
- Call subPrintText("Dwarf enabled")
- varDwarfIncrement = 0
- varTurnIncrement = 0
- varDwarfChance = 0.97
- GoTo lab200
- End If
- If A$ = "debug" Then
- varTurnIncrement = 0 'Tell the turnIncrementer not to increment
- Call subDebug
- GoTo labMainLoop
- End If
- 'If single letter command then treat as a direction (NSEWUD)
- If Len(A$) = 1 Then
- Call subVerbMove(A$, varCurrentLocation)
- GoTo labMainLoop
- End If
- 'Look for a space in the command. Then look for another space in the bit of
- 'string after the space. Tells us there's more than one word.
- varSpacePos = InStr(A$, " ")
- IF INSTR(funcTrimSpaces$(RIGHT$(A$, LEN(A$) - varSpacePos)), " ") <> 0 THEN
- Call subPrintText("I'm sorry. I can't understand more than two words at a time")
- varTurnIncrement = 0
- GoTo labMainLoop
- End If
- 'If no spaces then process as a single verb
- 'else there must be two words so split into varWord1$ and varWord2$ and pass as verb then noun.
- If varSpacePos = 0 Then
- Call subProcessVerb(A$)
- GoTo lab211
- ELSE
- varWord1$ = funcTrimSpaces$(LEFT$(A$, varSpacePos - 1))
- varWord2$ = funcTrimSpaces$(RIGHT$(A$, LEN(A$) - varSpacePos))
- IF varWord1$ = "load" THEN 'this is a bit cheeky but since the interpreter doesnt take an arbitrary 2nd param, have to intercept & do this.
- varTurnIncrement = 0 'Tell the turnIncrementer not to increment
- Call subLoad(varWord2$)
- GoTo lab200
- End If
- If varWord1$ = "save" Then
- varTurnIncrement = 0 'Tell the turnIncrementer not to increment
- CALL subSave(varWord2$)
- GOTO lab200
- END IF
- CALL subProcessVerb(varWord1$) 'Get the index of the Verb entered
- CALL subProcessNoun(varWord2$) 'Get the index of the noun entered
- END IF
- IF varWord1$ = "go" OR varWord1$ = "exit" OR varWord1$ = "leave" THEN
- GOTO lab244
- End If
- If varWord1$ = "drink" Then
- CALL subVerbEat(varWord2Index, 2)
- GoTo labMainLoop
- End If
- 'varWord1Index and varWord2Index are the indexes of the inputted verb and noun.
- 'If varWord1Index isnt indexed as a known word then print "I don't understand the word"
- If varWord1Index = -1 Then
- CALL subPrintText("I don't understand the word " + varWord1$)
- varTurnIncrement = 0
- If varWord2Index <> -1 Then
- GoTo labMainLoop
- End If
- End If
- 'Do same for varWord2Index
- If varWord2Index = -1 Then
- CALL subPrintText("I don't understand the word " + varWord2$)
- varTurnIncrement = 0
- GoTo labMainLoop
- Else
- If varWord1Index > 14 Then 'not one of the first 14 words defined at labVerbs: so process otherwise
- GoTo lab211
- End If
- End If
- ' Verbs:
- ' We can see that Get and Take jump to the same routine
- ' get, take, open, wave, throw, drop, kill, eat, cross, feed, rub, light, read, pay
- On varWord1Index GOTO lab213, lab213, lab214, lab215, lab216, lab217, lab218, lab220, lab221, lab224, lab225, lab226, lab227, lab228
- lab211:
- If A$ = "exit" Then
- Call subVerbOut(varCurrentLocation) 'synonym with Out.
- GoTo labMainLoop
- Else
- If varWord1Index <> -1 Then
- K = varWord1Index - 14 'so now we've detected a verb that has no noun K=index of that verb - 14 (<14=two word verbs)
- Else
- Call subProcessNoun(A$)
- If varWord2Index = -1 Then
- Call subPrintText("I don't understand the word " + A$)
- GoTo labMainLoop
- Else
- Call subPrintText("What do you want to do to the " + A$)
- GoTo labMainLoop
- End If
- End If
- End If
- lab212:
- On K GOTO lab237, lab229, lab230, lab230, lab231, lab232, lab235, lab236, lab229, lab238, lab240, lab243, lab243, lab243, lab243, lab243, lab243, lab219, lab244
- Call subPrintText("I can't apply that without a noun")
- GoTo labMainLoop
- lab213: 'Get/Take
- Call subVerbGetTake(varWord2Index, varCurrentLocation, 1)
- If X = 0 Then 'X seems to be set to 1 on an unsuccesful get
- varCarryingCounter = varCarryingCounter + 1 'varCarryingCounter=Carrying = there's a max of 15
- GoTo labMainLoop
- Else
- GoTo labMainLoop
- End If
- lab214: 'Open
- Call subVerbOpen(varWord2Index)
- GoTo labMainLoop
- lab215: 'Wave
- Call subVerbWave(varWord2Index)
- GoTo labMainLoop
- lab216: 'Throw
- Call subVerbThrow(varWord2Index)
- If X = 0 Then 'X seems to be set to 1 on an unsuccesful throw
- varCarryingCounter = varCarryingCounter - 1 'varCarryingCounter=Carrying - there's a max of 15
- GoTo labMainLoop
- Else
- GoTo labMainLoop
- End If
- lab217: 'drop = takes you to Get routine
- Call subVerbGetTake(varWord2Index, 1, varCurrentLocation) 'Drop - calls 'get with INV a location
- If X = 0 Then
- varCarryingCounter = varCarryingCounter - 1 'varCarryingCounter=Carrying - there's a max of 15
- GoTo labMainLoop
- Else
- GoTo labMainLoop
- End If
- lab218: 'Kill
- Call subVerbKill(varWord2Index)
- GoTo labMainLoop
- lab219: 'Fill
- Call subVerbFill(varWord2Index)
- GoTo labMainLoop
- lab220: 'Eat
- Call subVerbEat(varWord2Index, 1)
- GoTo labMainLoop
- lab221: 'Cross
- Call subVerbCross(varWord2Index)
- GoTo labMainLoop
- If varWord2Index = 53 Then
- Call subVerbCross(varWord2Index)
- GoTo labMainLoop
- End If
- If varWord2Index = 56 Then 'varWord2Index=building
- If varCurrentLocation <> 3 And varCurrentLocation < 9 Then 'Not Blacksmiths Forge and not outside
- varCurrentLocation = 3
- Call subPrintLocation(varCurrentLocation)
- GoTo labMainLoop
- Else
- If varCurrentLocation = 3 Then
- varCurrentLocation = 2
- Call subPrintLocation(varCurrentLocation)
- GoTo labMainLoop
- Else
- Call subPrintText("I can't apply that")
- GoTo labMainLoop
- End If
- End If
- End If
- lab224:
- Call subVerbFeed(varWord2Index)
- GoTo labMainLoop
- lab225:
- Call subVerbRub(varWord2Index)
- GoTo labMainLoop
- lab226:
- Call subVerbLight(varWord2Index)
- GoTo labMainLoop
- lab227:
- Call subVerbRead(varWord2Index)
- GoTo labMainLoop
- lab228: 'pay
- Call subVerbPay(varWord2Index)
- GoTo labMainLoop
- lab229:
- Call subVerbIn(varCurrentLocation)
- GoTo labMainLoop
- lab230:
- Call subVerbOut(varCurrentLocation)
- GoTo labMainLoop
- lab231:
- R$ = "#" 'This # was something different
- varKneelingFlag = 1
- Call subPrintText("You are kneeling down.")
- GoTo labMainLoop
- lab232:
- Call subPrintText("You don't want to quit already do you?")
- varTurnIncrement = 0 'dont need to increment the turn counter
- lab233:
- INPUT "Yes OR no ?", A$
- A$ = LEFT$(funcLowerCase$(A$), 1)
- If A$ = "n" Then
- GoTo labMainLoop
- End If
- If A$ = "y" Then
- Call subPrintText("OK")
- Call subCalculateScore(varCurrentLocation)
- End
- Else
- GoTo lab233
- End If
- lab235: 'score
- Call subCalculateScore(varCurrentLocation)
- GoTo labMainLoop
- lab236: 'look
- Call subPrintLocation(varCurrentLocation)
- GoTo labMainLoop
- lab237: 'inventory
- Call subPrintLocation(1)
- GoTo labMainLoop
- lab238: 'help
- Call subPrintHelp
- GoTo labMainLoop
- lab240: 'DIAXOS
- 'not all BASICs seem to handle XORing so tidily so have done it manually.
- If varSafeOpenFlag = 0 Then
- varSafeOpenFlag = 1
- ElseIf varSafeOpenFlag = 1 Then
- varSafeOpenFlag = 0
- End If
- 'varSafeOpenFlag = varSafeOpenFlag Xor 1 'varSafeOpenFlag is the safe door open flag. Every time we say diaxos, the safe door toggles
- Call subPrintText("There was a very loud creaking sound then!")
- If varCurrentLocation = 137 Then 'Wizards spell chamber
- varCurrentLocation = 138 'West Antechamber
- Else
- If varCurrentLocation = 141 Then 'Room similar to spell chamber
- varCurrentLocation = 11 ' Sorcerers Lair
- End If
- End If
- Call subPrintLocation(varCurrentLocation)
- GoTo labMainLoop
- lab243:
- varWord1$ = Left$(varWord1$, 1)
- Call subVerbMove(varWord1$, varCurrentLocation)
- GoTo labMainLoop
- lab244:
- varWord2$ = funcTrimSpaces$(varWord2$)
- Call subProcessVerb(varWord2$)
- If varWord1Index > 25 And varWord1Index < 32 Then 'varWord1Index is the verb index. 26=N s,e,w,u 31=D
- Call subVerbMove(Left$(varWord2$, 1), varCurrentLocation)
- GoTo labMainLoop
- Else
- If Len(varWord2$) = 1 Then
- Call subVerbMove(varWord2$, varCurrentLocation)
- GoTo labMainLoop
- Else
- If varWord1Index <> -1 Then
- K = varWord1Index - 14
- GoTo lab212
- End If
- End If
- End If
- 'double check this logic if there's problems
- Call subProcessNoun(varWord2$)
- If varWord2Index = -1 Then
- Call subPrintText("I can't apply that")
- GoTo labMainLoop
- End If
- If varWord2Index = 53 Then 'bridge
- Call subVerbCross(varWord2Index)
- GoTo labMainLoop
- End If
- If varWord2Index <> 56 Then 'building
- Call subPrintText("I can't apply that")
- GoTo labMainLoop
- Else
- If varCurrentLocation <> 3 And varCurrentLocation < 9 Then
- varCurrentLocation = 3
- Call subPrintLocation(varCurrentLocation)
- GoTo labMainLoop
- Else
- If varCurrentLocation = 3 Then
- varCurrentLocation = 2
- Call subPrintLocation(varCurrentLocation)
- GoTo labMainLoop
- End If
- End If
- End If
- Call subPrintText("I can't apply that")
- GoTo labMainLoop
- SUB subKill
- PRINT
- CALL subPrintText("Oh dear you seem to have been killed !")
- varKilledFlag = varKilledFlag - 100
- CALL subCalculateScore(varCurrentLocation)
- CALL subPrintText("You had " + STR$(varTurnCount) + " turns.")
- END
- End Sub
- Sub subGetObjName (n) 'returns the nth object
- 'can get rid of this sub really.
- R$ = varObjectDesc$(n)
- End Sub
- Sub subProcessNoun (B2$)
- 'Process Nouns (B2$ is the second part of a two word command)
- 'we're going to get the index number of the noun
- i%=0
- WHILE B2$ <> R$ AND i% <= 57
- i% = i% + 1
- R$ = varObjectDesc$(i%)
- WEND
- If i% >= 57 Then
- X = 1
- varWord2Index = -1
- Else
- varWord2Index = i% 'Set varWord2Index to the index of the word
- varWord2$ = R$ 'and R$ to the word itself
- End If
- End Sub
- Sub subProcessVerb (b1$) 'Verb?
- 'Process Verbs (B1$ is the first part of a two word command)
- i% = 0
- Restore labVerbs
- While b1$ <> R$ And i% <= 38
- i% = i% + 1
- R$ = varVerb$(i%)
- Wend
- If i% = 38 Then
- X = 1
- varWord1Index = -1
- Else
- varWord1Index = i%
- varWord1$ = R$
- End If
- End Sub
- Sub subPrintLocation (varCurrentLocation) 'prints out location, exits, objects plus other bits
- Dim varOutputString$
- varCounter = 0
- cn = 0
- varOutputString$ = ""
- IF varCurrentLocation = 1 THEN GOTO lab278 'called for INV so jump to INV processing
- R$ = varLocationDescription$(varCurrentLocation)
- 'Some Dwarf shenanigans
- If varObjectLocations(31) <> 0 Then
- varObjectLocations(31) = 0
- varDwarfFlag = 1 'weve bumped into the dwarf so set his flag on.
- End If
- Call subPrintText("You are " + R$)
- If varCurrentLocation = 136 Or varCurrentLocation = 15 Then varObjectLocations(56) = varCurrentLocation
- If varCurrentLocation = 16 And varFlamesFlag = 1 Then
- Call subPrintText("The walls are very hot!")
- Else
- If varCurrentLocation = 16 Then
- Call subPrintText("The walls are steaming!")
- End If
- End If
- 'If loc isnt Forge, serpents stomach or bottom of rock slide then call subPrintExits with varCurrentLocation. These locs dont have exits?
- If varCurrentLocation <> 3 And varCurrentLocation <> 142 And varCurrentLocation <> 143 Then
- Call subPrintExits(varCurrentLocation)
- If Abs(varCurrentLocation - 19) = 1 And varChasmFlag = 1 Then
- Print
- Else
- If Abs(varCurrentLocation - 42) = 1 And varBridgeFlag = 1 Then
- Print
- End If
- End If
- End If
- If varChasmFlag = 1 And Abs(varCurrentLocation - 19) = 1 Then
- Call subPrintText("A bridge now spans the chasm.")
- varObjectLocations(53) = varCurrentLocation 'A bridge now spans the
- End If
- If varBridgeFlag = 1 And Abs(varCurrentLocation - 42) = 1 Then
- Call subPrintText("A bridge now spans the glacier.")
- varObjectLocations(53) = varCurrentLocation
- End If
- If varCurrentLocation = 26 Or varCurrentLocation = 27 Then
- varObjectLocations(53) = varCurrentLocation
- End If
- lab278: 'display the objects, either INV if varCurrentLocation=1 or just what's here
- j = 0
- I = 0
- varCounter = 0
- While j < 52 'objects under #52 only.
- j = j + 1
- If varObjectLocations(j) = varCurrentLocation Then
- varCounter = varCounter + 1 'count the number of things at this location.
- End If
- Wend
- If varCounter = 0 And varCurrentLocation = 1 Then 'if count=0 and location=1 then print 'not carrying anything'
- Call subPrintText("You are not carrying anything.")
- GoTo lab284
- Else
- If varCounter = 0 And varCurrentLocation <> 1 Then
- GoTo lab284 'there's nothing here
- Else
- Print
- varMAX = varCounter
- End If
- End If
- If varCurrentLocation = 1 Then 'is location =1 (inv)
- varOutputString$ = "You're currently holding "
- Else
- varOutputString$ = "There is "
- End If
- I = 0
- cn = 0
- varCounter = varMAX
- While I < 52 'Loop through all the objects, poss replace with a for/next. After obj 52 we dont want to display
- I = I + 1
- If varObjectLocations(I) = varCurrentLocation Then 'run through the list of objects. check if something is here.
- Call subObjectText(I, varCounter, varCurrentLocation) 'If there is then..... call OT with the Ith object (in the object list) and the number of objects at this location, had to add varCurrentLocation - poss QB bug?
- varOutputString$ = varOutputString$ + R$
- varCounter = varCounter - 1 'reduce the count and repeat
- End If
- Wend
- Call subPrintText(varOutputString$)
- lab284:
- If varDwarfEncounters <> 0 And varDwarfFlag = 1 Then
- varObjectLocations(31) = varCurrentLocation
- End If
- If varCasketOpenFlag = 1 And varCurrentLocation = 94 Then
- Call subPrintText("The casket is open.")
- End If
- If varCurrentLocation = 24 And varSafeOpenFlag = 1 Then
- Call subPrintText("The safe door is open.")
- End If
- Print
- End Sub
- Sub subPrintExits (varCurrentLocation)
- 'This routine just prints out "there are exits to the North... etc"
- I = varCurrentLocation * 6 - 6
- For J = 1 To 6
- MAP = varExits(I + J)
- If MAP > 0 Then
- varCounter = varCounter + 1 'increment exit counter
- varExitArray(J) = 1
- Else
- varExitArray(J) = 0
- End If
- Next J
- If varCounter > 1 Then
- O$ = "There are exits to the "
- Else
- If varCounter = 1 Then
- O$ = "There is an exit "
- End If
- End If
- For J = 1 To 6
- ' changed this a bit from original code because of data mappings
- IF J = 1 THEN R$ = "north"
- IF J = 2 THEN R$ = "south"
- IF J = 3 THEN R$ = "east"
- IF J = 4 THEN R$ = "west"
- IF J = 5 THEN R$ = "up"
- IF J = 6 THEN R$ = "down"
- IF varCounter = 0 OR varExitArray(J) = 0 THEN GOTO lab296
- IF varCounter > 2 THEN O$ = O$ + R$ + ", "
- IF varCounter = 2 THEN O$ = O$ + R$ + " and "
- IF varCounter = 1 THEN O$ = O$ + R$ + "."
- varCounter = varCounter - 1
- lab296:
- NEXT J
- CALL subPrintText(O$)
- End Sub
- Sub subVerbOpen (varWord2Index) 'Open
- If varObjectLocations(varWord2Index) <> varCurrentLocation And varObjectLocations(varWord2Index) <> 1 And varWord2Index <> 28 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo lab306
- End If
- If varWord2Index = 40 And varCurrentLocation = 94 And varCasketOpenFlag = 0 Then
- varObjectLocations(43) = 94
- varCasketOpenFlag = 1
- Call subPrintLocation(varCurrentLocation)
- GoTo lab306
- End If
- If varWord2Index = 39 Then
- Call subPrintText("You cant do that at the moment.")
- End If
- If varWord2Index = 8 And varObjectLocations(5) = 1 Then
- Call subPrintText("The chest opens easily with the keys revealing many rubies.")
- varObjectLocations(16) = varCurrentLocation
- Else
- If varWord2Index = 8 Then
- Call subPrintText("You can't with no keys!")
- End If
- End If
- If varWord2Index = 10 And varObjectLocations(7) = 1 Then
- Call subPrintText("You open up the clam with the jack and many pearls roll out.")
- varObjectLocations(18) = varCurrentLocation
- Else
- If varWord2Index = 10 Then
- Call subPrintText("You can't do that at the moment")
- End If
- End If
- If varWord2Index = 8 Or varWord2Index = 10 Or varWord2Index = 39 Then GoTo lab306
- Call subPrintText("I can't apply that")
- lab306:
- End Sub
- Sub subVerbMove (A$, N)
- 'subVerbMove deals with single letter commands so N,S,E,W,U,D
- 'N=starting location?
- 'A$=the command (N,S... etc)
- M = InStr(varDirections$, A$) ' M is the offset of the given command in the string varDirections$
- X = 0 'Exit flag
- If M = 0 Then
- Call subPrintText("I don't understand the word " + A$)
- GoTo lab318
- End If
- Call subTrialMove(N, M) 'Call subTrialMove with current loc and offset of command
- ' RESTORE labExitData
- If X = 1 Then GoTo lab314
- If varLampLitFlag = 0 Then
- If N > 8 Then
- If Rnd(1) > 0.5 Then
- Call subPrintText("You fell in a pit")
- Call subKill
- End If
- End If
- End If
- MAP = varExits(N * 6 - 6 + M)
- If MAP = 0 Then
- Call subPrintText("There is no way to go that direction!")
- Else
- varCurrentLocation = MAP
- End If
- lab314:
- If varCurrentLocation = 4 Then 'inside the forest 25% chance of putting you at the end of the road (L2)
- If Rnd(1) > 0.75 Then
- varCurrentLocation = 2
- End If
- End If
- If varBearFlag = 1 Then varObjectLocations(35) = varCurrentLocation 'Make the Bear follow us if bear=1
- If varRabbitFlag = 1 Then varObjectLocations(38) = varCurrentLocation 'Make the rabbit follow us if rabbit=1
- Call subPrintLocation(varCurrentLocation)
- If varCurrentLocation = 33 And Rnd(1) > 0.5 Then
- Call subPrintText("A hollow voice whispers DIAXOS.")
- End If
- lab318:
- End Sub
- Sub subVerbGetTake (varWord2Index, N, K)
- 'Call subVerbGetTake(varWord2Index, 1, varCurrentLocation) - sample call
- 'jack, food, mouse,bridge,swamp,lake,building
- If Not (varWord2Index = 8 Or varWord2Index = 10 Or Abs(varWord2Index - 37) <= 7 Or varWord2Index >= 53) Then
- GoTo lab321
- Else
- X = 1
- If varObjectLocations(varWord2Index) <> N Then
- 'Seems to deal with taking something that isnt there. There was some funky code here that I could get the jist of so just removed
- 'Call subResponse(8 - Sgn(N - 1)) '??
- Call subPrintText("I see no " + varWord2$ + " here")
- GoTo lab332
- Else
- Call subPrintText("You're joking!")
- GoTo lab332
- End If
- End If
- lab321:
- R$ = "'"
- If K = 1 And varWord2Index = 28 And varObjectLocations(27) <> 1 And varCurrentLocation = 15 Then
- Call subPrintText("You have nothing to put it in, so it runs away through your fingers.")
- GoTo lab332
- End If
- If varWord2Index = 28 And varGotWaterFlag = 1 Then
- varObjectLocations(28) = 1
- Else
- If varWord2Index = 28 Then
- varObjectLocations(28) = 15
- Else
- If varWord2Index = 52 And K = 1 Then
- Call subPrintText("The mouse runs around refusing to be caught.")
- GoTo lab332
- End If
- End If
- End If
- R$ = " "
- If varWord2Index = 52 And N = 1 And K = 111 And varObjectLocations(42) = 111 Then
- varObjectLocations(42) = 0
- varWord1$ = "drop"
- varWord2$ = "mouse." + Chr$(10) + Chr$(13) + "The elephant sees it and runs away"
- End If
- R$ = ""
- If varCarryingCounter = 15 And K = 1 Then
- Call subPrintText("You can't carry anything more, you'll have to drop something first.")
- X = 1
- GoTo lab332
- End If
- If K = 1 And varObjectLocations(27) = 1 And varObjectLocations(28) = 1 And varWord2Index = 28 Then
- Call subPrintText("Your bottle is already full.")
- X = 1
- GoTo lab330
- End If
- If N = 1 And varWord2Index = 27 And varGotWaterFlag = 1 Then
- varGotWaterFlag = 0
- Call subPrintText("You drop the bottle and all the water leaks away!")
- varCarryingCounter = varCarryingCounter - 1
- varWord1$ = "will have to get some more from"
- varWord2$ = "lake"
- End If
- If varWord2Index = 28 And K = 1 And varObjectLocations(28) = N Then
- varWord1$ = "fill"
- varWord2$ = "bottle with the water"
- End If
- If varObjectLocations(varWord2Index) = N Then
- varObjectLocations(varWord2Index) = K
- Call subPrintText("You " + varWord1$ + " the " + varWord2$ + ".")
- Else
- If K = 1 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- X = 1
- Else
- Call subPrintText("You're not carrying the " + varWord2$ + " here.")
- X = 1
- End If
- End If
- lab330:
- If varObjectLocations(28) = 1 And varWord2Index = 28 Then
- varObjectLocations(28) = 15
- varGotWaterFlag = 1
- Else
- If varWord2Index = 28 Then
- varObjectLocations(28) = 15
- varGotWaterFlag = 0
- End If
- End If
- If varCurrentLocation = 117 And N = 1 And varWord2Index <> 9 Then
- varObjectLocations(varWord2Index) = 0
- Call subPrintText("Oh dear the " + varWord2$ + " sank into the swamp.")
- End If
- lab332:
- End Sub
- Sub subTrialMove (varCurrentLocation, n) 'seems to be like a trial move...
- 'X is set high if a move cant be made for whatever reason.
- If varCurrentLocation = varObjectLocations(36) Then
- I = 11
- Do
- I = I + 1
- Loop Until varObjectLocations(I) = 1 Or I = 30 'Having a quick look through the inv for something the pirate wants
- If I < 30 Then
- varObjectLocations(I) = 51
- Call subGetObjName(I)
- Call subPrintText("The pirate snatches your " + R$)
- c% = c% - 1
- If I = 27 And varGotWaterFlag = 1 Then
- varGotWaterFlag = 0
- End If
- End If
- End If
- If varCurrentLocation = varObjectLocations(35) Then
- varBearFlag = 1
- Call subPrintText("There is a brown bear following you.")
- End If
- If varCurrentLocation = varObjectLocations(38) Then
- varRabbitFlag = 1
- Call subPrintText("The giant rabbit is still with you!")
- End If
- If varCurrentLocation = 16 And varFlamesFlag = 1 And n = 3 Then
- X = 1
- Call subPrintText("The flame's heat drives you back.")
- End If
- If varCurrentLocation = 117 And n = 3 And varObjectLocations(41) = 117 Then
- Call subPrintText("The crocodile snaps its jaws neatly biting your leg off. You bleed to death!")
- Call subKill
- End If
- If varCurrentLocation = 94 And n <> 6 And varCasketOpenFlag = 0 Then
- varObjectLocations(43) = 94
- varCasketOpenFlag = 1
- GoTo lab349
- End If
- If varCurrentLocation = 111 And n = 1 And varCurrentLocation = varObjectLocations(42) Then
- Call subPrintText("The elephant is blocking the way.")
- X = 1
- GoTo lab349
- End If
- If varCurrentLocation = 48 And varCurrentLocation = varObjectLocations(33) And n = 4 Then
- X = 1
- Call subPrintText("The goblins crowd around and stop you.")
- End If
- If varCurrentLocation = 30 And n = 1 And varCurrentLocation = varObjectLocations(32) Then
- X = 1
- Call subPrintText("The ogre is blocking the way.")
- End If
- If varCurrentLocation = 36 And n = 6 And varCurrentLocation = varObjectLocations(30) Then
- X = 1
- Call subPrintText("The dragon is blocking the way.")
- End If
- If varCurrentLocation = 32 And varCurrentLocation = varObjectLocations(37) And varCurrentLocation = varObjectLocations(35) Then
- Call subPrintText("The bear growls and chases the orc away.")
- varObjectLocations(35) = 0 'make poor friendly bear gone
- varObjectLocations(37) = 0 'make Orc gone
- varBearFlag = 0 ' Bear flag = off
- End If
- If varCurrentLocation = 32 And varCurrentLocation = varObjectLocations(37) And n = 1 Then
- X = 1
- Call subPrintText("The orc won't let you get by.")
- End If
- If (varCurrentLocation = 24 And n = 5) Or (varCurrentLocation = 51 And n = 6) Then
- If varSafeOpenFlag = 0 Then
- X = 1
- Call subPrintText("You can't! The safe door is shut.")
- Print
- End If
- End If
- If varCurrentLocation = 51 And n = 6 Then
- If varSafeOpenFlag = 0 Then
- X = 1
- Call subPrintText("You can't! The safe door is shut.")
- PRINT
- End If
- End If
- If varCurrentLocation = 28 And n = 6 Then
- Call subPrintText("ARRRGH! CRASH!! The rocks gave way and you rolled to the bottom of the rock slide.")
- Print
- END IF
- lab349:
- End Sub
- Sub subVerbKill (w) 'Kill
- If varObjectLocations(w) <> varCurrentLocation Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo lab354
- Else
- If w < 30 Or w = 39 Or w = 40 Or Abs(w - 48) < 4 Or w > 52 Then
- Call subPrintText("You're joking!")
- GoTo lab354
- End If
- END IF
- lab351:
- Input "What with? Your bare hands ? ", b$
- b$ = funcLowerCase$(b$)
- If b$ <> "no" Then
- GoTo lab353
- Else
- Input "What with then ? ", varWord2$
- CALL subProcessNoun(funcLowerCase$(varWord2$))
- If X = 1 Then
- GoTo lab354
- Else
- varWord1$ = "throw"
- Call subVerbThrow(varWord2Index)
- If X = 1 Then
- GoTo lab354
- Else
- varCarryingCounter = varCarryingCounter - 1
- GoTo lab354
- End If
- End If
- End If
- lab353:
- If b$ <> "yes" Then
- Call subPrintText("yes or no")
- GoTo lab351
- Else
- If w = 30 Then
- Call subPrintText("Well done! You vanquished a dragon with your bare hands!")
- varObjectLocations(30) = 0
- varObjectLocations(6) = varCurrentLocation
- Else
- Call subPrintText("Your blows are useless.")
- End If
- End If
- lab354:
- End Sub
- Sub subVerbWave (varWord2Index) 'Wave
- If varObjectLocations(varWord2Index) <> 1 And varWord2Index <> 28 Then
- Call subPrintText("You're not carrying the " + varWord2$ + ".")
- GoTo lab362
- Else
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo lab362
- End If
- End If
- If varWord2Index <> 4 Then
- Call subPrintText("OK")
- GoTo lab362
- End If
- If varCurrentLocation = 18 And varChasmFlag = 0 Then
- Call subPrintText("A bridge now spans the chasm.")
- varChasmFlag = 1
- varObjectLocations(53) = varCurrentLocation
- GoTo lab362
- Else
- If varCurrentLocation = 135 And varObjectLocations(26) = 0 Then
- Call subPrintText("The fairy king appears, hands you a mithril ring, bows and slips away.")
- varObjectLocations(26) = 1
- GoTo lab362
- End If
- End If
- If varCurrentLocation = 41 And varBridgeFlag = 0 Then
- Call subPrintText("A bridge now spans the glacier.")
- varBridgeFlag = 1
- varObjectLocations(53) = varCurrentLocation
- GoTo lab362
- End If
- If varCurrentLocation = 50 And varKneelingFlag = 1 Then
- varWavingAtSphinxFlag = 1 'sets flag of waving at sphinx
- Call subFinish
- End If
- Call subPrintText("Nothing happens")
- lab362:
- End Sub
- Sub subVerbEat (varWord2Index, n) 'Eat
- If varWord2Index = 28 And n = 2 And (varGotWaterFlag = 1 Or varCurrentLocation = 15) Then
- Call subPrintText("Thanks! It was delicious")
- varGotWaterFlag = 0
- GoTo lab369
- End If
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo lab369
- End If
- If varObjectLocations(varWord2Index) <> 1 Then
- Call subPrintText("You're not carrying the " + varWord2$ + " here.")
- GoTo lab369
- End If
- If n = 1 Then
- If varWord2Index = 9 Or varWord2Index = 29 Or varWord2Index = 50 Then
- Call subPrintText("Thanks! It was delicuious")
- varObjectLocations(varWord2Index) = 0
- GoTo lab369
- End If
- End If
- Call subPrintText("You're joking!")
- lab369:
- End Sub
- Sub subVerbCross (varWord2Index) 'Cross
- If varObjectLocations(varWord2Index) <> 1 And varObjectLocations(varWord2Index) <> varCurrentLocation And varWord2Index <> 28 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo lab378
- Else
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo lab378
- End If
- End If
- If varCurrentLocation <> 18 Then
- GoTo lab372
- Else
- If varChasmFlag = 1 Then
- varCurrentLocation = 20
- Call subPrintLocation(varCurrentLocation)
- GoTo lab378
- Else
- Call subPrintText("You can't! It's too wide to jump.")
- GoTo lab378
- End If
- End If
- lab372:
- If varCurrentLocation <> 20 Then
- GoTo lab373
- Else
- If varChasmFlag = 1 Then
- varCurrentLocation = 18
- Call subPrintLocation(varCurrentLocation)
- GoTo lab378
- Else
- Call subPrintText("You can't! It's too wide to jump.")
- GoTo lab378
- End If
- End If
- lab373:
- If Abs(varCurrentLocation - 42) <> 1 Then
- GoTo lab374
- Else
- If varBridgeFlag = 0 Then
- Call subPrintText("You can't! It's too wide to jump.")
- GoTo lab378
- Else
- If varObjectLocations(26) = 1 Then
- varCurrentLocation = varCurrentLocation - 2 * Sgn(varCurrentLocation - 42)
- Call subPrintLocation(varCurrentLocation)
- GoTo lab378
- Else
- Call subPrintText("AAARGHH The bridge collapsed!")
- Call subKill
- End If
- End If
- End If
- lab374:
- If Abs(varCurrentLocation - 26.5) < 1 And varObjectLocations(34) = 26 Then 'Test the ABS thing and presence of troll.
- Call subPrintText("The troll wont let you get by.")
- GoTo lab378
- End If
- If varCurrentLocation <> 27 And varCurrentLocation <> 26 Then 'are we next to troll bridge or at troll bridge
- GoTo lab376
- Else
- If varRabbitFlag = 1 Or varBearFlag = 1 Then 'If the rabbit or bear is with us then....
- Call subPrintText("AAARGHH The bridge collapsed!")
- Call subKill
- Else
- varCurrentLocation = 27 + (varCurrentLocation = 27) 'everything is good so move us to 27 if we're not at 27 already
- Call subPrintLocation(varCurrentLocation)
- GoTo lab378
- End If
- End If
- lab376:
- If varCurrentLocation = 15 And varWord2Index = 55 And varObjectLocations(48) = 1 Then
- varCurrentLocation = 142
- Call subPrintText("You set off in the boat. Suddenly a sea-serpent leaps from beneath the waves and swallows you!")
- Call subPrintLocation(varCurrentLocation)
- varObjectLocations(48) = 0
- GoTo lab378
- Else
- If varCurrentLocation = 15 And varWord2Index = 55 Then
- Call subPrintText("It's too wide to swim.")
- GoTo lab378
- End If
- End If
- Call subPrintText("I can't apply that")
- lab378:
- End Sub
- Sub subVerbThrow (varWord2Index) ' throw?
- Call subVerbGetTake(varWord2Index, 1, varCurrentLocation)
- If X = 1 Then GoTo lab407
- R$ = " "
- If varWord2Index > 1 Then GoTo lab393
- If varCurrentLocation = varObjectLocations(31) And Rnd(1) < 0.6 Then
- varObjectLocations(31) = 0 'Dwarf is dead, remove him.
- varDwarfEncounters = 0
- varDwarfFlag = 0
- Call subPrintText("You killed a little dwarf!")
- GoTo lab407
- Else
- If varCurrentLocation = varObjectLocations(31) Then
- Call subPrintText("The dwarf dodges neatly aside.")
- GoTo lab407
- End If
- End If
- If varCurrentLocation = varObjectLocations(32) Then
- Call subPrintText("The ogre catches the axe and slices you in two with it.")
- Call subKill
- End If
- If varCurrentLocation = varObjectLocations(30) Then
- Call subPrintText("The axe bounces harmlessly off the dragon.")
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(33) Then
- Call subPrintText("That made the goblins real mad!")
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(34) Then
- Call subPrintText("The troll ducks, picks up the fallen axe and kills you with a single blow.")
- Call subKill
- End If
- If varCurrentLocation = varObjectLocations(35) Then
- Call subPrintText("The bear is confused. He only wants to be your friend!")
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(36) Then
- Call subPrintText("The pirate dodges smartly away into the tunnels!")
- varObjectLocations(36) = 20 + Int(Rnd(10))
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(37) Then
- Call subPrintText("The orc dodges and then growls ominously at you!")
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(38) Then
- Call subPrintText("The rabbit hops aside and says NEEERH WHATS UP DOC ?")
- End If
- GoTo lab407
- lab393:
- If varWord2Index > 2 Then
- GoTo lab403
- End If
- If varCurrentLocation = varObjectLocations(31) Then
- Call subPrintText("You killed a little dwarf!")
- varDwarfEncounters = 0
- varObjectLocations(31) = 0
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(32) Then
- Call subPrintText("The sword kills the ogre but then melts away.")
- varObjectLocations(32) = 0
- varObjectLocations(2) = 0
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(30) Then
- Call subPrintText("The sword kills the dragon. Then both sword and dragon fade away until only the dragons teeth remain.")
- varObjectLocations(30) = 0
- varObjectLocations(2) = 0
- varObjectLocations(6) = varCurrentLocation
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(33) Then
- Call subPrintText("That made the goblins real mad!")
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(34) Then
- Call subPrintText("The troll catches the sword and kills you with a single stroke.")
- Call subKill
- End If
- If varCurrentLocation = varObjectLocations(35) Then
- Call subPrintText("The bear is confused. He only wants to be your friend!")
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(36) Then
- Call subPrintText("The pirate dodges smartly away into the tunnels!")
- varObjectLocations(36) = 20 + Int(Rnd(10))
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(37) Then
- Call subPrintText("The orc dodges and then growls ominously at you!")
- GoTo lab407
- End If
- If varCurrentLocation = varObjectLocations(38) Then
- Call subPrintText("The rabbit hops aside and says NEEERH WHATS UP DOC ?")
- GoTo lab407
- End If
- lab403:
- If varWord2Index = 28 And varCurrentLocation = 16 And varFlamesFlag = 1 Then
- varFlamesFlag = 0
- Call subPrintText("The flame dies in a cloud of steam.")
- End If
- If varWord2Index = 6 And varCurrentLocation = varObjectLocations(33) Then
- Call subPrintText("The teeth become skeleton warriors and drive the goblins away.")
- varObjectLocations(33) = 0
- varObjectLocations(6) = 0
- Else 'I think this logic can be separated out; it was like this to save a line?
- If varCurrentLocation = varObjectLocations(41) And varWord2Index = 47 Then
- Call subPrintText("The mouse eats the stilton and allows itself to be caught.")
- varObjectLocations(41) = 0
- varObjectLocations(47) = 0
- End If
- End If
- R$ = ""
- If varCurrentLocation = 117 And varWord2Index = 9 Then
- Call subPrintText("Suddenly a huge bird swoops down snatches the food and carries you across the swamp.")
- varCurrentLocation = 118
- varObjectLocations(9) = 0
- Call subPrintLocation(varCurrentLocation)
- End If
- If varCurrentLocation = varObjectLocations(43) And varWord2Index = 49 Then
- Call subPrintText("The stake pierces the vampires chest he screams and is dispersed on the wind.")
- varObjectLocations(43) = 0
- varObjectLocations(49) = 0
- End If
- lab407:
- End Sub
- Sub subVerbFeed (varWord2Index) 'Feed
- If varObjectLocations(varWord2Index) <> varCurrentLocation And varObjectLocations(varWord2Index) <> 1 And varWord2Index <> 28 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo lab414
- Else
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo lab414
- End If
- End If
- If varWord2Index = 30 Or varWord2Index = 32 Or varWord2Index = 33 Or varWord2Index = 37 Then
- Call subPrintText("The only thing it wants to eat is, possibly, YOU!")
- GoTo lab414
- Else
- If varWord2Index <> 38 And varWord2Index <> 35 And varWord2Index <> 41 And varWord2Index <> 52 Then
- Call subPrintText("You're joking")
- GoTo lab414
- End If
- End If
- If varWord2Index = 41 And varObjectLocations(9) = 1 Then
- Call subPrintText("You throw the food to the crocodile. Suddenly a huge bird swoops down snatches the food and carries you across the swamp.")
- varCurrentLocation = 118
- Call subPrintLocation(varCurrentLocation)
- varObjectLocations(9) = 0
- GoTo lab414
- Else
- If varWord2Index = 41 Then
- Call subPrintText("You have nothing it wants.")
- GoTo lab414
- End If
- End If
- If varWord2Index = 52 And varObjectLocations(50) = 1 Then
- Call subPrintText("The mouse eats the stilton and allows itself to be caught.")
- varObjectLocations(52) = 1
- varObjectLocations(50) = 0
- GoTo lab414
- Else
- If varWord2Index = 52 Then
- Call subPrintText("You have nothing it wants.")
- GoTo lab414
- End If
- End If
- If varWord2Index = 35 Or varWord2Index = 38 Then
- Call subPrintText("What with")
- K = varWord2Index
- O$ = varWord2$
- Input A$
- CALL subProcessNoun(funcLowerCase$(A$))
- If varWord2Index <> 29 And varWord2Index <> 9 Then
- Call subPrintText("You're joking!")
- Else
- Call subEat
- varObjectLocations(varWord2Index) = 0
- varObjectLocations(K) = 0
- varCarryingCounter = varCarryingCounter - 2
- If K = 35 Then
- varBearFlag = 0
- Else
- If K = 38 Then
- varRabbitFlag = 0
- End If
- End If
- End If
- End If
- lab414:
- End Sub
- Sub subVerbRub (varWord2Index) 'Rub?
- If varObjectLocations(varWord2Index) <> varCurrentLocation And varObjectLocations(varWord2Index) <> 1 And varWord2Index <> 28 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo lab420
- Else
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo lab420
- End If
- End If
- If varWord2Index = 3 And varLampLitFlag = 1 And varLampFuel <= 10 Then
- varLampFuel = 150
- Call subPrintText("Your lamp is brighter now.")
- GoTo lab420
- Else
- If varWord2Index = 3 And varLampFuel <= 0 Then
- varLampFuel = 150
- Call subPrintText("Nothing obvious happens!")
- GoTo lab420
- Else
- If varWord2Index = 3 And varLampFuel > 0 Then
- Call subPrintText("Nothing obvious happens!")
- GoTo lab420
- End If
- End If
- End If
- If varWord2Index = 26 Then
- varCurrentLocation = 11
- Call subPrintLocation(varCurrentLocation)
- GoTo lab420
- End If
- Call subPrintText("You're joking!")
- lab420:
- End Sub
- Sub subVerbLight (varWord2Index) 'Light verb
- If varObjectLocations(varWord2Index) <> varCurrentLocation And varObjectLocations(varWord2Index) <> 1 And varWord2Index <> 28 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo labExitVerbLight
- Else
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo labExitVerbLight
- End If
- End If
- If varWord2Index = 51 Then
- varObjectLocations(51) = 0
- Call subPrintText("Your matches flare up making a lot of smoke.")
- If varCurrentLocation = 142 Then
- Call subPrintText("The serpent starts to cough violently and you get thrown out.")
- varCurrentLocation = 136
- Call subPrintLocation(varCurrentLocation)
- GoTo labExitVerbLight
- Else
- If varWord2Index = 51 Then
- GoTo labExitVerbLight
- End If
- End If
- End If
- If varWord2Index = 3 And varLampLitFlag = 0 And varLampFuel > 0 Then
- varLampLitFlag = 1
- Call subPrintText("Your lamp is now on.")
- GoTo labExitVerbLight
- Else
- If varWord2Index = 3 And varLampLitFlag = 0 Then
- Call subPrintText(" Your lamp has run out.")
- GoTo labExitVerbLight
- Else
- If varWord2Index = 3 Then
- Call subPrintText("Your lamp is already lit!")
- GoTo labExitVerbLight
- End If
- End If
- End If
- Call subPrintText("I can't apply that")
- labExitVerbLight:
- End Sub
- Sub subVerbRead (varWord2Index) 'read
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo labExitVerbRead
- End If
- If varObjectLocations(varWord2Index) <> varCurrentLocation And varObjectLocations(varWord2Index) <> 1 Then
- Call subPrintText("I see no " + varWord2$ + " here")
- GoTo labExitVerbRead
- End If
- If varWord2Index = 21 Then
- Call subPrintText("The books tell of a land across the water.")
- Else
- Call subPrintText("I can't apply that")
- End If
- labExitVerbRead:
- End Sub
- Sub subVerbPay (varWord2Index)
- If varWord2Index = 28 Then
- Call subPrintText("I can't apply that")
- GoTo labExitVerbPay
- End If
- I = 11
- If varObjectLocations(varWord2Index) <> varCurrentLocation And varObjectLocations(varWord2Index) <> 1 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo labExitVerbPay
- End If
- If varWord2Index = 34 Then
- While I <> 26 And varObjectLocations(I) <> 1
- I = I + 1
- Wend
- If I < 26 Then
- varObjectLocations(I) = 51
- Call subGetObjName(I)
- Call subSnatch
- varObjectLocations(34) = 0
- varCarryingCounter = varCarryingCounter - 1
- Else
- Call subPrintText("You fell in a pit.")
- End If
- End If
- labExitVerbPay:
- End Sub
- Sub subVerbIn (n) 'In
- If n = 2 Then
- varCurrentLocation = 3
- Call subPrintLocation(varCurrentLocation)
- Else
- If n = 8 Then
- varCurrentLocation = 9
- Call subPrintLocation(varCurrentLocation)
- Else
- Call subPrintText("I can't apply that")
- End If
- End If
- End Sub
- Sub subVerbOut (n) 'out or exit
- 'n is current loc
- If n = 3 Then '
- varCurrentLocation = 2
- Call subPrintLocation(varCurrentLocation)
- Else
- If n = 9 Then
- varCurrentLocation = 8
- Call subPrintLocation(varCurrentLocation)
- Else
- Call subPrintText("I can't apply that")
- End If
- End If
- End Sub
- Sub subCalculateScore (varCurrentLocation)
- 'calculate and print score
- varScore = 0
- 'iterate through these objects. If we have them in inventory (1) or are they at Sphinx (50) then add 30 points
- For j = 11 To 29
- If varObjectLocations(j) = 1 Or varObjectLocations(j) = 50 Then varScore = varScore + 30
- Next j
- For j = 45 To 48
- If varObjectLocations(j) = 1 Or varObjectLocations(j) = 50 Then varScore = varScore + 30
- Next j
- If varWavingAtSphinxFlag = 1 Then ' varWavingAtSphinxFlag is set if we're kneeling and wand waving
- If varCurrentLocation = 50 Then ' are we at the sphinx ?
- varScore = varScore + 170
- End If
- End If
- If varScore + varKilledFlag < 0 Then
- Call subPrintText("You have scored 0 out of a possible 800.")
- Else
- Call subPrintText("You have scored " + Str$(varScore + varKilledFlag) + " out of 800.")
- End If
- End Sub
- FUNCTION funcTrimSpaces$ (z$)
- 'seems to just trim off leading spaces. QB seems not to like ASC(x) so jiggled a bit.
- lab453: 'Surely we can do some loopery here
- If Left$(z$, 1) = " " Then
- z$ = Right$(z$, Len(z$) - 1)
- GoTo lab453
- End If
- lab454: 'surely we can do some loopery here
- If Right$(z$, 1) = " " Then
- z$ = Left$(z$, Len(z$) - 1)
- GoTo lab454
- End If
- funcTrimSpaces$ = z$
- END FUNCTION
- FUNCTION funcLowerCase$ (z$)
- 'Just converts to lower case, puts entire z$ into lower case into B$ and passes to funTrimSpaces$
- b$ = ""
- For j = 1 To Len(z$)
- Q = Asc(Mid$(z$, j, 1))
- If Q > 64 And Q < 91 Then
- Q = Q + 32
- End If
- b$ = b$ + Chr$(Q)
- Next j
- funcLowerCase$ = (funcTrimSpaces$(b$))
- END FUNCTION
- Sub subVerbFill (w) 'F=Fill?
- If w = 28 Then 'is the verb water?
- Call subPrintText("I can't apply that")
- GoTo labExitVerbFill
- End If
- If varObjectLocations(w) <> varCurrentLocation And varObjectLocations(w) <> 1 Then
- Call subPrintText("I see no " + varWord2$ + " here.")
- GoTo labExitVerbFill
- Else
- If varObjectLocations(varWord2Index) <> 1 Then
- Call subPrintText("You're not carrying the " + varWord2$ + ".")
- GoTo labExitVerbFill
- End If
- End If
- If w = 27 And varCurrentLocation = varObjectLocations(28) And varGotWaterFlag = 0 Then
- Call subPrintText("Your bottle is now full of water.")
- varGotWaterFlag = 1
- Else
- If w = 27 And varCurrentLocation = varObjectLocations(28) Then
- Call subPrintText("your bottle is already full.")
- Else
- Call subPrintText("I can't apply that")
- End If
- End If
- labExitVerbFill:
- End Sub
- Sub subObjectText (w, n, varCurrentLocation)
- 'process OT for w=object number, n=count left to deal with
- 'OT seems to print out the description of the object given the objects presence eg "a set of keys" when the object is just 'keys'
- R$ = ""
- K = 0
- If n = 1 And varMAX <> 1 Then
- R$ = R$ + " and "
- End If
- If w = 5 Then 'keys
- R$ = R$ + "a set of keys,"
- GoTo lab478
- End If
- If w = 6 Then 'teeth
- R$ = R$ + "a set of dragon's teeth,"
- GoTo lab478
- End If
- If w = 26 Then 'ring
- R$ = R$ + "a mithril "
- GoTo lab477
- End If
- IF w = 1 OR w = 42 OR w = 17 OR w = 46 THEN 'axe, elephant, emerald, amethyst
- R$ = R$ + "an "
- GoTo lab477
- End If
- If w = 50 Then 'stilton
- R$ = R$ + "a piece of stilton,"
- GoTo lab478
- End If
- If w = 9 Then 'food
- GoTo lab477
- End If
- If w = 7 Then 'jack
- R$ = R$ + "a hydraulic "
- GoTo lab477
- End If
- If w = 48 Or w = 49 Then 'boat, stake
- R$ = R$ + "a wooden "
- GoTo lab477
- End If
- If w = 11 Or w = 20 Then 'sapphires, opals
- R$ = R$ + "a cluster of "
- GoTo lab477
- End If
- If w = 16 Or w = 18 Then 'rubies, pearls
- R$ = R$ + "a small fortune in "
- GoTo lab477
- End If
- If w = 51 Then 'matches
- R$ = R$ + "a box of "
- GoTo lab477
- End If
- If w = 33 Then 'goblins
- R$ = R$ + "a gang of "
- GoTo lab477
- End If
- If w = 22 Then 'spices
- R$ = R$ + "a small jar of "
- GoTo lab477
- End If
- If w = 21 Then 'books
- R$ = R$ + "a collection of library "
- GoTo lab477
- End If
- If w = 19 Then 'coins
- R$ = R$ + "a set of "
- GoTo lab477
- End If
- If w = 43 Then 'vampire
- R$ = R$ + "an evil "
- GoTo lab477
- End If
- If w = 36 Then 'pirate
- R$ = R$ + "a bearded "
- GoTo lab477
- End If
- If Abs(w - 14) < 2 Then 'gold, silver, maybe platinum
- R$ = R$ + "a bar of "
- GoTo lab477
- End If
- If w = 44 Then 'serpent
- R$ = R$ + "a bad smell,"
- GoTo lab478
- End If
- If w = 32 Or w = 37 Or w = 41 Then 'ogre, orc, crocodile
- R$ = R$ + "a mean looking "
- GoTo lab477
- End If
- If w = 30 Or w = 42 Then 'dragon, elephant
- R$ = R$ + "a large "
- GoTo lab477
- End If
- If w = 35 Or w = 38 Then 'bear, rabbit
- R$ = R$ + "a friendly "
- GoTo lab477
- End If
- If w <> 27 Then 'if anything other than the bottle then lab475
- GoTo lab475
- Else 'so we have the bottle
- If varGotWaterFlag = 0 Then 'does it have water.. no
- R$ = R$ + "a bottle,"
- GoTo lab478
- Else
- R$ = R$ + "a bottle of water," 'must have water then
- GoTo lab478
- End If
- End If
- lab475:
- IF w = 28 AND varGotWaterFlag = 1 AND LEFT$(A$, 3) = "inv" THEN 'varWord2Index8= water
- GOTO lab478
- ELSE
- If w = 28 Then
- GoTo lab477
- End If
- End If
- R$ = R$ + "a "
- lab477:
- O$ = R$
- Call subGetObjName(w)
- R$ = O$ + R$ + ", "
- IF INSTR(R$, " ") = 0 THEN
- R$ = " " + R$
- K = 1
- End If
- lab478:
- IF n <= 2 THEN
- R$ = Left$(R$, Len(R$) - 1)
- END IF
- If varCurrentLocation <> 1 And n = 1 Then
- R$ = R$ + " here"
- END IF
- If n = 1 Then
- R$ = R$ + "."
- End If
- 'If Pos(0) + Len(R$) > (varScreenWidth - 2) Then
- ' R$ = funScreenPrint$(R$, (varScreenWidth - 1))
- 'End If
- If K = 1 And R$ = " " Then
- R$ = Right$(R$, Len(R$) - 1)
- End If
- cn = 0
- ' Call subPrintText(R$)
- End Sub
- Sub subPrintText (varScrText$)
- ' Color colCyan 'so we can see what is being run through this sub
- Dim a%, z%, varStringLength
- varStringLength = Len(varScrText$)
- a% = 1
- z% = varScreenWidth + 1 - Pos(0)
- Do
- If z% > varStringLength + 1 Then
- z% = varStringLength + 1
- Else
- DO
- z% = z% - 1
- Loop Until Mid$(varScrText$, z%, 1) = " "
- End If
- If z% < a% Then
- z% = a% + varScreenWidth + 1
- End If
- Print Mid$(varScrText$, a%, z% - a%);
- If z% - a% < varScreenWidth Then
- Print
- Else
- If Mid$(varScrText$, z%, 1) = " " Then
- a% = a% + 1
- Else
- z% = z% + 1
- End If
- End If
- a% = z% + 1
- z% = a% + varScreenWidth + 1
- Loop Until a% > varStringLength
- If Pos(0) > 0 Then
- Print
- GoTo labExit
- Else
- GoTo labExit
- End If
- labExit:
- 'Color colGreen 'put the colour back
- End Sub
- Sub subFinish
- Call subPrintText("Well done, you've solved the puzzle.")
- Call subCalculateScore(varCurrentLocation)
- Call subPrintText("You had " + Str$(varTurnCount) + " turns.")
- End
- End Sub
- Sub subEat
- Call subPrintText("The " + O$ + " eats the " + varWord2$ + " and runs away.")
- End Sub
- Sub subSnatch
- Call subPrintText("The troll snatches your " + R$ + " and runs away.")
- End Sub
- Sub subSave (filename$)
- filename$ = filename$ + ".sav"
- Open filename$ For Output As #1
- Print #1, varBearFlag, varChasmFlag, varCasketOpenFlag, varCarryingCounter, varDwarfEncounters, varFlamesFlag, varGoblinEncounters
- Print #1, varKilledFlag, varCurrentLocation, varLampFuel, varWavingAtSphinxFlag, varRabbitFlag, varTurnLastSeenDwarf, varSafeOpenFlag
- Print #1, varScore, varTurnCount, varBridgeFlag, varVampireEncounters, varGotWaterFlag, varLampLitFlag, varDwarfFlag, varDwarfChance
- Print #1, varSuppressDwarf
- For cnt = 1 To 56
- Print #1, varObjectLocations(cnt)
- Next
- Close #1
- Call subPrintText("Game state saved")
- End Sub
- Sub subLoad (filename$)
- filename$ = filename$ + ".sav"
- Open filename$ For Input As #1
- Input #1, varBearFlag, varChasmFlag, varCasketOpenFlag, varCarryingCounter, varDwarfEncounters, varFlamesFlag, varGoblinEncounters
- Input #1, varKilledFlag, varCurrentLocation, varLampFuel, varWavingAtSphinxFlag, varRabbitFlag, varTurnLastSeenDwarf, varSafeOpenFlag
- Input #1, varScore, varTurnCount, varBridgeFlag, varVampireEncounters, varGotWaterFlag, varLampLitFlag, varDwarfFlag, varDwarfChance
- Input #1, varSuppressDwarf
- FOR cnt = 1 TO 56
- Input #1, varObjectLocations(cnt)
- Next
- Close #1
- Call subPrintText("Game state loaded")
- Print
- Call subPrintLocation(varCurrentLocation)
- End Sub
- Sub subDebug
- 'Prints out the state of play
- If varDwarfChance = 0.97 Then
- varDwarfStatus$ = "ENABLED"
- Else
- varDwarfStatus$ = "DISABLED"
- End If
- 'Color colRed
- Print
- Print "Environment"
- 'Color colGreen
- Print "Location # :"; varCurrentLocation
- Print "Dwarf Status: "; varDwarfStatus$
- Print
- 'Color colRed
- Print "Counters"
- 'Color colGreen
- Print "Turn: "; varTurnCount; "Items :"; varCarryingCounter; " Lamp Fuel="; varLampFuel; "DwarfEncounters: "; varDwarfEncounters
- PRINT "DwarfSeenIncr: "; varTurnLastSeenDwarf
- Print
- 'Color colRed
- Print "Flags"
- 'Color colGreen
- Print "Bear: "; varBearFlag; " Rabbit: "; varRabbitFlag; " Dwarf: "; varDwarfFlag; " Lamp Lit: "; varLampLitFlag
- Print "Water: "; varGotWaterFlag; " Flames: "; varFlamesFlag; " Casket: "; varCasketOpenFlag; " Chasm: "; varChasmFlag
- Print "DwarfSuppress: "; varSuppressDwarf; "Safe: "; varSafeOpenFlag
- Print
- 'Color colRed
- Print "Exit Array"
- 'Color colCyan
- Print " N S E W U D"
- 'Color colCyan + 8
- For i% = 1 To 6
- Print varExitArray(i%);
- Next i%
- 'Color colRed
- PRINT
- INPUT "Press enter for objects",dummy$
- PRINT "Objects array :"
- count%=0
- FOR j%=1 TO 14
- FOR i% = 1 TO 4
- 'Color colCyan + 8
- PRINT count%; ":";
- 'Color colCyan
- PRINT varObjectLocations(count%); " ",
- count%=count%+1
- NEXT i%
- PRINT
- NEXT j%
- 'Color 2
- Print
- End Sub
- Sub subReadExits
- labExitData: 'Keeping labExitData here for now since two SUBs use it and QB64 seems to keep DATA local to the sub. Nor does QB64 allow for it at end.
- '1
- Data 0,0,0,0,0,0
- Data 4,5,4,4,0,0
- Data 0,0,0,0,0,0
- Data 4,4,4,4,0,0
- Data 2,6,7,4,0,0
- Data 5,4,4,4,0,0
- Data 4,4,8,5,0,0
- Data 4,4,4,7,0,9
- Data 0,14,10,0,8,0
- Data 15,11,16,9,0,0
- '11
- Data 10,0,12,0,0,0
- Data 0,13,14,11,0,0
- Data 12,0,0,0,0,17
- Data 9,0,0,12,0,0
- Data 0,10,17,0,0,0
- Data 0,17,18,10,0,0
- Data 16,0,0,15,13,0
- Data 19,0,0,16,0,0
- Data 0,18,0,0,0,0
- Data 21,0,22,0,0,0
- '21
- Data 0,20,23,0,0,0
- Data 0,25,0,20,24,0
- Data 120,0,24,21,0,0
- Data 0,0,0,23,51,22
- Data 22,26,0,0,0,0
- Data 25,0,0,0,0,0
- Data 0,0,30,28,0,0
- Data 0,29,27,0,0,143
- Data 28,39,0,0,0,0
- Data 31,0,0,27,33,0
- '31
- Data 0,30,32,0,0,0
- Data 40,0,0,31,0,0
- Data 0,34,35,0,0,30
- Data 33,0,0,73,0,0
- Data 0,36,0,33,0,0
- Data 35,0,0,0,0,37
- Data 0,0,0,38,36,0
- Data 0,0,37,0,0,0
- Data 29,72,0,0,0,0
- Data 0,32,0,0,42,41
- '41
- Data 0,0,0,0,40,0
- Data 0,0,0,0,0,40
- Data 44,0,0,46,47,0
- Data 45,43,47,46,0,0
- Data 0,44,111,0,46,47
- Data 45,43,44,48,46,47
- Data 45,43,44,0,0,0
- Data 0,0,46,49,0,101
- Data 52,0,48,0,0,0
- Data 0,71,0,0,0,0
- '51
- Data 0,0,0,0,0,24
- Data 0,0,53,49,0,0
- Data 54,52,52,52,0,0
- Data 53,55,53,53,0,0
- Data 54,54,56,54,0,0
- Data 55,55,55,57,0,0
- Data 56,56,58,56,0,0
- Data 57,59,57,57,0,0
- Data 60,58,58,58,0,0
- Data 59,61,59,59,0,0
- '61
- Data 60,60,62,60,0,0
- Data 61,61,61,63,0,0
- Data 62,62,64,62,0,0
- Data 63,65,63,63,0,0
- Data 66,64,64,64,0,0
- Data 65,67,65,65,0,0
- Data 52,66,68,66,0,0
- Data 67,67,67,69,0,0
- Data 68,68,70,68,0,0
- Data 69,71,69,69,0,0
- '71
- Data 50,70,70,70,0,0
- Data 73,39,0,74,0,81
- Data 81,0,86,72,74,0
- Data 0,72,73,75,0,79
- Data 74,0,76,0,76,77
- Data 75,77,0,0,78,75
- Data 78,79,0,0,75,76
- Data 76,0,79,77,0,82
- Data 0,74,78,77,80,0
- Data 0,81,82,86,79,0
- '81
- Data 72,0,73,80,0,82
- Data 80,78,0,0,81,83
- Data 84,87,0,0,85,82
- Data 87,0,85,83,0,88
- Data 0,87,84,83,86,0
- Data 73,0,80,87,0,85
- Data 83,84,0,0,85,86
- Data 84,0,89,90,0,91
- Data 90,0,90,88,0,91
- Data 89,89,0,0,88,91
- '91
- Data 88,89,0,0,92,90
- Data 0,91,0,93,0,0
- Data 0,0,92,0,94,0
- Data 98,99,97,0,95,93
- Data 0,100,0,0,0,94
- Data 0,0,0,0,100,0
- Data 0,0,100,94,0,0
- Data 0,94,0,100,0,0
- Data 94,0,0,0,0,100
- Data 95,0,98,97,99,96
- '101
- Data 102,0,103,0,48,0
- Data 0,101,0,108,0,107
- Data 0,105,0,101,0,109
- Data 0,106,107,0,110,0
- Data 103,0,0,0,0,106
- Data 104,0,0,0,105,0
- Data 0,0,0,104,102,0
- Data 0,0,0,102,0,0
- Data 0,0,0,0,103,0
- Data 0,0,104,0,0,0
- '111
- Data 112,0,0,45,0,0
- Data 0,111,0,0,113,0
- Data 0,0,114,0,0,112
- Data 119,0,0,113,0,0
- Data 0,116,0,120,0,0
- Data 115,117,0,0,0,0
- Data 116,0,118,0,0,0
- Data 0,0,121,117,0,0
- Data 0,114,0,0,0,0
- Data 0,23,115,0,0,0
- '121
- Data 0,123,122,118,0,0
- Data 0,0,131,121,124,0
- Data 121,127,0,132,0,0
- Data 0,126,0,128,0,122
- Data 126,0,133,134,0,0
- Data 124,125,0,0,0,0
- Data 123,0,0,0,135,0
- Data 0,0,124,129,0,0
- Data 0,0,128,0,0,130
- Data 0,0,0,0,129,0
- '131
- Data 0,0,0,122,0,0
- Data 0,0,123,0,0,0
- Data 0,0,0,125,0,0
- Data 0,0,125,0,0,0
- Data 0,0,0,0,0,127
- Data 0,0,0,0,0,137
- Data 0,0,0,0,136,0
- Data 0,0,139,0,0,0
- Data 0,140,0,138,0,0
- Data 139,0,141,0,0,0
- '141
- Data 0,0,0,140,0,0
- Data 0,0,0,0,0,0
- Data 0,0,0,0,0,0
- Restore labExitData
- For varCO = 1 To (143 * 6)
- Read varExits(varCO)
- Next varCO
- End Sub
- Sub subReadObjectLocations
- labObjectLocations:
- 'Read in the objects into the array. Rearranged into 10's
- 'Seems to be a discrepancy here - loop to 55, yet there's 56 here.
- 'Perhaps because the building (obj56) plays no pickyupy role
- Data 0,13,3,11,3,0,143,49,17,40
- Data 39,38,134,19,51,0,42,0,131,132
- Data 22,34,49,31,20,0,5,15,14,36
- Data 0,30,48,26,29,10,32,21,24,94
- Data 117,111,0,142,110,95,138,92,126,108
- Data 119,96,0,117,15,3
- Restore labObjectLocations
- For j = 1 To 55
- Read varObjectLocations(j)
- Next j
- End Sub
- Sub subPrintHelp
- Print "I can't, you're on your own."
- Print
- Print "To move use directions such as N,S or E. I can understand simple instructions."
- Print "These statements should be in the form <verb> <noun> separated by a space."
- Print
- Print "If you get stuck try something completely different."
- Print
- Print "By the way magic is quite useful!"
- End Sub
- Sub subReadLocationDescriptions
- labdatalocs:
- Data Dummyloc 'This is because the original code data started at line 2 and was RESTORED to by proc call.
- Data "at the end of a road, outside a building. All around is forest."
- Data "in the building, obviously an old blacksmith's forge."
- Data in the forest.
- Data "on the road, a small raised path leads east, the road runs north-south."
- Data on the top of a mountain. In the distance a small building can be seen. All around you is dense forest. A road leads north.
- Data on a narrow path which seems to descend to the east.
- Data in the valley of doom. The path disappears down a small shaft here. Strange echoes can be heard from below.
- Data in the hall of spirits. Ghostly laughs and howls can be heard echoing around the walls. The air is full of dust and cobwebs.
- Data at a cross-roads in the tunnels. A chill wind blows from the north.
- Data in the Sorcerers lair. The walls resound with the sound of long forgotten spells.
- Data at a T-junction.
- Data "in the sword chamber, a large stone sits in the middle of the floor."
- Data in the gardeners store.
- Data by a lake which stretches far away to the horizon. The far side can only be dimly seen.
- Data in the fiery passage.
- Data in the banqueting hall.
- Data "at the edge of a deep crack, it is too wide to jump."
- Data in the smelting room. A large furnace sits in the corner.
- Data "in the oriental room, beside the chasm. The walls are decorated with chinese paintings."
- Data "in a very large room, the floor is covered with straw."
- Data in the old library.
- Data at a T-junction.
- Data in the bank vault. An enormous safe is set into the ceiling. There is no obvious handle.
- Data in a steep passage.
- Data at the troll bridge. A sign says STOP! TROLL OPERATED TOLL BRIDGE
- Data at a fork in the path. Behind you is the troll bridge.
- Data "in a very small, dark room. Full of broken rocks. A sign says DANGER FALLING ROCKS."
- Data in a large cave. It smells of bears.
- Data in a large room full of huge furniture.
- Data in the soft room. The walls resemble warm ice-cream.
- Data "in the slimy passage. A green, sticky slime crawls all around you."
- Data in a very small rocky cavern containing many stalactites.
- Data in a tiny room. On the wall it says Be humble in the eyes of the sphinx and use your brains!
- Data in a narrow tunnel.
- Data in the dragons lair. The bones of many adventurers lie here.
- Data in a narrow steep-sided passage. The roof cant be seen by lamp-light.
- Data at the DEAD-END-DIAMOND-MINE.
- Data in the blue room.
- Data in the oyster room. A very cold draft comes from below.
- Data on the edge of a vast glacier. It is riddled with deep crevasses too wide to jump!
- Data in the green room.
- Data on a high plateau. The bridge leads back across the glacier.
- Data in the catacombs.
- Data in the catacombs.
- Data in the catacombs.
- Data in the catacombs.
- Data in the hall of the mountain king.
- Data in an old pirates hideout. Many seafaring relics lie here
- Data on the edge of the desert. A huge sphinx sits here.
- Data in the safe.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the desert.
- Data in the red room.
- Data in the red room.
- Data in the white room.
- Data in the orange room.
- Data in the purple room.
- Data at a cross in the tunnels.
- Data at a cross in the tunnels.
- Data at a cross in the tunnels.
- Data at a cross in the tunnels.
- Data at a cross in the tunnels.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data wandering about in the iron passages. Your compass directions seem to be rather confused.
- Data at the foot of a hill. A castle can be seen at the top of it.
- Data in the castle gateway. The castle has obviously been left derelict for many years as the walls are begining to crumble away.
- Data in an immense courtyard.
- Data in the ruins of the north tower.
- Data in the dungeons. The air here is very musty. The floor is covered in dust and cobwebs cling to you as you move.
- Data in the Counts dining room. The decorations on the walls here are the blood stains of some of his unfortunate victims!
- Data on a steep staircase.
- Data in the south tower.
- Data in the ballroom. The music of the orchestras which used to play here still lingers on.
- Data at the entrance to the gnomes halls.
- Data in the gnomes kitchen.
- Data in the main hall. The Gnomes are obviously very untidy! They are also very shy and slip silently away as you enter.
- Data at a T-junction.
- Data at the south end of the main hall.
- Data in a low tunnel.
- Data in a low tunnel.
- Data in the dairy. There is a mouth_watering smell here of buttermilk and cheese.
- Data "in the pit. It is small,dark and very unpleasant here."
- Data in the rainbow room. The walls are decorated with all the colours imaginable.
- Data in a large chamber decorated in the style of the Maharajas palace.
- Data in a tiny water-worn pipe.
- Data in a tunnel hewn out of the rock by a giant explosion.
- Data in a room full of bottles of chemicals. This is the alchemists store. The smell of sulphur is overpowering.
- Data in a very tight passageway. A cool damp wind blows from the south.
- Data in a dark damp passageway. The ground is becoming a little soggy here.
- Data in the Everglades. It is rather swampy here and the mosquitoes are real pests!
- Data in a dark damp passageway. The ground is a little soggy here.
- Data in the alchemists laboratory. Theres a powerful sulphurous odour!
- Data "on a small path winding its way through a petrified forest."
- Data at a T-junction.
- Data at a T-junction.
- Data in the music room. Beautiful melodies echo all around.
- Data at a T-junction.
- Data "on the yellow brick road. Well I think it was yellow once upon a time but it has got rather muddy now."
- Data in an immense canyon. The sides reach upwards as far as the eye can see.
- Data in a small shrine obviously devoted to some fairy chief as pictures of him decorate all the walls.
- Data in a small passage. The ground is rather soft underfoot.
- Data in a patch of quicksand. Luckily though some kind previous adventurer has put a plank down so you can go on safely.
- Data at a dead_end. Oh dear you seem to have struggled through that quicksand for nothing.
- Data in the treasury.
- Data at yet another dead_end.
- Data at a dead end. Youll have to follow the yellow brick road once more.
- Data at the end of the yellow brick road. Im afraid you cant go any further in this direction as the rest of the road hasnt been built yet.
- Data in a fairy grotto. It is very beautiful but seems to be deserted.
- Data on the east shore. The mountains rise sharply all around the cove.
- Data in the wizards spell-chamber. When you entered the wizard was here mumbling about some lost spell-books. He saw you grunted something and vanished.
- Data in the west antechamber to the inner sanctum.
- Data in the inner sanctum. Not many have passed this way before. One intrepid adventurer seems to have written some graffiti DAVE KNEW W LANE.
- Data in the east antechamber.
- Data in a room similar to the spell-chamber.
- Data in the serpents stomach. Oh dear you seem to have become the monsters lunch.
- Data at the bottom of the rock slide. It is cramped and airless here. There is no obvious way to get out.
- Restore labdatalocs
- For i% = 1 To 143
- Read varLocationDescription$(i%)
- Next i%
- End Sub
- Sub subReadObjects
- labObjects:
- Data axe,sword,lamp,wand,keys,teeth,jack,chest,food,clam
- Data sapphires,diamond,gold,silver,platinum,rubies,emerald,pearls,coins,opals
- Data books,spices,sceptre,cushion,rug,ring,bottle,water,carrot,dragon
- Data dwarf,ogre,goblins,troll,bear,pirate,orc,rabbit,safe,casket
- Data crocodile,elephant,vampire,serpent,bracelet,amethyst,crown,boat,stake,stilton
- Data matches,mouse,bridge,swamp,lake,building,
- Restore labObjects:
- For i% = 1 To 56
- Read varObjectDesc$(i%)
- NEXT i%
- End Sub
- Sub subReadVerbs
- labVerbs:
- Data get,take,open,wave,throw,drop,kill,eat,cross,feed
- Data rub,light,read,pay,inventory,enter,out,leave,kneel,quit
- Data score,look,in,help,diaxos,north,south,east,west,up
- Data down,fill,go,load,save
- Restore labVerbs:
- For i% = 1 To 35
- Read varVerb$(i%)
- Next i%
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement