- ;; TODO: Allow gameobj to customize
- (if self-should-take
- ;; Set the location to whoever's picking us up
- (begin
- (gameobj-set-loc! gameobj player)
- (<- player 'tell
- #:text (format #f "You pick up ~a.\n"
- our-name))
- (<- player-loc 'tell-room
- #:text (format #f "~a picks up ~a.\n"
- player-name
- our-name)
- #:exclude player))
- (<- player 'tell
- #:text (format #f "It doesn't seem like you can take ~a.\n"
- our-name))))
+ (call-with-values (lambda ()
+ (slot-ref-maybe-runcheck gameobj 'take-me? player))
+ (lambda* (self-should-take #:key (why-not
+ `("It doesn't seem like you can take "
+ ,our-name ".")))
+ (if self-should-take
+ ;; Set the location to whoever's picking us up
+ (begin
+ (gameobj-set-loc! gameobj player)
+ (<- player 'tell
+ #:text (format #f "You pick up ~a.\n"
+ our-name))
+ (<- player-loc 'tell-room
+ #:text (format #f "~a picks up ~a.\n"
+ player-name
+ our-name)
+ #:exclude player))
+ (<- player 'tell #:text why-not)))))