Function: dun-take

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

Signature

(dun-take OBJ)

Source Code

;; Defined in /usr/src/emacs/lisp/play/dunnet.el.gz
(defun dun-take (obj)
    (setq obj (dun-firstword obj))
    (if (not obj)
	(dun-mprincl "You must supply an object.")
      (if (string= obj "all")
	  (let (gotsome)
	    (if dun-inbus
		(dun-mprincl "You can't take anything while on the bus.")
	      (setq gotsome nil)
	      (dolist (x (nth dun-current-room dun-room-objects))
		(if (and (>= x 0) (not (= x obj-special)))
		    (progn
		      (setq gotsome t)
		      (dun-mprinc (cadr (nth x dun-objects)) ": ")
		      (dun-take-object x))))
	      (if (not gotsome)
		  (dun-mprincl "Nothing to take."))))
	(let (objnum)
	  (setq objnum (cdr (assq (intern obj) dun-objnames)))
	  (if (null objnum)
	      (dun-mprincl "I don't know what that is.")
	    (if (and dun-inbus (not (and (member objnum dun-jar)
					 (member obj-jar dun-inventory))))
		(dun-mprincl "You can't take anything while on the bus.")
	      (dun-take-object objnum)))))))