def animate_path(game_state, path, graphic_char): path = [p for p in path if game_state.player.dungeon_mask.can_see_point(p)] camera = game_state.camera for _ in range(settings.MISSILE_ANIMATION_DELAY): game_state.prepare_draw() for position in path: x, y = camera.dungeon_to_screen_position(position) console.set_color_fg((x, y), graphic_char.color_fg) console.set_symbol((x, y), graphic_char.icon) console.flush()
def animate_point(game_state, position, graphic_chars): if not game_state.player.dungeon_mask.can_see_point(position): return camera = game_state.camera x, y = camera.dungeon_to_screen_position(position) for graphic_char in graphic_chars: game_state.prepare_draw() console.set_color_fg((x, y), graphic_char.color_fg) console.set_symbol((x, y), graphic_char.icon) for _ in range(settings.MISSILE_ANIMATION_DELAY): console.flush()
def _draw_path_point(self, point): screen_position = self.camera.dungeon_to_screen_position(point) terrain = self.entity.dungeon_level.value.\ get_tile_or_unknown(point).get_terrain() if(self.entity.dungeon_mask.can_see_point(point) and terrain.has("is_solid")): console.set_symbol(screen_position, icon.DIAGONAL_STRIPES) console.set_color_bg(screen_position, colors.BLOCKED_PATH) else: console.set_symbol(screen_position, icon.DIAGONAL_STRIPES) console.set_color_fg(screen_position, colors.PATH)
def draw(self, camera): points = list(self.position_list) points.reverse() point = None for point in points: if not self.parent.mover.can_pass_terrain( self.parent.dungeon_level.value.get_tile_or_unknown(point).get_terrain()): break console.set_symbol(camera.dungeon_to_screen_position(point), icon.FOOT_STEPS) console.set_color_fg(camera.dungeon_to_screen_position(point), colors.GRAY) if point: console.set_symbol(camera.dungeon_to_screen_position(point), "X") console.set_color_fg(camera.dungeon_to_screen_position(point), colors.LIGHT_ORANGE)
def draw(self, camera): points = list(self.position_list) points.reverse() point = None for point in points: if not self.parent.mover.can_pass_terrain( self.parent.dungeon_level.value.get_tile_or_unknown( point).get_terrain()): break console.set_symbol(camera.dungeon_to_screen_position(point), icon.FOOT_STEPS) console.set_color_fg(camera.dungeon_to_screen_position(point), colors.GRAY) if point: console.set_symbol(camera.dungeon_to_screen_position(point), "X") console.set_color_fg(camera.dungeon_to_screen_position(point), colors.LIGHT_ORANGE)
def draw_missile_at_point(self, point): x, y = self.camera.dungeon_to_screen_position(point) console.set_color_fg((x, y), self.color_fg) console.set_symbol((x, y), self.symbol)
def _draw_cursor(self): position = self.camera.dungeon_to_screen_position(self.cursor_position) console.set_symbol(position, self.cursor_symbol) console.set_color_fg(position, self.cursor_color)