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