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