adding and dropping things works
[mudsync.git] / mudsync / thing.scm
index 341371f7531dbccdd4de448b878524f5224e90da..a3ae6b003e3d706407252ca931e9f1fbd4d50a56 100644 (file)
   #:use-module (ice-9 format)
   #:export (<thing>
             thing-commands
+            thing-commands*
             thing-contained-commands
-            thing-actions))
+            thing-contained-commands*
+            thing-actions
+            thing-actions*))
 
 (define thing-commands
   (list
    (direct-command "take" 'cmd-take)))
 
-;;; Are these kinds of things useful?
-;; ;; Doesn't inherit anything (gameobj has no commands)
-;; ;; so it's an alias.
-;; (define thing-commands* thing-commands)
+;; Doesn't inherit anything (gameobj has no commands)
+;; so it's an alias.
+(define thing-commands* thing-commands)
 
 (define thing-contained-commands
   (list
-   (empty-command "drop" 'cmd-drop)))
+   (direct-command "drop" 'cmd-drop)))
 
-;; ;; Doesn't inherit anything (gameobj has no contained-commands)
-;; ;; so it's an alias.
-;; (define thing-contained-commands* thing-contained-commands)
+;; Doesn't inherit anything (gameobj has no contained-commands)
+;; so it's an alias.
+(define thing-contained-commands* thing-contained-commands)
 
 (define thing-actions
   (build-actions
     (message-ref
      (<-wait thing player 'get-name)
      'val))
+  (define player-loc
+    (message-ref
+     (<-wait thing player 'get-loc)
+     'val))
   (define thing-name (slot-ref thing 'name))
   (define should-take
     (slot-ref-maybe-runcheck thing 'takeable player))
@@ -93,7 +99,7 @@
         (<- thing player 'tell
             #:text (format #f "You pick up ~a.\n"
                            thing-name))
-        (<- thing (gameobj-loc thing) 'tell-room
+        (<- thing player-loc 'tell-room
             #:text (format #f "~a picks up ~a.\n"
                            player-name
                            thing-name)