X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fgameobj.scm;h=66f617f9db2e70f915b18bb09ca96873286266bd;hp=c5f1648e12209ecf6340da428fb35b3508bd562a;hb=f077644528d3ff0aa8b64c3050f72e9b08b80d49;hpb=baf2f16f3e37b4a6b69603c4c21530d4093bb193 diff --git a/mudsync/gameobj.scm b/mudsync/gameobj.scm index c5f1648..66f617f 100644 --- a/mudsync/gameobj.scm +++ b/mudsync/gameobj.scm @@ -93,10 +93,10 @@ ("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) @@ -586,8 +587,6 @@ By default, this is whether or not the generally-visible flag is set." (else (let ((this-thing-name (mbody-val (<-wait this-thing 'get-name)))) - - ;; Wait to announce to the player just in case settting the location ;; errors out or something. Maybe it's overthinking things, I dunno. (<-wait this-thing 'set-loc! #:loc (actor-id gameobj)) @@ -596,4 +595,5 @@ By default, this is whether or not the generally-visible flag is set." ,our-name ".")) (<- player-loc 'tell-room #:text `(,player-name " puts " ,this-thing-name " in " - ,our-name ".")))))) + ,our-name ".") + #:exclude player)))))