void game::draw_line(const int x, const int y, const point center_point, std::vector<point> ret)
{
    if (u_see( x, y)) {
        for (std::vector<point>::iterator it = ret.begin();
             it != ret.end(); ++it) {
            const Creature *critter = critter_at( it->x, it->y );
            // NPCs and monsters get drawn with inverted colors
            if( critter != nullptr && u.sees( critter ) ) {
                critter->draw( w_terrain, center_point.x, center_point.y, true );
            } else {
                m.drawsq(w_terrain, u, it->x, it->y, true, true, center_point.x, center_point.y);
            }
        }
    }
}
Пример #2
0
void game::draw_line(const int x, const int y, const point center_point, std::vector<point> ret)
{
    if (u.sees( x, y)) {
        for( auto &elem : ret ) {
            const Creature *critter = critter_at( elem.x, elem.y );
            // NPCs and monsters get drawn with inverted colors
            if( critter != nullptr && u.sees( *critter ) ) {
                critter->draw( w_terrain, center_point.x, center_point.y, true );
            } else {
                m.drawsq( w_terrain, u, elem.x, elem.y, true, true, center_point.x,
                          center_point.y );
            }
        }
    }
}
Пример #3
0
item *game::inv_map_for_liquid( const item &liquid, const std::string &title, int radius )
{
    const auto filter = [ this, &liquid ]( const item_location & location ) {
        if( location.where() == item_location::type::character ) {
            Character *character = dynamic_cast<Character *>( critter_at( location.position() ) );
            if( character == nullptr ) {
                debugmsg( "Invalid location supplied to the liquid filter: no character found." );
                return false;
            }
            return location->get_remaining_capacity_for_liquid( liquid, *character ) > 0;
        }

        const bool allow_buckets = location.where() == item_location::type::map;
        return location->get_remaining_capacity_for_liquid( liquid, allow_buckets ) > 0;
    };

    return inv_internal( u, inventory_filter_preset( filter ), title, radius,
                         string_format( _( "You don't have a suitable container for carrying %s." ),
                                        liquid.tname().c_str() ) ).get_item();
}