home · contact · privacy
Password-protect tiles from (un-)installing things on them.
[plomrogue2] / plomrogue / tasks.py
index 841a0e663d0f343542dd7e0dd96476f37a5151e3..3dc09282449ac03088d88800c488004f8dfafaee 100644 (file)
@@ -198,6 +198,7 @@ class Task_COMMAND(Task):
 
 
 class Task_INSTALL(Task):
+    argtypes = 'string'
 
     def _get_uninstallables(self):
         return [t for t in self.thing.game.things
@@ -207,6 +208,9 @@ class Task_INSTALL(Task):
                 and t.position == self.thing.position]
 
     def check(self):
+        if not self.thing.game.can_do_tile_with_pw(*self.thing.position,
+                                                   self.args[0]):
+            raise GameError('wrong password for tile')
         if self.thing.carrying:
             if not hasattr(self.thing.carrying, 'installable')\
                or not self.thing.carrying.installable: