annotate lisp/games/dunnet.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents 376386a54a3c
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; dunnet.el --- Text adventure for Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
3 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
4
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Ron Schnell <ronnie@media.mit.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Created: 25 Jul 1992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Version: 2.0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Keywords: games
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
25 ;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
27 ;;; Synched up with: FSF 19.34.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; This game can be run in batch mode. To do this, use:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; emacs -batch -l dunnet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; The log file should be set for your system, and it must
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
36 ;;; be writable by all.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (defvar dun-log-file "/usr/local/dunnet.score"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "Name of file to store score information for dunnet.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (if nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (eval-and-compile (setq byte-compile-warnings nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
45 (eval-when-compile
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
46 (require 'cl))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;;;; Mode definitions for interactive mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (defun dun-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 "Major mode for running dunnet."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (text-mode)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
54 (make-local-variable 'scroll-step)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
55 (setq scroll-step 2)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (use-local-map dungeon-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (setq major-mode 'dungeon-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (setq mode-name "Dungeon"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (defun dun-parse (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 "Function called when return is pressed in interactive mode to parse line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (interactive "*p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (setq beg (+ (point) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (if (and (not (= beg (point))) (not (< (point) beg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (string= ">" (buffer-substring (- beg 1) beg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (setq line (downcase (buffer-substring beg (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (princ line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (if (eq (dun-vparse dun-ignore dun-verblist line) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (dun-mprinc "I don't understand that.\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (dun-messages))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (defun dun-messages ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (if dun-dead
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (text-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (if (eq dungeon-mode 'dungeon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (if (not (= room dun-current-room))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (dun-describe-room dun-current-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (setq room dun-current-room)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (dun-fix-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (dun-mprinc ">")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defun dunnet ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "Switch to *dungeon* buffer and start game."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (switch-to-buffer "*dungeon*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (dun-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (setq dun-dead nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (setq room 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (dun-messages))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;;;; This section contains all of the verbs and commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;;; Give long description of room if haven't been there yet. Otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;;; short. Also give long if we were called with negative room number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (defun dun-describe-room (room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (if (and (not (member (abs room) dun-light-rooms))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (not (member obj-lamp dun-inventory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (dun-mprincl "It is pitch dark. You are likely to be eaten by a grue.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (dun-mprincl (cadr (nth (abs room) dun-rooms)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (if (and (and (or (member room dun-visited)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (string= dun-mode "dun-superb")) (> room 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (not (string= dun-mode "long")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (dun-mprinc (car (nth (abs room) dun-rooms)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (if (not (string= dun-mode "long"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (if (not (member (abs room) dun-visited))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (setq dun-visited (append (list (abs room)) dun-visited))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (dolist (xobjs (nth dun-current-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (if (= xobjs obj-special)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (dun-special-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (if (>= xobjs 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (dun-mprincl (car (nth xobjs dun-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (if (not (and (= xobjs obj-bus) dun-inbus))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (dun-mprincl (car (nth (abs xobjs) dun-perm-objects)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (if (and (= xobjs obj-jar) dun-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (dun-mprincl "The jar contains:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (dolist (x dun-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (dun-mprinc " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (dun-mprincl (car (nth x dun-objects)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (if (and (member obj-bus (nth dun-current-room dun-room-objects)) dun-inbus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (dun-mprincl "You are on the bus."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;;; There is a special object in the room. This object's description,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;; or lack thereof, depends on certain conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (defun dun-special-object ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (if (= dun-current-room computer-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (if dun-computer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 "The panel lights are flashing in a seemingly organized pattern.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (dun-mprincl "The panel lights are steady and motionless.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (if (and (= dun-current-room red-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (not (member obj-towel (nth red-room dun-room-objects))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (dun-mprincl "There is a hole in the floor here."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (if (and (= dun-current-room marine-life-area) dun-black)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "The room is lit by a black light, causing the fish, and some of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 your objects, to give off an eerie glow."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (if (and (= dun-current-room fourth-vermont-intersection) dun-hole)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (if (not dun-inbus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (dun-mprincl"You fall into a hole in the ground.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (setq dun-current-room vermont-station)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (dun-describe-room vermont-station))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 "The bus falls down a hole in the ground and explodes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (dun-die "burning")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (if (> dun-current-room endgame-computer-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (if (not dun-correct-answer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (dun-endgame-question)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (dun-mprincl "Your question is:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (dun-mprincl dun-endgame-question))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (if (= dun-current-room sauna)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (dun-mprincl (nth dun-sauna-level '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "It is normal room temperature in here."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 "It is luke warm in here."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 "It is comfortably hot in here."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 "It is refreshingly hot in here."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 "You are dead now.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (if (and (= dun-sauna-level 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (or (member obj-rms dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (member obj-rms (nth dun-current-room dun-room-objects))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 "You notice the wax on your statuette beginning to melt, until it completely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 melts off. You are left with a beautiful diamond!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (if (member obj-rms dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (dun-remove-obj-from-inven obj-rms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (setq dun-inventory (append dun-inventory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (list obj-diamond))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (dun-remove-obj-from-room dun-current-room obj-rms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (dun-replace dun-room-objects dun-current-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (append (nth dun-current-room dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (list obj-diamond))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (if (member obj-floppy dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 "You notice your floppy disk beginning to melt. As you grab for it, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 disk bursts into flames, and disintegrates.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (dun-remove-obj-from-inven obj-floppy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (dun-remove-obj-from-room dun-current-room obj-floppy)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (defun dun-die (murderer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (if murderer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (dun-mprincl "You are dead."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (dun-do-logfile 'dun-die murderer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (dun-score nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (setq dun-dead t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (defun dun-quit (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (dun-die nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ;;; Print every object in player's inventory. Special case for the jar,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;;; as we must also print what is in it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (defun dun-inven (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (dun-mprinc "You currently have:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (dolist (curobj dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (if curobj
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (dun-mprincl (cadr (nth curobj dun-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (if (and (= curobj obj-jar) dun-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (dun-mprincl "The jar contains:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (dolist (x dun-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (dun-mprinc " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (dun-mprincl (cadr (nth x dun-objects))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (defun dun-shake (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (when (setq objnum (dun-objnum-from-args-std obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (if (member objnum dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;;; If shaking anything will do anything, put here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (dun-mprinc "Shaking ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (dun-mprinc (downcase (cadr (nth objnum dun-objects))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (dun-mprinc " seems to have no effect.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (if (and (not (member objnum (nth dun-current-room dun-room-silents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (not (member objnum (nth dun-current-room dun-room-objects))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (dun-mprincl "I don't see that here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ;;; Shaking trees can be deadly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (if (= objnum obj-tree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 "You begin to shake a tree, and notice a coconut begin to fall from the air.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 As you try to get your hand up to block it, you feel the impact as it lands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 on your head.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (dun-die "a coconut"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (if (= objnum obj-bear)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 "As you go up to the bear, it removes your head and places it on the ground.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (dun-die "a bear"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (if (< objnum 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (dun-mprincl "You cannot shake that.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (dun-mprincl "You don't have that.")))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (defun dun-drop (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (if dun-inbus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (dun-mprincl "You can't drop anything while on the bus.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (let (objnum ptr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (when (setq objnum (dun-objnum-from-args-std obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (if (not (setq ptr (member objnum dun-inventory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (dun-mprincl "You don't have that.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (dun-remove-obj-from-inven objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (dun-replace dun-room-objects dun-current-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (append (nth dun-current-room dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (list objnum)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (dun-mprincl "Done.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (if (member objnum (list obj-food obj-weight obj-jar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (dun-drop-check objnum))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ;;; Dropping certain things causes things to happen.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (defun dun-drop-check (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (if (and (= objnum obj-food) (= room bear-hangout)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (member obj-bear (nth bear-hangout dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 "The bear takes the food and runs away with it. He left something behind.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (dun-remove-obj-from-room dun-current-room obj-bear)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (dun-remove-obj-from-room dun-current-room obj-food)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (dun-replace dun-room-objects dun-current-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (append (nth dun-current-room dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (list obj-key)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (if (and (= objnum obj-jar) (member obj-nitric dun-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (member obj-glycerine dun-jar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 "As the jar impacts the ground it explodes into many pieces.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (setq dun-jar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (dun-remove-obj-from-room dun-current-room obj-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (if (= dun-current-room fourth-vermont-intersection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (setq dun-hole t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (setq dun-current-room vermont-station)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 "The explosion causes a hole to open up in the ground, which you fall
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 through.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (if (and (= objnum obj-weight) (= dun-current-room maze-button-room))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (dun-mprincl "A passageway opens.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ;;; Give long description of current room, or an object.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (defun dun-examine (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (setq objnum (dun-objnum-from-args obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (if (eq objnum obj-special)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (dun-describe-room (* dun-current-room -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (if (and (eq objnum obj-computer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (member obj-pc (nth dun-current-room dun-room-silents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (dun-examine '("pc"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (if (eq objnum nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (dun-mprincl "I don't know what that is.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (if (and (not (member objnum
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (nth dun-current-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (not (member objnum
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (nth dun-current-room dun-room-silents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (not (member objnum dun-inventory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (dun-mprincl "I don't see that here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (if (>= objnum 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (if (and (= objnum obj-bone)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (= dun-current-room marine-life-area) dun-black)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 "In this light you can see some writing on the bone. It says:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 For an explosive time, go to Fourth St. and Vermont.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (if (nth objnum dun-physobj-desc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (dun-mprincl (nth objnum dun-physobj-desc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (dun-mprincl "I see nothing special about that.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (if (nth (abs objnum) dun-permobj-desc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (dun-mprincl (nth (abs objnum) dun-permobj-desc)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (dun-mprincl "I see nothing special about that.")))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (defun dun-take (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (if dun-inbus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (dun-mprincl "You can't take anything while on the bus.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (setq obj (dun-firstword obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (if (not obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (dun-mprincl "You must supply an object.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (if (string= obj "all")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (let (gotsome)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (setq gotsome nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (dolist (x (nth dun-current-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (if (and (>= x 0) (not (= x obj-special)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (setq gotsome t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (dun-mprinc (cadr (nth x dun-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (dun-mprinc ": ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (dun-take-object x))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (if (not gotsome)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (dun-mprincl "Nothing to take.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (setq objnum (cdr (assq (intern obj) dun-objnames)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (if (eq objnum nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (dun-mprinc "I don't know what that is.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (dun-take-object objnum)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (defun dun-take-object (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (if (and (member objnum dun-jar) (member obj-jar dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (let (newjar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (dun-mprincl "You remove it from the jar.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (setq newjar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (dolist (x dun-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (if (not (= x objnum))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (setq newjar (append newjar (list x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (setq dun-jar newjar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (setq dun-inventory (append dun-inventory (list objnum))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (if (not (member objnum (nth dun-current-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (if (not (member objnum (nth dun-current-room dun-room-silents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (dun-mprinc "I do not see that here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (dun-try-take objnum))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (if (>= objnum 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (if (and (car dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (> (+ (dun-inven-weight) (nth objnum dun-object-lbs)) 11))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (dun-mprinc "Your load would be too heavy.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (setq dun-inventory (append dun-inventory (list objnum)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (dun-remove-obj-from-room dun-current-room objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (dun-mprinc "Taken. ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (if (and (= objnum obj-towel) (= dun-current-room red-room))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 "Taking the towel reveals a hole in the floor."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (dun-try-take objnum)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (dun-mprinc "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (defun dun-inven-weight ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (let (total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (setq total 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (dolist (x dun-jar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (setq total (+ total (nth x dun-object-lbs))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (dolist (x dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (setq total (+ total (nth x dun-object-lbs)))) total))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ;;; We try to take an object that is untakable. Print a message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 ;;; depending on what it is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (defun dun-try-take (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (dun-mprinc "You cannot take that."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (defun dun-dig (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (if dun-inbus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (dun-mprincl "You can't dig while on the bus.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (if (not (member 0 dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (dun-mprincl "You have nothing with which to dig.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (if (not (nth dun-current-room dun-diggables))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (dun-mprincl "Digging here reveals nothing.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (dun-mprincl "I think you found something.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (dun-replace dun-room-objects dun-current-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (append (nth dun-current-room dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (nth dun-current-room dun-diggables)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (dun-replace dun-diggables dun-current-room nil)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (defun dun-climb (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (setq objnum (dun-objnum-from-args obj))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
432 (cond ((null objnum)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
433 (dun-mprincl "I don't know that name."))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
434 ((and (not (eq objnum obj-special))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
435 (not (member objnum (nth dun-current-room dun-room-objects)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
436 (not (member objnum (nth dun-current-room dun-room-silents)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
437 (not (member objnum dun-inventory)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
438 (dun-mprincl "I don't see that here."))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
439 ((and (eq objnum obj-special)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
440 (not (member obj-tree (nth dun-current-room dun-room-silents))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
441 (dun-mprincl "There is nothing here to climb."))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
442 ((and (not (eq objnum obj-tree)) (not (eq objnum obj-special)))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
443 (dun-mprincl "You can't climb that."))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
444 (t
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
445 (dun-mprincl
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
446 "You manage to get about two feet up the tree and fall back down. You
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
447 notice that the tree is very unsteady.")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (defun dun-eat (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (when (setq objnum (dun-objnum-from-args-std obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (if (not (member objnum dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (dun-mprincl "You don't have that.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (if (not (= objnum obj-food))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (dun-mprinc "You forcefully shove ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (dun-mprinc (downcase (cadr (nth objnum dun-objects))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (dun-mprincl " down your throat, and start choking.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (dun-die "choking"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (dun-mprincl "That tasted horrible.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (dun-remove-obj-from-inven obj-food))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (defun dun-put (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (if dun-inbus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (dun-mprincl "You can't do that while on the bus")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (let (newargs objnum objnum2 obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (setq newargs (dun-firstwordl args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (if (not newargs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (dun-mprincl "You must supply an object")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (setq obj (intern (car newargs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (setq objnum (cdr (assq obj dun-objnames)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (if (not objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (dun-mprincl "I don't know what that object is.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (if (not (member objnum dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (dun-mprincl "You don't have that.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (setq newargs (dun-firstwordl (cdr newargs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (setq newargs (dun-firstwordl (cdr newargs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (if (not newargs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (dun-mprincl "You must supply an indirect object.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (setq objnum2 (cdr (assq (intern (car newargs)) dun-objnames)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (if (and (eq objnum2 obj-computer) (= dun-current-room pc-area))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (setq objnum2 obj-pc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (if (not objnum2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (dun-mprincl "I don't know what that indirect object is.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (if (and (not (member objnum2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (nth dun-current-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (not (member objnum2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (nth dun-current-room dun-room-silents)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (not (member objnum2 dun-inventory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (dun-mprincl "That indirect object is not here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (dun-put-objs objnum objnum2))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (defun dun-put-objs (obj1 obj2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (if (and (= obj2 obj-drop) (not dun-nomail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (setq obj2 obj-chute))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (if (= obj2 obj-disposal) (setq obj2 obj-chute))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (if (and (= obj1 obj-cpu) (= obj2 obj-computer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (dun-remove-obj-from-inven obj-cpu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (setq dun-computer t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 "As you put the CPU board in the computer, it immediately springs to life.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 The lights start flashing, and the fans seem to startup."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (if (and (= obj1 obj-weight) (= obj2 obj-button))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (dun-drop '("weight"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (if (= obj2 obj-jar) ;; Put something in jar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (if (not (member obj1 (list obj-paper obj-diamond obj-emerald
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 obj-license obj-coins obj-egg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 obj-nitric obj-glycerine)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (dun-mprincl "That will not fit in the jar.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (dun-remove-obj-from-inven obj1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (setq dun-jar (append dun-jar (list obj1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (dun-mprincl "Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (if (= obj2 obj-chute) ;; Put something in chute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (dun-remove-obj-from-inven obj1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 "You hear it slide down the chute and off into the distance.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (dun-put-objs-in-treas (list obj1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (if (= obj2 obj-box) ;; Put key in key box
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (if (= obj1 obj-key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 "As you drop the key, the box begins to shake. Finally it explodes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 with a bang. The key seems to have vanished!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (dun-remove-obj-from-inven obj1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (dun-replace dun-room-objects computer-room (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (nth computer-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (list obj1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (dun-remove-obj-from-room dun-current-room obj-box)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (setq dun-key-level (1+ dun-key-level)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (dun-mprincl "You can't put that in the key box!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (if (and (= obj1 obj-floppy) (= obj2 obj-pc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (setq dun-floppy t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (dun-remove-obj-from-inven obj1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (dun-mprincl "Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (if (= obj2 obj-urinal) ;; Put object in urinal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (dun-remove-obj-from-inven obj1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (dun-replace dun-room-objects urinal (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (nth urinal dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (list obj1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 "You hear it plop down in some water below."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (if (= obj2 obj-mail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (dun-mprincl "The mail chute is locked.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (if (member obj1 dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 "I don't know how to combine those objects. Perhaps you should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 just try dropping it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (dun-mprincl"You can't put that there.")))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (defun dun-type (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (if (not (= dun-current-room computer-room))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (dun-mprincl "There is nothing here on which you could type.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (if (not dun-computer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 "You type on the keyboard, but your characters do not even echo.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (dun-unix-interface))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 ;;; Various movement directions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (defun dun-n (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (dun-move north))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (defun dun-s (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (dun-move south))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (defun dun-e (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (dun-move east))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (defun dun-w (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (dun-move west))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (defun dun-ne (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (dun-move northeast))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (defun dun-se (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (dun-move southeast))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (defun dun-nw (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (dun-move northwest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (defun dun-sw (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (dun-move southwest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (defun dun-up (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (dun-move up))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (defun dun-down (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (dun-move down))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (defun dun-in (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (dun-move in))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (defun dun-out (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 (dun-move out))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (defun dun-go (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (if (or (not (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (eq (dun-doverb dun-ignore dun-verblist (car args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (cdr (cdr args))) -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (dun-mprinc "I don't understand where you want me to go.\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 ;;; Uses the dungeon-map to figure out where we are going. If the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 ;;; requested direction yields 255, we know something special is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 ;;; supposed to happen, or perhaps you can't go that way unless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 ;;; certain conditions are met.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (defun dun-move (dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 (if (and (not (member dun-current-room dun-light-rooms))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (not (member obj-lamp dun-inventory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 "You trip over a grue and fall into a pit and break every bone in your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 body.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 (dun-die "a grue"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 (let (newroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (setq newroom (nth dir (nth dun-current-room dungeon-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 (if (eq newroom -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (dun-mprinc "You can't go that way.\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (if (eq newroom 255)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 (dun-special-move dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 (setq room -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 (setq dun-lastdir dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (if dun-inbus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (if (or (< newroom 58) (> newroom 83))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 (dun-mprincl "The bus cannot go this way.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 "The bus lurches ahead and comes to a screeching halt.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (dun-remove-obj-from-room dun-current-room obj-bus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (setq dun-current-room newroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (dun-replace dun-room-objects newroom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (append (nth newroom dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 (list obj-bus)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (setq dun-current-room newroom)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 ;;; Movement in this direction causes something special to happen if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 ;;; right conditions exist. It may be that you can't go this way unless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 ;;; you have a key, or a passage has been opened.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 ;;; coding note: Each check of the current room is on the same 'if' level,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 ;;; i.e. there aren't else's. If two rooms next to each other have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 ;;; specials, and they are connected by specials, this could cause
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 ;;; a problem. Be careful when adding them to consider this, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 ;;; perhaps use else's.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (defun dun-special-move (dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (if (= dun-current-room building-front)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (if (not (member obj-key dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (dun-mprincl "You don't have a key that can open this door.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (setq dun-current-room old-building-hallway))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (if (= dun-current-room north-end-of-cave-passage)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (let (combo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 "You must type a 3 digit combination code to enter this room.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (dun-mprinc "Enter it here: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (setq combo (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (if (not dun-batch-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 (if (string= combo dun-combination)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (setq dun-current-room gamma-computing-center)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (dun-mprincl "Sorry, that combination is incorrect."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (if (= dun-current-room bear-hangout)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (if (member obj-bear (nth bear-hangout dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 "The bear is very annoyed that you would be so presumptuous as to try
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 and walk right by it. He tells you so by tearing your head off.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (dun-die "a bear"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 (dun-mprincl "You can't go that way.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (if (= dun-current-room vermont-station)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 "As you board the train it immediately leaves the station. It is a very
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 bumpy ride. It is shaking from side to side, and up and down. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 sit down in one of the chairs in order to be more comfortable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 "\nFinally the train comes to a sudden stop, and the doors open, and some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 force throws you out. The train speeds away.\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (setq dun-current-room museum-station)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (if (= dun-current-room old-building-hallway)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (if (and (member obj-key dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 (> dun-key-level 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (setq dun-current-room meadow)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (dun-mprincl "You don't have a key that can open this door.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (if (and (= dun-current-room maze-button-room) (= dir northwest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (if (member obj-weight (nth maze-button-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 (setq dun-current-room 18)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 (dun-mprincl "You can't go that way.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 (if (and (= dun-current-room maze-button-room) (= dir up))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 (if (member obj-weight (nth maze-button-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (dun-mprincl "You can't go that way.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 (setq dun-current-room weight-room)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (if (= dun-current-room classroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (dun-mprincl "The door is locked."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (if (or (= dun-current-room lakefront-north)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (= dun-current-room lakefront-south))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (dun-swim nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (if (= dun-current-room reception-area)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (if (not (= dun-sauna-level 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (setq dun-current-room health-club-front)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 "As you exit the building, you notice some flames coming out of one of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 windows. Suddenly, the building explodes in a huge ball of fire. The flames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 engulf you, and you burn to death.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (dun-die "burning")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 (if (= dun-current-room red-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (if (not (member obj-towel (nth red-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (setq dun-current-room long-n-s-hallway)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 (dun-mprincl "You can't go that way.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (if (and (> dir down) (> dun-current-room gamma-computing-center)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (< dun-current-room museum-lobby))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (if (not (member obj-bus (nth dun-current-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (dun-mprincl "You can't go that way.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (if (= dir in)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (if (member obj-license dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 "You board the bus and get in the driver's seat.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (setq dun-nomail t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 (setq dun-inbus t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (dun-mprincl "You are not licensed for this type of vehicle."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (dun-mprincl "You hop off the bus.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (setq dun-inbus nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (if (= dun-current-room fifth-oaktree-intersection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (if (not dun-inbus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 (dun-mprincl "You fall down the cliff and land on your head.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (dun-die "a cliff"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 "The bus flies off the cliff, and plunges to the bottom, where it explodes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (dun-die "a bus accident")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (if (= dun-current-room main-maple-intersection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (if (not dun-inbus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (dun-mprincl "The gate will not open.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 "As the bus approaches, the gate opens and you drive through.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (dun-remove-obj-from-room main-maple-intersection obj-bus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (dun-replace dun-room-objects museum-entrance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (append (nth museum-entrance dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 (list obj-bus)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (setq dun-current-room museum-entrance)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (if (= dun-current-room cave-entrance)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 "As you enter the room you hear a rumbling noise. You look back to see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 huge rocks sliding down from the ceiling, and blocking your way out.\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (setq dun-current-room misty-room)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 (defun dun-long (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 (setq dun-mode "long"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 (defun dun-turn (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (let (objnum direction)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (when (setq objnum (dun-objnum-from-args-std obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (if (not (or (member objnum (nth dun-current-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (member objnum (nth dun-current-room dun-room-silents))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (dun-mprincl "I don't see that here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (if (not (= objnum obj-dial))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (dun-mprincl "You can't turn that.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (setq direction (dun-firstword (cdr obj)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (if (or (not direction)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (not (or (string= direction "clockwise")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (string= direction "counterclockwise"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (dun-mprincl "You must indicate clockwise or counterclockwise.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 (if (string= direction "clockwise")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (setq dun-sauna-level (+ dun-sauna-level 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (setq dun-sauna-level (- dun-sauna-level 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (if (< dun-sauna-level 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 "The dial will not turn further in that direction.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (setq dun-sauna-level 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (dun-sauna-heat))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 (defun dun-sauna-heat ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (if (= dun-sauna-level 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (dun-mprincl
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
800 "The temperature has returned to normal room temperature."))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 (if (= dun-sauna-level 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (dun-mprincl "It is now luke warm in here. You begin to sweat."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (if (= dun-sauna-level 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (dun-mprincl "It is pretty hot in here. It is still very comfortable."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (if (= dun-sauna-level 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 "It is now very hot. There is something very refreshing about this.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (if (or (member obj-rms dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 (member obj-rms (nth dun-current-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 "You notice the wax on your statuette beginning to melt, until it completely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 melts off. You are left with a beautiful diamond!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (if (member obj-rms dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 (dun-remove-obj-from-inven obj-rms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (setq dun-inventory (append dun-inventory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 (list obj-diamond))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (dun-remove-obj-from-room dun-current-room obj-rms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 (dun-replace dun-room-objects dun-current-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (append (nth dun-current-room dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 (list obj-diamond))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 (if (or (member obj-floppy dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 (member obj-floppy (nth dun-current-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 "You notice your floppy disk beginning to melt. As you grab for it, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 disk bursts into flames, and disintegrates.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (if (member obj-floppy dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 (dun-remove-obj-from-inven obj-floppy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 (dun-remove-obj-from-room dun-current-room obj-floppy))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 (if (= dun-sauna-level 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 "As the dial clicks into place, you immediately burst into flames.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (dun-die "burning"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 (defun dun-press (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 (when (setq objnum (dun-objnum-from-args-std obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 (if (not (or (member objnum (nth dun-current-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 (member objnum (nth dun-current-room dun-room-silents))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 (dun-mprincl "I don't see that here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 (if (not (member objnum (list obj-button obj-switch)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (dun-mprinc "You can't ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 (dun-mprinc (car line-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (dun-mprincl " that."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 (if (= objnum obj-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 "As you press the button, you notice a passageway open up, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 as you release it, the passageway closes."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 (if (= objnum obj-switch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (if dun-black
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 (dun-mprincl "The button is now in the off position.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (setq dun-black nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (dun-mprincl "The button is now in the on position.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (setq dun-black t))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (defun dun-swim (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (if (not (member dun-current-room (list lakefront-north lakefront-south)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (dun-mprincl "I see no water!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (if (not (member obj-life dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 "You dive in the water, and at first notice it is quite cold. You then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 start to get used to it as you realize that you never really learned how
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 to swim.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 (dun-die "drowning"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (if (= dun-current-room lakefront-north)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (setq dun-current-room lakefront-south)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (setq dun-current-room lakefront-north)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (defun dun-score (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (if (not dun-endgame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (let (total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 (setq total (dun-reg-score))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 (dun-mprinc "You have scored ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (dun-mprinc total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 (dun-mprincl " out of a possible 90 points.") total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (dun-mprinc "You have scored ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (dun-mprinc (dun-endgame-score))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 (dun-mprincl " endgame points out of a possible 110.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (if (= (dun-endgame-score) 110)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 "\n\nCongratulations. You have won. The wizard password is 'moby'"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (defun dun-help (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 "Welcome to dunnet (2.0), by Ron Schnell (ronnie@media.mit.edu).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 Here is some useful information (read carefully because there are one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 or more clues in here):
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 - If you have a key that can open a door, you do not need to explicitly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 open it. You may just use 'in' or walk in the direction of the door.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 - If you have a lamp, it is always lit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 - You will not get any points until you manage to get treasures to a certain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 place. Simply finding the treasures is not good enough. There is more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 than one way to get a treasure to the special place. It is also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 important that the objects get to the special place *unharmed* and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 *untarnished*. You can tell if you have successfully transported the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 object by looking at your score, as it changes immediately. Note that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 an object can become harmed even after you have received points for it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 If this happens, your score will decrease, and in many cases you can never
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 get credit for it again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 - You can save your game with the 'save' command, and use restore it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 with the 'restore' command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 - There are no limits on lengths of object names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 - Directions are: north,south,east,west,northeast,southeast,northwest,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 southwest,up,down,in,out.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 - These can be abbreviated: n,s,e,w,ne,se,nw,sw,u,d,in,out.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 - If you go down a hole in the floor without an aid such as a ladder,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 you probably won't be able to get back up the way you came, if at all.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 - To run this game in batch mode (no emacs window), use:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 emacs -batch -l dunnet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 If you have questions or comments, please contact ronnie@media.mit.edu."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 (defun dun-flush (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 (if (not (= dun-current-room bathroom))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 (dun-mprincl "I see nothing to flush.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 (dun-mprincl "Whoooosh!!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 (dun-put-objs-in-treas (nth urinal dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 (dun-replace dun-room-objects urinal nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 (defun dun-piss (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 (if (not (= dun-current-room bathroom))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 (dun-mprincl "You can't do that here, don't even bother trying.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 (if (not dun-gottago)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 (dun-mprincl "I'm afraid you don't have to go now.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 (dun-mprincl "That was refreshing.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 (setq dun-gottago nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 (dun-replace dun-room-objects urinal (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 (nth urinal dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (list obj-URINE))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 (defun dun-sleep (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 (if (not (= dun-current-room bedroom))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 "You try to go to sleep while standing up here, but can't seem to do it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 (setq dun-gottago t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 "As soon as you start to doze off you begin dreaming. You see images of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 workers digging caves, slaving in the humid heat. Then you see yourself
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 as one of these workers. While no one is looking, you leave the group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 and walk into a room. The room is bare except for a horseshoe
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 shaped piece of stone in the center. You see yourself digging a hole in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 the ground, then putting some kind of treasure in it, and filling the hole
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 with dirt again. After this, you immediately wake up.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (defun dun-break (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (if (not (member obj-axe dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 (dun-mprincl "You have nothing you can use to break things.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (when (setq objnum (dun-objnum-from-args-std obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (if (member objnum dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 "You take the object in your hands and swing the axe. Unfortunately, you miss
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 the object and slice off your hand. You bleed to death.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (dun-die "an axe"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (if (not (or (member objnum (nth dun-current-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 (member objnum
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 (nth dun-current-room dun-room-silents))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 (dun-mprincl "I don't see that here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 (if (= objnum obj-cable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 "As you break the ethernet cable, everything starts to blur. You collapse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 for a moment, then straighten yourself up.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 (dun-replace dun-room-objects gamma-computing-center
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (nth gamma-computing-center dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (if (member obj-key dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (setq dun-inventory (list obj-key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (dun-remove-obj-from-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 gamma-computing-center obj-key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 (setq dun-inventory nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 (setq dun-current-room computer-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (setq dun-ethernet nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (dun-mprincl "Connection closed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (dun-unix-interface))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 (if (< objnum 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (dun-mprincl "Your axe shatters into a million pieces.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 (dun-remove-obj-from-inven obj-axe))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 (dun-mprincl "Your axe breaks it into a million pieces.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (dun-remove-obj-from-room dun-current-room objnum)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 (defun dun-drive (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 (if (not dun-inbus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (dun-mprincl "You cannot drive when you aren't in a vehicle.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (dun-mprincl "To drive while you are in the bus, just give a direction.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (defun dun-superb (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (setq dun-mode 'dun-superb))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 (defun dun-reg-score ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 (let (total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (setq total 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 (dolist (x (nth treasure-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 (setq total (+ total (nth x dun-object-pts))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 (if (member obj-URINE (nth treasure-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 (setq total 0)) total))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 (defun dun-endgame-score ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (let (total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 (setq total 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 (dolist (x (nth endgame-treasure-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 (setq total (+ total (nth x dun-object-pts)))) total))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 (defun dun-answer (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (if (not dun-correct-answer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 (dun-mprincl "I don't believe anyone asked you anything.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 (setq args (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 (if (not args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 (dun-mprincl "You must give the answer on the same line.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 (if (dun-members args dun-correct-answer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 (dun-mprincl "Correct.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 (if (= dun-lastdir 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 (setq dun-current-room (1+ dun-current-room))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (setq dun-current-room (- dun-current-room 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 (setq dun-correct-answer nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (dun-mprincl "That answer is incorrect.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 (defun dun-endgame-question ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 (if (not dun-endgame-questions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (dun-mprincl "Your question is:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 (dun-mprincl "No more questions, just do 'answer foo'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 (setq dun-correct-answer '("foo")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 (let (which i newques)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 (setq i 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 (setq newques nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 (setq which (random (length dun-endgame-questions)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (dun-mprincl "Your question is:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 (dun-mprincl (setq dun-endgame-question (car
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (nth which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 dun-endgame-questions))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 (setq dun-correct-answer (cdr (nth which dun-endgame-questions)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 (while (< i which)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 (setq newques (append newques (list (nth i dun-endgame-questions))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 (setq i (1+ i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 (setq i (1+ which))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 (while (< i (length dun-endgame-questions))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 (setq newques (append newques (list (nth i dun-endgame-questions))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (setq i (1+ i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 (setq dun-endgame-questions newques))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 (defun dun-power (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 (if (not (= dun-current-room pc-area))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 (dun-mprincl "That operation is not applicable here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 (if (not dun-floppy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 (dun-dos-no-disk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 (dun-dos-interface))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 (defun dun-feed (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 (when (setq objnum (dun-objnum-from-args-std args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 (if (and (= objnum obj-bear)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 (member obj-bear (nth dun-current-room dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 (if (not (member obj-food dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 (dun-mprincl "You have nothing with which to feed it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 (dun-drop '("food"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 (if (not (or (member objnum (nth dun-current-room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 (member objnum dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 (member objnum (nth dun-current-room dun-room-silents))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 (dun-mprincl "I don't see that here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 (dun-mprincl "You cannot feed that."))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 ;;;; This section defines various utility functions used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 ;;;; by dunnet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 ;;; Function which takes a verb and a list of other words. Calls proper
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 ;;; function associated with the verb, and passes along the other words.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (defun dun-doverb (dun-ignore dun-verblist verb rest)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 (if (not verb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 (if (member (intern verb) dun-ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 (if (not (car rest)) -1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 (dun-doverb dun-ignore dun-verblist (car rest) (cdr rest)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 (if (not (cdr (assq (intern verb) dun-verblist))) -1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 (setq dun-numcmds (1+ dun-numcmds))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 (eval (list (cdr (assq (intern verb) dun-verblist)) (quote rest)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 ;;; Function to take a string and change it into a list of lowercase words.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 (defun dun-listify-string (strin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 (let (pos ret-list end-pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 (setq pos 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 (setq ret-list nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 (while (setq end-pos (string-match "[ ,:;]" (substring strin pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 (setq end-pos (+ end-pos pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 (if (not (= end-pos pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 (setq ret-list (append ret-list (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 (downcase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 (substring strin pos end-pos))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 (setq pos (+ end-pos 1))) ret-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 (defun dun-listify-string2 (strin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 (let (pos ret-list end-pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 (setq pos 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 (setq ret-list nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 (while (setq end-pos (string-match " " (substring strin pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 (setq end-pos (+ end-pos pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 (if (not (= end-pos pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 (setq ret-list (append ret-list (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 (downcase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 (substring strin pos end-pos))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 (setq pos (+ end-pos 1))) ret-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 (defun dun-replace (list n number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 (rplaca (nthcdr n list) number))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 ;;; Get the first non-ignored word from a list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (defun dun-firstword (list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 (if (not (car list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 (while (and list (member (intern (car list)) dun-ignore))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 (setq list (cdr list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 (car list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (defun dun-firstwordl (list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 (if (not (car list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 (while (and list (member (intern (car list)) dun-ignore))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 (setq list (cdr list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 ;;; parse a line passed in as a string Call the proper verb with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 ;;; rest of the line passed in as a list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 (defun dun-vparse (dun-ignore dun-verblist line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (setq line-list (dun-listify-string (concat line " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 (dun-doverb dun-ignore dun-verblist (car line-list) (cdr line-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 (defun dun-parse2 (dun-ignore dun-verblist line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 (setq line-list (dun-listify-string2 (concat line " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 (dun-doverb dun-ignore dun-verblist (car line-list) (cdr line-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 ;;; Read a line, in window mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 (defun dun-read-line ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 (let (line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (setq line (read-string ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 (dun-mprinc line) line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 ;;; Insert something into the window buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (defun dun-minsert (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 (if (stringp string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 (insert string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (insert (prin1-to-string string))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 ;;; Print something out, in window mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (defun dun-mprinc (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 (if (stringp string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (insert string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 (insert (prin1-to-string string))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 ;;; In window mode, keep screen from jumping by keeping last line at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 ;;; the bottom of the screen.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 (defun dun-fix-screen ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (forward-line (- 0 (- (window-height) 2 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (set-window-start (selected-window) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 (end-of-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 ;;; Insert something into the buffer, followed by newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (defun dun-minsertl (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 (dun-minsert string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (dun-minsert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 ;;; Print something, followed by a newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 (defun dun-mprincl (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 (dun-mprinc string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 ;;; Function which will get an object number given the list of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 ;;; words in the command, except for the verb.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 (defun dun-objnum-from-args (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 (let (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 (setq obj (dun-firstword obj))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 (if (not obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 obj-special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 (setq objnum (cdr (assq (intern obj) dun-objnames))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 (defun dun-objnum-from-args-std (obj)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 (let (result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 (if (eq (setq result (dun-objnum-from-args obj)) obj-special)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 (dun-mprincl "You must supply an object."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 (if (eq result nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 (dun-mprincl "I don't know what that is."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 (if (eq result obj-special)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 result)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 ;;; Take a short room description, and change spaces and slashes to dashes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 (defun dun-space-to-hyphen (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 (let (space)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 (if (setq space (string-match "[ /]" string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 (setq string (concat (substring string 0 space) "-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 (substring string (1+ space))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 (dun-space-to-hyphen string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 ;;; Given a unix style pathname, build a list of path components (recursive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 (defun dun-get-path (dirstring startlist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 (let (slash pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 (if (= (length dirstring) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 startlist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 (if (string= (substring dirstring 0 1) "/")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 (dun-get-path (substring dirstring 1) (append startlist (list "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 (if (not (setq slash (string-match "/" dirstring)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 (append startlist (list dirstring))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 (dun-get-path (substring dirstring (1+ slash))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 (append startlist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 (list (substring dirstring 0 slash)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 ;;; Is a string a member of a string list?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 (defun dun-members (string string-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 (let (found)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (setq found nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 (dolist (x string-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 (if (string= x string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (setq found t))) found))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 ;;; Function to put objects in the treasure room. Also prints current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 ;;; score to let user know he has scored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 (defun dun-put-objs-in-treas (objlist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 (let (oscore newscore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 (setq oscore (dun-reg-score))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 (dun-replace dun-room-objects 0 (append (nth 0 dun-room-objects) objlist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 (setq newscore (dun-reg-score))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 (if (not (= oscore newscore))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 (dun-score nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 ;;; Load an encrypted file, and eval it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 (defun dun-load-d (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 (let (old-buffer result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 (setq result t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 (setq old-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 (switch-to-buffer (get-buffer-create "*loadc*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 (insert-file-contents filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 (error (setq result nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 (unless (not result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 (dun-rot13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 (error (yank)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 (eval-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 (switch-to-buffer old-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 ;;; Functions to remove an object either from a room, or from inventory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 (defun dun-remove-obj-from-room (room objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 (let (newroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 (setq newroom nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 (dolist (x (nth room dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 (if (not (= x objnum))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 (setq newroom (append newroom (list x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 (rplaca (nthcdr room dun-room-objects) newroom)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 (defun dun-remove-obj-from-inven (objnum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 (let (new-inven)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 (setq new-inven nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 (dolist (x dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 (if (not (= x objnum))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 (setq new-inven (append new-inven (list x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (setq dun-inventory new-inven)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (let ((i 0) (lower "abcdefghijklmnopqrstuvwxyz") upper)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 (setq dun-translate-table (make-vector 256 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 (while (< i 256)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 (aset dun-translate-table i i)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 (setq i (1+ i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 (setq lower (concat lower lower))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 (setq upper (upcase lower))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 (setq i 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 (while (< i 26)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 (aset dun-translate-table (+ ?a i) (aref lower (+ i 13)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 (aset dun-translate-table (+ ?A i) (aref upper (+ i 13)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 (setq i (1+ i))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 (defun dun-rot13 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 (let (str len (i 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 (setq str (buffer-substring (point-min) (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 (setq len (length str))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 (while (< i len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 (aset str i (aref dun-translate-table (aref str i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 (setq i (1+ i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 (insert str)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 ;;;; This section defines the globals that are used in dunnet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 ;;;; IMPORTANT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 ;;;; All globals which can change must be saved from 'save-game. Add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 ;;;; all new globals to bottom of file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 (setq dun-visited '(27))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 (setq dun-current-room 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 (setq dun-exitf nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 (setq dun-badcd nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 (defvar dungeon-mode-map nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 (setq dungeon-mode-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 (define-key dungeon-mode-map "\r" 'dun-parse)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1352 ;; XEmacs
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 (defvar dungeon-batch-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 (let ((map (make-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 (n 32))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 (while (< 0 (setq n (- n 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 (define-key map (make-string 1 n) 'dungeon-nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 (define-key map "\r" 'exit-minibuffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 (define-key map "\n" 'exit-minibuffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 (setq dun-computer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 (setq dun-floppy nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (setq dun-key-level 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 (setq dun-hole nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 (setq dun-correct-answer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 (setq dun-lastdir 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 (setq dun-numsaves 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 (setq dun-jar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 (setq dun-dead nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 (setq room 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 (setq dun-numcmds 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 (setq dun-wizard nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 (setq dun-endgame-question nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 (setq dun-logged-in nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 (setq dungeon-mode 'dungeon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 (setq dun-unix-verbs '((ls . dun-ls) (ftp . dun-ftp) (echo . dun-echo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (exit . dun-uexit) (cd . dun-cd) (pwd . dun-pwd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 (rlogin . dun-rlogin) (uncompress . dun-uncompress)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (cat . dun-cat) (zippy . dun-zippy)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (setq dun-dos-verbs '((dir . dun-dos-dir) (type . dun-dos-type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 (exit . dun-dos-exit) (command . dun-dos-spawn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 (b: . dun-dos-invd) (c: . dun-dos-invd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (a: . dun-dos-nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 (setq dun-batch-mode nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (setq dun-cdpath "/usr/toukmond")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (setq dun-cdroom -10)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 (setq dun-uncompressed nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 (setq dun-ethernet t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 (setq dun-restricted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 '(dun-room-objects dungeon-map dun-rooms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 dun-room-silents dun-combination))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 (setq dun-ftptype 'ascii)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 (setq dun-endgame nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (setq dun-gottago t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 (setq dun-black nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (setq dun-rooms '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 "You are in the treasure room. A door leads out to the north."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 "Treasure room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 "You are at a dead end of a dirt road. The road goes to the east.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 In the distance you can see that it will eventually fork off. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 trees here are very tall royal palms, and they are spaced equidistant
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 from each other."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 "Dead end"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 "You are on the continuation of a dirt road. There are more trees on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 both sides of you. The road continues to the east and west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 "E/W Dirt road"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 "You are at a fork of two passages, one to the northeast, and one to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 southeast. The ground here seems very soft. You can also go back west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 "Fork"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 "You are on a northeast/southwest road."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 "NE/SW road"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 "You are at the end of the road. There is a building in front of you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 to the northeast, and the road leads back to the southwest."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 "Building front"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 "You are on a southeast/northwest road."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 "SE/NW road"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 "You are standing at the end of a road. A passage leads back to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 northwest."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 "Bear hangout"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 "You are in the hallway of an old building. There are rooms to the east
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 and west, and doors leading out to the north and south."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 "Old Building hallway"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 "You are in a mailroom. There are many bins where the mail is usually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 kept. The exit is to the west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 "Mailroom"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 "You are in a computer room. It seems like most of the equipment has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 been removed. There is a VAX 11/780 in front of you, however, with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 one of the cabinets wide open. A sign on the front of the machine
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 says: This VAX is named 'pokey'. To type on the console, use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 'type' command. The exit is to the east."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 "Computer room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 "You are in a meadow in the back of an old building. A small path leads
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 to the west, and a door leads to the south."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 "Meadow"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 "You are in a round, stone room with a door to the east. There
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 is a sign on the wall that reads: 'receiving room'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 "Receiving room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 "You are at the south end of a hallway that leads to the north. There
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 are rooms to the east and west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 "Northbound Hallway"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 "You are in a sauna. There is nothing in the room except for a dial
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 on the wall. A door leads out to west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 "Sauna"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 "You are at the end of a north/south hallway. You can go back to the south,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 or off to a room to the east."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 "End of N/S Hallway"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 "You are in an old weight room. All of the equipment is either destroyed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 or completely broken. There is a door out to the west, and there is a ladder
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 leading down a hole in the floor."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 "Weight room" ;16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 "You are in a maze of twisty little passages, all alike.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 There is a button on the ground here."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 "Maze button room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 "You are in a maze of little twisty passages, all alike."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 "Maze"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 "You are in a maze of thirsty little passages, all alike."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 "Maze" ;19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 "You are in a maze of twenty little passages, all alike."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 "Maze"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 "You are in a daze of twisty little passages, all alike."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 "Maze" ;21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 "You are in a maze of twisty little cabbages, all alike."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 "Maze" ;22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 "You are in a reception area for a health and fitness center. The place
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 appears to have been recently ransacked, and nothing is left. There is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 a door out to the south, and a crawlspace to the southeast."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 "Reception area"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 "You are outside a large building to the north which used to be a health
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 and fitness center. A road leads to the south."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 "Health Club front"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 "You are at the north side of a lake. On the other side you can see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 a road which leads to a cave. The water appears very deep."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 "Lakefront North"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 "You are at the south side of a lake. A road goes to the south."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 "Lakefront South"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 "You are in a well-hidden area off to the side of a road. Back to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 northeast through the brush you can see the bear hangout."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 "Hidden area"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 "The entrance to a cave is to the south. To the north, a road leads
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 towards a deep lake. On the ground nearby there is a chute, with a sign
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 that says 'put treasures here for points'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 "Cave Entrance" ;28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 "You are in a misty, humid room carved into a mountain.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 To the north is the remains of a rockslide. To the east, a small
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 passage leads away into the darkness." ;29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 "Misty Room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 "You are in an east/west passageway. The walls here are made of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 multicolored rock and are quite beautiful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 "Cave E/W passage" ;30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 "You are at the junction of two passages. One goes north/south, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 the other goes west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 "N/S/W Junction" ;31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 "You are at the north end of a north/south passageway. There are stairs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 leading down from here. There is also a door leading west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 "North end of cave passage" ;32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 "You are at the south end of a north/south passageway. There is a hole
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 in the floor here, into which you could probably fit."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 "South end of cave passage" ;33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 "You are in what appears to be a worker's bedroom. There is a queen-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 sized bed in the middle of the room, and a painting hanging on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 wall. A door leads to another room to the south, and stairways
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 lead up and down."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 "Bedroom" ;34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 "You are in a bathroom built for workers in the cave. There is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 urinal hanging on the wall, and some exposed pipes on the opposite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 wall where a sink used to be. To the north is a bedroom."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 "Bathroom" ;35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 "This is a marker for the urinal. User will not see this, but it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 is a room that can contain objects."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 "Urinal" ;36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 "You are at the northeast end of a northeast/southwest passageway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 Stairs lead up out of sight."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 "Ne end of ne/sw cave passage" ;37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 "You are at the junction of northeast/southwest and east/west passages."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 "Ne/sw-e/w junction" ;38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 "You are at the southwest end of a northeast/southwest passageway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 "Sw end of ne/sw cave passage" ;39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 "You are at the east end of an e/w passage. There are stairs leading up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 to a room above."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 "East end of e/w cave passage" ;40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 "You are at the west end of an e/w passage. There is a hole on the ground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610 which leads down out of sight."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 "West end of e/w cave passage" ;41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614 "You are in a room which is bare, except for a horseshoe shaped boulder
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 in the center. Stairs lead down from here." ;42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 "Horseshoe boulder room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 "You are in a room which is completely empty. Doors lead out to the north
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 and east."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 "Empty room" ;43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 "You are in an empty room. Interestingly enough, the stones in this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 room are painted blue. Doors lead out to the east and south." ;44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 "Blue room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 "You are in an empty room. Interestingly enough, the stones in this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630 room are painted yellow. Doors lead out to the south and west." ;45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 "Yellow room"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 "You are in an empty room. Interestingly enough, the stones in this room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635 are painted red. Doors lead out to the west and north."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 "Red room" ;46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 "You are in the middle of a long north/south hallway." ;47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 "Long n/s hallway"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 "You are 3/4 of the way towards the north end of a long north/south hallway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 "3/4 north" ;48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 "You are at the north end of a long north/south hallway. There are stairs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648 leading upwards."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 "North end of long hallway" ;49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 "You are 3/4 of the way towards the south end of a long north/south hallway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 "3/4 south" ;50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 "You are at the south end of a long north/south hallway. There is a hole
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 to the south."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 "South end of long hallway" ;51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 "You are at a landing in a stairwell which continues up and down."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 "Stair landing" ;52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 "You are at the continuation of an up/down staircase."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 "Up/down staircase" ;53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 "You are at the top of a staircase leading down. A crawlway leads off
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 to the northeast."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 "Top of staircase." ;54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 "You are in a crawlway that leads northeast or southwest."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 "Ne crawlway" ;55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 "You are in a small crawlspace. There is a hole in the ground here, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 a small passage back to the southwest."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 "Small crawlspace" ;56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 "You are in the Gamma Computing Center. An IBM 3090/600s is whirring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 away in here. There is an ethernet cable coming out of one of the units,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 and going through the ceiling. There is no console here on which you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 could type."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 "Gamma computing center" ;57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 "You are near the remains of a post office. There is a mail drop on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 face of the building, but you cannot see where it leads. A path leads
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 back to the east, and a road leads to the north."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 "Post office" ;58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 "You are at the intersection of Main Street and Maple Ave. Main street
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 runs north and south, and Maple Ave runs east off into the distance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 If you look north and east you can see many intersections, but all of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 the buildings that used to stand here are gone. Nothing remains except
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 street signs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 There is a road to the northwest leading to a gate that guards a building."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 "Main-Maple intersection" ;59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 "You are at the intersection of Main Street and the west end of Oaktree Ave."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 "Main-Oaktree intersection" ;60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 "You are at the intersection of Main Street and the west end of Vermont Ave."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 "Main-Vermont intersection" ;61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 "You are at the north end of Main Street at the west end of Sycamore Ave." ;62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 "Main-Sycamore intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 "You are at the south end of First Street at Maple Ave." ;63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 "First-Maple intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 "You are at the intersection of First Street and Oaktree Ave." ;64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 "First-Oaktree intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 "You are at the intersection of First Street and Vermont Ave." ;65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 "First-Vermont intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 "You are at the north end of First Street at Sycamore Ave." ;66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 "First-Sycamore intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 "You are at the south end of Second Street at Maple Ave." ;67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 "Second-Maple intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 "You are at the intersection of Second Street and Oaktree Ave." ;68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 "Second-Oaktree intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 "You are at the intersection of Second Street and Vermont Ave." ;69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 "Second-Vermont intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 "You are at the north end of Second Street at Sycamore Ave." ;70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 "Second-Sycamore intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 "You are at the south end of Third Street at Maple Ave." ;71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 "Third-Maple intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 "You are at the intersection of Third Street and Oaktree Ave." ;72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 "Third-Oaktree intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 "You are at the intersection of Third Street and Vermont Ave." ;73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 "Third-Vermont intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 "You are at the north end of Third Street at Sycamore Ave." ;74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 "Third-Sycamore intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 "You are at the south end of Fourth Street at Maple Ave." ;75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 "Fourth-Maple intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 "You are at the intersection of Fourth Street and Oaktree Ave." ;76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 "Fourth-Oaktree intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 "You are at the intersection of Fourth Street and Vermont Ave." ;77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 "Fourth-Vermont intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 "You are at the north end of Fourth Street at Sycamore Ave." ;78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 "Fourth-Sycamore intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 "You are at the south end of Fifth Street at the east end of Maple Ave." ;79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 "Fifth-Maple intersection"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 "You are at the intersection of Fifth Street and the east end of Oaktree Ave.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 There is a cliff off to the east."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 "Fifth-Oaktree intersection" ;80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 "You are at the intersection of Fifth Street and the east end of Vermont Ave."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 "Fifth-Vermont intersection" ;81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 "You are at the north end of Fifth Street and the east end of Sycamore Ave."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 "Fifth-Sycamore intersection" ;82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 "You are in front of the Museum of Natural History. A door leads into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 the building to the north, and a road leads to the southeast."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 "Museum entrance" ;83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 "You are in the main lobby for the Museum of Natural History. In the center
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 of the room is the huge skeleton of a dinosaur. Doors lead out to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 south and east."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 "Museum lobby" ;84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 "You are in the geological display. All of the objects that used to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 be on display are missing. There are rooms to the east, west, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 north."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 "Geological display" ;85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 "You are in the marine life area. The room is filled with fish tanks,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 which are filled with dead fish that have apparently died due to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 starvation. Doors lead out to the south and east."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 "Marine life area" ;86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 "You are in some sort of maintenance room for the museum. There is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 switch on the wall labeled 'BL'. There are doors to the west and north."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 "Maintenance room" ;87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 "You are in a classroom where school children were taught about natural
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 history. On the blackboard is written, 'No children allowed downstairs.'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 There is a door to the east with an 'exit' sign on it. There is another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 door to the west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 "Classroom" ;88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 "You are at the Vermont St. subway station. A train is sitting here waiting."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 "Vermont station" ;89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 "You are at the Museum subway stop. A passage leads off to the north."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 "Museum station" ;90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 "You are in a north/south tunnel."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 "N/S tunnel" ;91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 "You are at the north end of a north/south tunnel. Stairs lead up and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 down from here. There is a garbage disposal here."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 "North end of n/s tunnel" ;92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 "You are at the top of some stairs near the subway station. There is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 a door to the west."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 "Top of subway stairs" ;93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 "You are at the bottom of some stairs near the subway station. There is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 a room to the northeast."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 "Bottom of subway stairs" ;94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 "You are in another computer room. There is a computer in here larger
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 than you have ever seen. It has no manufacturers name on it, but it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 does have a sign that says: This machine's name is 'endgame'. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 exit is to the southwest. There is no console here on which you could
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 type."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 "Endgame computer room" ;95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 "You are in a north/south hallway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 "Endgame n/s hallway" ;96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 "You have reached a question room. You must answer a question correctly in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 order to get by. Use the 'answer' command to answer the question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 "Question room 1" ;97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 "You are in a north/south hallway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 "Endgame n/s hallway" ;98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 "You are in a second question room."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 "Question room 2" ;99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 "You are in a north/south hallway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 "Endgame n/s hallway" ;100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 "You are in a third question room."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 "Question room 3" ;101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 "You are in the endgame treasure room. A door leads out to the north, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 a hallway leads to the south."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 "Endgame treasure room" ;102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 "You are in the winner's room. A door leads back to the south."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 "Winner's room" ;103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 "You have reached a dead end. There is a PC on the floor here. Above
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 it is a sign that reads:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 Type the 'reset' command to type on the PC.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 A hole leads north."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 "PC area" ;104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 (setq dun-light-rooms '(0 1 2 3 4 5 6 7 8 9 10 11 12 13 24 25 26 27 28 58 59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 77 78 79 80 81 82 83))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (setq dun-verblist '((die . dun-die) (ne . dun-ne) (north . dun-n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 (south . dun-s) (east . dun-e) (west . dun-w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 (u . dun-up) (d . dun-down) (i . dun-inven)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 (inventory . dun-inven) (look . dun-examine) (n . dun-n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 (s . dun-s) (e . dun-e) (w . dun-w) (se . dun-se)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 (nw . dun-nw) (sw . dun-sw) (up . dun-up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 (down . dun-down) (in . dun-in) (out . dun-out)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 (go . dun-go) (drop . dun-drop) (southeast . dun-se)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 (southwest . dun-sw) (northeast . dun-ne)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 (northwest . dun-nw) (save . dun-save-game)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 (restore . dun-restore) (long . dun-long) (dig . dun-dig)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (shake . dun-shake) (wave . dun-shake)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 (examine . dun-examine) (describe . dun-examine)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 (climb . dun-climb) (eat . dun-eat) (put . dun-put)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 (type . dun-type) (insert . dun-put)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 (score . dun-score) (help . dun-help) (quit . dun-quit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 (read . dun-examine) (verbose . dun-long)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
1931 (urinate . dun-piss) (piss . dun-piss) ; censored
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 (flush . dun-flush) (sleep . dun-sleep) (lie . dun-sleep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 (x . dun-examine) (break . dun-break) (drive . dun-drive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 (board . dun-in) (enter . dun-in) (turn . dun-turn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 (press . dun-press) (push . dun-press) (swim . dun-swim)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 (on . dun-in) (off . dun-out) (chop . dun-break)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 (switch . dun-press) (cut . dun-break) (exit . dun-out)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 (leave . dun-out) (reset . dun-power) (flick . dun-press)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 (superb . dun-superb) (answer . dun-answer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 (throw . dun-drop) (l . dun-examine) (take . dun-take)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 (get . dun-take) (feed . dun-feed)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 (setq dun-inbus nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 (setq dun-nomail nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 (setq dun-ignore '(the to at))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 (setq dun-mode 'moby)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 (setq dun-sauna-level 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 (defconst north 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 (defconst south 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 (defconst east 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 (defconst west 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 (defconst northeast 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 (defconst southeast 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 (defconst northwest 6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 (defconst southwest 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 (defconst up 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 (defconst down 9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 (defconst in 10)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 (defconst out 11)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 (setq dungeon-map '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963 ; no so ea we ne se nw sw up do in ot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 ( 96 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 ( -1 -1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 ( -1 -1 3 1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 ( -1 -1 -1 2 4 6 -1 -1 -1 -1 -1 -1 ) ;3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 ( -1 -1 -1 -1 5 -1 -1 3 -1 -1 -1 -1 ) ;4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 ( -1 -1 -1 -1 255 -1 -1 4 -1 -1 255 -1 ) ;5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 ( -1 -1 -1 -1 -1 7 3 -1 -1 -1 -1 -1 ) ;6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 ( -1 -1 -1 -1 -1 255 6 27 -1 -1 -1 -1 ) ;7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 ( 255 5 9 10 -1 -1 -1 5 -1 -1 -1 5 ) ;8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 ( -1 -1 -1 8 -1 -1 -1 -1 -1 -1 -1 -1 ) ;9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 ( -1 -1 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 ( -1 8 -1 58 -1 -1 -1 -1 -1 -1 -1 -1 ) ;11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 ( -1 -1 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 ( 15 -1 14 12 -1 -1 -1 -1 -1 -1 -1 -1 ) ;13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 ( -1 -1 -1 13 -1 -1 -1 -1 -1 -1 -1 -1 ) ;14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 ( -1 13 16 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 ( -1 -1 -1 15 -1 -1 -1 -1 -1 17 16 -1 ) ;16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 ( -1 -1 17 17 17 17 255 17 255 17 -1 -1 ) ;17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 ( 18 18 18 18 18 -1 18 18 19 18 -1 -1 ) ;18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 ( -1 18 18 19 19 20 19 19 -1 18 -1 -1 ) ;19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 ( -1 -1 -1 18 -1 -1 -1 -1 -1 21 -1 -1 ) ;20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 ( -1 -1 -1 -1 -1 20 22 -1 -1 -1 -1 -1 ) ;21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 ( 18 18 18 18 16 18 23 18 18 18 18 18 ) ;22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 ( -1 255 -1 -1 -1 19 -1 -1 -1 -1 -1 -1 ) ;23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 ( 23 25 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 ( 24 255 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 (255 28 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 ( -1 -1 -1 -1 7 -1 -1 -1 -1 -1 -1 -1 ) ;27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 ( 26 255 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 ( -1 -1 30 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 ( -1 -1 31 29 -1 -1 -1 -1 -1 -1 -1 -1 ) ;30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 ( 32 33 -1 30 -1 -1 -1 -1 -1 -1 -1 -1 ) ;31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 ( -1 31 -1 255 -1 -1 -1 -1 -1 34 -1 -1 ) ;32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 ( 31 -1 -1 -1 -1 -1 -1 -1 -1 35 -1 -1 ) ;33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 ( -1 35 -1 -1 -1 -1 -1 -1 32 37 -1 -1 ) ;34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 ( 34 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 ( -1 -1 -1 -1 -1 -1 -1 38 34 -1 -1 -1 ) ;37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 ( -1 -1 40 41 37 -1 -1 39 -1 -1 -1 -1 ) ;38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003 ( -1 -1 -1 -1 38 -1 -1 -1 -1 -1 -1 -1 ) ;39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 ( -1 -1 -1 38 -1 -1 -1 -1 42 -1 -1 -1 ) ;40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 ( -1 -1 38 -1 -1 -1 -1 -1 -1 43 -1 -1 ) ;41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 ( -1 -1 -1 -1 -1 -1 -1 -1 -1 40 -1 -1 ) ;42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 ( 44 -1 46 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 ( -1 43 45 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 ( -1 46 -1 44 -1 -1 -1 -1 -1 -1 -1 -1 ) ;45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010 ( 45 -1 -1 43 -1 -1 -1 -1 -1 255 -1 -1 ) ;46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 ( 48 50 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 ( 49 47 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 ( -1 48 -1 -1 -1 -1 -1 -1 52 -1 -1 -1 ) ;49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 ( 47 51 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 ( 50 104 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 ( -1 -1 -1 -1 -1 -1 -1 -1 53 49 -1 -1 ) ;52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 ( -1 -1 -1 -1 -1 -1 -1 -1 54 52 -1 -1 ) ;53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 ( -1 -1 -1 -1 55 -1 -1 -1 -1 53 -1 -1 ) ;54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 ( -1 -1 -1 -1 56 -1 -1 54 -1 -1 -1 54 ) ;55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 ( -1 -1 -1 -1 -1 -1 -1 55 -1 31 -1 -1 ) ;56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 ( -1 -1 32 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 ( 59 -1 11 -1 -1 -1 -1 -1 -1 -1 255 255) ;58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 ( 60 58 63 -1 -1 -1 255 -1 -1 -1 255 255) ;59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 ( 61 59 64 -1 -1 -1 -1 -1 -1 -1 255 255) ;60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 ( 62 60 65 -1 -1 -1 -1 -1 -1 -1 255 255) ;61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 ( -1 61 66 -1 -1 -1 -1 -1 -1 -1 255 255) ;62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 ( 64 -1 67 59 -1 -1 -1 -1 -1 -1 255 255) ;63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 ( 65 63 68 60 -1 -1 -1 -1 -1 -1 255 255) ;64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 ( 66 64 69 61 -1 -1 -1 -1 -1 -1 255 255) ;65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 ( -1 65 70 62 -1 -1 -1 -1 -1 -1 255 255) ;66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 ( 68 -1 71 63 -1 -1 -1 -1 -1 -1 255 255) ;67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 ( 69 67 72 64 -1 -1 -1 -1 -1 -1 255 255) ;68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 ( 70 68 73 65 -1 -1 -1 -1 -1 -1 255 255) ;69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 ( -1 69 74 66 -1 -1 -1 -1 -1 -1 255 255) ;70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 ( 72 -1 75 67 -1 -1 -1 -1 -1 -1 255 255) ;71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 ( 73 71 76 68 -1 -1 -1 -1 -1 -1 255 255) ;72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 ( 74 72 77 69 -1 -1 -1 -1 -1 -1 255 255) ;73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 ( -1 73 78 70 -1 -1 -1 -1 -1 -1 255 255) ;74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 ( 76 -1 79 71 -1 -1 -1 -1 -1 -1 255 255) ;75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 ( 77 75 80 72 -1 -1 -1 -1 -1 -1 255 255) ;76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 ( 78 76 81 73 -1 -1 -1 -1 -1 -1 255 255) ;77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 ( -1 77 82 74 -1 -1 -1 -1 -1 -1 255 255) ;78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 ( 80 -1 -1 75 -1 -1 -1 -1 -1 -1 255 255) ;79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 ( 81 79 255 76 -1 -1 -1 -1 -1 -1 255 255) ;80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 ( 82 80 -1 77 -1 -1 -1 -1 -1 -1 255 255) ;81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 ( -1 81 -1 78 -1 -1 -1 -1 -1 -1 255 255) ;82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047 ( 84 -1 -1 -1 -1 59 -1 -1 -1 -1 255 255) ;83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 ( -1 83 85 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 ( 86 -1 87 84 -1 -1 -1 -1 -1 -1 -1 -1 ) ;85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 ( -1 85 88 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 ( 88 -1 -1 85 -1 -1 -1 -1 -1 -1 -1 -1 ) ;87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 ( -1 87 255 86 -1 -1 -1 -1 -1 -1 -1 -1 ) ;88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 -1 ) ;89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 ( 91 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 ( 92 90 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 ( -1 91 -1 -1 -1 -1 -1 -1 93 94 -1 -1 ) ;92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 ( -1 -1 -1 88 -1 -1 -1 -1 -1 92 -1 -1 ) ;93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058 ( -1 -1 -1 -1 95 -1 -1 -1 92 -1 -1 -1 ) ;94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059 ( -1 -1 -1 -1 -1 -1 -1 94 -1 -1 -1 -1 ) ;95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 ( 97 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 ( 99 97 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 ( 101 99 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 ( -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 ( 103 101 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 ( -1 102 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 ( 51 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ) ;104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 ; no so ea we ne se nw sw up do in ot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 ;;; How the user references *all* objects, permanent and regular.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 (setq dun-objnames '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 (shovel . 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 (lamp . 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 (cpu . 2) (board . 2) (card . 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 (food . 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 (key . 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 (paper . 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 (rms . 6) (statue . 6) (statuette . 6) (stallman . 6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 (diamond . 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 (weight . 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 (life . 9) (preserver . 9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 (bracelet . 10) (emerald . 10)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 (gold . 11)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 (platinum . 12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 (towel . 13) (beach . 13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 (axe . 14)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 (silver . 15)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 (license . 16)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 (coins . 17)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 (egg . 18)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 (jar . 19)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096 (bone . 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 (acid . 21) (nitric . 21)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 (glycerine . 22)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 (ruby . 23)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 (amethyst . 24)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 (mona . 25)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 (bill . 26)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 (floppy . 27) (disk . 27)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 (boulder . -1)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
2106 (tree . -2) (trees . -2) (palm . -2)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 (bear . -3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 (bin . -4) (bins . -4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 (cabinet . -5) (computer . -5) (vax . -5) (ibm . -5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 (protoplasm . -6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 (dial . -7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 (button . -8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 (chute . -9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 (painting . -10)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 (bed . -11)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 (urinal . -12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 (URINE . -13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 (pipes . -14) (pipe . -14)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 (box . -15) (slit . -15)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 (cable . -16) (ethernet . -16)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 (mail . -17) (drop . -17)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 (bus . -18)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 (gate . -19)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 (cliff . -20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 (skeleton . -21) (dinosaur . -21)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 (fish . -22)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 (tanks . -23)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 (switch . -24)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 (blackboard . -25)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 (disposal . -26) (garbage . -26)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 (ladder . -27)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 (subway . -28) (train . -28)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 (pc . -29) (drive . -29)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 (dolist (x dun-objnames)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 (let (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 (setq name (concat "obj-" (prin1-to-string (car x))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 (eval (list 'defconst (intern name) (cdr x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 (defconst obj-special 255)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 ;;; The initial setup of what objects are in each room.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 ;;; Regular objects have whole numbers lower than 255.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 ;;; Objects that cannot be taken but might move and are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 ;;; described during room description are negative.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 ;;; Stuff that is described and might change are 255, and are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 ;;; handled specially by 'dun-describe-room.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 (setq dun-room-objects (list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 (list obj-shovel) ;; treasure-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 (list obj-boulder) ;; dead-end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 (list obj-food) ;; se-nw-road
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 (list obj-bear) ;; bear-hangout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 (list obj-special) ;; computer-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 (list obj-lamp obj-license obj-silver);; meadow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 (list obj-special) ;; sauna
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 (list obj-weight obj-life) ;; weight-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 (list obj-rms obj-floppy) ;; thirsty-maze
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 (list obj-emerald) ;; hidden-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 (list obj-gold) ;; misty-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 (list obj-towel obj-special) ;; red-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 (list obj-box) ;; stair-landing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175 (list obj-axe) ;; smal-crawlspace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177 nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 (list obj-special) ;; fourth-vermont-intersection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 (list obj-coins) ;; fifth-oaktree-intersection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 (list obj-bus) ;; fifth-sycamore-intersection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 (list obj-bone) ;; museum-lobby
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 (list obj-jar obj-special obj-ruby) ;; marine-life-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 (list obj-nitric) ;; maintenance-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 (list obj-glycerine) ;; classroom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 (list obj-amethyst) ;; bottom-of-subway-stairs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 (list obj-special) ;; question-room-1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 (list obj-special) ;; question-room-2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 (list obj-special) ;; question-room-three
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198 (list obj-mona) ;; winner's-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 ;;; These are objects in a room that are only described in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 ;;; room description. They are permanent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 (setq dun-room-silents (list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 (list obj-tree) ;; dead-end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 (list obj-tree) ;; e-w-dirt-road
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 (list obj-bin) ;; mailroom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 (list obj-computer) ;; computer-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 (list obj-dial) ;; sauna
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 (list obj-ladder) ;; weight-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 (list obj-button obj-ladder) ;; maze-button-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 (list obj-chute) ;; cave-entrance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 (list obj-painting obj-bed) ;; bedroom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 (list obj-urinal obj-pipes) ;; bathroom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 (list obj-boulder) ;; horseshoe-boulder-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 nil nil nil nil nil nil nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 (list obj-computer obj-cable) ;; gamma-computing-center
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 (list obj-mail) ;; post-office
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 (list obj-gate) ;; main-maple-intersection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 nil nil nil nil nil nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 (list obj-cliff) ;; fifth-oaktree-intersection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 (list obj-dinosaur) ;; museum-lobby
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 (list obj-fish obj-tanks) ;; marine-life-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 (list obj-switch) ;; maintenance-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 (list obj-blackboard) ;; classroom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 (list obj-train) ;; vermont-station
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 (list obj-disposal) ;; north-end-of-n-s-tunnel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 (list obj-computer) ;; endgame-computer-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 nil nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 (list obj-pc) ;; pc-area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 (setq dun-inventory '(1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 ;;; Descriptions of objects, as they appear in the room description, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 ;;; the inventory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 (setq dun-objects '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 ("There is a shovel here." "A shovel") ;0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 ("There is a lamp nearby." "A lamp") ;1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 ("There is a CPU card here." "A computer board") ;2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 ("There is some food here." "Some food") ;3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 ("There is a shiny brass key here." "A brass key") ;4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 ("There is a slip of paper here." "A slip of paper") ;5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 ("There is a wax statuette of Richard Stallman here." ;6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 "An RMS statuette")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 ("There is a shimmering diamond here." "A diamond") ;7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 ("There is a 10 pound weight here." "A weight") ;8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 ("There is a life preserver here." "A life preserver");9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 ("There is an emerald bracelet here." "A bracelet") ;10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 ("There is a gold bar here." "A gold bar") ;11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 ("There is a platinum bar here." "A platinum bar") ;12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 ("There is a beach towel on the ground here." "A beach towel")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 ("There is an axe here." "An axe") ;14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 ("There is a silver bar here." "A silver bar") ;15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 ("There is a bus driver's license here." "A license") ;16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 ("There are some valuable coins here." "Some valuable coins")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 ("There is a jewel-encrusted egg here." "A valuable egg") ;18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 ("There is a glass jar here." "A glass jar") ;19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 ("There is a dinosaur bone here." "A bone") ;20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 ("There is a packet of nitric acid here." "Some nitric acid")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 ("There is a packet of glycerine here." "Some glycerine") ;22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 ("There is a valuable ruby here." "A ruby") ;23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 ("There is a valuable amethyst here." "An amethyst") ;24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 ("The Mona Lisa is here." "The Mona Lisa") ;25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 ("There is a 100 dollar bill here." "A $100 bill") ;26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 ("There is a floppy disk here." "A floppy disk") ;27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 ;;; Weight of objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 (setq dun-object-lbs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 '(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 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 (setq dun-object-pts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 '(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 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 ;;; Unix representation of objects.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 (setq dun-objfiles '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 "shovel.o" "lamp.o" "cpu.o" "food.o" "key.o" "paper.o"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 "rms.o" "diamond.o" "weight.o" "preserver.o" "bracelet.o"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 "gold.o" "platinum.o" "towel.o" "axe.o" "silver.o" "license.o"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 "coins.o" "egg.o" "jar.o" "bone.o" "nitric.o" "glycerine.o"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 "ruby.o" "amethyst.o"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 ;;; These are the descriptions for the negative numbered objects from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 ;;; dun-room-objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 (setq dun-perm-objects '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 ("There is a large boulder here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 ("There is a ferocious bear here!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 ("There is a worthless pile of protoplasm here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 ("There is a strange smell in this room.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 "There is a box with a slit in it, bolted to the wall here."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 ("There is a bus here.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 ;;; These are the descriptions the user gets when regular objects are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 ;;; examined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 (setq dun-physobj-desc '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 "It is a normal shovel with a price tag attached that says $19.99."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 "The lamp is hand-crafted by Geppetto."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 "The CPU board has a VAX chip on it. It seems to have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 2 Megabytes of RAM onboard."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 "It looks like some kind of meat. Smells pretty bad."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 "The paper says: Don't forget to type 'help' for help. Also, remember
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 this word: 'worms'"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 "The statuette is of the likeness of Richard Stallman, the author of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 famous EMACS editor. You notice that he is not wearing any shoes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 "You observe that the weight is heavy."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 "It says S. S. Minnow."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 "It has a picture of snoopy on it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 "It has your picture on it!"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 "They are old coins from the 19th century."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 "It is a valuable Fabrege egg."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 "It is a a plain glass jar."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 ;;; These are the descriptions the user gets when non-regular objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370 ;;; are examined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 (setq dun-permobj-desc '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 "It is just a boulder. It cannot be moved."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 "They are palm trees with a bountiful supply of coconuts in them."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 "It looks like a grizzly to me."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 "All of the bins are empty. Looking closely you can see that there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 are names written at the bottom of each bin, but most of them are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 faded away so that you cannot read them. You can only make out three
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 names:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 Jeffrey Collier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 Robert Toukmond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 Thomas Stock
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 "It is just a garbled mess."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 "The dial points to a temperature scale which has long since faded away."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 "It is a velvet painting of Elvis Presly. It seems to be nailed to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 wall, and you cannot move it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 "It is a queen sized bed, with a very firm mattress."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 "The urinal is very clean compared with everything else in the cave. There
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 isn't even any rust. Upon close examination you realize that the drain at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 bottom is missing, and there is just a large hole leading down the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 pipes into nowhere. The hole is too small for a person to fit in. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 flush handle is so clean that you can see your reflection in it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400 "The box has a slit in the top of it, and on it, in sloppy handwriting, is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 written: 'For key upgrade, put key in here.'"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 "It says 'express mail' on it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 "It is a 35 passenger bus with the company name 'mobytours' on it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 "It is a large metal gate that is too big to climb over."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 "It is a HIGH cliff."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 "Unfortunately you do not know enough about dinosaurs to tell very much about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 it. It is very big, though."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 "The fish look like they were once quite beautiful."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 "It is a normal ladder that is permanently attached to the hole."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 "It is a passenger train that is ready to go."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416 "It is a personal computer that has only one floppy disk drive."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 (setq dun-diggables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 (list nil nil nil (list obj-cpu) nil nil nil nil nil nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 nil nil nil nil nil nil nil nil nil nil ;11-20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 nil nil nil nil nil nil nil nil nil nil ;21-30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 nil nil nil nil nil nil nil nil nil nil ;31-40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 nil (list obj-platinum) nil nil nil nil nil nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 (setq dun-room-shorts nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 (dolist (x dun-rooms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 (setq dun-room-shorts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 (append dun-room-shorts (list (downcase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 (dun-space-to-hyphen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 (cadr x)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 (setq dun-endgame-questions '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 "What is your password on the machine called 'pokey'?" "robert")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 "What password did you use during anonymous ftp to gamma?" "foo")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 "Excluding the endgame, how many places are there where you can put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 treasures for points?" "4" "four")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 "What is your login name on the 'endgame' machine?" "toukmond"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 "What is the nearest whole dollar to the price of the shovel?" "20" "twenty")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 "What is the name of the bus company serving the town?" "mobytours")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 "Give either of the two last names in the mailroom, other than your own."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 "collier" "stock")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 "What cartoon character is on the towel?" "snoopy")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 "What is the last name of the author of EMACS?" "stallman")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 "How many megabytes of memory is on the CPU board for the Vax?" "2")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 "Which street in town is named after a U.S. state?" "vermont")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 "How many pounds did the weight weigh?" "ten" "10")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 "Name the STREET which runs right over the subway stop." "fourth" "4" "4th")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 "How many corners are there in town (excluding the one with the Post Office)?"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 "24" "twentyfour" "twenty-four")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 "What type of bear was hiding your key?" "grizzly")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 "Name either of the two objects you found by digging." "cpu" "card" "vax"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 "board" "platinum")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 "What network protocol is used between pokey and gamma?" "tcp/ip" "ip" "tcp")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 (let (a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 (setq a 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 (dolist (x dun-room-shorts)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 (eval (list 'defconst (intern x) a))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 (setq a (+ a 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 ;;;; This section defines the UNIX emulation functions for dunnet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 (defun dun-unix-parse (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 (interactive "*p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 (let (beg esign)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 (setq beg (+ (point) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 (if (and (not (= beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 (string= "$" (buffer-substring (- beg 2) (- beg 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 (setq line (downcase (buffer-substring beg (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 (princ line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 (if (eq (dun-parse2 nil dun-unix-verbs line) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 (if (setq esign (string-match "=" line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 (dun-doassign line esign)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (dun-mprinc (car line-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 (dun-mprincl ": not found.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (if (eq dungeon-mode 'unix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 (dun-fix-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 (dun-mprinc "$ ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 (defun dun-doassign (line esign)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 (if (not dun-wizard)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 (let (passwd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 (dun-mprinc "Enter wizard password: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 (setq passwd (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 (if (not dun-batch-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 (if (string= passwd "moby")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 (setq dun-wizard t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 (dun-doassign line esign))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 (dun-mprincl "Incorrect.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 (let (varname epoint afterq i value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 (setq varname (substring line 0 esign))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 (if (not (setq epoint (string-match ")" line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 (if (string= (substring line (1+ esign) (+ esign 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 (setq afterq (substring line (+ esign 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 (setq epoint (+
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 (string-match "\"" afterq)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 (+ esign 3))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 (if (not (setq epoint (string-match " " line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 (setq epoint (length line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 (setq epoint (1+ epoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 (while (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 (not (= epoint (length line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 (setq i (string-match ")" (substring line epoint))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 (setq epoint (+ epoint i 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 (setq value (substring line (1+ esign) epoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 (dun-eval varname value))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 (defun dun-eval (varname value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 (let (eval-error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 (switch-to-buffer (get-buffer-create "*dungeon-eval*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 (insert "(setq ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 (insert varname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 (insert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 (insert value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 (insert ")")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 (setq eval-error nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 (eval-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 (error (setq eval-error t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 (switch-to-buffer "*dungeon*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 (if eval-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 (dun-mprincl "Invalid syntax."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 (defun dun-unix-interface ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 (dun-login)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 (if dun-logged-in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 (setq dungeon-mode 'unix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 (define-key dungeon-mode-map "\r" 'dun-unix-parse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 (dun-mprinc "$ "))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 (defun dun-login ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 (let (tries username password)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 (setq tries 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 (while (and (not dun-logged-in) (> (setq tries (- tries 1)) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 (dun-mprinc "\n\nUNIX System V, Release 2.2 (pokey)\n\nlogin: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 (setq username (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 (if (not dun-batch-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 (dun-mprinc "password: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 (setq password (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 (if (not dun-batch-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 (if (or (not (string= username "toukmond"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 (not (string= password "robert")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 (dun-mprincl "login incorrect")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 (setq dun-logged-in t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 (dun-mprincl "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 Welcome to Unix\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 Please clean up your directories. The filesystem is getting full.
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
2592 Our tcp/ip link to gamma is a little flaky, but seems to work.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 The current version of ftp can only send files from the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 directory, and deletes them after they are sent! Be careful.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 Note: Restricted bourne shell in use.\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 (setq dungeon-mode 'dungeon)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 (defun dun-ls (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 (if (car args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 (let (ocdpath ocdroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 (setq ocdpath dun-cdpath)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 (setq ocdroom dun-cdroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 (if (not (eq (dun-cd args) -2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 (dun-ls nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 (setq dun-cdpath ocdpath)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 (setq dun-cdroom ocdroom))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 (if (= dun-cdroom -10)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 (dun-ls-inven))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 (if (= dun-cdroom -2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 (dun-ls-rooms))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 (if (= dun-cdroom -3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 (dun-ls-root))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 (if (= dun-cdroom -4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 (dun-ls-usr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 (if (> dun-cdroom 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 (dun-ls-room))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 (defun dun-ls-root ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 (dun-mprincl "total 4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 drwxr-xr-x 3 root staff 512 Jan 1 1970 .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 drwxr-xr-x 3 root staff 2048 Jan 1 1970 usr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 drwxr-xr-x 3 root staff 2048 Jan 1 1970 rooms"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 (defun dun-ls-usr ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 (dun-mprincl "total 4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 drwxr-xr-x 3 root staff 512 Jan 1 1970 .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 drwxr-xr-x 3 toukmond restricted 512 Jan 1 1970 toukmond"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 (defun dun-ls-rooms ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 (dun-mprincl "total 16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 drwxr-xr-x 3 root staff 512 Jan 1 1970 .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 (dolist (x dun-visited)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 "drwxr-xr-x 3 root staff 512 Jan 1 1970 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 (dun-mprincl (nth x dun-room-shorts))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 (defun dun-ls-room ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 (dun-mprincl "total 4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 drwxr-xr-x 3 root staff 512 Jan 1 1970 .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 -rwxr-xr-x 3 root staff 2048 Jan 1 1970 description")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 (dolist (x (nth dun-cdroom dun-room-objects))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 (if (and (>= x 0) (not (= x 255)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 (dun-mprinc "-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 (dun-mprincl (nth x dun-objfiles))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 (defun dun-ls-inven ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 (dun-mprinc "total 467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 drwxr-xr-x 3 toukmond restricted 512 Jan 1 1970 .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 (dolist (x dun-unix-verbs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 (if (not (eq (car x) 'IMPOSSIBLE))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 (dun-mprinc"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 -rwxr-xr-x 1 toukmond restricted 10423 Jan 1 1970 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 (dun-mprinc (car x)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 (if (not dun-uncompressed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 "-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 paper.o.Z"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 (dolist (x dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 "-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 (dun-mprincl (nth x dun-objfiles))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671 (defun dun-echo (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 (let (nomore var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 (setq nomore nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 (dolist (x args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 (if (not nomore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 (if (not (string= (substring x 0 1) "$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 (dun-mprinc x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 (dun-mprinc " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681 (setq var (intern (substring x 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 (if (not (boundp var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683 (dun-mprinc " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684 (if (member var dun-restricted)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 (dun-mprinc var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687 (dun-mprinc ": Permission denied")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 (setq nomore t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 (eval (list 'dun-mprinc var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 (dun-mprinc " ")))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 (dun-mprinc "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 (defun dun-ftp (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 (let (host username passwd ident newlist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 (if (not (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697 (dun-mprincl "ftp: hostname required on command line.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 (setq host (intern (car args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 (if (not (member host '(gamma dun-endgame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700 (dun-mprincl "ftp: Unknown host.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 (if (eq host 'dun-endgame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 (dun-mprincl "ftp: connection to endgame not allowed")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 (if (not dun-ethernet)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 (dun-mprincl "ftp: host not responding.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 (dun-mprincl "Connected to gamma. FTP ver 0.9 00:00:00 01/01/70")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 (dun-mprinc "Username: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 (setq username (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 (if (string= username "toukmond")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 (if dun-batch-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 (dun-mprincl "toukmond ftp access not allowed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 (dun-mprincl "\ntoukmond ftp access not allowed."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 (if (string= username "anonymous")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 (if dun-batch-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 "Guest login okay, send your user ident as password.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 "\nGuest login okay, send your user ident as password."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718 (if dun-batch-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 (dun-mprinc "Password required for ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 (dun-mprinc "\nPassword required for "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 (dun-mprincl username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722 (dun-mprinc "Password: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 (setq ident (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 (if (not (string= username "anonymous"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 (if dun-batch-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 (dun-mprincl "Login failed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 (dun-mprincl "\nLogin failed."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 (if dun-batch-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 "Guest login okay, user access restrictions apply.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 "\nGuest login okay, user access restrictions apply."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733 (dun-ftp-commands)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 (setq newlist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 '("What password did you use during anonymous ftp to gamma?"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 (setq newlist (append newlist (list ident)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 (rplaca (nthcdr 1 dun-endgame-questions) newlist)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 (defun dun-ftp-commands ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 (setq dun-exitf nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 (let (line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 (while (not dun-exitf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 (dun-mprinc "ftp> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744 (setq line (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 (if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 (eq
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 (dun-parse2 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 '((type . dun-ftptype) (binary . dun-bin) (bin . dun-bin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 (send . dun-send) (put . dun-send) (quit . dun-ftpquit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 (help . dun-ftphelp)(ascii . dun-fascii)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 ) line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 (dun-mprincl "No such command. Try help.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 (setq dun-ftptype 'ascii)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 (defun dun-ftptype (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 (if (not (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 (dun-mprincl "Usage: type [binary | ascii]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 (setq args (intern (car args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 (if (eq args 'binary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 (dun-bin nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 (if (eq args 'ascii)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 (dun-fascii 'nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 (dun-mprincl "Unknown type.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 (defun dun-bin (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 (dun-mprincl "Type set to binary.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 (setq dun-ftptype 'binary))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 (defun dun-fascii (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 (dun-mprincl "Type set to ascii.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 (setq dun-ftptype 'ascii))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 (defun dun-ftpquit (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775 (setq dun-exitf t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 (defun dun-send (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 (if (not (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 (dun-mprincl "Usage: send <filename>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 (setq args (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 (let (counter foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 (setq foo nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 (setq counter 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 ;;; User can send commands! Stupid user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 (if (assq (intern args) dun-unix-verbs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790 (rplaca (assq (intern args) dun-unix-verbs) 'IMPOSSIBLE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 (dun-mprinc "Sending ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 (dun-mprinc dun-ftptype)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 (dun-mprinc " file for ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 (dun-mprincl args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 (dun-mprincl "Transfer complete."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 (dolist (x dun-objfiles)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 (if (string= args x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 (if (not (member counter dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 (dun-mprincl "No such file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 (setq foo t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 (dun-mprinc "Sending ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 (dun-mprinc dun-ftptype)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 (dun-mprinc " file for ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 (dun-mprinc (downcase (cadr (nth counter dun-objects))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 (dun-mprincl ", (0 bytes)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 (if (not (eq dun-ftptype 'binary))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 (if (not (member obj-protoplasm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 (nth receiving-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 (dun-replace dun-room-objects receiving-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 (append (nth receiving-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 (list obj-protoplasm))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 (dun-remove-obj-from-inven counter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 (dun-remove-obj-from-inven counter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 (dun-replace dun-room-objects receiving-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821 (append (nth receiving-room dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 (list counter))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 (setq foo t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 (dun-mprincl "Transfer complete."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 (setq counter (+ 1 counter)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 (if (not foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 (dun-mprincl "No such file."))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 (defun dun-ftphelp (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 "Possible commands are:\nsend quit type ascii binary help"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 (defun dun-uexit (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 (setq dungeon-mode 'dungeon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 (dun-mprincl "\nYou step back from the console.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 (define-key dungeon-mode-map "\r" 'dun-parse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 (if (not dun-batch-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 (dun-messages)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (defun dun-pwd (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 (dun-mprincl dun-cdpath))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 (defun dun-uncompress (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 (if (not (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 (dun-mprincl "Usage: uncompress <filename>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 (setq args (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 (if (or dun-uncompressed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 (and (not (string= args "paper.o"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 (not (string= args "paper.o.z"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 (dun-mprincl "Uncompress command failed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 (setq dun-uncompressed t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 (setq dun-inventory (append dun-inventory (list obj-paper))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 (defun dun-rlogin (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 (let (passwd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 (if (not (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (dun-mprincl "Usage: rlogin <hostname>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 (setq args (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 (if (string= args "endgame")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 (dun-rlogin-endgame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 (if (not (string= args "gamma"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (dun-mprincl "No such host.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 (if (not dun-ethernet)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864 (dun-mprincl "Host not responding.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 (dun-mprinc "Password: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 (setq passwd (dun-read-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867 (if (not (string= passwd "worms"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 (dun-mprincl "\nlogin incorrect")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869 (dun-mprinc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 "\nYou begin to feel strange for a moment, and you lose your items."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 (dun-replace dun-room-objects computer-room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873 (append (nth computer-room dun-room-objects)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 dun-inventory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 (setq dun-inventory nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 (setq dun-current-room receiving-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 (dun-uexit nil))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 (defun dun-cd (args)
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
2880 (let (tcdpath tcdroom path-elements room-check)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881 (if (not (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 (dun-mprincl "Usage: cd <path>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 (setq tcdpath dun-cdpath)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 (setq tcdroom dun-cdroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 (setq dun-badcd nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 (setq path-elements (dun-get-path (car args) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888 (error (dun-mprincl "Invalid path.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 (setq dun-badcd t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890 (dolist (pe path-elements)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 (unless dun-badcd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 (if (not (string= pe "."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 (if (string= pe "..")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (if (> tcdroom 0) ;In a room
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 (setq tcdpath "/rooms")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 (setq tcdroom -2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 ;In /rooms,/usr,root
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 (if (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 (= tcdroom -2) (= tcdroom -4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 (= tcdroom -3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 (setq tcdpath "/")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 (setq tcdroom -3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 (if (= tcdroom -10) ;In /usr/toukmond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 (setq tcdpath "/usr")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 (setq tcdroom -4))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 (if (string= pe "/")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912 (setq tcdpath "/")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 (setq tcdroom -3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 (if (= tcdroom -4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 (if (string= pe "toukmond")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 (setq tcdpath "/usr/toukmond")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 (setq tcdroom -10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 (dun-nosuchdir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 (if (= tcdroom -10)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 (dun-nosuchdir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 (if (> tcdroom 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 (dun-nosuchdir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924 (if (= tcdroom -3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 (if (string= pe "rooms")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 (setq tcdpath "/rooms")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929 (setq tcdroom -2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 (if (string= pe "usr")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932 (setq tcdpath "/usr")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 (setq tcdroom -4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 (dun-nosuchdir))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 (if (= tcdroom -2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 (dolist (x dun-visited)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938 (setq room-check
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 (nth x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 dun-room-shorts))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 (if (string= room-check pe)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 (setq tcdpath
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 (concat "/rooms/" room-check))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 (setq tcdroom x))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 (if (= tcdroom -2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (dun-nosuchdir)))))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 (if (not dun-badcd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 (setq dun-cdpath tcdpath)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951 (setq dun-cdroom tcdroom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 -2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955 (defun dun-nosuchdir ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956 (dun-mprincl "No such directory.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 (setq dun-badcd t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 (defun dun-cat (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 (let (doto checklist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 (if (not (setq args (car args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 (dun-mprincl "Usage: cat <ascii-file-name>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 (if (string-match "/" args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 (dun-mprincl "cat: only files in current directory allowed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 (if (and (> dun-cdroom 0) (string= args "description"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 (dun-mprincl (car (nth dun-cdroom dun-rooms)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 (if (setq doto (string-match "\\.o" args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 (if (= dun-cdroom -10)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 (setq checklist dun-inventory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 (setq checklist (nth dun-cdroom dun-room-objects)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 (if (not (member (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 (assq (intern
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974 (substring args 0 doto))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975 dun-objnames))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 checklist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 (dun-mprincl "File not found.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 (dun-mprincl "Ascii files only.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 (if (assq (intern args) dun-unix-verbs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 (dun-mprincl "Ascii files only.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 (dun-mprincl "File not found."))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 (defun dun-zippy (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 (dun-mprincl (yow)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 (defun dun-rlogin-endgame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 (if (not (= (dun-score nil) 90))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 (dun-mprincl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 "You have not achieved enough points to connect to endgame.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 (dun-mprincl"\nWelcome to the endgame. You are a truly noble adventurer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991 (setq dun-current-room treasure-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 (setq dun-endgame t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 (dun-replace dun-room-objects endgame-treasure-room (list obj-bill))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 (dun-uexit nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 (random t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 (setq tloc (+ 60 (random 18)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 (dun-replace dun-room-objects tloc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 (append (nth tloc dun-room-objects) (list 18)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 (setq tcomb (+ 100 (random 899)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 (setq dun-combination (prin1-to-string tcomb))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 ;;;; This section defines the DOS emulation functions for dunnet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 (defun dun-dos-parse (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 (interactive "*p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 (let (beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 (setq beg (+ (point) 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 (if (not (= beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 (let (line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 (setq line (downcase (buffer-substring beg (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 (princ line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 (if (eq (dun-parse2 nil dun-dos-verbs line) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 (sleep-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 (dun-mprincl "Bad command or file name"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025 (if (eq dungeon-mode 'dos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 (dun-fix-screen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 (dun-dos-prompt)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 (defun dun-dos-interface ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 (dun-dos-boot-msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 (setq dungeon-mode 'dos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 (define-key dungeon-mode-map "\r" 'dun-dos-parse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034 (dun-dos-prompt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 (defun dun-dos-type (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 (sleep-for 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 (if (setq args (car args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 (if (string= args "foo.txt")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 (dun-dos-show-combination)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 (if (string= args "command.com")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 (dun-mprincl "Cannot type binary files")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 (dun-mprinc "File not found - ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 (dun-mprincl (upcase args))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 (dun-mprincl "Must supply file name")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 (defun dun-dos-invd (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (sleep-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 (dun-mprincl "Invalid drive specification"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 (defun dun-dos-dir (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 (sleep-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053 (if (or (not (setq args (car args))) (string= args "\\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 (dun-mprincl "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 Volume in drive A is FOO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 Volume Serial Number is 1A16-08C9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 Directory of A:\\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 COMMAND COM 47845 04-09-91 2:00a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 FOO TXT 40 01-20-93 1:01a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 2 file(s) 47845 bytes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 1065280 bytes free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064 (dun-mprincl "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065 Volume in drive A is FOO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066 Volume Serial Number is 1A16-08C9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 Directory of A:\\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069 File not found")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 (defun dun-dos-prompt ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 (dun-mprinc "A> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 (defun dun-dos-boot-msg ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 (sleep-for 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (dun-mprinc "Current time is ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 (dun-mprincl (substring (current-time-string) 12 20))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 (dun-mprinc "Enter new time: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 (dun-read-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 (if (not dun-batch-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082 (dun-mprinc "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 (defun dun-dos-spawn (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 (sleep-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 (dun-mprincl "Cannot spawn subshell"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 (defun dun-dos-exit (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 (setq dungeon-mode 'dungeon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 (dun-mprincl "\nYou power down the machine and step back.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091 (define-key dungeon-mode-map "\r" 'dun-parse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092 (if (not dun-batch-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093 (dun-messages)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095 (defun dun-dos-no-disk ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096 (sleep-for 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097 (dun-mprincl "Boot sector not found"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100 (defun dun-dos-show-combination ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101 (sleep-for 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102 (dun-mprinc "\nThe combination is ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103 (dun-mprinc dun-combination)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 (dun-mprinc ".\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 (defun dun-dos-nil (args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 ;;;; This section defines the save and restore game functions for dunnet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113 (defun dun-save-game (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 (if (not (setq filename (car filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 (dun-mprincl "You must supply a filename for the save.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 (if (file-exists-p filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 (delete-file filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118 (setq dun-numsaves (1+ dun-numsaves))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 (dun-make-save-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 (dun-save-val "dun-current-room")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121 (dun-save-val "dun-computer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 (dun-save-val "dun-combination")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 (dun-save-val "dun-visited")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (dun-save-val "dun-diggables")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 (dun-save-val "dun-key-level")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (dun-save-val "dun-floppy")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127 (dun-save-val "dun-numsaves")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 (dun-save-val "dun-numcmds")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129 (dun-save-val "dun-logged-in")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130 (dun-save-val "dungeon-mode")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131 (dun-save-val "dun-jar")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 (dun-save-val "dun-lastdir")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 (dun-save-val "dun-black")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 (dun-save-val "dun-nomail")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 (dun-save-val "dun-unix-verbs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 (dun-save-val "dun-hole")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 (dun-save-val "dun-uncompressed")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 (dun-save-val "dun-ethernet")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 (dun-save-val "dun-sauna-level")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 (dun-save-val "dun-room-objects")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 (dun-save-val "dun-room-silents")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 (dun-save-val "dun-inventory")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (dun-save-val "dun-endgame-questions")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 (dun-save-val "dun-endgame")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 (dun-save-val "dun-cdroom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 (dun-save-val "dun-cdpath")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 (dun-save-val "dun-correct-answer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148 (dun-save-val "dun-inbus")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 (if (dun-compile-save-out filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 (dun-mprincl "Error saving to file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 (dun-do-logfile 'save nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 (switch-to-buffer "*dungeon*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 (princ "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 (dun-mprincl "Done."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156 (defun dun-make-save-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157 (switch-to-buffer (get-buffer-create "*save-dungeon*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158 (erase-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 (defun dun-compile-save-out (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 (let (ferror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 (setq ferror nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 (dun-rot13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 (error (setq ferror t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 (if (not ferror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 (goto-char (point-min))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 (write-region 1 (point-max) filename nil 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 (error (setq ferror t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 ferror))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 (defun dun-save-val (varname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 (let (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 (setq varname (intern varname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 (setq value (eval varname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 (dun-minsert "(setq ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 (dun-minsert varname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 (dun-minsert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 (if (or (listp value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 (symbolp value))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 (dun-minsert "'"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186 (if (stringp value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 (dun-minsert "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 (dun-minsert value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 (if (stringp value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 (dun-minsert "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 (dun-minsertl ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 (defun dun-restore (args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 (let (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 (if (not (setq file (car args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 (dun-mprincl "You must supply a filename.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 (if (not (dun-load-d file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 (dun-mprincl "Could not load restore file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 (dun-mprincl "Done.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 (setq room 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 (defun dun-do-logfile (type how)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 (let (ferror newscore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 (setq ferror nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 (switch-to-buffer (get-buffer-create "*score*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 (insert-file-contents dun-log-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 (error (setq ferror t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212 (unless ferror
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214 (dun-minsert (current-time-string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 (dun-minsert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 (dun-minsert (user-login-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 (dun-minsert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 (if (eq type 'save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 (dun-minsert "saved ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 (if (= (dun-endgame-score) 110)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 (dun-minsert "won ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 (if (not how)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 (dun-minsert "quit ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 (dun-minsert "killed by ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 (dun-minsert how)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 (dun-minsert " "))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 (dun-minsert "at ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228 (dun-minsert (cadr (nth (abs room) dun-rooms)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229 (dun-minsert ". score: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 (if (> (dun-endgame-score) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231 (dun-minsert (setq newscore (+ 90 (dun-endgame-score))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 (dun-minsert (setq newscore (dun-reg-score))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 (dun-minsert " saves: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 (dun-minsert dun-numsaves)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 (dun-minsert " commands: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 (dun-minsert dun-numcmds)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 (dun-minsert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 (write-region 1 (point-max) dun-log-file nil 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 (kill-buffer (current-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 ;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 ;;;; These are functions, and function re-definitions so that dungeon can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 ;;;; be run in batch mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 (defun dun-batch-mprinc (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248 (if (stringp arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249 (send-string-to-terminal arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250 (send-string-to-terminal (prin1-to-string arg))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 (defun dun-batch-mprincl (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 (if (stringp arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 (send-string-to-terminal arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257 (send-string-to-terminal "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258 (send-string-to-terminal (prin1-to-string arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 (send-string-to-terminal "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 (defun dun-batch-parse (dun-ignore dun-verblist line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 (setq line-list (dun-listify-string (concat line " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263 (dun-doverb dun-ignore dun-verblist (car line-list) (cdr line-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 (defun dun-batch-parse2 (dun-ignore dun-verblist line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 (setq line-list (dun-listify-string2 (concat line " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 (dun-doverb dun-ignore dun-verblist (car line-list) (cdr line-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 (defun dun-batch-read-line ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 (read-from-minibuffer "" nil dungeon-batch-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 (defun dun-batch-loop ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274 (setq dun-dead nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 (setq room 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 (while (not dun-dead)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277 (if (eq dungeon-mode 'dungeon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279 (if (not (= room dun-current-room))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 (dun-describe-room dun-current-room)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 (setq room dun-current-room)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 (dun-mprinc ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 (setq line (downcase (dun-read-line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 (if (eq (dun-vparse dun-ignore dun-verblist line) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 (dun-mprinc "I don't understand that.\n"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288 (defun dun-batch-dos-interface ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 (dun-dos-boot-msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 (setq dungeon-mode 'dos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 (while (eq dungeon-mode 'dos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292 (dun-dos-prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293 (setq line (downcase (dun-read-line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 (if (eq (dun-parse2 nil dun-dos-verbs line) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 (sleep-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 (dun-mprincl "Bad command or file name"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 (dun-mprinc "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 (defun dun-batch-unix-interface ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 (dun-login)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 (if dun-logged-in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305 (setq dungeon-mode 'unix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306 (while (eq dungeon-mode 'unix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307 (dun-mprinc "$ ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308 (setq line (downcase (dun-read-line)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 (if (eq (dun-parse2 nil dun-unix-verbs line) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 (let (esign)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 (if (setq esign (string-match "=" line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312 (dun-doassign line esign)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313 (dun-mprinc (car line-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 (dun-mprincl ": not found.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 (dun-mprinc "\n"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 (defun dungeon-nil (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 "noop"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320 (interactive "*p"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322 (defun dun-batch-dungeon ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323 (load "dun-batch")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 (setq dun-visited '(27))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 (dun-batch-loop))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 (unless (not noninteractive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329 (fset 'dun-mprinc 'dun-batch-mprinc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330 (fset 'dun-mprincl 'dun-batch-mprincl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 (fset 'dun-vparse 'dun-batch-parse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332 (fset 'dun-parse2 'dun-batch-parse2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 (fset 'dun-read-line 'dun-batch-read-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 (fset 'dun-dos-interface 'dun-batch-dos-interface)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335 (fset 'dun-unix-interface 'dun-batch-unix-interface)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336 (dun-mprinc "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 (setq dun-batch-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338 (dun-batch-loop))
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
3339
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents: 0
diff changeset
3340 ;;; dunnet.el ends here