(setq line (downcase (buffer-substring beg (point))))
(princ line)
(if (eq (dun-vparse dun-ignore dun-verblist line) -1)
- (dun-mprinc "I don't understand that.\n")))
+ (dun-mprincl "I don't understand that.")))
(goto-char (point-max))
(dun-mprinc "\n")))
(dun-messages))
(> room 0))
(not (string= dun-mode "long")))
nil
- (dun-mprinc (car (nth (abs room) dun-rooms)))
- (dun-mprinc "\n"))
+ (dun-mprincl (car (nth (abs room) dun-rooms))))
(when (and (not (string= dun-mode "long"))
(not (member (abs room) dun-visited)))
(setq dun-visited (append (list (abs room)) dun-visited)))
(when (and (= xobjs obj-jar) dun-jar)
(dun-mprincl "The jar contains:")
(dolist (x dun-jar)
- (dun-mprinc " ")
- (dun-mprincl (car (nth x dun-objects))))))
+ (dun-mprincl " " (car (nth x dun-objects))))))
(if (and (member obj-bus (nth dun-current-room dun-room-objects)) dun-inbus)
(dun-mprincl "You are on the bus."))))
;;; as we must also print what is in it.
(defun dun-inven (_args)
- (dun-mprinc "You currently have:")
- (dun-mprinc "\n")
+ (dun-mprincl "You currently have:")
(dolist (curobj dun-inventory)
(if curobj
(progn
(progn
(dun-mprincl "The jar contains:")
(dolist (x dun-jar)
- (dun-mprinc " ")
- (dun-mprincl (cadr (nth x dun-objects))))))))))
+ (dun-mprincl " " (cadr (nth x dun-objects))))))))))
(defun dun-shake (obj)
(let ((objnum (dun-objnum-from-args-std obj)))
(cond
((member objnum dun-inventory)
;; If shaking anything will do anything, put here.
- (dun-mprinc "Shaking ")
- (dun-mprinc (downcase (cadr (nth objnum dun-objects))))
- (dun-mprinc " seems to have no effect.")
- (dun-mprinc "\n"))
+ (dun-mprinc "Shaking " (downcase (cadr (nth objnum dun-objects))))
+ (dun-mprincl " seems to have no effect."))
((and (not (member objnum (nth dun-current-room dun-room-silents)))
(not (member objnum (nth dun-current-room dun-room-objects))))
(dun-mprincl "I don't see that here."))
(if (and (>= x 0) (not (= x obj-special)))
(progn
(setq gotsome t)
- (dun-mprinc (cadr (nth x dun-objects)))
- (dun-mprinc ": ")
+ (dun-mprinc (cadr (nth x dun-objects)) ": ")
(dun-take-object x))))
(if (not gotsome)
(dun-mprincl "Nothing to take."))))
(if (or (not (car args))
(eq (dun-doverb dun-ignore dun-verblist (car args)
(cdr (cdr args))) -1))
- (dun-mprinc "I don't understand where you want me to go.\n")))
+ (dun-mprincl "I don't understand where you want me to go.")))
;;; Uses the dungeon-map to figure out where we are going. If the
;;; requested direction yields 255, we know something special is
(let (newroom)
(setq newroom (nth dir (nth dun-current-room dungeon-map)))
(if (eq newroom -1)
- (dun-mprinc "You can't go that way.\n")
+ (dun-mprincl "You can't go that way.")
(if (eq newroom 255)
(dun-special-move dir)
(setq dun-room -1)
(member objnum (nth dun-current-room dun-room-silents))))
(dun-mprincl "I don't see that here."))
((not (member objnum (list obj-button obj-switch)))
- (dun-mprinc "You can't ")
- (dun-mprinc (car line-list))
- (dun-mprincl " that."))
+ (dun-mprincl "You can't " (car line-list) " that."))
((= objnum obj-button)
(dun-mprincl
"As you press the button, you notice a passageway open up, but
(if (not dun-endgame)
(let (total)
(setq total (dun-reg-score))
- (dun-mprinc "You have scored ")
- (dun-mprinc total)
- (dun-mprincl " out of a possible 90 points.") total)
- (dun-mprinc "You have scored ")
- (dun-mprinc (dun-endgame-score))
+ (dun-mprincl "You have scored " total " out of a possible 90 points.")
+ total)
+ (dun-mprinc "You have scored " (dun-endgame-score))
(dun-mprincl " endgame points out of a possible 110.")
(if (= (dun-endgame-score) 110)
(dun-mprincl
;;; Insert something into the window buffer
-(defun dun-minsert (string)
- (if (stringp string)
- (insert string)
- (insert (prin1-to-string string))))
+(defun dun-minsert (&rest args)
+ (dolist (arg args)
+ (if (stringp arg)
+ (insert arg)
+ (insert (prin1-to-string arg)))))
;;; Print something out, in window mode
-(defun dun-mprinc (string)
- (if (stringp string)
- (insert string)
- (insert (prin1-to-string string))))
+(defun dun-mprinc (&rest args)
+ (dolist (arg args)
+ (if (stringp arg)
+ (insert arg)
+ (insert (prin1-to-string arg)))))
;;; In window mode, keep screen from jumping by keeping last line at
;;; the bottom of the screen.
;;; Insert something into the buffer, followed by newline.
-(defun dun-minsertl (string)
- (dun-minsert string)
+(defun dun-minsertl (&rest args)
+ (apply #'dun-minsert args)
(dun-minsert "\n"))
;;; Print something, followed by a newline.
-(defun dun-mprincl (string)
- (dun-mprinc string)
+(defun dun-mprincl (&rest args)
+ (apply #'dun-mprinc args)
(dun-mprinc "\n"))
;;; Function which will get an object number given the list of
(defun dun-save-val (varname)
(let ((value (symbol-value (intern varname))))
- (dun-minsert "(setq ")
- (dun-minsert varname)
- (dun-minsert " ")
+ (dun-minsert "(setq " varname " ")
(if (or (listp value)
(symbolp value))
(dun-minsert "'"))
(dun-mprincl (error-message-string err))))
(when (null ferror)
(goto-char (point-max))
- (dun-minsert (current-time-string))
- (dun-minsert " ")
- (dun-minsert (user-login-name))
- (dun-minsert " ")
+ (dun-minsert (current-time-string) " " (user-login-name) " ")
(if (eq type 'save)
(dun-minsert "saved ")
(if (= (dun-endgame-score) 110)
(dun-minsert "won ")
(if (not how)
(dun-minsert "quit ")
- (dun-minsert "killed by ")
- (dun-minsert how)
- (dun-minsert " "))))
- (dun-minsert "at ")
- (dun-minsert (cadr (nth (abs dun-room) dun-rooms)))
- (dun-minsert ". score: ")
+ (dun-minsert "killed by " how " "))))
+ (dun-minsert "at " (cadr (nth (abs dun-room) dun-rooms)) ". score: ")
(if (> (dun-endgame-score) 0)
(dun-minsert (+ 90 (dun-endgame-score)))
(dun-minsert (dun-reg-score)))
- (dun-minsert " saves: ")
- (dun-minsert dun-numsaves)
- (dun-minsert " commands: ")
- (dun-minsert dun-numcmds)
- (dun-minsert "\n")
+ (dun-minsertl " saves: " dun-numsaves " commands: " dun-numcmds)
(write-region 1 (point-max) dun-log-file nil 1)))))
;;;; be run in batch mode.
-(defun dun-batch-mprinc (arg)
- (if (stringp arg)
- (send-string-to-terminal arg)
- (send-string-to-terminal (prin1-to-string arg))))
+(defun dun-batch-mprinc (&rest args)
+ (dolist (arg args)
+ (if (stringp arg)
+ (send-string-to-terminal arg)
+ (send-string-to-terminal (prin1-to-string arg)))))
-(defun dun-batch-mprincl (arg)
- (if (stringp arg)
- (progn
- (send-string-to-terminal arg)
- (send-string-to-terminal "\n"))
- (send-string-to-terminal (prin1-to-string arg))
- (send-string-to-terminal "\n")))
+(defun dun-batch-mprincl (&rest args)
+ (dolist (arg args)
+ (if (stringp arg)
+ (send-string-to-terminal arg)
+ (send-string-to-terminal (prin1-to-string arg))))
+ (send-string-to-terminal "\n"))
(defun dun-batch-parse (ignore verblist line)
(setq line-list (dun-listify-string (concat line " ")))