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