+ #:val (slot-ref actor 'loc)))
+
+(define (gameobj-set-loc! gameobj loc)
+ "Set the location of this object."
+ (define old-loc (gameobj-loc gameobj))
+ (format #t "DEBUG: Location set to ~s for ~s\n"
+ loc (actor-id-actor gameobj))
+
+ (when (not (equal? old-loc loc))
+ (slot-set! gameobj 'loc loc)
+ ;; Change registation of where we currently are
+ (if old-loc
+ (<-wait gameobj old-loc 'remove-occupant! #:who (actor-id gameobj)))
+ (if loc
+ (<-wait gameobj loc 'add-occupant! #:who (actor-id gameobj)))))
+
+;; @@: Should it really be #:id ? Maybe #:loc-id or #:loc?
+(define-mhandler (gameobj-act-set-loc! actor message loc)
+ "Action routine to set the location."
+ (gameobj-set-loc! actor loc))
+
+(define (slot-ref-maybe-runcheck gameobj slot whos-asking)
+ "Do a slot-ref on gameobj, evaluating it including ourselves
+and whos-asking, and see if we should just return it or run it."
+ (match (slot-ref gameobj slot)
+ ((? procedure? slot-val-proc)
+ (slot-val-proc gameobj whos-asking))
+ (anything-else anything-else)))
+
+(define gameobj-get-name (simple-slot-getter 'name))
+
+(define-mhandler (gameobj-act-set-name! actor message val)
+ (slot-set! actor 'name val))
+
+(define-mhandler (gameobj-get-desc actor message whos-looking)
+ (define desc-text
+ (match (slot-ref actor 'desc)
+ ((? procedure? desc-proc)
+ (desc-proc actor whos-looking))
+ (desc desc)))
+ (<-reply actor message #:val desc-text))
+
+(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))
+
+(define-mhandler (gameobj-visible-name actor message whos-looking)
+ ;; Are we visible?
+ (define we-are-visible
+ ((slot-ref actor 'visible-to-player?) actor whos-looking))
+
+ (define name-to-return
+ (if we-are-visible
+ ;; Return our name
+ (match (slot-ref actor 'name)
+ ((? procedure? name-proc)
+ (name-proc actor whos-looking))
+ ((? string? name)
+ name)
+ (#f #f))
+ #f))
+ (<-reply actor message #:text name-to-return))
+
+(define (gameobj-self-destruct gameobj)
+ "General gameobj self destruction routine"
+ ;; Unregister from being in any particular room
+ (gameobj-set-loc! gameobj #f)
+ (slot-set! gameobj 'destructed #t)
+ ;; Boom!
+ (self-destruct gameobj))
+
+(define-mhandler (gameobj-act-self-destruct gameobj message)
+ "Action routine for self destruction"
+ (gameobj-self-destruct gameobj))
+
+;; Unless an actor has a tell message, we just ignore it
+(define gameobj-tell-no-op
+ (const 'no-op))