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