diff skaapsteker/dialogue.py @ 476:1c05b6c2b971

Start of drop item support.
author Simon Cross <hodgestar@gmail.com>
date Sat, 09 Apr 2011 21:55:45 +0200
parents 45755c143813
children b48c194c4af9
line wrap: on
line diff
--- a/skaapsteker/dialogue.py	Sat Apr 09 21:53:19 2011 +0200
+++ b/skaapsteker/dialogue.py	Sat Apr 09 21:55:45 2011 +0200
@@ -39,12 +39,18 @@
         """Switch dialogue to another npc."""
         OpenDialog.post(npc_name)
 
+    def _drop_item(self, item):
+        """Create a tail of the given type."""
+        print "Dropping", item
+        self.world.get_item(item, to_level=self._me.level)
+
     def event(self, ev):
         my_locals = {
             "state": self.states,
             "world": self.world,
             "npcs": self.world.npcs,
             "switch_to": self._switch_dialogue_to,
+            "drop_item": self._drop_item,
         }
         my_locals.update(ev.items)
         state = self.states[self.state]