From: Christopher Allan Webber Date: Fri, 6 May 2016 20:12:28 +0000 (-0500) Subject: Added emote! X-Git-Tag: fosdem-2017~160 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=b1beda2a66973d1644dc0a57a9742fb06ea1e770;p=mudsync.git Added emote! --- diff --git a/mudsync/room.scm b/mudsync/room.scm index 11920e2..0b0e852 100644 --- a/mudsync/room.scm +++ b/mudsync/room.scm @@ -72,7 +72,8 @@ (empty-command "look" 'cmd-look-room) (empty-command "go" 'cmd-go-where) (loose-direct-command "go" 'cmd-go) - (greedy-command "say" 'cmd-say))) + (greedy-command "say" 'cmd-say) + (greedy-command "emote" 'cmd-emote))) (define room-actions (build-actions @@ -88,7 +89,8 @@ ;; look-room version (cmd-look-room (wrap-apply room-look-room)) (cmd-look-at (wrap-apply room-look-at)) - (cmd-say (wrap-apply room-cmd-say)))) + (cmd-say (wrap-apply room-cmd-say)) + (cmd-emote (wrap-apply room-cmd-emote)))) (define room-actions* (append room-actions gameobj-actions)) @@ -301,6 +303,15 @@ claim to point to." (format #f "~a says: ~a\n" player-name phrase)) (room-tell-room room message-to-send)) +(define-mhandler (room-cmd-emote room message phrase) + "Command: Say something to room participants." + (define player-name + (message-ref (<-wait room (message-from message) + 'get-name) 'val)) + (define message-to-send + (format #f "* ~a ~a\n" player-name phrase)) + (room-tell-room room message-to-send)) + (define-mhandler (room-announce-entrance room message who-entered) (define player-name (message-ref (<-wait room who-entered 'get-name)