Пример #1
0
    def determine_visible(self):

        ####################################
        # rendering
        occluded = self.determine_occluders()

        # all light sources individually
        visible = set().union(*(utils.visible_coords_absolute_2D(occluded, light, light.position()) for light in self.lightsources))

        ####################################
        # RELATIVE

        # add special overlaps (trees the player *can't* see but which block vision nonetheless)
        # faster now, since 'visible' is smaller
        visible = utils.remaining(
            relative_coords(visible,    self.player.position()),
            relative_coords(occluded,   self.player.position()),
            arctracing.BLOCKTABLE
            )

        # if we're in smoke, show adjacents
        if visible == set( [(0,0)] ):
            visible.update( [(1,0), (-1,0), (0,-1), (0,1)] )

        self.visible = visible
Пример #2
0
 def visible_coords(self, blocked_relative):
     return utils.remaining(self.potentially_illuminated(), blocked_relative, self.blocktable)
Пример #3
0
 def visible_coords(self, blocked):
     return utils.remaining(self.all, blocked, self.table)