put "You and a band of other adventurers were exploring a dungeon when the "
put "entrance collapsed! Only you made it out, but your survival came at the "
put "expense of your equipment! Now, you find yourself stranded in a strange "
put "cave system, with only one goal: find a way out!"
%VARIABLES
var input : string
var knife : boolean
var potion : boolean
var key : boolean
var sword : boolean
var helmet : boolean
var gold : int
var maxhealth : int
var currenthealth : int
var maxstamina : int
var currentstamina : int
var torch : boolean
var gottenkey : boolean
var got_coin_one : boolean
got_coin_one := false
gottenkey := false
torch := false
knife := false
potion := false
key :=false
sword := false
helmet := false
gold :=0
maxhealth:= 20
currenthealth := 20
maxstamina := 10
currentstamina := 10
%Procedures
forward procedure entrance
forward procedure firsthall
forward procedure keyroomONE
forward procedure tut_goldroom
forward procedure tut_gate_nokey
forward procedure tut_gate_key
forward procedure main_entrance
%Tutorial segment
body procedure entrance
loop
get input
if input = "look" and torch = false then put "Behind you is a pile of rubble which used to be the "
put "entrance to the dungeon. In front of you is the cave mouth, shrouded in inky "
put "blackness. To your right there flickers a dim torch. (type help for help)"
end if
if input = "look" and torch = true then put "Behind you is a pile of rubble which used to be the "
put "entrance to the dungeon. In front of you is the cave mouth, shrouded in inky "
put "blackness. The torch rests in your hand now, and its light plays off of the"
put "bronze stand which was once its home."
end if
if input = "inv" then put "You are carrying:"
if gold >0 then put gold, " gold pieces"
if knife = true then put "a knife"
if potion = true then put "a potion"
if key = true then put "a key"
if sword = true then put "a sword"
if helmet = true then put "a helmet"
end if
end if
end if
end if
end if
end if
end if
if input = "get torch" or input ="torch" then put "you pick up the dim torch"
torch :=true
end if
if input = "go forward" or input ="forward" and torch = false then put "The dark makes you uneasy"
end if
if input = "go forward" or input = "forward" and torch = true then put "you advance forward"
firsthall
end if
if input = "help" then put "inv opens inventory, look looks around, get (object) picks up an object,"
put " go (direction) or just (direction) will move in that direction, and nav open the navigation menu."
end if
exit when input = "go forward" or input = "forward" and torch = true
end loop
end entrance
%tutorial area hallway%
body procedure firsthall
put "You are in a long, smooth hallway carved into the rock of the cave. "
put "Immediately to your left is a large doorway. Ahead and to your right is another"
put "gaping hole in the wall. Straight ahead is a large gate with an oversized lock"
put "on it."
loop
get input
if input = "look" then put "You are in a long, smooth hallway carved into the rock of the cave. "
put "Immediately to your left is a large doorway. Ahead and to your right is another"
put "gaping hole in the wall. Straight ahead is a large gate with an oversized lock"
put "on it."
end if
if input = "inv" then put "You are carrying:"
if gold >0 then put gold, " gold pieces"
if knife = true then put "a knife"
if potion = true then put "a potion"
if key = true then put "a key"
if sword = true then put "a sword"
if helmet = true then put "a helmet"
end if
end if
end if
end if
end if
end if
end if
if input = "help" then put "inv opens inventory, look looks around, get (object) picks up an object,"
put " go (direction) or just (direction) will move in that direction, and nav open the navigation menu."
end if
if input = "left" or input = "go left" then put "You head left" %This is the as far as the program works, once you try to go any direction other than left nothing happens%
keyroomONE
if input = "right" or input = "go right" then put "You go right"
tut_goldroom
if input = "forward" or input = "go forward" and key = false then put "You advance"
tut_gate_nokey
if input = "forward" or input = "go forward" and key = true then put "You advance"
tut_gate_key
end if
end if
end if
end if
end loop
end firsthall
%First Keyroom%
body procedure keyroomONE
if gottenkey = false then put "The room to your left is carved equally smoothly out of the solid rock. The room seems completely"
put "barren at first, but the light of your torch reflects of a small object in the center of the room."
put "It is a key!"
end if
if gottenkey = true then put "The room is empty, nothing remains but dust."
end if
loop
get input
if input = "look" then put "The room to your left is carved equally smoothly out of the solid rock. The room seems completely"
put "barren at first, but the light of your torch reflects of a small object in the center of the room."
put "It is a key!"
end if
if input = "look key" then put "It is hard to see from the doorway of the room, but the key seems gold or brass, and about the"
put "right size to fit the lock on the gate you saw earlier."
end if
if input = "inv" then put "You are carrying:"
if gold >0 then put gold, " gold pieces"
if knife = true then put "a knife"
if potion = true then put "a potion"
if key = true then put "a key"
if sword = true then put "a sword"
if helmet = true then put "a helmet"
end if
end if
end if
end if
end if
end if
end if
if input = "help" then put "inv opens inventory, look looks around, get (object) picks up an object,"
put " go (direction) or just (direction) will move in that direction, and nav open the navigation menu."
end if
if input = "key" or input = "get key" and gottenkey = false then put "You notice the key is strangely warm as you slip it into your"
put "pocket. Gained ONE KEY!"
gottenkey := true
end if
if input = "key" or input = "get key" and gottenkey = true then put "You already have the key."
end if
if input = "go back" or input = "back" or input = "return" or input = "door" then firsthall
end if
end loop
end keyroomONE
%hallway with gold piece 1%
body procedure tut_goldroom
if got_coin_one = false then put "You advance and head right to find yourself in another, narrower hallway. It banks right"
put "suddenly and then leads to a dead end. Just as you let out a groan and turn to leave, however,"
put "a glint catches your eye in the darkness! Some object is sitting on the floor before you!"
end if
if got_coin_one = true then put "The coin that was once here now rests comfortably in your pocket."
end if
loop
get input
if input = "look" and got_coin_one = false then put "You find yourself in another, narrower hallway. It banks right"
put "suddenly and then leads to a dead end. Just as you let out a groan and turn to leave, however,"
put "a glint catches your eye in the darkness! Some object is sitting on the floor before you!"
end if
if input = "look" and got_coin_one = true then put "There is nothing here but a dead end. You should head back and"
put "return to the main hallway."
end if
if input = "inv" then put "You are carrying:"
if gold >0 then put gold, " gold pieces"
if knife = true then put "a knife"
if potion = true then put "a potion"
if key = true then put "a key"
if sword = true then put "a sword"
if helmet = true then put "a helmet"
end if
end if
end if
end if
end if
end if
end if
if input = "look object" or input = "look glint" then put "Upon closer inspection, you realize the object is a small"
put "gold coin!"
end if
if input = "get coin" or input = "coin" or input = "object" or input = "get object" and got_coin_one = false then put "You crouch" ..
put " down and grab the object. It is a gold coin! Finally something good "
put "has come of this misadventure. Now you only need to escape!"
gold := gold+1
end if
if input = "get coin" or input = "coin" or input = "object" or input = "get object" and got_coin_one = true then put "You have it already"
end if
if input = "back" or input = "go back" or input = "return" and got_coin_one = false then put "You leave the hallway, and the faint glimmer fades."
firsthall
end if
if input = "back" or input = "go back" or input = "return" and got_coin_one = true then put "You head back to the main path, the slight weight in your pocket cheering you up already."
firsthall
end if
end loop
end tut_goldroom
%opening the gate with the key%
body procedure tut_gate_key
put "The key slides in easily and the gate vanishes. You head forward, eager to escape,"
put "but when you look behind you there is naught but a solid stone wall."
main_entrance
end tut_gate_key
%going to the gate without the key%
body procedure tut_gate_nokey
put "The lock is large and holds fast. You can sense magic coming off of it as soon as you approach, and despite the gate"
put "having many large gaps in it, you cannot see what lies beyond, even when you push your torch through the bars. Why"
put "was a mage enchanting a gate in this middle-of-nowhere cave? Regardless, there is nothing you can do to budge the"
put "gate without a key."
firsthall
end tut_gate_nokey
body procedure main_entrance
put "The cave system seems impossibly cold, and a tremendous gust of wind rushes past you and almost"
put "snuffs out you torch, as if to accentuate the icy air. The wind encourages you,"
put "however, as it means that the cave connects to the surface somewhere nearby!"
end main_entrance
entrance
|