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