(build-actions
(init (wrap-apply player-init))
(handle-input (wrap-apply player-handle-input))
- (tell (wrap-apply player-tell))))
+ (tell (wrap-apply player-tell))
+ (disconnect-self-destruct (wrap-apply player-disconnect-self-destruct))))
(define player-actions*
(append player-actions
(<- player (gameobj-gm player) 'write-home
#:text text))
+(define-mhandler (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
+ #:exclude (actor-id player)
+ #:text (format #f "~a disappears in a puff of entropy!\n"
+ (slot-ref player 'name))))
+ (gameobj-self-destruct player))
+
;;; Command handling
;;; ================
;; returns false for in the command response
(fold
(lambda (co-occupant prev)
- (display "pre-message\n")
(let* ((result (<-wait player co-occupant 'get-commands
#:verb verb))
(commands (message-ref result 'commands))
(goes-by (message-ref result 'goes-by)))
- (display "post-message\n")
(append
(map (lambda (command)
(list command goes-by co-occupant))