home · contact · privacy
Add music player.
[plomrogue2] / plomrogue / tasks.py
index 8b831313c9d69a14f5b92b9f81273a13274e27b3..0bc0d9cf23c30c29e0b675f20ba0c77f0debe59f 100644 (file)
@@ -139,4 +139,22 @@ class Task_INTOXICATE(Task):
             if self.thing.game.sessions[c_id]['thing_id'] == self.thing.id_:
                 self.thing.game.io.send('RANDOM_COLORS', c_id)
                 self.thing.game.io.send('CHAT "You are drunk now."', c_id)
+                break
         self.thing.drunk = 10000
+
+
+class Task_COMMAND(Task):
+    argtypes = 'string'
+
+    def check(self):
+        if self.thing.carrying is None:
+            raise PlayError('nothing to command')
+        if not self.thing.carrying.commandable:
+            raise PlayError('cannot command this item type')
+
+    def do(self):
+        from plomrogue.misc import quote
+        reply = self.thing.carrying.interpret(self.args[0])
+        for c_id in self.thing.game.sessions:
+            if self.thing.game.sessions[c_id]['thing_id'] == self.thing.id_:
+                self.thing.game.io.send('REPLY ' + quote(reply), c_id)