(define (player-init player message)
;; Look around the room we're in
- (<- player (gameobj-loc player) 'look-room))
+ (<- (gameobj-loc player) 'look-room))
(define* (player-handle-input player message #:key input)
(match winner
((cmd-action winner-id message-args)
- (apply <- player winner-id cmd-action message-args))
+ (apply <- winner-id cmd-action message-args))
(#f
- (<- player (gameobj-gm player) 'write-home
+ (<- (gameobj-gm player) 'write-home
#:text "Huh?\n"))))
(define* (player-tell player message #:key text)
- (<- player (gameobj-gm player) 'write-home
+ (<- (gameobj-gm player) 'write-home
#:text text))
(define (player-disconnect-self-destruct player message)
"Action routine for being told to disconnect and self destruct."
(define loc (gameobj-loc player))
(when loc
- (<- player loc 'tell-room
+ (<- loc 'tell-room
#:exclude (actor-id player)
#:text (format #f "~a disappears in a puff of entropy!\n"
(slot-ref player 'name))))
(define inv-names
(map
(lambda (inv-item)
- (msg-val (<-wait player inv-item 'get-name)))
+ (mbody-val (<-wait inv-item 'get-name)))
(gameobj-occupants player)))
(define text-to-show
(if (eq? inv-names '())
(map (lambda (item-name)
(string-append " * " item-name "\n"))
inv-names))))
- (<- player (actor-id player) 'tell #:text text-to-show))
+ (<- (actor-id player) 'tell #:text text-to-show))
;;; Command handling
;; Ask the room for its commands
(define room-commands
;; TODO: Map room id and sort
- (msg-receive (_ #:key commands)
- (<-wait player player-loc
- 'get-container-commands
- #:verb verb)
+ (mbody-receive (_ #:key commands)
+ (<-wait player-loc 'get-container-commands
+ #:verb verb)
commands))
;; All the co-occupants of the room (not including ourself)
(define co-occupants
(remove
(lambda (x) (equal? x (actor-id player)))
- (msg-receive (_ #:key occupants)
- (<-wait player player-loc 'get-occupants)
+ (mbody-receive (_ #:key occupants)
+ (<-wait player-loc 'get-occupants)
occupants)))
;; @@: There's a race condition here if someone leaves the room
(define co-occupant-commands
(fold
(lambda (co-occupant prev)
- (msg-receive (_ #:key commands goes-by)
- (<-wait player co-occupant 'get-commands
- #:verb verb)
+ (mbody-receive (_ #:key commands goes-by)
+ (<-wait co-occupant 'get-commands
+ #:verb verb)
(append
(map (lambda (command)
(list command goes-by co-occupant))
(define inv-item-commands
(fold
(lambda (inv-item prev)
- (msg-receive (_ #:key commands goes-by)
- (<-wait player inv-item
- 'get-contained-commands
+ (mbody-receive (_ #:key commands goes-by)
+ (<-wait inv-item 'get-contained-commands
#:verb verb)
(append
(map (lambda (command)