- ;; @@: Can remove this indirection once things settle
- #:init-value (wrap-apply room-action-dispatch)))
-
-(define (room-init room message)
- (room-wire-exits! room))
-
-(define (room-wire-exits! room)
- "Actually hook up the rooms' exit addresses to the rooms they
-claim to point to."
- (for-each
- (lambda (exit)
- (define new-exit
- (message-ref
- (<-wait room (gameobj-gm room) 'lookup-special
- #:symbol (slot-ref exit 'to-symbol))
- 'room-id))
-
- (slot-set! exit 'to-address new-exit))
-
- (room-exits room)))
-
-(define-mhandler (room-cmd-go room message direct-obj)
+ #:init-thunk
+ (build-commands
+ (("l" "look") ((empty-command cmd-look-room)))
+ ("go" ((empty-command cmd-go-where)
+ (loose-direct-command cmd-go)))
+ (("say" "\"" "'") ((greedy-command cmd-say)))
+ (("emote" "/me") ((greedy-command cmd-emote)))
+ ;; movement aliases
+ (("n" "north") ((empty-command go-north)))
+ (("ne" "northeast") ((empty-command go-northeast)))
+ (("e" "east") ((empty-command go-east)))
+ (("se" "southeast") ((empty-command go-southeast)))
+ (("s" "south") ((empty-command go-south)))
+ (("sw" "southwest") ((empty-command go-southwest)))
+ (("w" "west") ((empty-command go-west)))
+ (("nw" "northwest") ((empty-command go-northwest)))
+ (("u" "up") ((empty-command go-up)))
+ (("d" "down") ((empty-command go-down)))))
+
+ (container-sub-commands
+ #:allocation #:each-subclass
+ #:init-thunk
+ (build-commands
+ (("l" "look") ((loose-direct-command cmd-look-at-from-room)))))
+
+ (actions #:allocation #:each-subclass
+ #:init-thunk
+ (build-actions
+ (cmd-go room-cmd-go)
+ (cmd-go-where room-cmd-go-where)
+ (announce-entrance room-announce-entrance)
+ (look-room room-look-room)
+ (tell-room room-act-tell-room)
+ ;; in this case the command is the same version as the normal
+ ;; look-room version
+ (cmd-look-room room-look-room)
+ (cmd-look-at-from-room room-look-dont-see-it)
+ (cmd-say room-cmd-say)
+ (cmd-emote room-cmd-emote)
+ ;; movement aliases
+ (go-north (exit-shorthand "north"))
+ (go-northeast (exit-shorthand "northeast"))
+ (go-east (exit-shorthand "east"))
+ (go-southeast (exit-shorthand "southeast"))
+ (go-south (exit-shorthand "south"))
+ (go-southwest (exit-shorthand "southwest"))
+ (go-west (exit-shorthand "west"))
+ (go-northwest (exit-shorthand "northwest"))
+ (go-up (exit-shorthand "up"))
+ (go-down (exit-shorthand "down")))))
+
+(define common-exit-aliases
+ '(("n" . "north")
+ ("ne" . "northeast")
+ ("e" . "east")
+ ("se" . "southeast")
+ ("s" . "south")
+ ("sw" . "southwest")
+ ("w" . "west")
+ ("nw" . "northwest")
+ ("u" . "up")
+ ("d" . "down")))
+
+(define (dealias-exit-name exit-name)
+ (or (assoc-ref common-exit-aliases exit-name)
+ exit-name))
+
+(define* (room-cmd-go room message #:key direct-obj)