29 |
;; This game can be run in batch mode. To do this, use: |
;; This game can be run in batch mode. To do this, use: |
30 |
;; emacs -batch -l dunnet |
;; emacs -batch -l dunnet |
31 |
|
|
32 |
;;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
;;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
33 |
;;; The log file should be set for your system, and it must |
;;; The log file should be set for your system, and it must |
34 |
;;; be writable by all. |
;;; be writable by all. |
35 |
|
|
79 |
(goto-char (point-max)) |
(goto-char (point-max)) |
80 |
(dun-mprinc "\n")) |
(dun-mprinc "\n")) |
81 |
(dun-messages)) |
(dun-messages)) |
82 |
|
|
83 |
(defun dun-messages () |
(defun dun-messages () |
84 |
(if dun-dead |
(if dun-dead |
85 |
(text-mode) |
(text-mode) |
111 |
;;; short. Also give long if we were called with negative room number. |
;;; short. Also give long if we were called with negative room number. |
112 |
|
|
113 |
(defun dun-describe-room (room) |
(defun dun-describe-room (room) |
114 |
(if (and (not (member (abs room) dun-light-rooms)) |
(if (and (not (member (abs room) dun-light-rooms)) |
115 |
(not (member obj-lamp dun-inventory))) |
(not (member obj-lamp dun-inventory))) |
116 |
(dun-mprincl "It is pitch dark. You are likely to be eaten by a grue.") |
(dun-mprincl "It is pitch dark. You are likely to be eaten by a grue.") |
117 |
(dun-mprincl (cadr (nth (abs room) dun-rooms))) |
(dun-mprincl (cadr (nth (abs room) dun-rooms))) |
118 |
(if (and (and (or (member room dun-visited) |
(if (and (and (or (member room dun-visited) |
119 |
(string= dun-mode "dun-superb")) (> room 0)) |
(string= dun-mode "dun-superb")) (> room 0)) |
120 |
(not (string= dun-mode "long"))) |
(not (string= dun-mode "long"))) |
121 |
nil |
nil |
147 |
(defun dun-special-object () |
(defun dun-special-object () |
148 |
(if (= dun-current-room computer-room) |
(if (= dun-current-room computer-room) |
149 |
(if dun-computer |
(if dun-computer |
150 |
(dun-mprincl |
(dun-mprincl |
151 |
"The panel lights are flashing in a seemingly organized pattern.") |
"The panel lights are flashing in a seemingly organized pattern.") |
152 |
(dun-mprincl "The panel lights are steady and motionless."))) |
(dun-mprincl "The panel lights are steady and motionless."))) |
153 |
|
|
154 |
(if (and (= dun-current-room red-room) |
(if (and (= dun-current-room red-room) |
155 |
(not (member obj-towel (nth red-room dun-room-objects)))) |
(not (member obj-towel (nth red-room dun-room-objects)))) |
156 |
(dun-mprincl "There is a hole in the floor here.")) |
(dun-mprincl "There is a hole in the floor here.")) |
157 |
|
|
158 |
(if (and (= dun-current-room marine-life-area) dun-black) |
(if (and (= dun-current-room marine-life-area) dun-black) |
159 |
(dun-mprincl |
(dun-mprincl |
160 |
"The room is lit by a black light, causing the fish, and some of |
"The room is lit by a black light, causing the fish, and some of |
161 |
your objects, to give off an eerie glow.")) |
your objects, to give off an eerie glow.")) |
162 |
(if (and (= dun-current-room fourth-vermont-intersection) dun-hole) |
(if (and (= dun-current-room fourth-vermont-intersection) dun-hole) |
163 |
(progn |
(progn |
167 |
(setq dun-current-room vermont-station) |
(setq dun-current-room vermont-station) |
168 |
(dun-describe-room vermont-station)) |
(dun-describe-room vermont-station)) |
169 |
(progn |
(progn |
170 |
(dun-mprincl |
(dun-mprincl |
171 |
"The bus falls down a hole in the ground and explodes.") |
"The bus falls down a hole in the ground and explodes.") |
172 |
(dun-die "burning"))))) |
(dun-die "burning"))))) |
173 |
|
|
186 |
"It is comfortably hot in here." |
"It is comfortably hot in here." |
187 |
"It is refreshingly hot in here." |
"It is refreshingly hot in here." |
188 |
"You are dead now."))) |
"You are dead now."))) |
189 |
(if (= dun-sauna-level 3) |
(if (= dun-sauna-level 3) |
190 |
(progn |
(progn |
191 |
(if (or (member obj-rms dun-inventory) |
(if (or (member obj-rms dun-inventory) |
192 |
(member obj-rms (nth dun-current-room dun-room-objects))) |
(member obj-rms (nth dun-current-room dun-room-objects))) |
193 |
(progn |
(progn |
194 |
(dun-mprincl |
(dun-mprincl |
195 |
"You notice the wax on your statuette beginning to melt, until it completely |
"You notice the wax on your statuette beginning to melt, until it completely |
196 |
melts off. You are left with a beautiful diamond!") |
melts off. You are left with a beautiful diamond!") |
197 |
(if (member obj-rms dun-inventory) |
(if (member obj-rms dun-inventory) |
198 |
(progn |
(progn |
199 |
(dun-remove-obj-from-inven obj-rms) |
(dun-remove-obj-from-inven obj-rms) |
200 |
(setq dun-inventory (append dun-inventory |
(setq dun-inventory (append dun-inventory |
201 |
(list obj-diamond)))) |
(list obj-diamond)))) |
202 |
(dun-remove-obj-from-room dun-current-room obj-rms) |
(dun-remove-obj-from-room dun-current-room obj-rms) |
203 |
(dun-replace dun-room-objects dun-current-room |
(dun-replace dun-room-objects dun-current-room |
207 |
(member obj-floppy (nth dun-current-room dun-room-objects))) |
(member obj-floppy (nth dun-current-room dun-room-objects))) |
208 |
(progn |
(progn |
209 |
(dun-mprincl |
(dun-mprincl |
210 |
"You notice your floppy disk beginning to melt. As you grab for it, the |
"You notice your floppy disk beginning to melt. As you grab for it, the |
211 |
disk bursts into flames, and disintegrates.") |
disk bursts into flames, and disintegrates.") |
212 |
(dun-remove-obj-from-inven obj-floppy) |
(dun-remove-obj-from-inven obj-floppy) |
213 |
(dun-remove-obj-from-room dun-current-room obj-floppy)))))))) |
(dun-remove-obj-from-room dun-current-room obj-floppy)))))))) |
303 |
(append (nth dun-current-room dun-room-objects) |
(append (nth dun-current-room dun-room-objects) |
304 |
(list obj-key))))) |
(list obj-key))))) |
305 |
|
|
306 |
(if (and (= objnum obj-jar) (member obj-nitric dun-jar) |
(if (and (= objnum obj-jar) (member obj-nitric dun-jar) |
307 |
(member obj-glycerine dun-jar)) |
(member obj-glycerine dun-jar)) |
308 |
(progn |
(progn |
309 |
(dun-mprincl |
(dun-mprincl |
310 |
"As the jar impacts the ground it explodes into many pieces.") |
"As the jar impacts the ground it explodes into many pieces.") |
311 |
(setq dun-jar nil) |
(setq dun-jar nil) |
312 |
(dun-remove-obj-from-room dun-current-room obj-jar) |
(dun-remove-obj-from-room dun-current-room obj-jar) |
314 |
(progn |
(progn |
315 |
(setq dun-hole t) |
(setq dun-hole t) |
316 |
(setq dun-current-room vermont-station) |
(setq dun-current-room vermont-station) |
317 |
(dun-mprincl |
(dun-mprincl |
318 |
"The explosion causes a hole to open up in the ground, which you fall |
"The explosion causes a hole to open up in the ground, which you fall |
319 |
through."))))) |
through."))))) |
320 |
|
|
322 |
(dun-mprincl "A passageway opens."))) |
(dun-mprincl "A passageway opens."))) |
323 |
|
|
324 |
;;; Give long description of current room, or an object. |
;;; Give long description of current room, or an object. |
325 |
|
|
326 |
(defun dun-examine (obj) |
(defun dun-examine (obj) |
327 |
(let (objnum) |
(let (objnum) |
328 |
(setq objnum (dun-objnum-from-args obj)) |
(setq objnum (dun-objnum-from-args obj)) |
333 |
(dun-examine '("pc")) |
(dun-examine '("pc")) |
334 |
(if (eq objnum nil) |
(if (eq objnum nil) |
335 |
(dun-mprincl "I don't know what that is.") |
(dun-mprincl "I don't know what that is.") |
336 |
(if (and (not (member objnum |
(if (and (not (member objnum |
337 |
(nth dun-current-room dun-room-objects))) |
(nth dun-current-room dun-room-objects))) |
338 |
(not (and (member obj-jar dun-inventory) |
(not (and (member obj-jar dun-inventory) |
339 |
(member objnum dun-jar))) |
(member objnum dun-jar))) |
340 |
(not (member objnum |
(not (member objnum |
341 |
(nth dun-current-room dun-room-silents))) |
(nth dun-current-room dun-room-silents))) |
342 |
(not (member objnum dun-inventory))) |
(not (member objnum dun-inventory))) |
343 |
(dun-mprincl "I don't see that here.") |
(dun-mprincl "I don't see that here.") |
344 |
(if (>= objnum 0) |
(if (>= objnum 0) |
345 |
(if (and (= objnum obj-bone) |
(if (and (= objnum obj-bone) |
346 |
(= dun-current-room marine-life-area) dun-black) |
(= dun-current-room marine-life-area) dun-black) |
347 |
(dun-mprincl |
(dun-mprincl |
348 |
"In this light you can see some writing on the bone. It says: |
"In this light you can see some writing on the bone. It says: |
349 |
For an explosive time, go to Fourth St. and Vermont.") |
For an explosive time, go to Fourth St. and Vermont.") |
350 |
(if (nth objnum dun-physobj-desc) |
(if (nth objnum dun-physobj-desc) |
400 |
(dun-try-take objnum)) |
(dun-try-take objnum)) |
401 |
(if (>= objnum 0) |
(if (>= objnum 0) |
402 |
(progn |
(progn |
403 |
(if (and (car dun-inventory) |
(if (and (car dun-inventory) |
404 |
(> (+ (dun-inven-weight) (nth objnum dun-object-lbs)) 11)) |
(> (+ (dun-inven-weight) (nth objnum dun-object-lbs)) 11)) |
405 |
(dun-mprinc "Your load would be too heavy.") |
(dun-mprinc "Your load would be too heavy.") |
406 |
(setq dun-inventory (append dun-inventory (list objnum))) |
(setq dun-inventory (append dun-inventory (list objnum))) |
407 |
(dun-remove-obj-from-room dun-current-room objnum) |
(dun-remove-obj-from-room dun-current-room objnum) |
408 |
(dun-mprinc "Taken. ") |
(dun-mprinc "Taken. ") |
409 |
(if (and (= objnum obj-towel) (= dun-current-room red-room)) |
(if (and (= objnum obj-towel) (= dun-current-room red-room)) |
410 |
(dun-mprinc |
(dun-mprinc |
411 |
"Taking the towel reveals a hole in the floor.")))) |
"Taking the towel reveals a hole in the floor.")))) |
412 |
(dun-try-take objnum))) |
(dun-try-take objnum))) |
413 |
(dun-mprinc "\n"))) |
(dun-mprinc "\n"))) |
494 |
(setq objnum2 obj-pc)) |
(setq objnum2 obj-pc)) |
495 |
(if (not objnum2) |
(if (not objnum2) |
496 |
(dun-mprincl "I don't know what that indirect object is.") |
(dun-mprincl "I don't know what that indirect object is.") |
497 |
(if (and (not (member objnum2 |
(if (and (not (member objnum2 |
498 |
(nth dun-current-room dun-room-objects))) |
(nth dun-current-room dun-room-objects))) |
499 |
(not (member objnum2 |
(not (member objnum2 |
500 |
(nth dun-current-room dun-room-silents))) |
(nth dun-current-room dun-room-silents))) |
501 |
(not (member objnum2 dun-inventory))) |
(not (member objnum2 dun-inventory))) |
502 |
(dun-mprincl "That indirect object is not here.") |
(dun-mprincl "That indirect object is not here.") |
528 |
(if (= obj2 obj-chute) ;; Put something in chute |
(if (= obj2 obj-chute) ;; Put something in chute |
529 |
(progn |
(progn |
530 |
(dun-remove-obj-from-inven obj1) |
(dun-remove-obj-from-inven obj1) |
531 |
(dun-mprincl |
(dun-mprincl |
532 |
"You hear it slide down the chute and off into the distance.") |
"You hear it slide down the chute and off into the distance.") |
533 |
(dun-put-objs-in-treas (list obj1))) |
(dun-put-objs-in-treas (list obj1))) |
534 |
(if (= obj2 obj-box) ;; Put key in key box |
(if (= obj2 obj-box) ;; Put key in key box |
555 |
(if (= obj2 obj-urinal) ;; Put object in urinal |
(if (= obj2 obj-urinal) ;; Put object in urinal |
556 |
(progn |
(progn |
557 |
(dun-remove-obj-from-inven obj1) |
(dun-remove-obj-from-inven obj1) |
558 |
(dun-replace dun-room-objects urinal (append |
(dun-replace dun-room-objects urinal (append |
559 |
(nth urinal dun-room-objects) |
(nth urinal dun-room-objects) |
560 |
(list obj1))) |
(list obj1))) |
561 |
(dun-mprincl |
(dun-mprincl |
563 |
(if (= obj2 obj-mail) |
(if (= obj2 obj-mail) |
564 |
(dun-mprincl "The mail chute is locked.") |
(dun-mprincl "The mail chute is locked.") |
565 |
(if (member obj1 dun-inventory) |
(if (member obj1 dun-inventory) |
566 |
(dun-mprincl |
(dun-mprincl |
567 |
"I don't know how to combine those objects. Perhaps you should |
"I don't know how to combine those objects. Perhaps you should |
568 |
just try dropping it.") |
just try dropping it.") |
569 |
(dun-mprincl"You can't put that there."))))))))))) |
(dun-mprincl"You can't put that there."))))))))))) |
572 |
(if (not (= dun-current-room computer-room)) |
(if (not (= dun-current-room computer-room)) |
573 |
(dun-mprincl "There is nothing here on which you could type.") |
(dun-mprincl "There is nothing here on which you could type.") |
574 |
(if (not dun-computer) |
(if (not dun-computer) |
575 |
(dun-mprincl |
(dun-mprincl |
576 |
"You type on the keyboard, but your characters do not even echo.") |
"You type on the keyboard, but your characters do not even echo.") |
577 |
(dun-unix-interface)))) |
(dun-unix-interface)))) |
578 |
|
|
615 |
(dun-move out)) |
(dun-move out)) |
616 |
|
|
617 |
(defun dun-go (args) |
(defun dun-go (args) |
618 |
(if (or (not (car args)) |
(if (or (not (car args)) |
619 |
(eq (dun-doverb dun-ignore dun-verblist (car args) |
(eq (dun-doverb dun-ignore dun-verblist (car args) |
620 |
(cdr (cdr args))) -1)) |
(cdr (cdr args))) -1)) |
621 |
(dun-mprinc "I don't understand where you want me to go.\n"))) |
(dun-mprinc "I don't understand where you want me to go.\n"))) |
622 |
|
|
626 |
;;; certain conditions are met. |
;;; certain conditions are met. |
627 |
|
|
628 |
(defun dun-move (dir) |
(defun dun-move (dir) |
629 |
(if (and (not (member dun-current-room dun-light-rooms)) |
(if (and (not (member dun-current-room dun-light-rooms)) |
630 |
(not (member obj-lamp dun-inventory))) |
(not (member obj-lamp dun-inventory))) |
631 |
(progn |
(progn |
632 |
(dun-mprinc |
(dun-mprinc |
633 |
"You trip over a grue and fall into a pit and break every bone in your |
"You trip over a grue and fall into a pit and break every bone in your |
634 |
body.") |
body.") |
635 |
(dun-die "a grue")) |
(dun-die "a grue")) |
645 |
(progn |
(progn |
646 |
(if (or (< newroom 58) (> newroom 83)) |
(if (or (< newroom 58) (> newroom 83)) |
647 |
(dun-mprincl "The bus cannot go this way.") |
(dun-mprincl "The bus cannot go this way.") |
648 |
(dun-mprincl |
(dun-mprincl |
649 |
"The bus lurches ahead and comes to a screeching halt.") |
"The bus lurches ahead and comes to a screeching halt.") |
650 |
(dun-remove-obj-from-room dun-current-room obj-bus) |
(dun-remove-obj-from-room dun-current-room obj-bus) |
651 |
(setq dun-current-room newroom) |
(setq dun-current-room newroom) |
671 |
(setq dun-current-room old-building-hallway)) |
(setq dun-current-room old-building-hallway)) |
672 |
(if (= dun-current-room north-end-of-cave-passage) |
(if (= dun-current-room north-end-of-cave-passage) |
673 |
(let (combo) |
(let (combo) |
674 |
(dun-mprincl |
(dun-mprincl |
675 |
"You must type a 3 digit combination code to enter this room.") |
"You must type a 3 digit combination code to enter this room.") |
676 |
(dun-mprinc "Enter it here: ") |
(dun-mprinc "Enter it here: ") |
677 |
(setq combo (dun-read-line)) |
(setq combo (dun-read-line)) |
684 |
(if (= dun-current-room bear-hangout) |
(if (= dun-current-room bear-hangout) |
685 |
(if (member obj-bear (nth bear-hangout dun-room-objects)) |
(if (member obj-bear (nth bear-hangout dun-room-objects)) |
686 |
(progn |
(progn |
687 |
(dun-mprinc |
(dun-mprinc |
688 |
"The bear is very annoyed that you would be so presumptuous as to try |
"The bear is very annoyed that you would be so presumptuous as to try |
689 |
and walk right by it. He tells you so by tearing your head off. |
and walk right by it. He tells you so by tearing your head off. |
690 |
") |
") |
721 |
(if (= dun-current-room classroom) |
(if (= dun-current-room classroom) |
722 |
(dun-mprincl "The door is locked.")) |
(dun-mprincl "The door is locked.")) |
723 |
|
|
724 |
(if (or (= dun-current-room lakefront-north) |
(if (or (= dun-current-room lakefront-north) |
725 |
(= dun-current-room lakefront-south)) |
(= dun-current-room lakefront-south)) |
726 |
(dun-swim nil)) |
(dun-swim nil)) |
727 |
|
|
739 |
(setq dun-current-room long-n-s-hallway) |
(setq dun-current-room long-n-s-hallway) |
740 |
(dun-mprincl "You can't go that way."))) |
(dun-mprincl "You can't go that way."))) |
741 |
|
|
742 |
(if (and (> dir down) (> dun-current-room gamma-computing-center) |
(if (and (> dir down) (> dun-current-room gamma-computing-center) |
743 |
(< dun-current-room museum-lobby)) |
(< dun-current-room museum-lobby)) |
744 |
(if (not (member obj-bus (nth dun-current-room dun-room-objects))) |
(if (not (member obj-bus (nth dun-current-room dun-room-objects))) |
745 |
(dun-mprincl "You can't go that way.") |
(dun-mprincl "You can't go that way.") |
749 |
"You are already in the bus!") |
"You are already in the bus!") |
750 |
(if (member obj-license dun-inventory) |
(if (member obj-license dun-inventory) |
751 |
(progn |
(progn |
752 |
(dun-mprincl |
(dun-mprincl |
753 |
"You board the bus and get in the driver's seat.") |
"You board the bus and get in the driver's seat.") |
754 |
(setq dun-nomail t) |
(setq dun-nomail t) |
755 |
(setq dun-inbus t)) |
(setq dun-inbus t)) |
773 |
(dun-mprincl |
(dun-mprincl |
774 |
"As the bus approaches, the gate opens and you drive through.") |
"As the bus approaches, the gate opens and you drive through.") |
775 |
(dun-remove-obj-from-room main-maple-intersection obj-bus) |
(dun-remove-obj-from-room main-maple-intersection obj-bus) |
776 |
(dun-replace dun-room-objects museum-entrance |
(dun-replace dun-room-objects museum-entrance |
777 |
(append (nth museum-entrance dun-room-objects) |
(append (nth museum-entrance dun-room-objects) |
778 |
(list obj-bus))) |
(list obj-bus))) |
779 |
(setq dun-current-room museum-entrance))))) |
(setq dun-current-room museum-entrance))))) |
796 |
(if (not (= objnum obj-dial)) |
(if (not (= objnum obj-dial)) |
797 |
(dun-mprincl "You can't turn that.") |
(dun-mprincl "You can't turn that.") |
798 |
(setq direction (dun-firstword (cdr obj))) |
(setq direction (dun-firstword (cdr obj))) |
799 |
(if (or (not direction) |
(if (or (not direction) |
800 |
(not (or (string= direction "clockwise") |
(not (or (string= direction "clockwise") |
801 |
(string= direction "counterclockwise")))) |
(string= direction "counterclockwise")))) |
802 |
(dun-mprincl "You must indicate clockwise or counterclockwise.") |
(dun-mprincl "You must indicate clockwise or counterclockwise.") |
803 |
(if (string= direction "clockwise") |
(if (string= direction "clockwise") |
804 |
(setq dun-sauna-level (+ dun-sauna-level 1)) |
(setq dun-sauna-level (+ dun-sauna-level 1)) |
805 |
(setq dun-sauna-level (- dun-sauna-level 1))) |
(setq dun-sauna-level (- dun-sauna-level 1))) |
806 |
|
|
807 |
(if (< dun-sauna-level 0) |
(if (< dun-sauna-level 0) |
808 |
(progn |
(progn |
809 |
(dun-mprincl |
(dun-mprincl |
810 |
"The dial will not turn further in that direction.") |
"The dial will not turn further in that direction.") |
811 |
(setq dun-sauna-level 0)) |
(setq dun-sauna-level 0)) |
812 |
(dun-sauna-heat)))))))) |
(dun-sauna-heat)))))))) |
813 |
|
|
814 |
(defun dun-sauna-heat () |
(defun dun-sauna-heat () |
815 |
(if (= dun-sauna-level 0) |
(if (= dun-sauna-level 0) |
816 |
(dun-mprincl |
(dun-mprincl |
817 |
"The temperature has returned to normal room temperature.")) |
"The temperature has returned to normal room temperature.")) |
818 |
(if (= dun-sauna-level 1) |
(if (= dun-sauna-level 1) |
819 |
(dun-mprincl "It is now luke warm in here. You are perspiring.")) |
(dun-mprincl "It is now luke warm in here. You are perspiring.")) |
821 |
(dun-mprincl "It is pretty hot in here. It is still very comfortable.")) |
(dun-mprincl "It is pretty hot in here. It is still very comfortable.")) |
822 |
(if (= dun-sauna-level 3) |
(if (= dun-sauna-level 3) |
823 |
(progn |
(progn |
824 |
(dun-mprincl |
(dun-mprincl |
825 |
"It is now very hot. There is something very refreshing about this.") |
"It is now very hot. There is something very refreshing about this.") |
826 |
(if (or (member obj-rms dun-inventory) |
(if (or (member obj-rms dun-inventory) |
827 |
(member obj-rms (nth dun-current-room dun-room-objects))) |
(member obj-rms (nth dun-current-room dun-room-objects))) |
828 |
(progn |
(progn |
829 |
(dun-mprincl |
(dun-mprincl |
830 |
"You notice the wax on your statuette beginning to melt, until it completely |
"You notice the wax on your statuette beginning to melt, until it completely |
831 |
melts off. You are left with a beautiful diamond!") |
melts off. You are left with a beautiful diamond!") |
832 |
(if (member obj-rms dun-inventory) |
(if (member obj-rms dun-inventory) |
833 |
(progn |
(progn |
834 |
(dun-remove-obj-from-inven obj-rms) |
(dun-remove-obj-from-inven obj-rms) |
835 |
(setq dun-inventory (append dun-inventory |
(setq dun-inventory (append dun-inventory |
836 |
(list obj-diamond)))) |
(list obj-diamond)))) |
837 |
(dun-remove-obj-from-room dun-current-room obj-rms) |
(dun-remove-obj-from-room dun-current-room obj-rms) |
838 |
(dun-replace dun-room-objects dun-current-room |
(dun-replace dun-room-objects dun-current-room |
842 |
(member obj-floppy (nth dun-current-room dun-room-objects))) |
(member obj-floppy (nth dun-current-room dun-room-objects))) |
843 |
(progn |
(progn |
844 |
(dun-mprincl |
(dun-mprincl |
845 |
"You notice your floppy disk beginning to melt. As you grab for it, the |
"You notice your floppy disk beginning to melt. As you grab for it, the |
846 |
disk bursts into flames, and disintegrates.") |
disk bursts into flames, and disintegrates.") |
847 |
(if (member obj-floppy dun-inventory) |
(if (member obj-floppy dun-inventory) |
848 |
(dun-remove-obj-from-inven obj-floppy) |
(dun-remove-obj-from-inven obj-floppy) |
850 |
|
|
851 |
(if (= dun-sauna-level 4) |
(if (= dun-sauna-level 4) |
852 |
(progn |
(progn |
853 |
(dun-mprincl |
(dun-mprincl |
854 |
"As the dial clicks into place, you immediately burst into flames.") |
"As the dial clicks into place, you immediately burst into flames.") |
855 |
(dun-die "burning")))) |
(dun-die "burning")))) |
856 |
|
|
882 |
(dun-mprincl "I see no water!") |
(dun-mprincl "I see no water!") |
883 |
(if (not (member obj-life dun-inventory)) |
(if (not (member obj-life dun-inventory)) |
884 |
(progn |
(progn |
885 |
(dun-mprincl |
(dun-mprincl |
886 |
"You dive in the water, and at first notice it is quite cold. You then |
"You dive in the water, and at first notice it is quite cold. You then |
887 |
start to get used to it as you realize that you never really learned how |
start to get used to it as you realize that you never really learned how |
888 |
to swim.") |
to swim.") |
903 |
(dun-mprinc (dun-endgame-score)) |
(dun-mprinc (dun-endgame-score)) |
904 |
(dun-mprincl " endgame points out of a possible 110.") |
(dun-mprincl " endgame points out of a possible 110.") |
905 |
(if (= (dun-endgame-score) 110) |
(if (= (dun-endgame-score) 110) |
906 |
(dun-mprincl |
(dun-mprincl |
907 |
"\n\nCongratulations. You have won. The wizard password is 'moby'")))) |
"\n\nCongratulations. You have won. The wizard password is 'moby'")))) |
908 |
|
|
909 |
(defun dun-help (args) |
(defun dun-help (args) |
961 |
(dun-mprincl "I'm afraid you don't have to go now.") |
(dun-mprincl "I'm afraid you don't have to go now.") |
962 |
(dun-mprincl "That was refreshing.") |
(dun-mprincl "That was refreshing.") |
963 |
(setq dun-gottago nil) |
(setq dun-gottago nil) |
964 |
(dun-replace dun-room-objects urinal (append |
(dun-replace dun-room-objects urinal (append |
965 |
(nth urinal dun-room-objects) |
(nth urinal dun-room-objects) |
966 |
(list obj-URINE)))))) |
(list obj-URINE)))))) |
967 |
|
|
992 |
the object and slice off your hand. You bleed to death.") |
the object and slice off your hand. You bleed to death.") |
993 |
(dun-die "an axe")) |
(dun-die "an axe")) |
994 |
(if (not (or (member objnum (nth dun-current-room dun-room-objects)) |
(if (not (or (member objnum (nth dun-current-room dun-room-objects)) |
995 |
(member objnum |
(member objnum |
996 |
(nth dun-current-room dun-room-silents)))) |
(nth dun-current-room dun-room-silents)))) |
997 |
(dun-mprincl "I don't see that here.") |
(dun-mprincl "I don't see that here.") |
998 |
(if (= objnum obj-cable) |
(if (= objnum obj-cable) |
999 |
(progn |
(progn |
1000 |
(dun-mprincl |
(dun-mprincl |
1001 |
"As you break the ethernet cable, everything starts to blur. You collapse |
"As you break the ethernet cable, everything starts to blur. You collapse |
1002 |
for a moment, then straighten yourself up. |
for a moment, then straighten yourself up. |
1003 |
") |
") |
1004 |
(dun-replace dun-room-objects gamma-computing-center |
(dun-replace dun-room-objects gamma-computing-center |
1005 |
(append |
(append |
1006 |
(nth gamma-computing-center dun-room-objects) |
(nth gamma-computing-center dun-room-objects) |
1007 |
dun-inventory)) |
dun-inventory)) |
1008 |
(if (member obj-key dun-inventory) |
(if (member obj-key dun-inventory) |
1009 |
(progn |
(progn |
1010 |
(setq dun-inventory (list obj-key)) |
(setq dun-inventory (list obj-key)) |
1011 |
(dun-remove-obj-from-room |
(dun-remove-obj-from-room |
1012 |
gamma-computing-center obj-key)) |
gamma-computing-center obj-key)) |
1013 |
(setq dun-inventory nil)) |
(setq dun-inventory nil)) |
1014 |
(setq dun-current-room computer-room) |
(setq dun-current-room computer-room) |
1070 |
(setq newques nil) |
(setq newques nil) |
1071 |
(setq which (random (length dun-endgame-questions))) |
(setq which (random (length dun-endgame-questions))) |
1072 |
(dun-mprincl "Your question is:") |
(dun-mprincl "Your question is:") |
1073 |
(dun-mprincl (setq dun-endgame-question (car |
(dun-mprincl (setq dun-endgame-question (car |
1074 |
(nth which |
(nth which |
1075 |
dun-endgame-questions)))) |
dun-endgame-questions)))) |
1076 |
(setq dun-correct-answer (cdr (nth which dun-endgame-questions))) |
(setq dun-correct-answer (cdr (nth which dun-endgame-questions))) |
1077 |
(while (< i which) |
(while (< i which) |
1093 |
(defun dun-feed (args) |
(defun dun-feed (args) |
1094 |
(let (objnum) |
(let (objnum) |
1095 |
(when (setq objnum (dun-objnum-from-args-std args)) |
(when (setq objnum (dun-objnum-from-args-std args)) |
1096 |
(if (and (= objnum obj-bear) |
(if (and (= objnum obj-bear) |
1097 |
(member obj-bear (nth dun-current-room dun-room-objects))) |
(member obj-bear (nth dun-current-room dun-room-objects))) |
1098 |
(progn |
(progn |
1099 |
(if (not (member obj-food dun-inventory)) |
(if (not (member obj-food dun-inventory)) |
1135 |
(while (setq end-pos (string-match "[ ,:;]" (substring strin pos))) |
(while (setq end-pos (string-match "[ ,:;]" (substring strin pos))) |
1136 |
(setq end-pos (+ end-pos pos)) |
(setq end-pos (+ end-pos pos)) |
1137 |
(if (not (= end-pos pos)) |
(if (not (= end-pos pos)) |
1138 |
(setq ret-list (append ret-list (list |
(setq ret-list (append ret-list (list |
1139 |
(downcase |
(downcase |
1140 |
(substring strin pos end-pos)))))) |
(substring strin pos end-pos)))))) |
1141 |
(setq pos (+ end-pos 1))) ret-list)) |
(setq pos (+ end-pos 1))) ret-list)) |
1147 |
(while (setq end-pos (string-match " " (substring strin pos))) |
(while (setq end-pos (string-match " " (substring strin pos))) |
1148 |
(setq end-pos (+ end-pos pos)) |
(setq end-pos (+ end-pos pos)) |
1149 |
(if (not (= end-pos pos)) |
(if (not (= end-pos pos)) |
1150 |
(setq ret-list (append ret-list (list |
(setq ret-list (append ret-list (list |
1151 |
(downcase |
(downcase |
1152 |
(substring strin pos end-pos)))))) |
(substring strin pos end-pos)))))) |
1153 |
(setq pos (+ end-pos 1))) ret-list)) |
(setq pos (+ end-pos 1))) ret-list)) |
1344 |
(aset dun-translate-table (+ ?a i) (aref lower (+ i 13))) |
(aset dun-translate-table (+ ?a i) (aref lower (+ i 13))) |
1345 |
(aset dun-translate-table (+ ?A i) (aref upper (+ i 13))) |
(aset dun-translate-table (+ ?A i) (aref upper (+ i 13))) |
1346 |
(setq i (1+ i)))) |
(setq i (1+ i)))) |
1347 |
|
|
1348 |
(defun dun-rot13 () |
(defun dun-rot13 () |
1349 |
(let (str len (i 0)) |
(let (str len (i 0)) |
1350 |
(setq str (buffer-substring (point-min) (point-max))) |
(setq str (buffer-substring (point-min) (point-max))) |
1396 |
(setq dun-endgame-question nil) |
(setq dun-endgame-question nil) |
1397 |
(setq dun-logged-in nil) |
(setq dun-logged-in nil) |
1398 |
(setq dungeon-mode 'dungeon) |
(setq dungeon-mode 'dungeon) |
1399 |
(setq dun-unix-verbs '((ls . dun-ls) (ftp . dun-ftp) (echo . dun-echo) |
(setq dun-unix-verbs '((ls . dun-ls) (ftp . dun-ftp) (echo . dun-echo) |
1400 |
(exit . dun-uexit) (cd . dun-cd) (pwd . dun-pwd) |
(exit . dun-uexit) (cd . dun-cd) (pwd . dun-pwd) |
1401 |
(rlogin . dun-rlogin) (uncompress . dun-uncompress) |
(rlogin . dun-rlogin) (uncompress . dun-uncompress) |
1402 |
(cat . dun-cat) (zippy . dun-zippy))) |
(cat . dun-cat) (zippy . dun-zippy))) |
1413 |
(setq dun-cdroom -10) |
(setq dun-cdroom -10) |
1414 |
(setq dun-uncompressed nil) |
(setq dun-uncompressed nil) |
1415 |
(setq dun-ethernet t) |
(setq dun-ethernet t) |
1416 |
(setq dun-restricted |
(setq dun-restricted |
1417 |
'(dun-room-objects dungeon-map dun-rooms |
'(dun-room-objects dungeon-map dun-rooms |
1418 |
dun-room-silents dun-combination)) |
dun-room-silents dun-combination)) |
1419 |
(setq dun-ftptype 'ascii) |
(setq dun-ftptype 'ascii) |
1420 |
(setq dun-endgame nil) |
(setq dun-endgame nil) |
1825 |
( |
( |
1826 |
"You are in the main lobby for the Museum of Natural History. In the center |
"You are in the main lobby for the Museum of Natural History. In the center |
1827 |
of the room is the huge skeleton of a dinosaur. Doors lead out to the |
of the room is the huge skeleton of a dinosaur. Doors lead out to the |
1828 |
south and east." |
south and east." |
1829 |
"Museum lobby" ;84 |
"Museum lobby" ;84 |
1830 |
) |
) |
1831 |
( |
( |
1832 |
"You are in the geological display. All of the objects that used to |
"You are in the geological display. All of the objects that used to |
1833 |
be on display are missing. There are rooms to the east, west, and |
be on display are missing. There are rooms to the east, west, and |
1834 |
north." |
north." |
1835 |
"Geological display" ;85 |
"Geological display" ;85 |
1836 |
) |
) |
1924 |
( |
( |
1925 |
"You have reached a dead end. There is a PC on the floor here. Above |
"You have reached a dead end. There is a PC on the floor here. Above |
1926 |
it is a sign that reads: |
it is a sign that reads: |
1927 |
Type the 'reset' command to type on the PC. |
Type the 'reset' command to type on the PC. |
1928 |
A hole leads north." |
A hole leads north." |
1929 |
"PC area" ;104 |
"PC area" ;104 |
1930 |
) |
) |
1931 |
)) |
)) |
1932 |
|
|
1933 |
(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 |
(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 |
1934 |
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
1935 |
77 78 79 80 81 82 83)) |
77 78 79 80 81 82 83)) |
1936 |
|
|
1937 |
(setq dun-verblist '((die . dun-die) (ne . dun-ne) (north . dun-n) |
(setq dun-verblist '((die . dun-die) (ne . dun-ne) (north . dun-n) |
1938 |
(south . dun-s) (east . dun-e) (west . dun-w) |
(south . dun-s) (east . dun-e) (west . dun-w) |
1939 |
(u . dun-up) (d . dun-down) (i . dun-inven) |
(u . dun-up) (d . dun-down) (i . dun-inven) |
1940 |
(inventory . dun-inven) (look . dun-examine) (n . dun-n) |
(inventory . dun-inven) (look . dun-examine) (n . dun-n) |
1941 |
(s . dun-s) (e . dun-e) (w . dun-w) (se . dun-se) |
(s . dun-s) (e . dun-e) (w . dun-w) (se . dun-se) |
1942 |
(nw . dun-nw) (sw . dun-sw) (up . dun-up) |
(nw . dun-nw) (sw . dun-sw) (up . dun-up) |
1943 |
(down . dun-down) (in . dun-in) (out . dun-out) |
(down . dun-down) (in . dun-in) (out . dun-out) |
1944 |
(go . dun-go) (drop . dun-drop) (southeast . dun-se) |
(go . dun-go) (drop . dun-drop) (southeast . dun-se) |
1945 |
(southwest . dun-sw) (northeast . dun-ne) |
(southwest . dun-sw) (northeast . dun-ne) |
1946 |
(northwest . dun-nw) (save . dun-save-game) |
(northwest . dun-nw) (save . dun-save-game) |
1947 |
(restore . dun-restore) (long . dun-long) (dig . dun-dig) |
(restore . dun-restore) (long . dun-long) (dig . dun-dig) |
1948 |
(shake . dun-shake) (wave . dun-shake) |
(shake . dun-shake) (wave . dun-shake) |
1949 |
(examine . dun-examine) (describe . dun-examine) |
(examine . dun-examine) (describe . dun-examine) |
1950 |
(climb . dun-climb) (eat . dun-eat) (put . dun-put) |
(climb . dun-climb) (eat . dun-eat) (put . dun-put) |
1951 |
(type . dun-type) (insert . dun-put) |
(type . dun-type) (insert . dun-put) |
1952 |
(score . dun-score) (help . dun-help) (quit . dun-quit) |
(score . dun-score) (help . dun-help) (quit . dun-quit) |
1953 |
(read . dun-examine) (verbose . dun-long) |
(read . dun-examine) (verbose . dun-long) |
1954 |
(urinate . dun-piss) (piss . dun-piss) |
(urinate . dun-piss) (piss . dun-piss) |
1955 |
(flush . dun-flush) (sleep . dun-sleep) (lie . dun-sleep) |
(flush . dun-flush) (sleep . dun-sleep) (lie . dun-sleep) |
1956 |
(x . dun-examine) (break . dun-break) (drive . dun-drive) |
(x . dun-examine) (break . dun-break) (drive . dun-drive) |
1957 |
(board . dun-in) (enter . dun-in) (turn . dun-turn) |
(board . dun-in) (enter . dun-in) (turn . dun-turn) |
1958 |
(press . dun-press) (push . dun-press) (swim . dun-swim) |
(press . dun-press) (push . dun-press) (swim . dun-swim) |
2096 |
|
|
2097 |
;;; How the user references *all* objects, permanent and regular. |
;;; How the user references *all* objects, permanent and regular. |
2098 |
(setq dun-objnames '( |
(setq dun-objnames '( |
2099 |
(shovel . 0) |
(shovel . 0) |
2100 |
(lamp . 1) |
(lamp . 1) |
2101 |
(cpu . 2) (board . 2) (card . 2) (chip . 2) |
(cpu . 2) (board . 2) (card . 2) (chip . 2) |
2102 |
(food . 3) |
(food . 3) |
2103 |
(key . 4) |
(key . 4) |
2104 |
(paper . 5) (slip . 5) |
(paper . 5) (slip . 5) |
2105 |
(rms . 6) (statue . 6) (statuette . 6) (stallman . 6) |
(rms . 6) (statue . 6) (statuette . 6) (stallman . 6) |
2106 |
(diamond . 7) |
(diamond . 7) |
2107 |
(weight . 8) |
(weight . 8) |
2108 |
(life . 9) (preserver . 9) |
(life . 9) (preserver . 9) |
2109 |
(bracelet . 10) (emerald . 10) |
(bracelet . 10) (emerald . 10) |
2110 |
(gold . 11) |
(gold . 11) |
2111 |
(platinum . 12) |
(platinum . 12) |
2112 |
(towel . 13) (beach . 13) |
(towel . 13) (beach . 13) |
2120 |
(acid . 21) (nitric . 21) |
(acid . 21) (nitric . 21) |
2121 |
(glycerine . 22) |
(glycerine . 22) |
2122 |
(ruby . 23) |
(ruby . 23) |
2123 |
(amethyst . 24) |
(amethyst . 24) |
2124 |
(mona . 25) |
(mona . 25) |
2125 |
(bill . 26) |
(bill . 26) |
2126 |
(floppy . 27) (disk . 27) |
(floppy . 27) (disk . 27) |
2127 |
|
|
2128 |
(boulder . -1) |
(boulder . -1) |
2129 |
(tree . -2) (trees . -2) (palm . -2) |
(tree . -2) (trees . -2) (palm . -2) |
2130 |
(bear . -3) |
(bear . -3) |
2131 |
(bin . -4) (bins . -4) |
(bin . -4) (bins . -4) |
2132 |
(cabinet . -5) (computer . -5) (vax . -5) (ibm . -5) |
(cabinet . -5) (computer . -5) (vax . -5) (ibm . -5) |
2133 |
(protoplasm . -6) |
(protoplasm . -6) |
2134 |
(dial . -7) |
(dial . -7) |
2135 |
(button . -8) |
(button . -8) |
2136 |
(chute . -9) |
(chute . -9) |
2137 |
(painting . -10) |
(painting . -10) |
2138 |
(bed . -11) |
(bed . -11) |
2139 |
(urinal . -12) |
(urinal . -12) |
2140 |
(URINE . -13) |
(URINE . -13) |
2141 |
(pipes . -14) (pipe . -14) |
(pipes . -14) (pipe . -14) |
2142 |
(box . -15) (slit . -15) |
(box . -15) (slit . -15) |
2143 |
(cable . -16) (ethernet . -16) |
(cable . -16) (ethernet . -16) |
2144 |
(mail . -17) (drop . -17) |
(mail . -17) (drop . -17) |
2145 |
(bus . -18) |
(bus . -18) |
2146 |
(gate . -19) |
(gate . -19) |
2147 |
(cliff . -20) |
(cliff . -20) |
2148 |
(skeleton . -21) (dinosaur . -21) |
(skeleton . -21) (dinosaur . -21) |
2149 |
(fish . -22) |
(fish . -22) |
2150 |
(tanks . -23) (tank . -23) |
(tanks . -23) (tank . -23) |
2152 |
(blackboard . -25) |
(blackboard . -25) |
2153 |
(disposal . -26) (garbage . -26) |
(disposal . -26) (garbage . -26) |
2154 |
(ladder . -27) |
(ladder . -27) |
2155 |
(subway . -28) (train . -28) |
(subway . -28) (train . -28) |
2156 |
(pc . -29) (drive . -29) (coconut . -30) (coconuts . -30) |
(pc . -29) (drive . -29) (coconut . -30) (coconuts . -30) |
2157 |
(lake . -32) (water . -32) |
(lake . -32) (water . -32) |
2158 |
)) |
)) |
2169 |
;;; Objects that cannot be taken but might move and are |
;;; Objects that cannot be taken but might move and are |
2170 |
;;; described during room description are negative. |
;;; described during room description are negative. |
2171 |
;;; Stuff that is described and might change are 255, and are |
;;; Stuff that is described and might change are 255, and are |
2172 |
;;; handled specially by 'dun-describe-room. |
;;; handled specially by 'dun-describe-room. |
2173 |
|
|
2174 |
(setq dun-room-objects (list nil |
(setq dun-room-objects (list nil |
2175 |
|
|
2176 |
(list obj-shovel) ;; treasure-room |
(list obj-shovel) ;; treasure-room |
2177 |
(list obj-boulder) ;; dead-end |
(list obj-boulder) ;; dead-end |
2183 |
(list obj-lamp obj-license obj-silver);; meadow |
(list obj-lamp obj-license obj-silver);; meadow |
2184 |
nil nil |
nil nil |
2185 |
(list obj-special) ;; sauna |
(list obj-special) ;; sauna |
2186 |
nil |
nil |
2187 |
(list obj-weight obj-life) ;; weight-room |
(list obj-weight obj-life) ;; weight-room |
2188 |
nil nil |
nil nil |
2189 |
(list obj-rms obj-floppy) ;; thirsty-maze |
(list obj-rms obj-floppy) ;; thirsty-maze |
2190 |
nil nil nil nil nil nil nil |
nil nil nil nil nil nil nil |
2191 |
(list obj-emerald) ;; hidden-area |
(list obj-emerald) ;; hidden-area |
2192 |
nil |
nil |
2193 |
(list obj-gold) ;; misty-room |
(list obj-gold) ;; misty-room |
2268 |
(list obj-disposal) ;; north-end-of-n-s-tunnel |
(list obj-disposal) ;; north-end-of-n-s-tunnel |
2269 |
nil nil |
nil nil |
2270 |
(list obj-computer) ;; endgame-computer-room |
(list obj-computer) ;; endgame-computer-room |
2271 |
nil nil nil nil nil nil nil nil |
nil nil nil nil nil nil nil nil |
2272 |
(list obj-pc) ;; pc-area |
(list obj-pc) ;; pc-area |
2273 |
nil nil nil nil nil nil |
nil nil nil nil nil nil |
2274 |
)) |
)) |
2312 |
|
|
2313 |
;;; Weight of objects |
;;; Weight of objects |
2314 |
|
|
2315 |
(setq dun-object-lbs |
(setq dun-object-lbs |
2316 |
'(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)) |
'(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)) |
2317 |
(setq dun-object-pts |
(setq dun-object-pts |
2318 |
'(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)) |
'(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)) |
2319 |
|
|
2320 |
|
|
2384 |
"It has your picture on it!" |
"It has your picture on it!" |
2385 |
"They are old coins from the 19th century." |
"They are old coins from the 19th century." |
2386 |
"It is a valuable Fabrege egg." |
"It is a valuable Fabrege egg." |
2387 |
"It is a a plain glass jar." |
"It is a plain glass jar." |
2388 |
nil |
nil |
2389 |
nil |
nil |
2390 |
nil |
nil |
2420 |
"The urinal is very clean compared with everything else in the cave. There |
"The urinal is very clean compared with everything else in the cave. There |
2421 |
isn't even any rust. Upon close examination you realize that the drain at the |
isn't even any rust. Upon close examination you realize that the drain at the |
2422 |
bottom is missing, and there is just a large hole leading down the |
bottom is missing, and there is just a large hole leading down the |
2423 |
pipes into nowhere. The hole is too small for a person to fit in. The |
pipes into nowhere. The hole is too small for a person to fit in. The |
2424 |
flush handle is so clean that you can see your reflection in it." |
flush handle is so clean that you can see your reflection in it." |
2425 |
nil |
nil |
2426 |
nil |
nil |
2444 |
) |
) |
2445 |
) |
) |
2446 |
|
|
2447 |
(setq dun-diggables |
(setq dun-diggables |
2448 |
(list nil nil nil (list obj-cpu) nil nil nil nil nil nil nil |
(list nil nil nil (list obj-cpu) nil nil nil nil nil nil nil |
2449 |
nil nil nil nil nil nil nil nil nil nil ;11-20 |
nil nil nil nil nil nil nil nil nil nil ;11-20 |
2450 |
nil nil nil nil nil nil nil nil nil nil ;21-30 |
nil nil nil nil nil nil nil nil nil nil ;21-30 |
2453 |
|
|
2454 |
(setq dun-room-shorts nil) |
(setq dun-room-shorts nil) |
2455 |
(dolist (x dun-rooms) |
(dolist (x dun-rooms) |
2456 |
(setq dun-room-shorts |
(setq dun-room-shorts |
2457 |
(append dun-room-shorts (list (downcase |
(append dun-room-shorts (list (downcase |
2458 |
(dun-space-to-hyphen |
(dun-space-to-hyphen |
2459 |
(cadr x))))))) |
(cadr x))))))) |
2460 |
|
|
2526 |
(if (eq (dun-parse2 nil dun-unix-verbs line) -1) |
(if (eq (dun-parse2 nil dun-unix-verbs line) -1) |
2527 |
(progn |
(progn |
2528 |
(if (setq esign (string-match "=" line)) |
(if (setq esign (string-match "=" line)) |
2529 |
(dun-doassign line esign) |
(dun-doassign line esign) |
2530 |
(dun-mprinc (car line-list)) |
(dun-mprinc (car line-list)) |
2531 |
(dun-mprincl ": not found."))))) |
(dun-mprincl ": not found."))))) |
2532 |
(goto-char (point-max)) |
(goto-char (point-max)) |
2559 |
(setq epoint (+ |
(setq epoint (+ |
2560 |
(string-match "\"" afterq) |
(string-match "\"" afterq) |
2561 |
(+ esign 3)))) |
(+ esign 3)))) |
2562 |
|
|
2563 |
(if (not (setq epoint (string-match " " line))) |
(if (not (setq epoint (string-match " " line))) |
2564 |
(setq epoint (length line)))) |
(setq epoint (length line)))) |
2565 |
(setq epoint (1+ epoint)) |
(setq epoint (1+ epoint)) |
2587 |
(switch-to-buffer "*dungeon*") |
(switch-to-buffer "*dungeon*") |
2588 |
(if eval-error |
(if eval-error |
2589 |
(dun-mprincl "Invalid syntax.")))) |
(dun-mprincl "Invalid syntax.")))) |
2590 |
|
|
2591 |
|
|
2592 |
(defun dun-unix-interface () |
(defun dun-unix-interface () |
2593 |
(dun-login) |
(dun-login) |
2691 |
(dun-mprincl |
(dun-mprincl |
2692 |
"-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 paper.o.Z")) |
"-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 paper.o.Z")) |
2693 |
(dolist (x dun-inventory) |
(dolist (x dun-inventory) |
2694 |
(dun-mprinc |
(dun-mprinc |
2695 |
"-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 ") |
"-rwxr-xr-x 1 toukmond restricted 0 Jan 1 1970 ") |
2696 |
(dun-mprincl (nth x dun-objfiles)))) |
(dun-mprincl (nth x dun-objfiles)))) |
2697 |
|
|
2740 |
(if dun-batch-mode |
(if dun-batch-mode |
2741 |
(dun-mprincl |
(dun-mprincl |
2742 |
"Guest login okay, send your user ident as password.") |
"Guest login okay, send your user ident as password.") |
2743 |
(dun-mprincl |
(dun-mprincl |
2744 |
"\nGuest login okay, send your user ident as password.")) |
"\nGuest login okay, send your user ident as password.")) |
2745 |
(if dun-batch-mode |
(if dun-batch-mode |
2746 |
(dun-mprinc "Password required for ") |
(dun-mprinc "Password required for ") |
2753 |
(dun-mprincl "Login failed.") |
(dun-mprincl "Login failed.") |
2754 |
(dun-mprincl "\nLogin failed.")) |
(dun-mprincl "\nLogin failed.")) |
2755 |
(if dun-batch-mode |
(if dun-batch-mode |
2756 |
(dun-mprincl |
(dun-mprincl |
2757 |
"Guest login okay, user access restrictions apply.") |
"Guest login okay, user access restrictions apply.") |
2758 |
(dun-mprincl |
(dun-mprincl |
2759 |
"\nGuest login okay, user access restrictions apply.")) |
"\nGuest login okay, user access restrictions apply.")) |
2760 |
(dun-ftp-commands) |
(dun-ftp-commands) |
2761 |
(setq newlist |
(setq newlist |
2762 |
'("What password did you use during anonymous ftp to gamma?")) |
'("What password did you use during anonymous ftp to gamma?")) |
2763 |
(setq newlist (append newlist (list ident))) |
(setq newlist (append newlist (list ident))) |
2764 |
(rplaca (nthcdr 1 dun-endgame-questions) newlist))))))))) |
(rplaca (nthcdr 1 dun-endgame-questions) newlist))))))))) |
2765 |
|
|
2766 |
(defun dun-ftp-commands () |
(defun dun-ftp-commands () |
2767 |
(setq dun-exitf nil) |
(setq dun-exitf nil) |
2768 |
(let (line) |
(let (line) |
2769 |
(while (not dun-exitf) |
(while (not dun-exitf) |
2770 |
(dun-mprinc "ftp> ") |
(dun-mprinc "ftp> ") |
2771 |
(setq line (dun-read-line)) |
(setq line (dun-read-line)) |
2772 |
(if |
(if |
2773 |
(eq |
(eq |
2774 |
(dun-parse2 nil |
(dun-parse2 nil |
2775 |
'((type . dun-ftptype) (binary . dun-bin) (bin . dun-bin) |
'((type . dun-ftptype) (binary . dun-bin) (bin . dun-bin) |
2776 |
(send . dun-send) (put . dun-send) (quit . dun-ftpquit) |
(send . dun-send) (put . dun-send) (quit . dun-ftpquit) |
2777 |
(help . dun-ftphelp)(ascii . dun-fascii) |
(help . dun-ftphelp)(ascii . dun-fascii) |
2836 |
(if (not (eq dun-ftptype 'binary)) |
(if (not (eq dun-ftptype 'binary)) |
2837 |
(progn |
(progn |
2838 |
(if (not (member obj-protoplasm |
(if (not (member obj-protoplasm |
2839 |
(nth receiving-room |
(nth receiving-room |
2840 |
dun-room-objects))) |
dun-room-objects))) |
2841 |
(dun-replace dun-room-objects receiving-room |
(dun-replace dun-room-objects receiving-room |
2842 |
(append (nth receiving-room |
(append (nth receiving-room |
2843 |
dun-room-objects) |
dun-room-objects) |
2844 |
(list obj-protoplasm)))) |
(list obj-protoplasm)))) |
2845 |
(dun-remove-obj-from-inven counter)) |
(dun-remove-obj-from-inven counter)) |
2854 |
(dun-mprincl "No such file.")))))) |
(dun-mprincl "No such file.")))))) |
2855 |
|
|
2856 |
(defun dun-ftphelp (args) |
(defun dun-ftphelp (args) |
2857 |
(dun-mprincl |
(dun-mprincl |
2858 |
"Possible commands are:\nsend quit type ascii binary help")) |
"Possible commands are:\nsend quit type ascii binary help")) |
2859 |
|
|
2860 |
(defun dun-uexit (args) |
(defun dun-uexit (args) |
2895 |
(setq passwd (dun-read-line)) |
(setq passwd (dun-read-line)) |
2896 |
(if (not (string= passwd "worms")) |
(if (not (string= passwd "worms")) |
2897 |
(dun-mprincl "\nlogin incorrect") |
(dun-mprincl "\nlogin incorrect") |
2898 |
(dun-mprinc |
(dun-mprinc |
2899 |
"\nYou begin to feel strange for a moment, and you lose your items." |
"\nYou begin to feel strange for a moment, and you lose your items." |
2900 |
) |
) |
2901 |
(dun-replace dun-room-objects computer-room |
(dun-replace dun-room-objects computer-room |
2902 |
(append (nth computer-room dun-room-objects) |
(append (nth computer-room dun-room-objects) |
2903 |
dun-inventory)) |
dun-inventory)) |
2904 |
(setq dun-inventory nil) |
(setq dun-inventory nil) |
2905 |
(setq dun-current-room receiving-room) |
(setq dun-current-room receiving-room) |
2906 |
(dun-uexit nil)))))))) |
(dun-uexit nil)))))))) |
2907 |
|
|
2908 |
(defun dun-cd (args) |
(defun dun-cd (args) |
2909 |
(let (tcdpath tcdroom path-elements room-check) |
(let (tcdpath tcdroom path-elements room-check) |
2910 |
(if (not (car args)) |
(if (not (car args)) |
2926 |
(setq tcdpath "/rooms") |
(setq tcdpath "/rooms") |
2927 |
(setq tcdroom -2)) |
(setq tcdroom -2)) |
2928 |
;In /rooms,/usr,root |
;In /rooms,/usr,root |
2929 |
(if (or |
(if (or |
2930 |
(= tcdroom -2) (= tcdroom -4) |
(= tcdroom -2) (= tcdroom -4) |
2931 |
(= tcdroom -3)) |
(= tcdroom -3)) |
2932 |
(progn |
(progn |
2933 |
(setq tcdpath "/") |
(setq tcdpath "/") |
2964 |
(if (= tcdroom -2) |
(if (= tcdroom -2) |
2965 |
(progn |
(progn |
2966 |
(dolist (x dun-visited) |
(dolist (x dun-visited) |
2967 |
(setq room-check |
(setq room-check |
2968 |
(nth x |
(nth x |
2969 |
dun-room-shorts)) |
dun-room-shorts)) |
2970 |
(if (string= room-check pe) |
(if (string= room-check pe) |
2971 |
(progn |
(progn |
2972 |
(setq tcdpath |
(setq tcdpath |
2973 |
(concat "/rooms/" room-check)) |
(concat "/rooms/" room-check)) |
2974 |
(setq tcdroom x)))) |
(setq tcdroom x)))) |
2975 |
(if (= tcdroom -2) |
(if (= tcdroom -2) |
2998 |
(if (= dun-cdroom -10) |
(if (= dun-cdroom -10) |
2999 |
(setq checklist dun-inventory) |
(setq checklist dun-inventory) |
3000 |
(setq checklist (nth dun-cdroom dun-room-objects))) |
(setq checklist (nth dun-cdroom dun-room-objects))) |
3001 |
(if (not (member (cdr |
(if (not (member (cdr |
3002 |
(assq (intern |
(assq (intern |
3003 |
(substring args 0 doto)) |
(substring args 0 doto)) |
3004 |
dun-objnames)) |
dun-objnames)) |
3005 |
checklist)) |
checklist)) |
3006 |
(dun-mprincl "File not found.") |
(dun-mprincl "File not found.") |
3008 |
(if (assq (intern args) dun-unix-verbs) |
(if (assq (intern args) dun-unix-verbs) |
3009 |
(dun-mprincl "Ascii files only.") |
(dun-mprincl "Ascii files only.") |
3010 |
(dun-mprincl "File not found.")))))))) |
(dun-mprincl "File not found.")))))))) |
3011 |
|
|
3012 |
(defun dun-zippy (args) |
(defun dun-zippy (args) |
3013 |
(dun-mprincl (yow))) |
(dun-mprincl (yow))) |
3014 |
|
|
3015 |
(defun dun-rlogin-endgame () |
(defun dun-rlogin-endgame () |
3016 |
(if (not (= (dun-score nil) 90)) |
(if (not (= (dun-score nil) 90)) |
3017 |
(dun-mprincl |
(dun-mprincl |
3018 |
"You have not achieved enough points to connect to endgame.") |
"You have not achieved enough points to connect to endgame.") |
3019 |
(dun-mprincl"\nWelcome to the endgame. You are a truly noble adventurer.") |
(dun-mprincl"\nWelcome to the endgame. You are a truly noble adventurer.") |
3020 |
(setq dun-current-room treasure-room) |
(setq dun-current-room treasure-room) |
3025 |
|
|
3026 |
(random t) |
(random t) |
3027 |
(setq tloc (+ 60 (random 18))) |
(setq tloc (+ 60 (random 18))) |
3028 |
(dun-replace dun-room-objects tloc |
(dun-replace dun-room-objects tloc |
3029 |
(append (nth tloc dun-room-objects) (list 18))) |
(append (nth tloc dun-room-objects) (list 18))) |
3030 |
|
|
3031 |
(setq tcomb (+ 100 (random 899))) |
(setq tcomb (+ 100 (random 899))) |
3081 |
(sleep-for 1) |
(sleep-for 1) |
3082 |
(if (or (not (setq args (car args))) (string= args "\\")) |
(if (or (not (setq args (car args))) (string= args "\\")) |
3083 |
(dun-mprincl " |
(dun-mprincl " |
3084 |
Volume in drive A is FOO |
Volume in drive A is FOO |
3085 |
Volume Serial Number is 1A16-08C9 |
Volume Serial Number is 1A16-08C9 |
3086 |
Directory of A:\\ |
Directory of A:\\ |
3087 |
|
|
3091 |
1065280 bytes free |
1065280 bytes free |
3092 |
") |
") |
3093 |
(dun-mprincl " |
(dun-mprincl " |
3094 |
Volume in drive A is FOO |
Volume in drive A is FOO |
3095 |
Volume Serial Number is 1A16-08C9 |
Volume Serial Number is 1A16-08C9 |
3096 |
Directory of A:\\ |
Directory of A:\\ |
3097 |
|
|
3200 |
(error (setq ferror t))) |
(error (setq ferror t))) |
3201 |
(kill-buffer (current-buffer)) |
(kill-buffer (current-buffer)) |
3202 |
ferror)) |
ferror)) |
3203 |
|
|
3204 |
|
|
3205 |
(defun dun-save-val (varname) |
(defun dun-save-val (varname) |
3206 |
(let (value) |
(let (value) |
3338 |
(if (eq (dun-parse2 nil dun-unix-verbs line) -1) |
(if (eq (dun-parse2 nil dun-unix-verbs line) -1) |
3339 |
(let (esign) |
(let (esign) |
3340 |
(if (setq esign (string-match "=" line)) |
(if (setq esign (string-match "=" line)) |
3341 |
(dun-doassign line esign) |
(dun-doassign line esign) |
3342 |
(dun-mprinc (car line-list)) |
(dun-mprinc (car line-list)) |
3343 |
(dun-mprincl ": not found."))))) |
(dun-mprincl ": not found."))))) |
3344 |
(goto-char (point-max)) |
(goto-char (point-max)) |