Switching from #:generally-visible to #:invisible? as visibility flag
[mudsync.git] / mudsync / gameobj.scm
index 7f2f4e202defc63db99f4cf1de60b1bb95a21420..779c092d0abf4ead2d3eb0341367c3bd8325728c 100644 (file)
                        ("drop" ((direct-command cmd-drop #:obvious? #f)))))
 
   ;; Most objects are generally visible by default
-  (generally-visible #:init-value #t
-                     #:init-keyword #:generally-visible)
-  ;; @@: Would be preferable to be using generic methods for this...
-  ;;   Hopefully we can port this to Guile 2.2 soon...
+  (invisible? #:init-value #f
+              #:init-keyword #:invisible?)
+  ;; TODO: Fold this into a procedure in invisible? similar
+  ;;   to take-me? and etc
   (visible-to-player?
    #:init-value (wrap-apply gameobj-visible-to-player?))
 
@@ -322,7 +322,7 @@ and whos-asking, and see if we should just return it or run it."
 (define (gameobj-visible-to-player? gameobj whos-looking)
   "Check to see whether we're visible to the player or not.
 By default, this is whether or not the generally-visible flag is set."
-  (slot-ref gameobj 'generally-visible))
+  (not (slot-ref gameobj 'invisible?)))
 
 (define* (gameobj-visible-name actor message #:key whos-looking)
   ;; Are we visible?
@@ -533,7 +533,8 @@ By default, this is whether or not the generally-visible flag is set."
                    ,our-name "."))
       (<- player-loc 'tell-room
           #:text `(,player-name " takes " ,thing-to-take-name " from "
-                                ,our-name "."))))))
+                                ,our-name ".")
+          #:exclude player)))))
 
 (define* (cmd-put-in gameobj message
                      #:key direct-obj indir-obj preposition)
@@ -552,7 +553,7 @@ By default, this is whether or not the generally-visible flag is set."
                        (<-wait occupant 'goes-by)
                      (when (member direct-obj goes-by)
                        (return occupant))))
-                 (pk 'here (mbody-val (<-wait player 'get-occupants))))
+                 (mbody-val (<-wait player 'get-occupants)))
        ;; nothing found
        #f)))
   (define (should-put-in-me)
@@ -574,11 +575,11 @@ By default, this is whether or not the generally-visible flag is set."
            (or why-not default-objection))))
   (cond
    ;; Is it not there, or maybe we won't allow it to be taken?
-   ((pk '1st (or (not this-thing) (not (should-put-in-me))))
+   ((or (not this-thing) (not (should-put-in-me)))
     (<- (message-from message) 'tell
         #:text default-objection))
    ;; the thing we wsant to take itself has objected...
-   ((pk 'objection (this-thing-objection)) =>
+   ((this-thing-objection) =>
     (lambda (objection)
       (<- (message-from message) 'tell
           #:text objection)))
@@ -592,8 +593,9 @@ By default, this is whether or not the generally-visible flag is set."
       ;; errors out or something.  Maybe it's overthinking things, I dunno.
       (<-wait this-thing 'set-loc! #:loc (actor-id gameobj))
       (<- player 'tell
-          #:text (pk 'txt `("You put " ,this-thing-name " in "
-                            ,our-name ".")))
+          #:text `("You put " ,this-thing-name " in "
+                   ,our-name "."))
       (<- player-loc 'tell-room
           #:text `(,player-name " puts " ,this-thing-name " in "
-                                ,our-name "."))))))
+                                ,our-name ".")
+          #:exclude player)))))