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