diff --git a/ATL/Pooh/objects.atl b/ATL/Pooh/objects.atl index b6d56fc..d7643be 100644 --- a/ATL/Pooh/objects.atl +++ b/ATL/Pooh/objects.atl @@ -17,6 +17,7 @@ | Mr SANDERS | +--------------+ " + fixed define-item "Piglet's sign" description " @@ -25,6 +26,7 @@ | TRESPASSERS W > |_________________< " + fixed define-item "North Pole" description " diff --git a/ATL/Pooh/objects.atl b/ATL/Pooh/objects.atl index b6d56fc..d7643be 100644 --- a/ATL/Pooh/objects.atl +++ b/ATL/Pooh/objects.atl @@ -17,6 +17,7 @@ | Mr SANDERS | +--------------+ " + fixed define-item "Piglet's sign" description " @@ -25,6 +26,7 @@ | TRESPASSERS W > |_________________< " + fixed define-item "North Pole" description " diff --git a/lisp/game-objects.lisp b/lisp/game-objects.lisp index c5272e7..abdf8fe 100644 --- a/lisp/game-objects.lisp +++ b/lisp/game-objects.lisp @@ -54,6 +54,7 @@ (description "") (cost 0) (weapon) + (fixed) ;(pickup-hook NIL) ;(drop-hook NIL) (ability NIL)) ;XXX Remove abilities again? diff --git a/ATL/Pooh/objects.atl b/ATL/Pooh/objects.atl index b6d56fc..d7643be 100644 --- a/ATL/Pooh/objects.atl +++ b/ATL/Pooh/objects.atl @@ -17,6 +17,7 @@ | Mr SANDERS | +--------------+ " + fixed define-item "Piglet's sign" description " @@ -25,6 +26,7 @@ | TRESPASSERS W > |_________________< " + fixed define-item "North Pole" description " diff --git a/lisp/game-objects.lisp b/lisp/game-objects.lisp index c5272e7..abdf8fe 100644 --- a/lisp/game-objects.lisp +++ b/lisp/game-objects.lisp @@ -54,6 +54,7 @@ (description "") (cost 0) (weapon) + (fixed) ;(pickup-hook NIL) ;(drop-hook NIL) (ability NIL)) ;XXX Remove abilities again? diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 36cd234..c8bc4a9 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -247,16 +247,15 @@ (let* ((choice (choose-option (append (npc-sells npc) (list "None")))) (item (get-game-object 'item choice)) (cost (if item (item-cost item) NIL))) + ;; TODO The cost should be displayed alongside every item. (cond ((equalp choice "None") NIL) - ;; XXX Do we have to insure that every object referenced by the - ;; world exists, or is that the responsibility of the person - ;; who writes the ATL code? ((not item) (format t "~&This object does not exist!") - (format t "(Talk to the world creator)") + (format t "~&(This is a bug in the game world.)") NIL) ((< (player-money player) cost) - (format t "~&You do not have enough money!")) + (format t "~&This costs ~S. You do not have enough money!" + cost)) ((y-or-n-p "Buy ~A for ~S?" choice cost) (decf (player-money player) cost) (set-object-attribute player 'item choice) @@ -272,12 +271,14 @@ (let ((place (get-game-object 'place (player-place player))) (item (get-game-object 'item item-name))) (if (member item-name (place-item place) :test #'equalp) - (progn - ;; XXX Shouldn't the item's function be executed here? - ;; Or should item functions be disabled entirely? - (set-object-attribute player 'item item-name) - (remove-object-attribute place 'item item-name) - (format t "~&You have picked up: ~A" item-name)) + (if (item-fixed item) + (format t "~&You cannot pick this up!") + (progn + ;; XXX Shouldn't the item's function be executed here? + ;; Or should item functions be disabled entirely? + (set-object-attribute player 'item item-name) + (remove-object-attribute place 'item item-name) + (format t "~&You have picked up: ~A" item-name))) (format t "~&Sorry, this item is not here!")))) (defun drop (player &optional item)