home · contact · privacy
Implement doors.
[plomrogue2] / plomrogue / things.py
index a51b2b2b48083037b146cca377005ecf9994cb8b..4d319b9d21e0781b98d615d5d29f39e28392d2fd 100644 (file)
@@ -74,6 +74,26 @@ class Thing_SpawnPoint(Thing):
 
 
 
+class Thing_DoorSpawner(ThingSpawner):
+    child_type = 'Door'
+
+
+
+class Thing_Door(Thing):
+    symbol_hint = 'D'
+    blocking = False
+    portable = True
+
+    def open(self):
+        self.blocking = False
+        self.portable = True
+
+    def close(self):
+        self.blocking = True
+        self.portable = False
+
+
+
 class ThingAnimate(Thing):
     blocking = True
 
@@ -122,8 +142,8 @@ class ThingAnimate(Thing):
         if self._fov:
             return self._fov
         fov_map_class = self.game.map_geometry.fov_map_class
-        self._fov = fov_map_class(self.game.maps, self.position, 12,
-                                  self.game.get_map)
+        self._fov = fov_map_class(self.game.things, self.game.maps, self.position,
+                                  12, self.game.get_map)
         return self._fov
 
     def fov_test(self, big_yx, little_yx):