home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-30 | 55.7 KB | 1,603 lines |
- Path: uunet!zephyr.ens.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v14i028: dunnet - emacs-lisp text adventure, Part01/02
- Message-ID: <3323@master.CNA.TEK.COM>
- Date: 4 Aug 92 19:59:29 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 1592
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: ronnie@eddie.mit.edu (Ron Schnell)
- Posting-number: Volume 14, Issue 28
- Archive-name: dunnet/Part01
- Environment: gnu-emacs, emacs-lisp
-
- [I don't use gnu-emacs and so haven't tried this. -br]
-
- [From the author...]
- Dunnet is a text adventure game written in emacs-lisp. It requires
- that you have gnu-emacs, and the usual lisp libraries that come with it.
-
- Please e-mail me any comments or questions, especially if you find it
- too easy or hard.
-
- See the README for further information.
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 2)."
- # Contents: MANIFEST LCD-entry dun-globals.el dun-unix.el makefile
- # Wrapped by billr@saab on Tue Aug 4 12:57:54 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(517 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X File Name Archive # Description
- X-----------------------------------------------------------
- X COPYRIGHT 2
- X LCD-entry 1
- X MANIFEST 1 This shipping list
- X dun-batch.el 2
- X dun-commands.el 2
- X dun-globals.el 1
- X dun-main.el 2
- X dun-save.el 2
- X dun-unix.el 1
- X dun-util.el 2
- X dunnet 2
- X dunnet.window 2
- X makefile 1
- END_OF_FILE
- if test 517 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'LCD-entry' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'LCD-entry'\"
- else
- echo shar: Extracting \"'LCD-entry'\" \(133 characters\)
- sed "s/^X//" >'LCD-entry' <<'END_OF_FILE'
- X;; LCD Archive Entry:
- X;; dunnet|Ron Schnell|ronnie@eddie.mit.edu
- X;; |Text adventure.
- X;; |92-07-25|Version: 1.0|~/games/dunnet.tar.Z|
- END_OF_FILE
- if test 133 -ne `wc -c <'LCD-entry'`; then
- echo shar: \"'LCD-entry'\" unpacked with wrong size!
- fi
- # end of 'LCD-entry'
- fi
- if test -f 'dun-globals.el' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dun-globals.el'\"
- else
- echo shar: Extracting \"'dun-globals.el'\" \(37374 characters\)
- sed "s/^X//" >'dun-globals.el' <<'END_OF_FILE'
- X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- X;;;
- X;;; Globals
- X;;;
- X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- X
- X;;;; IMPORTANT
- X;;;; All globals which can change must be saved from 'save-game. Add
- X;;;; all new globals to bottom of file.
- X
- X(setq visited '(27))
- X(setq current-room 1)
- X(defvar dungeon-mode-map nil)
- X(setq dungeon-mode-map (make-sparse-keymap))
- X(define-key dungeon-mode-map "\r" 'dungeon-parse)
- X(setq computer nil)
- X(setq door1 'locked)
- X(setq key-level 0)
- X(setq hole nil)
- X(setq correct-answer nil)
- X(setq lastdir 0)
- X(setq numsaves 0)
- X(setq numcmds 0)
- X(setq wizard nil)
- X(setq endgame-question nil)
- X(setq logged-in nil)
- X(setq dungeon-mode 'dungeon)
- X(setq unix-verbs '((ls . ls) (ftp . ftp) (echo . echo) (exit . uexit) (cd . cd)
- X (pwd . pwd) (rlogin . rlogin) (uncompress . uncompress)
- X (cat . cat) (zippy . zippy)))
- X
- X(setq batch-mode nil)
- X
- X(setq cdpath "/usr/toukmond")
- X(setq cdroom -10)
- X(setq uncompressed nil)
- X(setq ethernet t)
- X(setq restricted '(room-objects dungeon-map rooms room-silents))
- X(setq path "/usr/toukmond")
- X(setq ftptype 'ascii)
- X(setq endgame nil)
- X(setq gottago t)
- X(setq jar nil)
- X(setq black nil)
- X
- X(setq rooms '(
- X (
- X"You are in the treasure room. A door leads out to the north."
- X "Treasure room"
- X )
- X (
- X"You are at a dead end of a dirt road. The road goes to the east.
- XIn the distance you can see that it will eventually fork off. The
- Xtrees here are very tall royal palms, and they are spaced equidistant
- Xfrom each other."
- X "Dead end"
- X )
- X (
- X"You are on the continuation of a dirt road. There are more trees on
- Xboth sides of you. The road continues to the east and west."
- X "E/W Dirt road"
- X )
- X (
- X"You are at a fork of two passages, one to the northeast, and one to the
- Xsoutheast. You can also go back west."
- X "Fork"
- X )
- X (
- X"You are on a northeast/southwest road."
- X "NE/SW road"
- X )
- X (
- X"You are at the end of the road. There is a building in front of you
- Xto the northeast, and the road leads back to the southwest."
- X "Building front"
- X )
- X (
- X"You are on a southeast/northwest road."
- X "SE/NW road"
- X )
- X (
- X"You are standing at the end of a road. A passage leads back to the
- Xnorthwest."
- X "Bear hangout"
- X )
- X (
- X"You are in the hallway of an old building. There are rooms to the east
- Xand west, and doors leading out to the north and south."
- X "Old Building hallway"
- X )
- X (
- X"You are in a mailroom. There are many bins where the mail is usually
- Xkept. The exit is to the west."
- X "Mailroom"
- X )
- X (
- X"You are in a computer room. It seems like most of the equipment has
- Xbeen removed. There is a VAX 11/780 in front of you, however, with
- Xone of the cabinets wide open. A sign on the front of the machine
- Xsays: This VAX is named 'pokey'. To type on the console, use the
- X'type' command. The exit is to the east."
- X "Computer room"
- X )
- X (
- X"You are in a meadow in the back of an old building. A small path leads
- Xto the west, and a door leads to the south."
- X "Meadow"
- X )
- X (
- X"You are in a round, stone room with a door to the east. There
- Xis a sign on the wall that reads: 'receiving room'."
- X "Receiving room"
- X )
- X (
- X"You are at the south end of a hallway that leads to the north. There
- Xare rooms to the east and west."
- X "Northbound Hallway"
- X )
- X (
- X"You are in a sauna. There is nothing in the room except for a dial
- Xon the wall. A door leads out to west."
- X "Sauna"
- X )
- X (
- X"You are at the end of a north/south hallway. You can go back to the south,
- Xor off to a room to the east."
- X "End of N/S Hallway"
- X )
- X (
- X"You are in an old weight room. All of the equipment is either destroyed
- Xor completely broken. There is a door out to the west, and there is a ladder
- Xleading down a hole in the floor."
- X "Weight room" ;16
- X )
- X (
- X"You are in a maze of twisty little passages, all alike.
- XThere is a button on the ground here."
- X "Maze"
- X )
- X (
- X"You are in a maze of little twisty passages, all alike."
- X "Maze"
- X )
- X (
- X"You are in a maze of thirsty little passages, all alike."
- X "Maze" ;19
- X )
- X (
- X"You are in a maze of twenty little passages, all alike."
- X "Maze"
- X )
- X (
- X"You are in a daze of twisty little passages, all alike."
- X "Maze" ;21
- X )
- X (
- X"You are in a maze of twisty little cabbages, all alike."
- X "Maze" ;22
- X )
- X (
- X"You are in a reception area for a health and fitness center. The place
- Xappears to have been recently ransacked, and nothing is left. There is
- Xa door out to the south, and a crawlspace to the southeast."
- X "Reception area"
- X )
- X (
- X"You are outside a large building to the north which used to be a health
- Xand fitness center. A road leads to the south."
- X "Health Club front"
- X )
- X (
- X"You are at the north side of a lake. On the other side you can see
- Xa road which leads to a cave. The water appears very deep."
- X "Lakefront North"
- X )
- X (
- X"You are at the south side of a lake. A road goes to the south."
- X "Lakefront South"
- X )
- X (
- X"You are in a well-hidden area off to the side of a road. Back to the
- Xnortheast through the brush you can see the bear hangout."
- X "Hidden area"
- X )
- X (
- X"The entrance to a cave is to the south. To the north, a road leads
- Xtowards a deep lake. On the ground nearby there is a chute, with a sign
- Xthat says 'put treasures here for points'."
- X "Cave Entrance" ;28
- X )
- X (
- X"You are in a misty, humid room carved into a mountain.
- XTo the north is the remains of a rockslide. To the east, a small
- Xpassage leads away into the darkness." ;29
- X "Misty Room"
- X )
- X (
- X"You are in an east/west passageway. The walls here are made of
- Xmulticolored rock and are quite beautiful."
- X "Cave E/W passage" ;30
- X )
- X (
- X"You are at the junction of two passages. One goes north/south, and
- Xthe other goes west."
- X "N/S/W Junction" ;31
- X )
- X (
- X"You are at the north end of a north/south passageway. There are stairs
- Xleading down from here. There is also a door leading west."
- X "North end of cave passage" ;32
- X )
- X (
- X"You are at the south end of a north/south passageway. There is a hole
- Xin the floor here, into which you could probably fit."
- X "South end of cave passage" ;33
- X )
- X (
- X"You are in what appears to be a worker's bedroom. There is a queen-
- Xsized bed in the middle of the room, and a painting hanging on the
- Xwall. A door leads to another room to the south, and stairways
- Xlead up and down."
- X "Bedroom" ;34
- X )
- X (
- X"You are in a bathroom built for workers in the cave. There is a
- Xurinal hanging on the wall, and some exposed pipes on the opposite
- Xwall where a sink used to be. To the north is a bedroom."
- X "Bathroom" ;35
- X )
- X (
- X"This is a marker for the urinal. User will not see this, but it
- Xis a room that can contain objects."
- X "Urinal" ;36
- X )
- X (
- X"You are at the northeast end of a northeast/southwest passageway.
- XStairs lead up out of sight."
- X "Ne end of ne/sw cave passage" ;37
- X )
- X (
- X"You are at the junction of northeast/southwest and east/west passages."
- X "Ne/sw-e/w junction" ;38
- X )
- X (
- X"You are at the southwest end of a northeast/southwest passageway."
- X "Sw end of ne/sw cave passage" ;39
- X )
- X (
- X"You are at the east end of an e/w passage. There are stairs leading up
- Xto a room above."
- X "East end of e/w cave passage" ;40
- X )
- X (
- X"You are at the west end of an e/w passage. There is a hole on the ground
- Xwhich leads down out of sight."
- X "West end of e/w cave passage" ;41
- X )
- X (
- X"You are in a room which is bare, except for a horseshoe shaped boulder
- Xin the center. Stairs lead down from here." ;42
- X "Horseshoe boulder room"
- X )
- X (
- X"You are in a room which is completely empty. Doors lead out to the north
- Xand east."
- X "Empty room" ;43
- X )
- X (
- X"You are in an empty room. Interestingly enough, the stones in this
- Xroom are painted blue. Doors lead out to the east and south." ;44
- X "Blue room"
- X )
- X (
- X"You are in an empty room. Interestingly enough, the stones in this
- Xroom are painted yellow. Doors lead out to the south and west." ;45
- X "Yellow room"
- X )
- X (
- X"You are in an empty room. Interestingly enough, the stones in this room
- Xare painted red. Doors lead out to the west and north."
- X "Red room" ;46
- X )
- X (
- X"You are in the middle of a long north/south hallway." ;47
- X "Long n/s hallway"
- X )
- X (
- X"You are 3/4 of the way towards the north end of a long north/south hallway."
- X "3/4 north" ;48
- X )
- X (
- X"You are at the north end of a long north/south hallway. There are stairs
- Xleading upwards."
- X "North end of long hallway" ;49
- X )
- X (
- X"You are 3/4 of the way towards the south end of a long north/south hallway."
- X "3/4 south" ;50
- X )
- X (
- X"You are at the south end of a long north/south hallway."
- X "South end of long hallway" ;51
- X )
- X (
- X"You are at a landing in a stairwell which continues up and down."
- X "Stair landing" ;52
- X )
- X (
- X"You are at the continuation of an up/down staircase."
- X "Up/down staircase" ;53
- X )
- X (
- X"You are at the top of a staircase leading down. A crawlway leads off
- Xto the northeast."
- X "Top of staircase." ;54
- X )
- X (
- X"You are in a crawlway that leads northeast or southwest."
- X "Ne crawlway" ;55
- X )
- X (
- X"You are in a small crawlspace. There is a hole in the ground here, and
- Xa small passage back to the southwest."
- X "Small crawlspace" ;56
- X )
- X (
- X"You are in the Gamma Computing Center. An IBM 3090/600s is whirring
- Xaway in here. There is an ethernet cable coming out of one of the units,
- Xand going through the ceiling. There is no console here on which you
- Xcould type."
- X "Gamma computing center" ;57
- X )
- X (
- X"You are near the remains of a post office. There is a mail drop on the
- Xface of the building, but you cannot see where it leads. A path leads
- Xback to the east, and a road leads to the north."
- X "Post office" ;58
- X )
- X (
- X"You are at the intersection of Main Street and Maple Ave. Main street
- Xruns north and south, and Maple Ave runs east off into the distance.
- XIf you look north and east you can see many intersections, but all of
- Xthe buildings that used to stand here are gone. Nothing remains except
- Xstreet signs.
- XThere is a road to the northwest leading to a gate that guards a building."
- X "Main-Maple intersection" ;59
- X )
- X (
- X"You are at the intersection of Main Street and the west end of Oaktree Ave."
- X "Main-Oaktree intersection" ;60
- X )
- X (
- X"You are at the intersection of Main Street and the west end of Vermont Ave."
- X "Main-Vermont intersection" ;61
- X )
- X (
- X"You are at the north end of Main Street at the west end of Sycamore Ave." ;62
- X "Main-Sycamore intersection"
- X )
- X (
- X"You are at the south end of First Street at Maple Ave." ;63
- X "First-Maple intersection"
- X )
- X (
- X"You are at the intersection of First Street and Oaktree Ave." ;64
- X "First-Oaktree intersection"
- X )
- X (
- X"You are at the intersection of First Street and Vermont Ave." ;65
- X "First-Vermont intersection"
- X )
- X (
- X"You are at the north end of First Street at Sycamore Ave." ;66
- X "First-Sycamore intersection"
- X )
- X (
- X"You are at the south end of Second Street at Maple Ave." ;67
- X "Second-Maple intersection"
- X )
- X (
- X"You are at the intersection of Second Street and Oaktree Ave." ;68
- X "Second-Oaktree intersection"
- X )
- X (
- X"You are at the intersection of Second Street and Vermont Ave." ;69
- X "Second-Vermont intersection"
- X )
- X (
- X"You are at the north end of Second Street at Sycamore Ave." ;70
- X "Second-Sycamore intersection"
- X )
- X (
- X"You are at the south end of Third Street at Maple Ave." ;71
- X "Third-Maple intersection"
- X )
- X (
- X"You are at the intersection of Third Street and Oaktree Ave." ;72
- X "Third-Oaktree intersection"
- X )
- X (
- X"You are at the intersection of Third Street and Vermont Ave." ;73
- X "Third-Vermont intersection"
- X )
- X (
- X"You are at the north end of Third Street at Sycamore Ave." ;74
- X "Third-Sycamore intersection"
- X )
- X (
- X"You are at the south end of Fourth Street at Maple Ave." ;75
- X "Fourth-Maple intersection"
- X )
- X (
- X"You are at the intersection of Fourth Street and Oaktree Ave." ;76
- X "Fourth-Oaktree intersection"
- X )
- X (
- X"You are at the intersection of Fourth Street and Vermont Ave." ;77
- X "Fourth-Vermont intersection"
- X )
- X (
- X"You are at the north end of Fourth Street at Sycamore Ave." ;78
- X "Fourth-Sycamore intersection"
- X )
- X (
- X"You are at the south end of Fifth Street at the east end of Maple Ave." ;79
- X "Fifth-Maple intersection"
- X )
- X (
- X"You are at the intersection of Fifth Street and the east end of Oaktree Ave.
- XThere is a cliff off to the east."
- X "Fifth-Oaktree intersection" ;80
- X )
- X (
- X"You are at the intersection of Fifth Street and the east end of Vermont Ave."
- X "Fifth-Vermont intersection" ;81
- X )
- X (
- X"You are at the north end of Fifth Street and the east end of Sycamore Ave."
- X "Fifth-Oaktree intersection" ;82
- X )
- X (
- X"You are in front of the Museum of Natural History. A door leads into
- Xthe building to the north, and a road leads to the southeast."
- X "Museum entrance" ;83
- X )
- X (
- X"You are in the main lobby for the Museum of Natural History. In the center
- Xof the room is the huge skeleton of a dinosaur. Doors lead out to the
- Xsouth and east."
- X "Museum lobby" ;84
- X )
- X (
- X"You are in the geological display. All of the objects that used to
- Xbe on display are missing. There are rooms to the east, west, and
- Xnorth."
- X "Geological display" ;85
- X )
- X (
- X"You are in the marine life area. The room is filled with fish tanks,
- Xwhich are filled with dead fish that have apparently died due to
- Xstarvation. Doors lead out to the south and east."
- X "Marine life area" ;86
- X )
- X (
- X"You are in some sort of maintenance room for the museum. There is a
- Xswitch on the wall labeled 'BL'. There are doors to the west and north."
- X "Maintenance room" ;87
- X )
- X (
- X"You are in a classroom where school children were taught about natural
- Xhistory. On the blackboard is written, 'No children allowed downstairs.'
- XThere is a door to the east with an 'exit' sign on it. There is another
- Xdoor to the west."
- X "Classroom" ;88
- X )
- X (
- X"You are at the Vermont St. subway station. A train is sitting here waiting."
- X "Vermont station." ;89
- X )
- X (
- X"You are at the Museum subway stop. A passage leads off to the north."
- X "Museum station." ;90
- X )
- X (
- X"You are in a north/south tunnel."
- X "N/S tunnel" ;91
- X )
- X (
- X"You are at the north end of a north/south tunnel. Stairs lead up and
- Xdown from here. There is a garbage disposal here."
- X "North end of n/s tunnel" ;92
- X )
- X (
- X"You are at the top of some stairs near the subway station. There is
- Xa door to the west."
- X "Top of subway stairs" ;93
- X )
- X (
- X"You are at the bottom of some stairs near the subway station. There is
- Xa room to the northeast."
- X "Bottom of subway stairs" ;94
- X )
- X (
- X"You are in another computer room. There is a computer in here larger
- Xthan you have ever seen. It has no manufacturers name on it, but it
- Xdoes have a sign that says: This machine's name is 'endgame'. The
- Xexit is to the southwest. There is no console here on which you could
- Xtype."
- X "Endgame computer room" ;95
- X )
- X (
- X"You are in a north/south hallway."
- X "Endgame n/s hallway" ;96
- X )
- X (
- X"You have reached a question room. You must answer a question correctly in
- Xorder to get by. Use the 'answer' command to answer the question."
- X "Question room 1" ;97
- X )
- X (
- X"You are in a north/south hallway."
- X "Endgame n/s hallway" ;98
- X )
- X (
- X"You are in a second question room."
- X "Question room 2" ;99
- X )
- X (
- X"You are in a north/south hallway."
- X "Endgame n/s hallway" ;100
- X )
- X (
- X"You are in a third question room."
- X "Question room 3" ;101
- X )
- X (
- X"You are in the endgame treasure room. A door leads out to the north, and
- Xa hallway leads to the south."
- X "Endgame treasure room" ;102
- X )
- X (
- X"You are in the winner's room. A door leads back to the south."
- X "Winner's room" ;103
- X )
- X))
- X
- X(setq light-rooms '(0 1 2 3 4 5 6 7 8 9 10 11 12 13 24 25 26 27 28 58 59
- X 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
- X 77 78 79 80 81 82 83))
- X
- X(setq verblist '((die . die) (ne . ne) (north . n) (south . s) (east . e)
- X (west . w) (u . up) (d . down) (i . inven) (inventory . inven)
- X (look . examine) (n . n) (s . s) (e . e) (w . w) (se . se)
- X (nw . nw) (sw . sw) (up . up) (down . down) (in . in)
- X (out . out) (go . go) (drop . drop) (southeast . se)
- X (southwest . sw) (northeast . ne) (northwest . nw)
- X (save . save-game) (restore . restore)
- X (long . long) (dig . dig) (shake . shake) (wave . shake)
- X (examine . examine) (describe . examine) (climb . climb)
- X (eat . eat) (put . dput) (type . type)
- X (score . score) (help . help) (quit . quit) (read . examine)
- X (verbose . long) (urinate . piss) (piss . piss)
- X (flush . flush) (sleep . sleep) (lie . sleep) (x . examine)
- X (break . break) (drive . drive) (board . in) (enter . in)
- X (turn . turn) (press . press) (push . press) (swim . swim)
- X (on . in) (off . out) (chop . break) (switch . press)
- X (cut . break) (exit . out) (leave . out)
- X (flick . press) (superb . superb) (answer . answer)
- X (throw . drop) (l . examine) (take . take) (get . take)))
- X
- X(setq inbus nil)
- X(setq nomail nil)
- X(setq ignore '(the to at))
- X(setq mode 'moby)
- X(setq sauna-level 0)
- X(setq dungeon-map '(
- X; no so ea we ne se nw sw up do in ot
- X ( 96 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;0
- X ( -1 -1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;1
- X ( -1 -1 3 1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;2
- X ( -1 -1 -1 2 4 6 -1 -1 -1 -1 -1 -1 ) ;3
- X ( -1 -1 -1 -1 5 -1 -1 3 -1 -1 -1 -1 ) ;4
- X ( -1 -1 -1 -1 255 -1 -1 4 -1 -1 255 -1 ) ;5
- X ( -1 -1 -1 -1 -1 7 3 -1 -1 -1 -1 -1 ) ;6
- X ( -1 -1 -1 -1 -1 255 6 27 -1 -1 -1 -1 ) ;7
- X ( 255 5 9 10 -1 -1 -1 5 -1 -1 -1 5 ) ;8
- X ( -1 -1 -1 8 -1 -1 -1 -1 -1 -1 -1 -1 ) ;9
- X ( -1 -1 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;10
- X ( -1 8 -1 58 -1 -1 -1 -1 -1 -1 -1 -1 ) ;11
- X ( -1 -1 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;12
- X ( 15 -1 14 12 -1 -1 -1 -1 -1 -1 -1 -1 ) ;13
- X ( -1 -1 -1 13 -1 -1 -1 -1 -1 -1 -1 -1 ) ;14
- X ( -1 13 16 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;15
- X ( -1 -1 -1 15 -1 -1 -1 -1 -1 17 16 -1 ) ;16
- X ( -1 -1 17 17 17 17 255 17 255 17 -1 -1 ) ;17
- X ( 18 18 18 18 18 -1 18 18 19 18 -1 -1 ) ;18
- X ( -1 18 18 19 19 20 19 19 -1 18 -1 -1 ) ;19
- X ( -1 -1 -1 18 -1 -1 -1 -1 -1 21 -1 -1 ) ;20
- X ( -1 -1 -1 -1 -1 20 22 -1 -1 -1 -1 -1 ) ;21
- X ( 18 18 18 18 16 18 23 18 18 18 18 18 ) ;22
- X ( -1 255 -1 -1 -1 19 -1 -1 -1 -1 -1 -1 ) ;23
- X ( 23 25 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;24
- X ( 24 255 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;25
- X (255 28 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;26
- X ( -1 -1 -1 -1 7 -1 -1 -1 -1 -1 -1 -1 ) ;27
- X ( 26 255 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;28
- X ( -1 -1 30 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;29
- X ( -1 -1 31 29 -1 -1 -1 -1 -1 -1 -1 -1 ) ;30
- X ( 32 33 -1 30 -1 -1 -1 -1 -1 -1 -1 -1 ) ;31
- X ( -1 31 -1 57 -1 -1 -1 -1 -1 34 -1 -1 ) ;32
- X ( 31 -1 -1 -1 -1 -1 -1 -1 -1 35 -1 -1 ) ;33
- X ( -1 35 -1 -1 -1 -1 -1 -1 32 37 -1 -1 ) ;34
- X ( 34 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;35
- X ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;36
- X ( -1 -1 -1 -1 -1 -1 -1 38 34 -1 -1 -1 ) ;37
- X ( -1 -1 40 41 37 -1 -1 39 -1 -1 -1 -1 ) ;38
- X ( -1 -1 -1 -1 38 -1 -1 -1 -1 -1 -1 -1 ) ;39
- X ( -1 -1 -1 38 -1 -1 -1 -1 42 -1 -1 -1 ) ;40
- X ( -1 -1 38 -1 -1 -1 -1 -1 -1 43 -1 -1 ) ;41
- X ( -1 -1 -1 -1 -1 -1 -1 -1 -1 40 -1 -1 ) ;42
- X ( 44 -1 46 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;43
- X ( -1 43 45 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;44
- X ( -1 46 -1 44 -1 -1 -1 -1 -1 -1 -1 -1 ) ;45
- X ( 45 -1 -1 43 -1 -1 -1 -1 -1 255 -1 -1 ) ;46
- X ( 48 50 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;47
- X ( 49 47 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;48
- X ( -1 48 -1 -1 -1 -1 -1 -1 52 -1 -1 -1 ) ;49
- X ( 47 51 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;50
- X ( 50 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;51
- X ( -1 -1 -1 -1 -1 -1 -1 -1 53 49 -1 -1 ) ;52
- X ( -1 -1 -1 -1 -1 -1 -1 -1 54 52 -1 -1 ) ;53
- X ( -1 -1 -1 -1 55 -1 -1 -1 -1 53 -1 -1 ) ;54
- X ( -1 -1 -1 -1 56 -1 -1 54 -1 -1 -1 54 ) ;55
- X ( -1 -1 -1 -1 -1 55 -1 -1 -1 31 -1 -1 ) ;56
- X ( -1 -1 32 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;57
- X ( 59 -1 11 -1 -1 -1 -1 -1 -1 -1 255 255) ;58
- X ( 60 58 63 -1 -1 -1 255 -1 -1 -1 255 255) ;59
- X ( 61 59 64 -1 -1 -1 -1 -1 -1 -1 255 255) ;60
- X ( 62 60 65 -1 -1 -1 -1 -1 -1 -1 255 255) ;61
- X ( -1 61 66 -1 -1 -1 -1 -1 -1 -1 255 255) ;62
- X ( 64 -1 67 59 -1 -1 -1 -1 -1 -1 255 255) ;63
- X ( 65 63 68 60 -1 -1 -1 -1 -1 -1 255 255) ;64
- X ( 66 64 69 61 -1 -1 -1 -1 -1 -1 255 255) ;65
- X ( -1 65 70 62 -1 -1 -1 -1 -1 -1 255 255) ;66
- X ( 68 -1 71 63 -1 -1 -1 -1 -1 -1 255 255) ;67
- X ( 69 67 72 64 -1 -1 -1 -1 -1 -1 255 255) ;68
- X ( 70 68 73 65 -1 -1 -1 -1 -1 -1 255 255) ;69
- X ( -1 69 74 66 -1 -1 -1 -1 -1 -1 255 255) ;70
- X ( 72 -1 75 67 -1 -1 -1 -1 -1 -1 255 255) ;71
- X ( 73 71 76 68 -1 -1 -1 -1 -1 -1 255 255) ;72
- X ( 74 72 77 69 -1 -1 -1 -1 -1 -1 255 255) ;73
- X ( -1 73 78 70 -1 -1 -1 -1 -1 -1 255 255) ;74
- X ( 76 -1 79 71 -1 -1 -1 -1 -1 -1 255 255) ;75
- X ( 77 75 80 72 -1 -1 -1 -1 -1 -1 255 255) ;76
- X ( 78 76 81 73 -1 -1 -1 -1 -1 -1 255 255) ;77
- X ( -1 77 82 74 -1 -1 -1 -1 -1 -1 255 255) ;78
- X ( 80 -1 -1 75 -1 -1 -1 -1 -1 -1 255 255) ;79
- X ( 81 79 255 76 -1 -1 -1 -1 -1 -1 255 255) ;80
- X ( 82 80 -1 77 -1 -1 -1 -1 -1 -1 255 255) ;81
- X ( -1 81 -1 78 -1 -1 -1 -1 -1 -1 255 255) ;82
- X ( 84 -1 -1 -1 -1 59 -1 -1 -1 -1 255 255) ;83
- X ( -1 83 85 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;84
- X ( 86 -1 87 84 -1 -1 -1 -1 -1 -1 -1 -1 ) ;85
- X ( -1 85 88 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;86
- X ( 88 -1 -1 85 -1 -1 -1 -1 -1 -1 -1 -1 ) ;87
- X ( -1 87 255 86 -1 -1 -1 -1 -1 -1 -1 -1 ) ;88
- X ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;89
- X ( 91 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;90
- X ( 92 90 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;91
- X ( -1 91 -1 -1 -1 -1 -1 -1 93 94 -1 -1 ) ;92
- X ( -1 -1 -1 88 -1 -1 -1 -1 -1 92 -1 -1 ) ;93
- X ( -1 -1 -1 -1 95 -1 -1 -1 92 -1 -1 -1 ) ;94
- X ( -1 -1 -1 -1 -1 -1 -1 94 -1 -1 -1 -1 ) ;95
- X ( 97 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;96
- X ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;97
- X ( 99 97 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;98
- X ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;99
- X ( 101 99 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;100
- X ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;101
- X ( 103 101 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;102
- X ( -1 102 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;103
- X )
- X; no so ea we ne se nw sw up do in ot
- X)
- X
- X
- X;;; The initial setup of what objects are in each room.
- X;;; Regular objects have whole numbers lower than 255.
- X;;; Objects that cannot be taken but might move and are
- X;;; described during room description are negative.
- X;;; Stuff that is described and might change are 255, and are
- X;;; handled specially by 'describe-room.
- X
- X(setq room-objects '(nil
- X (0) (-1) nil nil nil (3) (-3) nil (16) (255) ;1-10
- X (1 15) nil nil (255) nil (8 9) nil nil (6) nil ;11-20
- X nil nil nil nil nil nil (10) nil (11) nil ;21-30
- X nil nil nil nil nil nil nil nil nil nil ;31-40
- X nil nil nil nil nil (13 255) nil nil nil nil ;41-50
- X nil (-15) nil nil nil (14) nil nil nil nil ;51-60
- X nil nil nil nil nil nil nil nil nil nil ;61-70
- X nil nil nil nil nil nil (255) nil nil (17) ;71-80
- X nil (-18) nil (20) nil (19 255 23) (21) (22) nil nil
- X nil nil nil (24) nil nil (255) nil (255) nil ;91-100
- X (255) nil (25) nil nil nil nil nil nil nil
- X nil nil nil nil nil nil nil nil nil nil
- X nil nil nil nil nil nil nil nil nil nil
- X nil nil nil nil nil nil nil nil nil nil
- X nil nil nil nil nil nil nil nil nil nil
- X nil nil nil nil nil nil nil nil nil nil))
- X
- X;;; These are objects in a room that are only described in the
- X;;; room description. They are permanent.
- X
- X(setq room-silents '(nil
- X (-2) (-2) nil nil nil nil nil nil (-4) (-5) ;1-10
- X nil nil nil (-7) nil (-27) (-8 -27) nil nil nil ;11-20
- X nil nil nil nil nil nil nil (-9) nil nil ;21-30
- X nil nil nil (-10 -11) (-12 -14) nil nil nil nil nil ;31-40
- X nil (-1) nil nil nil nil nil nil nil nil ;41-50
- X nil nil nil nil nil nil (-5 -16) (-17) (-19) nil
- X nil nil nil nil nil nil nil nil nil nil ;61-70
- X nil nil nil nil nil nil nil nil nil (-20) ;71-80
- X nil nil nil (-21) nil (-22 -23) (-24) (-25) (-28) nil
- X nil (-26) nil nil (-5) nil nil nil nil nil ;91-100
- X nil nil nil nil nil nil nil nil nil nil
- X))
- X(setq inventory '(1))
- X
- X
- X(setq objects '(
- X ("There is a shovel here." "A shovel") ;0
- X ("There is a lamp nearby." "A lamp") ;1
- X ("There is a CPU card here." "A computer board") ;2
- X ("There is some food here." "Some food") ;3
- X ("There is a shiny brass key here." "A brass key") ;4
- X ("There is a slip of paper here." "A slip of paper") ;5
- X ("There is a wax statuette of Richard Stallman here." ;6
- X "An RMS statuette")
- X ("There is a shimmering diamond here." "A diamond") ;7
- X ("There is a 10 pound weight here." "A weight") ;8
- X ("There is a life preserver here." "A life preserver");9
- X ("There is an emerald bracelet here." "A bracelet") ;10
- X ("There is a gold bar here." "A gold bar") ;11
- X ("There is a platinum bar here." "A platinum bar") ;12
- X ("There is a beach towel on the ground here." "A beach towel")
- X ("There is an axe here." "An axe") ;14
- X ("There is a silver bar here." "A silver bar") ;15
- X ("There is a bus driver's license here." "A license") ;16
- X ("There are some valuable coins here." "Some valuable coins")
- X ("There is a jewel-encrusted egg here." "A valuable egg") ;18
- X ("There is a glass jar here." "A glass jar") ;19
- X ("There is a dinosaur bone here." "A bone") ;20
- X ("There is a packet of nitric acid here." "Some nitric acid")
- X ("There is a packet of glycerine here." "Some glycerine") ;22
- X ("There is a valuable ruby here." "A ruby") ;23
- X ("There is a valuable amethyst here." "An amethyst") ;24
- X ("The Mona Lisa is here." "The Mona Lisa") ;25
- X ("There is a 100 dollar bill here." "A $100 bill") ;26
- X )
- X)
- X
- X;;; Weight of objects
- X
- X(setq object-lbs '(2 1 1 1 1 0 2 2 10 3 1 1 1 0 1 1 0 1 1 1 1 0 0 2 2 1 0))
- X(setq object-pts '(0 0 0 0 0 0 0 10 0 0 10 10 10 0 0 10 0 10 10 0 0 0 0 10 10 10 10))
- X
- X;;; How the user references *all* objects, permanent and regular.
- X
- X(setq objnames '((lamp . 1) (shovel . 0) (boulder . -1) (tree . -2)
- X (trees . -2) (cpu . 2) (board . 2) (card . 2)
- X (food . 3) (key . 4) (bear . -3) (bin . -4)
- X (bins . -4) (cabinet . -5) (computer . -5) (vax . -5)
- X (protoplasm . -6) (paper . 5) (dial . -7) (rms . 6)
- X (statue . 6) (statuette . 6) (diamond . 7) (stallman . 6)
- X (weight . 8) (button . -8) (life . 9) (preserver . 9)
- X (bracelet . 10) (emerald . 10) (chute . -9) (gold . 11)
- X (painting . -10) (bed . -11) (urinal . -12) (URINE . -13)
- X (pipes . -14) (pipe . -14) (platinum . 12) (towel . 13)
- X (ibm . -5) (cable . -16) (ethernet . -16) (axe . 14)
- X (beach . 13) (box . -15) (slit . -15) (silver . 15)
- X (mail . -17) (ladder . -27) (subway . -28) (train . -28)
- X (drop . -17) (license . 16) (bus . -18) (gate . -19)
- X (coins . 17) (cliff . -20) (egg . 18) (jar . 19) (bone . 20)
- X (nitric . 21) (glycerine . 22) (skeleton . -21) (acid . 21)
- X (dinosaur . -21) (disposal . -26) (garbage . -26) (ruby . 23)
- X (fish . -22) (tanks . -23) (switch . -24) (blackboard . -25)
- X (amethyst . 24) (mona . 25) (bill . 26)
- X))
- X
- X;;; Unix representation of objects.
- X(setq objfiles '(
- X "shovel.o" "lamp.o" "cpu.o" "food.o" "key.o" "paper.o"
- X "rms.o" "diamond.o" "weight.o" "preserver.o" "bracelet.o"
- X "gold.o" "platinum.o" "towel.o" "axe.o" "silver.o" "license.o"
- X "coins.o" "egg.o" "jar.o" "bone.o" "nitric.o" "glycerine.o"
- X "ruby.o" "amethyst.o"
- X ))
- X
- X;;; These are the descriptions for the negative numbered objects from
- X;;; room-objects
- X
- X(setq perm-objects '(
- X nil
- X ("There is a large boulder here.")
- X nil
- X ("There is a ferocious bear here!")
- X nil
- X nil
- X ("There is a worthless pile of protoplasm here.")
- X nil
- X nil
- X nil
- X nil
- X nil
- X nil
- X ("There is a strange smell in this room.")
- X nil
- X (
- X"There is a box with a slit in it, bolted to the wall here."
- X )
- X nil
- X nil
- X ("There is a bus here.")
- X nil
- X nil
- X nil
- X))
- X
- X
- X;;; These are the descriptions the user gets when regular objects are
- X;;; examined.
- X
- X(setq physobj-desc '(
- X"It is a normal shovel with a price tag attached that says $19.99."
- X"The lamp is hand-crafted by Geppetto."
- X"The CPU board has a VAX chip on it. It seems to have
- X2 Megabytes of RAM onboard."
- X"It looks like some kind of meat. Smells pretty bad."
- Xnil
- X"The paper says: Don't forget to type 'help' for help. Also, remember
- Xthis word: 'worms'"
- X"The statuette is of the likeness of Richard Stallman, the author of the
- Xfamous EMACS editor. You notice that he is not wearing any shoes."
- Xnil
- X"You observe that the weight is heavy."
- X"It says S. S. Minnow."
- Xnil
- Xnil
- Xnil
- X"It has a picture of snoopy on it."
- Xnil
- Xnil
- X"It has your picture on it!"
- X"They are old coins from the 19th century."
- X"It is a valuable Fabrege egg."
- X"It is a a plain glass jar."
- Xnil
- Xnil
- Xnil
- Xnil
- Xnil
- X )
- X)
- X
- X;;; These are the descriptions the user gets when non-regular objects
- X;;; are examined.
- X
- X(setq permobj-desc '(
- X nil
- X"It is just a boulder. It cannot be moved."
- X"They are palm trees with a bountiful supply of coconuts in them."
- X"It looks like a grizzly to me."
- X"All of the bins are empty. Looking closely you can see that there
- Xare names written at the bottom of each bin, but most of them are
- Xfaded away so that you cannot read them. You can only make out three
- Xnames:
- X Jeffrey Collier
- X Robert Toukmond
- X Thomas Stock
- X"
- X nil
- X"It is just a garbled mess."
- X"The dial points to a temperature scale which has long since faded away."
- Xnil
- Xnil
- X"It is a velvet painting of Elvis Presly. It seems to be nailed to the
- Xwall, and you cannot move it."
- X"It is a queen sized bed, with a very firm mattress."
- X"The urinal is very clean compared with everything else in the cave. There
- Xisn't even any rust. Upon close examination you realize that the drain at the
- Xbottom is missing, and there is just a large hole leading down the
- Xpipes into nowhere. The hole is too small for a person to fit in."
- Xnil
- Xnil
- X"The box has a slit in the top of it, and on it, in sloppy handwriting, is
- Xwritten: 'For key upgrade, put key in here.'"
- Xnil
- X"It says 'express mail' on it."
- X"It is a 35 passenger bus with the company name 'mobytours' on it."
- X"It is a large metal gate that is too big to climb over."
- X"It is a HIGH cliff."
- X"Unfortunately you do not know enough about dinosaurs to tell very much about
- Xit. It is very big, though."
- X"The fish look like they were once quite beautiful."
- Xnil
- Xnil
- Xnil
- Xnil
- X"It is a normal ladder that is permanently attached to the hole."
- X"It is a passenger train that is ready to go."
- X )
- X)
- X
- X(setq diggables '(nil nil nil (2) nil nil nil nil nil nil nil ;0-10
- X nil nil nil nil nil nil nil nil nil nil ;11-20
- X nil nil nil nil nil nil nil nil nil nil ;21-30
- X nil nil nil nil nil nil nil nil nil nil ;31-40
- X nil (12) nil nil nil nil nil nil nil nil))
- X
- X(setq scroll-step 2)
- X(setq room-shorts nil)
- X(dolist (x rooms)
- X (setq room-shorts
- X (append room-shorts (list (downcase (space-to-hyphen
- X (cadr x)))))))
- X
- X(setq endgame-questions '(
- X (
- X"What is your password on the machine called 'pokey'?" "robert")
- X (
- X"What password did you use during anonymous ftp to gamma?" "foo")
- X (
- X"Excluding the endgame, how many places are there where you can put
- Xtreasures for points?" "4" "four")
- X (
- X"What is your login name on the 'endgame' machine?" "toukmond"
- X)
- X (
- X"What is the nearest whole dollar to the price of the shovel?" "20" "twenty")
- X (
- X"What is the name of the bus company serving the town?" "mobytours")
- X (
- X"Give either of the two last names in the mailroom, other than your own."
- X"collier" "stock")
- X (
- X"What cartoon character is on the towel?" "snoopy")
- X (
- X"What is the last name of the author of EMACS?" "stallman")
- X (
- X"How many megabytes of memory is on the CPU board for the Vax?" "2")
- X (
- X"Which street in town is named after a U.S. state?" "vermont")
- X (
- X"How many pounds did the weight weigh?" "ten" "10")
- X (
- X"Name the STREET which runs right over the subway stop." "fourth" "4" "4th")
- X (
- X"How many corners are there in town (excluding the one with the Post Office)?"
- X "24" "twentyfour" "twenty-four")
- X (
- X"What type of bear was hiding your key?" "grizzly")
- X (
- X"Name either of the two objects you found by digging." "cpu" "card" "vax"
- X"board" "platinum")
- X (
- X"What network protocol is used between pokey and gamma?" "tcp/ip" "ip")
- X))
- X
- END_OF_FILE
- if test 37374 -ne `wc -c <'dun-globals.el'`; then
- echo shar: \"'dun-globals.el'\" unpacked with wrong size!
- fi
- # end of 'dun-globals.el'
- fi
- if test -f 'dun-unix.el' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dun-unix.el'\"
- else
- echo shar: Extracting \"'dun-unix.el'\" \(13746 characters\)
- sed "s/^X//" >'dun-unix.el' <<'END_OF_FILE'
- X;;;;;;;;;;;;;;;;;;;
- X;;;;
- X;;;; UNIX
- X;;;;
- X;;;;;;;;;;;;;;;;;;;
- X
- X(defun unix-parse (args)
- X (interactive "*p")
- X (beginning-of-line)
- X (let (beg esign)
- X (setq beg (+ (point) 2))
- X (end-of-line)
- X (if (and (not (= beg (point)))
- X (string= "$" (buffer-substring (- beg 2) (- beg 1))))
- X (progn
- X (setq line (downcase (buffer-substring beg (point))))
- X (princ line)
- X (if (eq (parse2 nil unix-verbs line) -1)
- X (progn
- X (if (setq esign (string-match "=" line))
- X (doassign line)
- X (mprinc (car line-list))
- X (mprincl ": not found.")))))
- X (goto-char (point-max))
- X (mprinc "\n"))
- X (if (eq dungeon-mode 'unix)
- X (mprinc "$ "))))
- X
- X(defun doassign (line)
- X (if (not wizard)
- X (let (passwd)
- X (mprinc "Enter wizard password: ")
- X (setq passwd (read-line))
- X (if (not batch-mode)
- X (mprinc "\n"))
- X (if (string= passwd "moby")
- X (progn
- X (setq wizard t)
- X (doassign line))
- X (mprincl "Incorrect.")))
- X
- X (let (varname epoint afterq i value)
- X (setq varname (substring line 0 esign))
- X (if (not (setq epoint (string-match ")" line)))
- X (if (string= (substring line (1+ esign) (+ esign 2))
- X "\"")
- X (progn
- X (setq afterq (substring line (+ esign 2)))
- X (setq epoint (+
- X (string-match "\"" afterq)
- X (+ esign 3))))
- X
- X (if (not (setq epoint (string-match " " line)))
- X (setq epoint (length line))))
- X (setq epoint (1+ epoint))
- X (while (and
- X (not (= epoint (length line)))
- X (setq i (string-match ")" (substring line epoint))))
- X (setq epoint (+ epoint i 1))))
- X (setq value (substring line (1+ esign) epoint))
- X (dungeon-eval varname value))))
- X
- X(defun dungeon-eval (varname value)
- X (let (eval-error)
- X (switch-to-buffer (get-buffer-create "*dungeon-eval*"))
- X (erase-buffer)
- X (insert "(setq ")
- X (insert varname)
- X (insert " ")
- X (insert value)
- X (insert ")")
- X (setq eval-error nil)
- X (condition-case nil
- X (eval-current-buffer)
- X (error (setq eval-error t)))
- X (kill-buffer (current-buffer))
- X (switch-to-buffer "*dungeon*")
- X (if eval-error
- X (mprincl "Invalid syntax."))))
- X
- X
- X(defun unix-interface ()
- X (login)
- X (if logged-in
- X (progn
- X (setq dungeon-mode 'unix)
- X (define-key dungeon-mode-map "\r" 'unix-parse)
- X (mprinc "$ "))))
- X
- X
- X
- X(defun login ()
- X (let (tries username password)
- X (setq tries 4)
- X (while (and (not logged-in) (> (setq tries (- tries 1)) 0))
- X (mprinc "\n\nUNIX System 5, Release 2.2 (pokey)\n\nlogin: ")
- X (setq username (read-line))
- X (if (not batch-mode)
- X (mprinc "\n"))
- X (mprinc "password: ")
- X (setq password (read-line))
- X (if (not batch-mode)
- X (mprinc "\n"))
- X (if (or (not (string= username "toukmond"))
- X (not (string= password "robert")))
- X (mprincl "login incorrect")
- X (setq logged-in t)
- X (mprincl "
- XWelcome to Unix\n
- XPlease clean up your directories. The filesystem is getting full.
- XOur tcp/ip link to gamma is a little flakey, but seems to work.
- XThe current version of ftp can only send files from the current
- Xdirectory, and deletes them after they are sent! Be careful.
- X
- XNote: Restricted bourne shell in use.\n")))
- X (setq dungeon-mode 'dungeon)))
- X
- X(defun ls (args)
- X (if (car args)
- X (let (ocdpath ocdroom)
- X (setq ocdpath cdpath)
- X (setq ocdroom cdroom)
- X (if (not (eq (cd args) -2))
- X (ls nil))
- X (setq cdpath ocdpath)
- X (setq cdroom ocdroom))
- X (if (= cdroom -10)
- X (ls-inven))
- X (if (= cdroom -2)
- X (ls-rooms))
- X (if (= cdroom -3)
- X (ls-root))
- X (if (= cdroom -4)
- X (ls-usr))
- X (if (> cdroom 0)
- X (ls-room))))
- X
- X(defun ls-root ()
- X (mprincl "total 4
- Xdrwxr-xr-x 3 root staff 512 Jan 1 1970 .
- Xdrwxr-xr-x 3 root staff 2048 Jan 1 1970 ..
- Xdrwxr-xr-x 3 root staff 2048 Jan 1 1970 usr
- Xdrwxr-xr-x 3 root staff 2048 Jan 1 1970 rooms"))
- X
- X(defun ls-usr ()
- X (mprincl "total 4
- Xdrwxr-xr-x 3 root staff 512 Jan 1 1970 .
- Xdrwxr-xr-x 3 root staff 2048 Jan 1 1970 ..
- Xdrwxr-xr-x 3 toukmond restricted 512 Jan 1 1970 toukmond"))
- X
- X(defun ls-rooms ()
- X (mprincl "total 16
- Xdrwxr-xr-x 3 root staff 512 Jan 1 1970 .
- Xdrwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
- X (dolist (x visited)
- X (mprinc
- X"drwxr-xr-x 3 root staff 512 Jan 1 1970 ")
- X (mprincl (nth x room-shorts))))
- X
- X(defun ls-room ()
- X (mprincl "total 4
- Xdrwxr-xr-x 3 root staff 512 Jan 1 1970 .
- Xdrwxr-xr-x 3 root staff 2048 Jan 1 1970 ..
- X-rwxr-xr-x 3 root staff 2048 Jan 1 1970 description")
- X (dolist (x (nth cdroom room-objects))
- X (if (and (>= x 0) (not (= x 255)))
- X (progn
- X (mprinc "-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 ")
- X (mprincl (nth x objfiles))))))
- X
- X(defun ls-inven ()
- X (mprinc "total 467
- Xdrwxr-xr-x 3 toukmond restricted 512 Jan 1 1970 .
- Xdrwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
- X (dolist (x unix-verbs)
- X (if (not (eq (car x) 'IMPOSSIBLE))
- X (progn
- X (mprinc"
- X-rwxr-xr-x 1 toukmond restricted 10423 Jan 1 1970 ")
- X (mprinc (car x)))))
- X (mprinc "\n")
- X (if (not uncompressed)
- X (mprincl
- X"-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 paper.o.Z"))
- X (dolist (x inventory)
- X (mprinc
- X"-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 ")
- X (mprincl (nth x objfiles))))
- X
- X(defun echo (args)
- X (let (nomore var)
- X (setq nomore nil)
- X (dolist (x args)
- X (if (not nomore)
- X (progn
- X (if (not (string= (substring x 0 1) "$"))
- X (progn
- X (mprinc x)
- X (mprinc " "))
- X (setq var (intern (substring x 1)))
- X (if (not (boundp var))
- X (mprinc " ")
- X (if (member var restricted)
- X (progn
- X (mprinc var)
- X (mprinc ": Permission denied")
- X (setq nomore t))
- X (eval (list 'mprinc var))
- X (mprinc " ")))))))
- X (mprinc "\n")))
- X
- X
- X(defun ftp (args)
- X (let (host username passwd)
- X (if (not (car args))
- X (mprincl "ftp: hostname required on command line.")
- X (setq host (intern (car args)))
- X (if (not (member host '(gamma endgame)))
- X (mprincl "ftp: Unknown host.")
- X (if (eq host 'endgame)
- X (mprincl "ftp: connection to endgame not allowed")
- X (if (not ethernet)
- X (mprincl "ftp: host not responding.")
- X (mprincl "Connected to gamma. FTP ver 0.9 00:00:00 01/01/70")
- X (mprinc "Username: ")
- X (setq username (read-line))
- X (if (string= username "toukmond")
- X (if batch-mode
- X (mprincl "toukmond ftp access not allowed.")
- X (mprincl "\ntoukmond ftp access not allowed."))
- X (if (string= username "anonymous")
- X (if batch-mode
- X (mprincl
- X "Guest login okay, send your user ident as password.")
- X (mprincl
- X "\nGuest login okay, send your user ident as password."))
- X (if batch-mode
- X (mprinc "Password required for ")
- X (mprinc "\nPassword required for "))
- X (mprincl username))
- X (mprinc "Password: ")
- X (setq ident (read-line))
- X (if (not (string= username "anonymous"))
- X (if batch-mode
- X (mprincl "Login failed.")
- X (mprincl "\nLogin failed."))
- X (if batch-mode
- X (mprincl "Guest login okay, user access restrictions apply.")
- X (mprincl "\nGuest login okay, user access restrictions apply."))
- X (ftp-commands)
- X (setq newlist
- X'("What password did you use during anonymous ftp to gamma?"))
- X (setq newlist (append newlist (list ident)))
- X (rplaca (nthcdr 1 endgame-questions) newlist)))))))))
- X
- X(defun ftp-commands ()
- X (setq exitf nil)
- X (let (line)
- X (while (not exitf)
- X (mprinc "ftp> ")
- X (setq line (read-line))
- X (if
- X (eq
- X (parse2 nil
- X '((type . ftptype) (binary . bin) (bin . bin) (send . send)
- X (put . send) (quit . ftpquit) (help . ftphelp)
- X (ascii . fascii)
- X ) line)
- X -1)
- X (mprincl "No such command. Try help.")))
- X (setq ftptype 'ascii)))
- X
- X(defun ftptype (args)
- X (if (not (car args))
- X (mprincl "Usage: type [binary | ascii]")
- X (setq args (intern (car args)))
- X (if (eq args 'binary)
- X (bin nil)
- X (if (eq args 'ascii)
- X (fascii 'nil)
- X (mprincl "Unknown type.")))))
- X
- X(defun bin (args)
- X (mprincl "Type set to binary.")
- X (setq ftptype 'binary))
- X
- X(defun fascii (args)
- X (mprincl "Type set to ascii.")
- X (setq ftptype 'ascii))
- X
- X(defun ftpquit (args)
- X (setq exitf t))
- X
- X(defun send (args)
- X (if (not (car args))
- X (mprincl "Usage: send <filename>")
- X (setq args (car args))
- X (let (counter foo)
- X (setq foo nil)
- X (setq counter 0)
- X
- X;;; User can send commands! Stupid user.
- X
- X
- X (if (assq (intern args) unix-verbs)
- X (progn
- X (rplaca (assq (intern args) unix-verbs) 'IMPOSSIBLE)
- X (mprinc "Sending ")
- X (mprinc ftptype)
- X (mprinc " file for ")
- X (mprincl args)
- X (mprincl "Transfer complete."))
- X
- X (dolist (x objfiles)
- X (if (string= args x)
- X (progn
- X (if (not (member counter inventory))
- X (progn
- X (mprincl "No such file.")
- X (setq foo t))
- X (mprinc "Sending ")
- X (mprinc ftptype)
- X (mprinc " file for ")
- X (mprinc (downcase (cadr (nth counter objects))))
- X (mprincl ", (0 bytes)")
- X (if (not (eq ftptype 'binary))
- X (progn
- X (if (not (member -6 (nth 12 room-objects)))
- X (replace room-objects 12
- X (append (nth 12 room-objects) (list -6))))
- X (remove-obj-from-inven counter))
- X (remove-obj-from-inven counter)
- X (replace room-objects 12
- X (append (nth 12 room-objects) (list counter))))
- X (setq foo t)
- X (mprincl "Transfer complete."))))
- X (setq counter (+ 1 counter)))
- X (if (not foo)
- X (mprincl "No such file."))))))
- X
- X(defun ftphelp (args)
- X (mprincl
- X "Possible commands are:\nsend quit type ascii binary help"))
- X
- X(defun uexit (args)
- X (setq dungeon-mode 'dungeon)
- X (mprincl "\nYou step back from the console.")
- X (define-key dungeon-mode-map "\r" 'dungeon-parse)
- X (if (not batch-mode)
- X (dungeon-messages)))
- X
- X(defun pwd (args)
- X (mprincl cdpath))
- X
- X(defun uncompress (args)
- X (if (not (car args))
- X (mprincl "Usage: uncompress <filename>")
- X (setq args (car args))
- X (if (or uncompressed
- X (and (not (string= args "paper.o"))
- X (not (string= args "paper.o.z"))))
- X (mprincl "Uncompress command failed.")
- X (setq uncompressed t)
- X (setq inventory (append inventory (list 5))))))
- X
- X(defun rlogin (args)
- X (if (not (car args))
- X (mprincl "Usage: rlogin <hostname>")
- X (setq args (car args))
- X (if (string= args "endgame")
- X (rlogin-endgame)
- X (if (not (string= args "gamma"))
- X (mprincl "No such host.")
- X (if (not ethernet)
- X (mprincl "Host not responding.")
- X (mprinc "Password: ")
- X (setq passwd (read-line))
- X (if (not (string= passwd "worms"))
- X (mprincl "\nlogin incorrect")
- X (mprinc
- X"\nYou begin to feel strange for a moment, and you lose your items."
- X )
- X (replace room-objects 10 (append (nth 0 room-objects) inventory))
- X (setq inventory nil)
- X (setq current-room 12)
- X (uexit nil)))))))
- X
- X(defun cd (args)
- X (if (not (car args))
- X (mprincl "Usage: cd <path>")
- X (setq tcdpath cdpath)
- X (setq tcdroom cdroom)
- X (setq badcd nil)
- X (condition-case nil
- X (setq path-elements (get-path (car args) nil))
- X (error (mprincl "Invalid path.")
- X (setq badcd t)))
- X (dolist (pe path-elements)
- X (unless badcd
- X (if (not (string= pe "."))
- X (if (string= pe "..")
- X (progn
- X (if (> tcdroom 0) ;In a room
- X (progn
- X (setq tcdpath "/rooms")
- X (setq tcdroom -2))
- X ;In /rooms,/usr,root
- X (if (or (= tcdroom -2) (= tcdroom -4) (= tcdroom -3))
- X (progn
- X (setq tcdpath "/")
- X (setq tcdroom -3))
- X (if (= tcdroom -10) ;In /usr/toukmond
- X (progn
- X (setq tcdpath "/usr")
- X (setq tcdroom -4))))))
- X (if (string= pe "/")
- X (progn
- X (setq tcdpath "/")
- X (setq tcdroom -3))
- X (if (= tcdroom -4)
- X (if (string= pe "toukmond")
- X (progn
- X (setq tcdpath "/usr/toukmond")
- X (setq tcdroom -10))
- X (nosuchdir))
- X (if (= tcdroom -10)
- X (nosuchdir)
- X (if (> tcdroom 0)
- X (nosuchdir)
- X (if (= tcdroom -3)
- X (progn
- X (if (string= pe "rooms")
- X (progn
- X (setq tcdpath "/rooms")
- X (setq tcdroom -2))
- X (if (string= pe "usr")
- X (progn
- X (setq tcdpath "/usr")
- X (setq tcdroom -4))
- X (nosuchdir))))
- X (if (= tcdroom -2)
- X (progn
- X (dolist (x visited)
- X (setq room-check (nth x room-shorts))
- X (if (string= room-check pe)
- X (progn
- X (setq tcdpath
- X (concat "/rooms/" room-check))
- X (setq tcdroom x))))
- X (if (= tcdroom -2)
- X (nosuchdir)))))))))))))
- X (if (not badcd)
- X (progn
- X (setq cdpath tcdpath)
- X (setq cdroom tcdroom)
- X 0)
- X -2)))
- X
- X(defun nosuchdir ()
- X (mprincl "No such directory.")
- X (setq badcd t))
- X
- X(defun cat (args)
- X (if (not (setq args (car args)))
- X (mprincl "Usage: cat <ascii-file-name>")
- X (if (string-match "/" args)
- X (mprincl "cat: only files in current directory allowed.")
- X (if (and (> cdroom 0) (string= args "description"))
- X (mprincl (car (nth cdroom rooms)))
- X (if (setq doto (string-match "\\.o" args))
- X (progn
- X (if (= cdroom -10)
- X (setq checklist inventory)
- X (setq checklist (nth cdroom room-objects)))
- X (if (not (member (cdr
- X (assq (intern (substring args 0 doto)) objnames))
- X checklist))
- X (mprincl "File not found.")
- X (mprincl "Ascii files only.")))
- X (if (assq (intern args) unix-verbs)
- X (mprincl "Ascii files only.")
- X (mprincl "File not found.")))))))
- X
- X(defun zippy (args)
- X (mprincl (yow)))
- X
- X(defun rlogin-endgame ()
- X (if (not (= (score nil) 90))
- X (mprincl "You have not achieved enough points to connect to endgame.")
- X (mprincl"\nWelcome to the endgame. You are a truly noble adventurer.")
- X (setq current-room 0)
- X (setq endgame t)
- X (replace room-objects 102 '(26))
- X (uexit nil)))
- END_OF_FILE
- if test 13746 -ne `wc -c <'dun-unix.el'`; then
- echo shar: \"'dun-unix.el'\" unpacked with wrong size!
- fi
- # end of 'dun-unix.el'
- fi
- if test -f 'makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'makefile'\"
- else
- echo shar: Extracting \"'makefile'\" \(200 characters\)
- sed "s/^X//" >'makefile' <<'END_OF_FILE'
- X
- Xall: dun-globals.el
- X -mkdir ../bin
- X -emacs -batch -f batch-byte-compile *.el
- X -emacs -batch -l `pwd`/dun-util -f compile-globals
- X -rm dun-globals.elc
- X -mv dun-globals.dat ../bin
- X -mv *.elc ../bin
- END_OF_FILE
- if test 200 -ne `wc -c <'makefile'`; then
- echo shar: \"'makefile'\" unpacked with wrong size!
- fi
- # end of 'makefile'
- fi
- echo shar: End of archive 1 \(of 2\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked both archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-