X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fplayer.scm;fp=mudsync%2Fplayer.scm;h=1063955b6d4ba56371d82b5952ca84943d7d3991;hp=e3ae2ba8ffcee53cea6cef848d72216e5a74fbc4;hb=754bd427883ab189433fad90293e05d9aced2f70;hpb=701425bc611abaa8b4140942d995d5f32d24e2d7 diff --git a/mudsync/player.scm b/mudsync/player.scm index e3ae2ba..1063955 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))) + (msg-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 @@ -134,9 +134,8 @@ (define room-commands ;; TODO: Map room id and sort (msg-receive (_ #:key commands) - (<-wait player player-loc - 'get-container-commands - #:verb verb) + (<-wait player-loc 'get-container-commands + #:verb verb) commands)) ;; All the co-occupants of the room (not including ourself) @@ -144,7 +143,7 @@ (remove (lambda (x) (equal? x (actor-id player))) (msg-receive (_ #:key occupants) - (<-wait player player-loc 'get-occupants) + (<-wait player-loc 'get-occupants) occupants))) ;; @@: There's a race condition here if someone leaves the room @@ -157,8 +156,8 @@ (fold (lambda (co-occupant prev) (msg-receive (_ #:key commands goes-by) - (<-wait player co-occupant 'get-commands - #:verb verb) + (<-wait co-occupant 'get-commands + #:verb verb) (append (map (lambda (command) (list command goes-by co-occupant)) @@ -182,8 +181,7 @@ (fold (lambda (inv-item prev) (msg-receive (_ #:key commands goes-by) - (<-wait player inv-item - 'get-contained-commands + (<-wait inv-item 'get-contained-commands #:verb verb) (append (map (lambda (command)