X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fplayer.scm;h=a0caf239940198eb80808925ae652b00d295caa2;hp=e3ae2ba8ffcee53cea6cef848d72216e5a74fbc4;hb=f19d236c49f1145138e2274d2f5ab3fb1be3e890;hpb=c8c47c9d61abd219f561c020e9147d715717a16f diff --git a/mudsync/player.scm b/mudsync/player.scm index e3ae2ba..a0caf23 100644 --- a/mudsync/player.scm +++ b/mudsync/player.scm @@ -63,7 +63,7 @@ (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) @@ -79,20 +79,20 @@ (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)))) @@ -103,7 +103,7 @@ (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 '()) @@ -113,7 +113,7 @@ (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 @@ -133,18 +133,17 @@ ;; 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 @@ -156,9 +155,9 @@ (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)) @@ -181,9 +180,8 @@ (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)