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