;;; Basic actions
;;; -------------
-(define* (cmd-take gameobj message #:key direct-obj)
- (define player (message-from message))
+(define* (cmd-take gameobj message
+ #:key direct-obj
+ (player (message-from message)))
(define player-name
(mbody-val (<-wait player 'get-name)))
(define player-loc
#:text (format #f "It doesn't seem like you can take ~a.\n"
our-name))))
-(define* (cmd-drop gameobj message #:key direct-obj)
- (define player (message-from message))
+(define* (cmd-drop gameobj message
+ #:key direct-obj
+ (player (message-from message)))
(define player-name
(mbody-val (<-wait player 'get-name)))
(define player-loc
;; @@: Moving this to a container subclass/mixin could allow a lot more
;; customization of take out / put in phrases
(define* (cmd-take-from gameobj message
- #:key direct-obj indir-obj preposition)
- (define player (message-from message))
+ #:key direct-obj indir-obj preposition
+ (player (message-from message)))
(define player-name
(mbody-val (<-wait player 'get-name)))
(define player-loc
#:exclude player))))
(define* (cmd-put-in gameobj message
- #:key direct-obj indir-obj preposition)
- (define player (message-from message))
+ #:key direct-obj indir-obj preposition
+ (player (message-from message)))
(define player-name
(mbody-val (<-wait player 'get-name)))
(define player-loc
(cond
;; Is it not there, or maybe we won't allow it to be taken?
((not this-thing)
- (<- (message-from message) 'tell
+ (<- player 'tell
#:text `("You don't seem to have any such " ,direct-obj " to put "
,preposition " " ,our-name ".")))
((or (not (should-put-in-me)))
- (<- (message-from message) 'tell
+ (<- player 'tell
#:text (default-objection)))
;; the thing we wsant to take itself has objected...
((this-thing-objection) =>
(lambda (objection)
- (<- (message-from message) 'tell
+ (<- player 'tell
#:text objection)))
;; looks like we can take it
(else