Function: dun-turn

dun-turn is a byte-compiled function defined in dunnet.el.gz.

Signature

(dun-turn OBJ)

Source Code

;; Defined in /usr/src/emacs/lisp/play/dunnet.el.gz
(defun dun-turn (obj)
  (let (objnum direction)
    (when (setq objnum (dun-objnum-from-args-std obj))
      (if (not (or (member objnum (nth dun-current-room dun-room-objects))
		   (member objnum (nth dun-current-room dun-room-silents))))
	  (dun-mprincl "I don't see that here.")
	(if (not (= objnum obj-dial))
	    (dun-mprincl "You can't turn that.")
	  (setq direction (dun-firstword (cdr obj)))
	  (if (or (not direction)
		  (not (or (string= direction "clockwise")
			   (string= direction "counterclockwise"))))
	      (dun-mprincl "You must indicate clockwise or counterclockwise.")
	    (if (string= direction "clockwise")
		(setq dun-sauna-level (+ dun-sauna-level 1))
	      (setq dun-sauna-level (- dun-sauna-level 1)))

	    (if (< dun-sauna-level 0)
		(progn
		  (dun-mprincl
		   "The dial will not turn further in that direction.")
		  (setq dun-sauna-level 0))
	      (dun-sauna-heat dun-sauna-level))))))))