Constant Story "No Room"; Constant Headline "^Copyright Ben Heaton, 2003.^"; Release 2; Constant MAX_CARRIED=20; Constant AMUSING_PROVIDED; Constant DEATH_MENTION_UNDO; Constant MANUAL_PRONOUNS; Constant DIALECT_US; Constant MAX_SCORE=1; Global begun=0; Global helpnum=0; Replace OffersLight; Replace Amusing; Replace GoSub; Replace ExitSub; Replace LookSub; Replace PlacesSub; Replace PraySub; Replace ScoreSub; Replace TreeSub; Include "Parser"; Object LibraryMessages with before [; Attack: "Violence really isn't the answer to this one."; Dig: "There is no reason to dig."; Drink: "You are a little thirsty, but not enough to try drinking a solid object."; Drop: if (lm_n == 4){ remove noun; "Dropped. As it leaves you, the concept of position relative to you ceases to exist for it."; } Jump: "You jump up and down. You are still nowhere."; Examine: "You're unable to look at anything in this darkness."; Listen: "You hear no sounds."; LMode1: " is now in brief mode, which gives long descriptions of places never before visited and short descriptions otherwise. This change will probably not be noticable as long as you aren't in a place."; LMode2: " is now in verbose mode, which always gives long descriptions of places (even if you've been there before). This change will probably not be noticable as long as you aren't in a place."; LMode3: " is now in superbrief mode, which always gives short descriptions of places (even if you haven't been there before). This change will probably not be noticable as long as you aren't in a place."; Mild: "Indeed."; Miscellany: if (lm_n == 44) { "You'll have to be a bit more specific."; } if (lm_n == 30) { "You're not aware of any such thing."; } if (lm_n == 10) { "Clever. A command with no content, given to a game with no location. Yes, very clever. But not clever enough."; } No: "Denial is not as good an option as you may think."; Sing: deadflag=1; "You clear your throat, then begin to sing a little tune invented on the spot. The music flows through you, its beauty a surprise and a delight. So taken are you with this song, you spend all your remaining life devoted solely to singing it. Within the day, dehydration sets in, preventing you from singing out loud. But you continue to sing in your mind, mouthing the words until you become too weak to do so. Soon later, you pass out, and perish in short order."; Sleep: "You have not yet tired."; Smell: "You smell nothing unusual."; Swim: "There's no water to swim in."; Think: deadflag=1; "You think of an idea so great and terrible that no man can imagine it and hope to remain alive."; Touch: if (lm_n==3) "You feel as good looking as ever. Although it's hard to be certain without actually looking."; VagueGo: "There is nowhere to go."; Verify: if (lm_n==1) "The game file has verified as intact. Really. Well, probably."; Wake: deadflag=1; "You manage to wake up. It turns out that what you thought was an objective reality was merely dreamlike illusion. Unfortunately, there's no reality beyond it. Having awakened from the universe as you knew it, you cease to be."; Wave: "Pointless."; WaveHands: "You wave, hoping to signal someone or something. It doesn't have any effect."; Yes: "Good for you."; ]; Include "VerbLib"; [ OffersLight; rfalse; !Just to be sure. ]; [ Amusing; "Did you try:^ singing?^ praying?^ xyzzy?^ finding your shoes?^ waking up?^ thinking?^ "; ]; [ InScope person item; if (person==player) { objectloop (item in parent(player)) PlaceInScope(item); } return false; ]; !Items Object hat "hat", with name 'felt' 'hat' 'bowler', before [; Touch: "Feels bowler-shaped."; Smell: "The hat smells rather musty, as though it was recently stuffed away in some closet."; Eat: "~Eat your hat~ is just a saying."; Disrobe: "Might as well keep it on."; Drop, Throw: "It's a nice hat. No need to get rid of it."; ], has clothing; Object walls "Checking to see if this nothingness somehow has boundaries or surroundings of some kind", !the lengthy name above gets printed in parentheses when the walls are referred to. with name 'wall' 'walls' 'floor' 'ceiling' 'n' 's' 'e' 'w' 'ne' 'nw' 'se' 'sw' 'south' 'north' 'east' 'west' 'northwest' 'northeast' 'southeast' 'southwest', before [; "There's no such thing here. You are nowhere."; ], found_in [; rtrue;], has scenery static proper; Object shoes "shoes", with name 'shoe' 'shoes', before [; "You can't find your shoes."; ], found_in [; rtrue;], has scenery static; Object air "air" with name 'air' 'atmosphere' 'gas', found_in [; rtrue; ], before [; Take, Breathe: "You take in a deep breath. It feels pretty good."; Exhale: "You exhale. And thus the great cycle of breathing continues."; Eat: "Air is not food."; Touch: "Pretty insubstantial."; Smell: "The air smells rather nice."; Find: "The air is all around you."; ], has scenery static proper; !Items in the starting inventory Object pocket "pocket", with name 'pocket', before [; Drop, Give, Disrobe, Throw: "What a strange idea."; Touch: print "Your left pocket feels like a handy place to store objects."; if (lint in pocket) " There's a lot of lint on the sides of it."; ""; Reach: print "You reach into your pocket, and feel "; if (children(self)){ WriteListFrom(child(self), ENGLISH_BIT); " there."; } else "it to be empty."; Smell: "Your pocket smells like chocolate. It's been that way ever since you accidentally left a candy bar in there for a week."; ], has container open clothing worn; Object lint "lint" pocket, with name 'lint' 'drier', before [; Eat: remove self; "Surprisingly tasty, for lint. Which is to say, it's not very good. But you eat it all anyway, out of a strange sense of compulsion."; Touch: "Feels soft and linty."; Smell: "It smells just like the inside of your pocket."; ], has proper; Class Rod with name 'rod' 'rods//p', article "a", plural "rods", inlemon 0, !Is the rod in the lemon? description "A long rod, made of some sort of metal.", before [; Touch: "Cylindrical, hard, and somewhat cold. It's metal, but what kind is anyone's guess."; Tie: if (second == lwire or rwire) <>; Eat: "They don't look like things that should be eaten."; Insert: if (second == lemon){ if (lemon has general) !Meaning it's been squeezed "The lemon is too squashed for you to stick things into it."; move self to lemon; print "You stick "; print (the) self; " firmly into the lemon."; } Take: if (self in lemon){ move self to player; give self general; "You remove the rod from the lemon. It's a bit wet now."; } Find: if (self in lemon) "It's stuck into the lemon."; ], each_turn [; if (self in lemon){ self.inlemon=1; } else self.inlemon=0; ]; Rod curod "copper rod" pocket, with name 'copper' 'rod' 'cu', before [; Smell: if (self has general) "It smells like the lemon."; "It smells like a penny."; Eat: "It doesn't seem edible. It's a copper rod."; Touch: if (self has general) "Cylindrical, hard, and somewhat cold. About half of it is covered in lemon juice."; "Cylindrical, hard, and somewhat cold."; ]; Rod znrod "zinc rod" pocket, with name 'zinc' 'rod' 'zn', before [; Smell: if (self has general) "It smells like the lemon."; "It smells fairly zincish."; Eat: "It doesn't seem edible. It's a zinc rod."; Touch: if (self has general) "Cylindrical, hard, and somewhat cold. About half of it is covered in lemon juice."; "Cylindrical, hard, and somewhat cold."; ]; Object bag "cloth bag" with name 'cloth' 'felt' 'bag' 'sack' 'string' 'cord', before [; Touch: print "The bag is made of smooth felt. "; if (self has open) print "The string that previously kept it closed now hangs loosely at its side."; else "It is held shut by a small cord tied around it."; if (children(self)){ print " It contains "; WriteListFrom(child(self), ENGLISH_BIT); "."; } rtrue; Open: if (self has open) "The bag is already open."; give self open; "You untie the string, opening the bag."; Tie: if (second==nothing || second==bag) <>; Untie: <>; Close: if (self hasnt open) "The bag is already closed."; give self ~open; "You tie the string shut, closing the bag."; Smell: "It has no odor at all."; ], has container openable ~open; Object lemon "lemon" bag with name 'lemon' 'fruit' 'food', invent [; !Name in inventory shows relationship to other objects if ((curod in self) && (znrod in self)){ print "a lemon (with a copper rod and a zinc rod sticking into it)"; rtrue; } if (curod in self){ print "a lemon (with a copper rod sticking into it)"; rtrue; } if (znrod in self){ print "a lemon (with a zinc rod sticking into it)"; rtrue; } ], before [; Eat: if (curod in self){ print "(First taking the copper rod out of the lemon)^"; move curod to player; } if (znrod in self){ print "(First taking the zinc rod out of the lemon)^"; move znrod to player; } remove self; "You carefully unpeel the lemon, and bite into it. It tastes sour, as expected. After finishing it, you discard the useless remnants of the peel."; Smell: "Citric."; Touch: if (self has general) "You've squished it into a pulpy mess."; print "The lemon feels round and bumpy."; if (children(self)==1) " There's a rod sticking into it"; if (children(self)) " There are two rods sticking into it."; ""; Squeeze: if (self has general) "You've already squeezed it as much as you can."; if (children(self)==1) "You can't squeeze the lemon effectively while there's a rod sticking into it."; if (children(self)) "You can't squeeze the lemon effectively while there are rods sticking into it."; give self general; "You squeeze the lemon tightly between your hands. The juice spills out, lost to the nothingness."; Empty, EmptyT, Remove: if (children(self)) "There's no need to do that."; ], has edible transparent; Object bulb "broken flashlight" with name 'flashlight' 'flash' 'light' 'bulb' 'plastic' 'switch' 'broken' 'smashed' 'casing', invent [; print "a broken flashlight"; if (lwire.oncu){ print " (connected to the copper rod by the left wire"; if (rwire.onzn) print " and to the zinc rod by the right wire)"; else print ")"; } else if (lwire.onzn){ print " (connected to the zinc rod by the left wire"; if (rwire.oncu) print " and to the copper rod by the right wire)"; else print ")"; } else if (rwire.oncu){ print " (connected to the copper rod by the right wire)"; } else if (rwire.onzn){ print " (connected to the zinc rod by the right wire)"; } rtrue; ], before [; Smell: "It smells like glass and plastic."; Touch: "The flashlight is about three inches long, but it feels like it was originally longer. The back of it is smashed, and the area where batteries would go is missing. All that remains is a plastic casing holding a bulb. There's a small switch on one side, and two torn wires leading out from the back. They were presumably connected to the battery initially."; SwitchOn: if ( ((lwire.oncu && rwire.onzn) || (rwire.oncu && lwire.onzn)) && ((curod.inlemon) && (znrod.inlemon)) ) { score=score+1; deadflag=2; "You switch on the flashlight. Thanks to the voltaic battery powers of your lemon, the bulb illuminates your surroundings. You can now see where you are, and thus are no longer nowhere."; } "Nothing happens. In fact, it's hard to say whether the switch on your flashlight is actually in the on position now, as you can't see if there's a label."; SwitchOff: "Nothing happens. In fact, it's hard to say whether the switch on your flashlight is actually in the off position now, as you can't see if there's a label."; ], has switchable ~on transparent; Object lwire "left wire" bulb, with name 'torn' 'exposed' 'wire' 'left' 'wires', onzn 0, oncu 0, before [; Tie: if (second==bulb) "It's already attached to the light bulb."; if (second==znrod){ if (self.onzn) "It's already wound onto that."; if (rwire.onzn) "No need to tie them both to the same rod."; if (self.oncu){ self.oncu=0; print "(first unwinding the left wire from the copper rod)^"; } self.onzn=1; "You wind the left wire firmly onto the zinc rod."; } if (second==curod){ if (self.oncu) "It's already wound onto that."; if (rwire.oncu) "No need to tie them both to the same rod."; if (self.onzn){ self.onzn=0; print "(first unwinding the left wire from the zinc rod)^"; } self.oncu=1; "You wind the left wire firmly onto the copper rod."; } "There's no point in doing that with the left wire."; Untie: if (self.oncu){ self.oncu=0; "You untie the left wire from the copper rod."; } if (self.onzn){ self.onzn=0; "You untie the left wire from the zinc rod."; } Insert: if (second==lemon) "Putting the wire directly into the lemon won't achieve much. The fruit isn't going to provide power on its own."; "There's no point in doing that with the left wire."; Smell: "It smells a little like cotton candy, but mostly like a metal wire."; Touch: "A thin metal wire, poking out from the broken flashlight."; ]; Object rwire "right wire" bulb, with name 'torn' 'exposed' 'wire' 'right' 'wires', onzn 0, oncu 0, before [; Tie: if (second==bulb) "It's already attached to the light bulb."; if (second==znrod){ if (self.onzn) "It's already wound onto that."; if (lwire.onzn) "No need to tie them both to the same rod."; if (self.oncu){ self.oncu=0; print "(first unwinding the right wire from the copper rod)^"; } self.onzn=1; "You wind the right wire firmly onto the zinc rod."; } if (second==curod){ if (self.oncu) "It's already wound onto that."; if (lwire.oncu) "No need to tie them both to the same rod."; if (self.onzn){ self.onzn=0; print "(first unwinding the right wire from the zinc rod)^"; } self.oncu=1; "You wind the right wire firmly onto the copper rod."; } "There's no point in doing that with the right wire."; Untie: if (self.oncu){ self.oncu=0; "You untie the right wire from the copper rod."; } if (self.onzn){ self.onzn=0; "You untie the right wire from the zinc rod."; } Insert: if (second==lemon) "Putting the wire directly into the lemon won't achieve much. The fruit isn't going to generate power on its own."; "There's no point in doing that with the right wire."; Smell: "It smells a little like pickles, but mostly like a metal wire."; Touch: "A thin metal wire, poking out from the broken flashlight."; ]; [ Initialise; !The object tree and several attributes are manually reset in this !routine, as restarting wasn't working properly on all interpreters !I tested the game on otherwise. There may be a better way to !handle this. begun=false; move hat to shoes; move pocket to player; move lint to pocket; move curod to pocket; move znrod to pocket; give curod ~general; give znrod ~general; give pocket worn; move bag to player; give bag ~open; move lemon to bag; give lemon ~general; move bulb to player; lwire.oncu=0; rwire.onzn=0; lwire.onzn=0; rwire.oncu=0; deadflag=0; score=0; helpnum=0; "You can type ABOUT if you want to. Doing so will provide non-crucial information."; ]; !Grammar !Meta verbs Verb meta 'help' 'hints' 'hint' * -> Help; [ HelpSub; helpnum++; switch (helpnum){ 1: "To use this game's hint system, type HINT or HELP whenever you want to see a new hint. To reset the hints, so that you can view old ones again, type RESET HINTS."; 2: "You're nowhere, and it's dark. Perhaps you should do something about that."; 3: "You have a flashlight, but it's broken."; 4: "But the bulb is intact. You just need some way of supplying power to it."; 5: "Lemons contain some interestingly conductive acidic juices."; 6: "If you stick some copper and zinc into a lemon, and connect them, there'll be an electrochemical reaction."; 7: "So you'll just need to put the two rods into the lemon, and connect a wire from the broken flashlight to each of them."; 8: "And then turn the light on."; 9: "Or you could type WIN GAME. But that's less satisfying."; default: "That's all."; } ]; Verb meta 'tree' * -> Tree; [ TreeSub; "Nowhere^ You"; ]; Verb meta 'walkthrough' 'walkthru' * -> Walkthrough; [ WalkthroughSub; "^Walkthrough:^^i^open bag^get lemon^feel flashlight^tie left wire to copper rod^attach right wire to zinc rod^put zinc rod in lemon^insert copper rod into lemon^pray^smell hat^turn flashlight on"; ]; Verb meta 'reset' * 'hints'/'help' -> Reset; [ ResetSub; if (helpnum==0) "That's not a verb I recognize."; helpnum=1; "Hints reset."; ]; Verb meta 'xyzzy' 'plugh' 'plover' 'baf' * -> Xyzzy; [ XyzzySub; "See, technically you're in a location (Darkness), but your real_location isn't a room. Instead, it's the Inform Library itself, which is the most sense Inform could make of my game. In fact, I didn't create any rooms when I was programming this. (Granted, with Inform it's a bit tricky to say what is a room and what isn't.) It would probably have been simpler to just make a fake room to put the player in, and achieve the same effect, but that's not perverse enough. I felt I had to try to go beyond the familiar one room games, and this is as close to zero rooms as I was able to get."; ]; Verb meta 'win' * -> WinGame * 'game' -> WinGame; [ WinGameSub; deadflag = 2; "You won! Yay!"; ]; Verb meta 'lose' * -> LoseGame * 'game' -> LoseGame; [ LoseGameSub; deadflag = 2; "No, I won't let you lose that way."; ]; Verb meta 'about' 'credits' 'info' * -> About; [ AboutSub; "No Room was written by Ben Heaton. He can be contacted for hints and general comments at noroom@@64factitious.net. To see a walkthrough, type WALKTHROUGH. For hints, type HELP. For a brief statement on the programming, type XYZZY.^^This game would be worse than it is without the help of beta testers Maryna Gray and Aaron Stonestrom. It wouldn't exist at all without the existence of the rec.arts.int-fiction community, and Graham Nelson, creator of Inform."; ]; !Other verbs Verb 'find' 'locate' * noun -> Find; [ FindSub; !Implemented because the Amusing message might cause players to try it on various objects if (noun in player) "You're holding it."; if ((noun in pocket) && (pocket in player)) "It's in your pocket."; if ((noun in bag) && (bag in player)) "It's in your bag"; if (noun==player) "You're nowhere."; "You can't find it."; ]; Verb 'be' * -> Be; [ BeSub; "You are."; ]; Verb 'pee' 'piss' 'urinate' * -> Urinate; [ UrinateSub; "You don't feel like it."; ]; Verb 'cry' 'weep' 'sob' 'wail' 'bawl' * -> Cry; [ CrySub; "Waah!"; ]; Verb 'yell' 'scream' 'bellow' 'holler' ' howl' 'roar' 'vociferate' 'yawp' * -> Yell * 'at' noun -> YellAt; [ YellSub; deadflag=1; "You yell as loudly as you can. Then you yell even louder than that. The resulting impossibility kills you."; ]; [ YellAtSub; "There is no response."; ]; Verb 'smile' 'grin' 'smirk' 'beam' 'twinkle' * -> Smile; [ SmileSub; "You smile cheerfully."; ]; Verb 'frown' 'scowl' 'glower' 'glare' 'lour' * -> Frown; [ FrownSub; "You frown. This has no practical effect."; ]; Verb 'dance' * -> Dance; [ DanceSub; "Your dancing is abominable."; ]; Verb 'dream' 'daydream' * -> Dream; [ DreamSub; deadflag=1; "You dream an impossible dream, and imagine it so fully that you become part of it yourself. You are now impossible."; ]; Verb 'breathe' 'inhale' * -> Breathe * 'out' -> Exhale * noun -> Breathe; [ BreatheSub; if (noun==nothing) <>; "You can't breathe that. It's not gaseous enough."; ]; Verb 'exhale' * -> Exhale * noun -> Exhale; [ ExhaleSub; if (noun==nothing) <>; "That's not something you can inhale, so exhaling it would be tricky."; ]; Verb 'see' * -> See; [ SeeSub; "You can't."; ]; [ GoSub; "There is nowhere to go."; ]; [ ExitSub; "There is nowhere to go."; ]; [ LookSub; if (begun) "There's nothing to look at here. Well, there may be, but without light the issue is rather moot."; else { begun=1; style bold; print "^Darkness"; style roman; "^You are nowhere. It's dark."; } ]; Verb 'untie' 'loose' * noun -> Untie; [ UntieSub; "You would achieve nothing by this."; ]; Verb 'reach' * noun -> Reach * 'in'/'into' noun -> Reach; [ ReachSub; "You can't reach into that."; ]; [ PlacesSub; "You are not in any place. You have not been in any places."; ]; [ ThrowSub; remove noun; "You throw ", (the) noun, " away into the darkness, and the concept of place ceases to exist for it."; ]; [ PraySub; if (hat in player) "Nothing happens."; move hat to player; give hat worn; "Your prayer is answered, in hat form."; ]; [ ScoreSub; if (deadflag){ if (score == 0) "You have scored 0 out of a possible 1."; if (score == 1) "You have scored 1 out of a possible 1."; } if (score == 0) "You have so far scored 0 out of a possible 1."; if (score == 1) "You have so far scored 1 out of a possible 1."; ]; Include "Grammar"; Extend only 'murder' replace; Extend only 'hug' replace; Verb 'shake' = 'wave'; Verb 'apologize' = 'sorry'; Verb 'stick' * noun 'in'/'into' noun -> Insert; Verb 'wind' * noun -> Tie * noun 'around'/'on'/'onto' noun-> Tie; Verb 'connect' * noun -> Tie * noun 'to' noun-> Tie; Extend only 'throw' replace * held -> Throw * held 'at' / 'against' / 'on' / 'onto' noun -> ThrowAt; Extend only 'rub' replace * noun -> Touch; Extend only 'twist' replace * noun ->Tie * noun 'around'/'on'/'onto' noun -> Tie; Extend only 'shout' first * -> Yell * 'at' noun -> YellAt; Extend only 'tie' * noun 'around'/'on'/'onto' noun -> Tie;