(define (run-replacement actor replaces replace-steps)
(when replaces
- (msg-receive (_ #:key occupants)
+ (mbody-receive (_ #:key occupants)
(<-wait replaces 'assist-replace)
(for-each
(lambda (replace-step)
(match special-symbol
;; if it's a symbol, look it up dynamically
((? symbol? _)
- (msg-val (<-wait (slot-ref gameobj 'gm) 'lookup-special
- #:symbol special-symbol)))
+ (mbody-val (<-wait (slot-ref gameobj 'gm) 'lookup-special
+ #:symbol special-symbol)))
;; if it's false, return nothing
(#f #f)
;; otherwise it's probably an address, return it as-is
(define inv-names
(map
(lambda (inv-item)
- (msg-val (<-wait inv-item 'get-name)))
+ (mbody-val (<-wait inv-item 'get-name)))
(gameobj-occupants player)))
(define text-to-show
(if (eq? inv-names '())
;; Ask the room for its commands
(define room-commands
;; TODO: Map room id and sort
- (msg-receive (_ #:key commands)
+ (mbody-receive (_ #:key commands)
(<-wait player-loc 'get-container-commands
#:verb verb)
commands))
(define co-occupants
(remove
(lambda (x) (equal? x (actor-id player)))
- (msg-receive (_ #:key occupants)
+ (mbody-receive (_ #:key occupants)
(<-wait player-loc 'get-occupants)
occupants)))
(define co-occupant-commands
(fold
(lambda (co-occupant prev)
- (msg-receive (_ #:key commands goes-by)
+ (mbody-receive (_ #:key commands goes-by)
(<-wait co-occupant 'get-commands
#:verb verb)
(append
(define inv-item-commands
(fold
(lambda (inv-item prev)
- (msg-receive (_ #:key commands goes-by)
+ (mbody-receive (_ #:key commands goes-by)
(<-wait inv-item 'get-contained-commands
#:verb verb)
(append
(dyn-ref room (slot-ref exit 'to))
#f))
(define player-name
- (msg-val (<-wait (message-from message) 'get-name)))
+ (mbody-val (<-wait (message-from message) 'get-name)))
(cond
(exit
;; Set the player's new location
(lambda (return)
(for-each
(lambda (occupant)
- (msg-receive (_ #:key goes-by)
+ (mbody-receive (_ #:key goes-by)
(<-wait occupant 'goes-by)
(if (member called-this goes-by)
(return occupant))))
(cond
(matching-object
(let ((obj-desc
- (msg-val (<-wait matching-object 'get-desc
+ (mbody-val (<-wait matching-object 'get-desc
#:whos-looking (message-from message)))))
(if obj-desc
(<- (message-from message) 'tell
(define* (room-cmd-say room message #:key phrase)
"Command: Say something to room participants."
(define player-name
- (msg-val (<-wait (message-from message) 'get-name)))
+ (mbody-val (<-wait (message-from message) 'get-name)))
(define message-to-send
(format #f "~a says: ~a\n" player-name phrase))
(room-tell-room room message-to-send))
(define* (room-cmd-emote room message #:key phrase)
"Command: Say something to room participants."
(define player-name
- (msg-val (<-wait (message-from message) 'get-name)))
+ (mbody-val (<-wait (message-from message) 'get-name)))
(define message-to-send
(format #f "* ~a ~a\n" player-name phrase))
(room-tell-room room message-to-send))
(define* (room-announce-entrance room message #:key who-entered)
(define player-name
- (msg-val (<-wait who-entered 'get-name)))
+ (mbody-val (<-wait who-entered 'get-name)))
(define message-to-send
(format #f "~a enters the room.\n" player-name))
(room-tell-room room message-to-send
(define* (thing-cmd-take thing message #:key direct-obj)
(define player (message-from message))
(define player-name
- (msg-val (<-wait player 'get-name)))
+ (mbody-val (<-wait player 'get-name)))
(define player-loc
- (msg-val (<-wait player 'get-loc)))
+ (mbody-val (<-wait player 'get-loc)))
(define thing-name (slot-ref thing 'name))
(define should-take
(slot-ref-maybe-runcheck thing 'takeable player))
(define* (thing-cmd-drop thing message #:key direct-obj)
(define player (message-from message))
(define player-name
- (msg-val (<-wait player 'get-name)))
+ (mbody-val (<-wait player 'get-name)))
(define player-loc
- (msg-val (<-wait player 'get-loc)))
+ (mbody-val (<-wait player 'get-loc)))
(define thing-name (slot-ref thing 'name))
(define should-drop
(slot-ref-maybe-runcheck thing 'dropable player))
(define* (sign-cmd-sign-in actor message
#:key direct-obj indir-obj preposition)
(define old-name
- (msg-val (<-wait (message-from message) 'get-name)))
+ (mbody-val (<-wait (message-from message) 'get-name)))
(define name indir-obj)
(if (valid-name? indir-obj)
(begin
;; handler... meanwhile, this procedure suspends until we get
;; their response.
(define who-rang
- (msg-val (<-wait (message-from message) 'get-name)))
+ (mbody-val (<-wait (message-from message) 'get-name)))
;; Now we'll invoke the "tell" message handler on the player
;; who rang us, displaying this text on their screen.
(define* (furniture-cmd-sit actor message #:key direct-obj)
(define player-name
- (msg-val (<-wait (message-from message) 'get-name)))
+ (mbody-val (<-wait (message-from message) 'get-name)))
(<- (message-from message) 'tell
#:text (format #f "You ~a ~a.\n"
(slot-ref actor 'sit-phrase)
(define* (clerk-cmd-dismiss clerk message . _)
(define player-name
- (msg-val (<-wait (message-from message) 'get-name)))
+ (mbody-val (<-wait (message-from message) 'get-name)))
(match (slot-ref clerk 'state)
('on-duty
(<- (gameobj-loc clerk) 'tell-room