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