aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/play/dunnet.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/play/dunnet.el')
-rw-r--r--lisp/play/dunnet.el119
1 files changed, 58 insertions, 61 deletions
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index 8ed0bb3bbb4..981b8464aaa 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -1,6 +1,6 @@
1;;; dunnet.el --- text adventure for Emacs 1;;; dunnet.el --- text adventure for Emacs
2 2
3;; Copyright (C) 1992-1993, 2001-2016 Free Software Foundation, Inc. 3;; Copyright (C) 1992-1993, 2001-2017 Free Software Foundation, Inc.
4 4
5;; Author: Ron Schnell <ronnie@driver-aces.com> 5;; Author: Ron Schnell <ronnie@driver-aces.com>
6;; Created: 25 Jul 1992 6;; Created: 25 Jul 1992
@@ -50,7 +50,7 @@
50 (make-local-variable 'scroll-step) 50 (make-local-variable 'scroll-step)
51 (setq scroll-step 2)) 51 (setq scroll-step 2))
52 52
53(defun dun-parse (arg) 53(defun dun-parse (_arg)
54 "Function called when return is pressed in interactive mode to parse line." 54 "Function called when return is pressed in interactive mode to parse line."
55 (interactive "*p") 55 (interactive "*p")
56 (beginning-of-line) 56 (beginning-of-line)
@@ -210,13 +210,13 @@ disk bursts into flames, and disintegrates.")
210 (dun-score nil) 210 (dun-score nil)
211 (setq dun-dead t)) 211 (setq dun-dead t))
212 212
213(defun dun-quit (args) 213(defun dun-quit (_args)
214 (dun-die nil)) 214 (dun-die nil))
215 215
216;;; Print every object in player's inventory. Special case for the jar, 216;;; Print every object in player's inventory. Special case for the jar,
217;;; as we must also print what is in it. 217;;; as we must also print what is in it.
218 218
219(defun dun-inven (args) 219(defun dun-inven (_args)
220 (dun-mprinc "You currently have:") 220 (dun-mprinc "You currently have:")
221 (dun-mprinc "\n") 221 (dun-mprinc "\n")
222 (dolist (curobj dun-inventory) 222 (dolist (curobj dun-inventory)
@@ -265,7 +265,7 @@ on your head.")
265(defun dun-drop (obj) 265(defun dun-drop (obj)
266 (if dun-inbus 266 (if dun-inbus
267 (dun-mprincl "You can't drop anything while on the bus.") 267 (dun-mprincl "You can't drop anything while on the bus.")
268 (let (objnum ptr) 268 (let (objnum)
269 (when (setq objnum (dun-objnum-from-args-std obj)) 269 (when (setq objnum (dun-objnum-from-args-std obj))
270 (if (not (setq ptr (member objnum dun-inventory))) 270 (if (not (setq ptr (member objnum dun-inventory)))
271 (dun-mprincl "You don't have that.") 271 (dun-mprincl "You don't have that.")
@@ -412,10 +412,10 @@ For an explosive time, go to Fourth St. and Vermont.")
412;;; We try to take an object that is untakable. Print a message 412;;; We try to take an object that is untakable. Print a message
413;;; depending on what it is. 413;;; depending on what it is.
414 414
415(defun dun-try-take (obj) 415(defun dun-try-take (_obj)
416 (dun-mprinc "You cannot take that.")) 416 (dun-mprinc "You cannot take that."))
417 417
418(defun dun-dig (args) 418(defun dun-dig (_args)
419 (if dun-inbus 419 (if dun-inbus
420 (dun-mprincl "Digging here reveals nothing.") 420 (dun-mprincl "Digging here reveals nothing.")
421 (if (not (member 0 dun-inventory)) 421 (if (not (member 0 dun-inventory))
@@ -557,7 +557,7 @@ with a bang. The key seems to have vanished!")
557just try dropping it.") 557just try dropping it.")
558 (dun-mprincl"You can't put that there."))))))))))) 558 (dun-mprincl"You can't put that there.")))))))))))
559 559
560(defun dun-type (args) 560(defun dun-type (_args)
561 (if (not (= dun-current-room computer-room)) 561 (if (not (= dun-current-room computer-room))
562 (dun-mprincl "There is nothing here on which you could type.") 562 (dun-mprincl "There is nothing here on which you could type.")
563 (if (not dun-computer) 563 (if (not dun-computer)
@@ -567,40 +567,40 @@ just try dropping it.")
567 567
568;;; Various movement directions 568;;; Various movement directions
569 569
570(defun dun-n (args) 570(defun dun-n (_args)
571 (dun-move north)) 571 (dun-move north))
572 572
573(defun dun-s (args) 573(defun dun-s (_args)
574 (dun-move south)) 574 (dun-move south))
575 575
576(defun dun-e (args) 576(defun dun-e (_args)
577 (dun-move east)) 577 (dun-move east))
578 578
579(defun dun-w (args) 579(defun dun-w (_args)
580 (dun-move west)) 580 (dun-move west))
581 581
582(defun dun-ne (args) 582(defun dun-ne (_args)
583 (dun-move northeast)) 583 (dun-move northeast))
584 584
585(defun dun-se (args) 585(defun dun-se (_args)
586 (dun-move southeast)) 586 (dun-move southeast))
587 587
588(defun dun-nw (args) 588(defun dun-nw (_args)
589 (dun-move northwest)) 589 (dun-move northwest))
590 590
591(defun dun-sw (args) 591(defun dun-sw (_args)
592 (dun-move southwest)) 592 (dun-move southwest))
593 593
594(defun dun-up (args) 594(defun dun-up (_args)
595 (dun-move up)) 595 (dun-move up))
596 596
597(defun dun-down (args) 597(defun dun-down (_args)
598 (dun-move down)) 598 (dun-move down))
599 599
600(defun dun-in (args) 600(defun dun-in (_args)
601 (dun-move in)) 601 (dun-move in))
602 602
603(defun dun-out (args) 603(defun dun-out (_args)
604 (dun-move out)) 604 (dun-move out))
605 605
606(defun dun-go (args) 606(defun dun-go (args)
@@ -774,7 +774,7 @@ engulf you, and you burn to death.")
774huge rocks sliding down from the ceiling, and blocking your way out.\n") 774huge rocks sliding down from the ceiling, and blocking your way out.\n")
775 (setq dun-current-room misty-room))))) 775 (setq dun-current-room misty-room)))))
776 776
777(defun dun-long (args) 777(defun dun-long (_args)
778 (setq dun-mode "long")) 778 (setq dun-mode "long"))
779 779
780(defun dun-turn (obj) 780(defun dun-turn (obj)
@@ -867,7 +867,7 @@ as you release it, the passageway closes."))
867 (dun-mprincl "The button is now in the on position.") 867 (dun-mprincl "The button is now in the on position.")
868 (setq dun-black t)))))))) 868 (setq dun-black t))))))))
869 869
870(defun dun-swim (args) 870(defun dun-swim (_args)
871 (if (not (member dun-current-room (list lakefront-north lakefront-south))) 871 (if (not (member dun-current-room (list lakefront-north lakefront-south)))
872 (dun-mprincl "I see no water!") 872 (dun-mprincl "I see no water!")
873 (if (not (member obj-life dun-inventory)) 873 (if (not (member obj-life dun-inventory))
@@ -882,7 +882,7 @@ to swim.")
882 (setq dun-current-room lakefront-north))))) 882 (setq dun-current-room lakefront-north)))))
883 883
884 884
885(defun dun-score (args) 885(defun dun-score (_args)
886 (if (not dun-endgame) 886 (if (not dun-endgame)
887 (let (total) 887 (let (total)
888 (setq total (dun-reg-score)) 888 (setq total (dun-reg-score))
@@ -896,7 +896,7 @@ to swim.")
896 (dun-mprincl 896 (dun-mprincl
897"\n\nCongratulations. You have won. The wizard password is ‘moby’")))) 897"\n\nCongratulations. You have won. The wizard password is ‘moby’"))))
898 898
899(defun dun-help (args) 899(defun dun-help (_args)
900 (dun-mprincl 900 (dun-mprincl
901"Welcome to dunnet (2.02), by Ron Schnell (ronnie@driver-aces.com - @RonnieSchnell). 901"Welcome to dunnet (2.02), by Ron Schnell (ronnie@driver-aces.com - @RonnieSchnell).
902Here is some useful information (read carefully because there are one 902Here is some useful information (read carefully because there are one
@@ -937,14 +937,14 @@ If you have questions or comments, please contact ronnie@driver-aces.com
937My home page is http://www.driver-aces.com/ronnie.html 937My home page is http://www.driver-aces.com/ronnie.html
938")) 938"))
939 939
940(defun dun-flush (args) 940(defun dun-flush (_args)
941 (if (not (= dun-current-room bathroom)) 941 (if (not (= dun-current-room bathroom))
942 (dun-mprincl "I see nothing to flush.") 942 (dun-mprincl "I see nothing to flush.")
943 (dun-mprincl "Whoooosh!!") 943 (dun-mprincl "Whoooosh!!")
944 (dun-put-objs-in-treas (nth urinal dun-room-objects)) 944 (dun-put-objs-in-treas (nth urinal dun-room-objects))
945 (dun-replace dun-room-objects urinal nil))) 945 (dun-replace dun-room-objects urinal nil)))
946 946
947(defun dun-piss (args) 947(defun dun-piss (_args)
948 (if (not (= dun-current-room bathroom)) 948 (if (not (= dun-current-room bathroom))
949 (dun-mprincl "You can't do that here, don't even bother trying.") 949 (dun-mprincl "You can't do that here, don't even bother trying.")
950 (if (not dun-gottago) 950 (if (not dun-gottago)
@@ -956,7 +956,7 @@ My home page is http://www.driver-aces.com/ronnie.html
956 (list obj-URINE)))))) 956 (list obj-URINE))))))
957 957
958 958
959(defun dun-sleep (args) 959(defun dun-sleep (_args)
960 (if (not (= dun-current-room bedroom)) 960 (if (not (= dun-current-room bedroom))
961 (dun-mprincl 961 (dun-mprincl
962"You try to go to sleep while standing up here, but can't seem to do it.") 962"You try to go to sleep while standing up here, but can't seem to do it.")
@@ -1012,12 +1012,12 @@ for a moment, then straighten yourself up.
1012 (dun-mprincl "Your axe breaks it into a million pieces.") 1012 (dun-mprincl "Your axe breaks it into a million pieces.")
1013 (dun-remove-obj-from-room dun-current-room objnum))))))))) 1013 (dun-remove-obj-from-room dun-current-room objnum)))))))))
1014 1014
1015(defun dun-drive (args) 1015(defun dun-drive (_args)
1016 (if (not dun-inbus) 1016 (if (not dun-inbus)
1017 (dun-mprincl "You cannot drive when you aren't in a vehicle.") 1017 (dun-mprincl "You cannot drive when you aren't in a vehicle.")
1018 (dun-mprincl "To drive while you are in the bus, just give a direction."))) 1018 (dun-mprincl "To drive while you are in the bus, just give a direction.")))
1019 1019
1020(defun dun-superb (args) 1020(defun dun-superb (_args)
1021 (setq dun-mode 'dun-superb)) 1021 (setq dun-mode 'dun-superb))
1022 1022
1023(defun dun-reg-score () 1023(defun dun-reg-score ()
@@ -1073,7 +1073,7 @@ for a moment, then straighten yourself up.
1073 (setq i (1+ i))) 1073 (setq i (1+ i)))
1074 (setq dun-endgame-questions newques)))) 1074 (setq dun-endgame-questions newques))))
1075 1075
1076(defun dun-power (args) 1076(defun dun-power (_args)
1077 (if (not (= dun-current-room pc-area)) 1077 (if (not (= dun-current-room pc-area))
1078 (dun-mprincl "That operation is not applicable here.") 1078 (dun-mprincl "That operation is not applicable here.")
1079 (if (not dun-floppy) 1079 (if (not dun-floppy)
@@ -1113,7 +1113,7 @@ for a moment, then straighten yourself up.
1113 (dun-doverb dun-ignore dun-verblist (car rest) (cdr rest))) 1113 (dun-doverb dun-ignore dun-verblist (car rest) (cdr rest)))
1114 (if (not (cdr (assq (intern verb) dun-verblist))) -1 1114 (if (not (cdr (assq (intern verb) dun-verblist))) -1
1115 (setq dun-numcmds (1+ dun-numcmds)) 1115 (setq dun-numcmds (1+ dun-numcmds))
1116 (eval (list (cdr (assq (intern verb) dun-verblist)) (quote rest))))))) 1116 (funcall (cdr (assq (intern verb) dun-verblist)) rest)))))
1117 1117
1118 1118
1119;;; Function to take a string and change it into a list of lowercase words. 1119;;; Function to take a string and change it into a list of lowercase words.
@@ -1221,11 +1221,10 @@ for a moment, then straighten yourself up.
1221;;; words in the command, except for the verb. 1221;;; words in the command, except for the verb.
1222 1222
1223(defun dun-objnum-from-args (obj) 1223(defun dun-objnum-from-args (obj)
1224 (let (objnum) 1224 (setq obj (dun-firstword obj))
1225 (setq obj (dun-firstword obj)) 1225 (if (not obj)
1226 (if (not obj) 1226 obj-special
1227 obj-special 1227 (cdr (assq (intern obj) dun-objnames))))
1228 (setq objnum (cdr (assq (intern obj) dun-objnames))))))
1229 1228
1230(defun dun-objnum-from-args-std (obj) 1229(defun dun-objnum-from-args-std (obj)
1231 (let (result) 1230 (let (result)
@@ -1251,7 +1250,7 @@ for a moment, then straighten yourself up.
1251;;; Given a unix style pathname, build a list of path components (recursive) 1250;;; Given a unix style pathname, build a list of path components (recursive)
1252 1251
1253(defun dun-get-path (dirstring startlist) 1252(defun dun-get-path (dirstring startlist)
1254 (let (slash pos) 1253 (let (slash)
1255 (if (= (length dirstring) 0) 1254 (if (= (length dirstring) 0)
1256 startlist 1255 startlist
1257 (if (string= (substring dirstring 0 1) "/") 1256 (if (string= (substring dirstring 0 1) "/")
@@ -2480,7 +2479,7 @@ treasures for points?" "4" "four")
2480;;;; This section defines the UNIX emulation functions for dunnet. 2479;;;; This section defines the UNIX emulation functions for dunnet.
2481;;;; 2480;;;;
2482 2481
2483(defun dun-unix-parse (args) 2482(defun dun-unix-parse (_args)
2484 (interactive "*p") 2483 (interactive "*p")
2485 (beginning-of-line) 2484 (beginning-of-line)
2486 (let (beg esign) 2485 (let (beg esign)
@@ -2687,13 +2686,13 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
2687 (dun-mprinc var) 2686 (dun-mprinc var)
2688 (dun-mprinc ": Permission denied") 2687 (dun-mprinc ": Permission denied")
2689 (setq nomore t)) 2688 (setq nomore t))
2690 (eval (list 'dun-mprinc var)) 2689 (dun-mprinc var)
2691 (dun-mprinc " "))))))) 2690 (dun-mprinc " ")))))))
2692 (dun-mprinc "\n"))) 2691 (dun-mprinc "\n")))
2693 2692
2694 2693
2695(defun dun-ftp (args) 2694(defun dun-ftp (args)
2696 (let (host username passwd ident newlist) 2695 (let (host username ident newlist)
2697 (if (not (car args)) 2696 (if (not (car args))
2698 (dun-mprincl "ftp: hostname required on command line.") 2697 (dun-mprincl "ftp: hostname required on command line.")
2699 (setq host (intern (car args))) 2698 (setq host (intern (car args)))
@@ -2768,15 +2767,15 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
2768 (dun-fascii 'nil) 2767 (dun-fascii 'nil)
2769 (dun-mprincl "Unknown type."))))) 2768 (dun-mprincl "Unknown type.")))))
2770 2769
2771(defun dun-bin (args) 2770(defun dun-bin (_args)
2772 (dun-mprincl "Type set to binary.") 2771 (dun-mprincl "Type set to binary.")
2773 (setq dun-ftptype 'binary)) 2772 (setq dun-ftptype 'binary))
2774 2773
2775(defun dun-fascii (args) 2774(defun dun-fascii (_args)
2776 (dun-mprincl "Type set to ascii.") 2775 (dun-mprincl "Type set to ascii.")
2777 (setq dun-ftptype 'ascii)) 2776 (setq dun-ftptype 'ascii))
2778 2777
2779(defun dun-ftpquit (args) 2778(defun dun-ftpquit (_args)
2780 (setq dun-exitf t)) 2779 (setq dun-exitf t))
2781 2780
2782(defun dun-send (args) 2781(defun dun-send (args)
@@ -2831,18 +2830,18 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
2831 (if (not foo) 2830 (if (not foo)
2832 (dun-mprincl "No such file.")))))) 2831 (dun-mprincl "No such file."))))))
2833 2832
2834(defun dun-ftphelp (args) 2833(defun dun-ftphelp (_args)
2835 (dun-mprincl 2834 (dun-mprincl
2836 "Possible commands are:\nsend quit type ascii binary help")) 2835 "Possible commands are:\nsend quit type ascii binary help"))
2837 2836
2838(defun dun-uexit (args) 2837(defun dun-uexit (_args)
2839 (setq dungeon-mode 'dungeon) 2838 (setq dungeon-mode 'dungeon)
2840 (dun-mprincl "\nYou step back from the console.") 2839 (dun-mprincl "\nYou step back from the console.")
2841 (define-key dun-mode-map "\r" 'dun-parse) 2840 (define-key dun-mode-map "\r" 'dun-parse)
2842 (if (not dun-batch-mode) 2841 (if (not dun-batch-mode)
2843 (dun-messages))) 2842 (dun-messages)))
2844 2843
2845(defun dun-pwd (args) 2844(defun dun-pwd (_args)
2846 (dun-mprincl dun-cdpath)) 2845 (dun-mprincl dun-cdpath))
2847 2846
2848(defun dun-uncompress (args) 2847(defun dun-uncompress (args)
@@ -3009,7 +3008,7 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
3009;;;; This section defines the DOS emulation functions for dunnet 3008;;;; This section defines the DOS emulation functions for dunnet
3010;;;; 3009;;;;
3011 3010
3012(defun dun-dos-parse (args) 3011(defun dun-dos-parse (_args)
3013 (interactive "*p") 3012 (interactive "*p")
3014 (beginning-of-line) 3013 (beginning-of-line)
3015 (let (beg) 3014 (let (beg)
@@ -3047,7 +3046,7 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
3047 (dun-mprincl (upcase args)))) 3046 (dun-mprincl (upcase args))))
3048 (dun-mprincl "Must supply file name"))) 3047 (dun-mprincl "Must supply file name")))
3049 3048
3050(defun dun-dos-invd (args) 3049(defun dun-dos-invd (_args)
3051 (sleep-for 1) 3050 (sleep-for 1)
3052 (dun-mprincl "Invalid drive specification")) 3051 (dun-mprincl "Invalid drive specification"))
3053 3052
@@ -3084,11 +3083,11 @@ File not found")))
3084 (if (not dun-batch-mode) 3083 (if (not dun-batch-mode)
3085 (dun-mprinc "\n"))) 3084 (dun-mprinc "\n")))
3086 3085
3087(defun dun-dos-spawn (args) 3086(defun dun-dos-spawn (_args)
3088 (sleep-for 1) 3087 (sleep-for 1)
3089 (dun-mprincl "Cannot spawn subshell")) 3088 (dun-mprincl "Cannot spawn subshell"))
3090 3089
3091(defun dun-dos-exit (args) 3090(defun dun-dos-exit (_args)
3092 (setq dungeon-mode 'dungeon) 3091 (setq dungeon-mode 'dungeon)
3093 (dun-mprincl "\nYou power down the machine and step back.") 3092 (dun-mprincl "\nYou power down the machine and step back.")
3094 (define-key dun-mode-map "\r" 'dun-parse) 3093 (define-key dun-mode-map "\r" 'dun-parse)
@@ -3106,7 +3105,7 @@ File not found")))
3106 (dun-mprinc dun-combination) 3105 (dun-mprinc dun-combination)
3107 (dun-mprinc ".\n")) 3106 (dun-mprinc ".\n"))
3108 3107
3109(defun dun-dos-nil (args)) 3108(defun dun-dos-nil (_args))
3110 3109
3111 3110
3112;;;; 3111;;;;
@@ -3177,9 +3176,7 @@ File not found")))
3177 3176
3178 3177
3179(defun dun-save-val (varname) 3178(defun dun-save-val (varname)
3180 (let (value) 3179 (let ((value (symbol-value (intern varname))))
3181 (setq varname (intern varname))
3182 (setq value (eval varname))
3183 (dun-minsert "(setq ") 3180 (dun-minsert "(setq ")
3184 (dun-minsert varname) 3181 (dun-minsert varname)
3185 (dun-minsert " ") 3182 (dun-minsert " ")
@@ -3205,7 +3202,7 @@ File not found")))
3205 3202
3206 3203
3207(defun dun-do-logfile (type how) 3204(defun dun-do-logfile (type how)
3208 (let (ferror newscore) 3205 (let (ferror)
3209 (setq ferror nil) 3206 (setq ferror nil)
3210 (switch-to-buffer (get-buffer-create "*score*")) 3207 (switch-to-buffer (get-buffer-create "*score*"))
3211 (erase-buffer) 3208 (erase-buffer)
@@ -3231,8 +3228,8 @@ File not found")))
3231 (dun-minsert (cadr (nth (abs room) dun-rooms))) 3228 (dun-minsert (cadr (nth (abs room) dun-rooms)))
3232 (dun-minsert ". score: ") 3229 (dun-minsert ". score: ")
3233 (if (> (dun-endgame-score) 0) 3230 (if (> (dun-endgame-score) 0)
3234 (dun-minsert (setq newscore (+ 90 (dun-endgame-score)))) 3231 (dun-minsert (+ 90 (dun-endgame-score)))
3235 (dun-minsert (setq newscore (dun-reg-score)))) 3232 (dun-minsert (dun-reg-score)))
3236 (dun-minsert " saves: ") 3233 (dun-minsert " saves: ")
3237 (dun-minsert dun-numsaves) 3234 (dun-minsert dun-numsaves)
3238 (dun-minsert " commands: ") 3235 (dun-minsert " commands: ")
@@ -3318,7 +3315,7 @@ File not found")))
3318 (goto-char (point-max)) 3315 (goto-char (point-max))
3319 (dun-mprinc "\n")))) 3316 (dun-mprinc "\n"))))
3320 3317
3321(defun dungeon-nil (arg) 3318(defun dungeon-nil (_arg)
3322 "noop" 3319 "noop"
3323 (interactive "*p") 3320 (interactive "*p")
3324 nil) 3321 nil)
@@ -3329,7 +3326,7 @@ File not found")))
3329 (dun-mprinc "\n") 3326 (dun-mprinc "\n")
3330 (dun-batch-loop)) 3327 (dun-batch-loop))
3331 3328
3332(unless (not noninteractive) 3329(when noninteractive
3333 (fset 'dun-mprinc 'dun-batch-mprinc) 3330 (fset 'dun-mprinc 'dun-batch-mprinc)
3334 (fset 'dun-mprincl 'dun-batch-mprincl) 3331 (fset 'dun-mprincl 'dun-batch-mprincl)
3335 (fset 'dun-vparse 'dun-batch-parse) 3332 (fset 'dun-vparse 'dun-batch-parse)
@@ -3343,8 +3340,8 @@ File not found")))
3343 3340
3344(provide 'dunnet) 3341(provide 'dunnet)
3345 3342
3346;;; dunnet.el ends here
3347
3348;; Local Variables: 3343;; Local Variables:
3349;; byte-compile-warnings: (not free-vars lexical) 3344;; byte-compile-warnings: (not free-vars lexical)
3350;; End: 3345;; End:
3346
3347;;; dunnet.el ends here