X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_free?a=blobdiff_plain;f=plomrogue%2Fthings.py;h=9edfa68ca85871557aeb396075c37ed68475011d;hb=31951696faf591c6d92236c70a9637c7620111e5;hp=30cd2bfe104fdd2a36836b87a401f6d33cc555f2;hpb=6354f0d85ce38a5450142b2bc775e49f0abfc7b8;p=plomrogue2 diff --git a/plomrogue/things.py b/plomrogue/things.py index 30cd2bf..9edfa68 100644 --- a/plomrogue/things.py +++ b/plomrogue/things.py @@ -145,6 +145,11 @@ class Thing_Bottle(Thing): symbol_hint = 'B' portable = True full = True + thing_char = '~' + + def empty(self): + self.thing_char = '_' + self.full = False @@ -324,15 +329,28 @@ class ThingAnimate(Thing): self.game.changed = True self.task = self.get_next_task() + def prepare_multiprocessible_fov_stencil(self): + fov_map_class = self.game.map_geometry.fov_map_class + fov_radius = 3 if self.drunk > 0 else 12 + self._fov = fov_map_class(self.game.things, self.game.maps, + self.position, fov_radius, self.game.get_map) + + def multiprocessible_fov_stencil(self): + self._fov.init_terrain() + @property def fov_stencil(self): if self._fov: return self._fov - fov_map_class = self.game.map_geometry.fov_map_class - self._fov = fov_map_class(self.game.things, self.game.maps, self.position, - 12, self.game.get_map) + # due to the pre-multiprocessing in game.send_gamestate, + # the following should actually never be called + self.prepare_multiprocessible_fov_stencil() + self.multiprocessible_fov_stencil() return self._fov + def fov_stencil_make(self): + self._fov.make() + def fov_test(self, big_yx, little_yx): test_position = self.fov_stencil.target_yx(big_yx, little_yx) if self.fov_stencil.inside(test_position):