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