예제 #1
0
bool overmapbuffer::has_horde(int const x, int const y, int const z) {
    for (auto const &m : overmap_buffer.monsters_at(x, y, z)) {
        if (m->horde) {
            return true;
        }
    }

    return false;
}
예제 #2
0
bool overmapbuffer::has_horde( const int x, const int y, const int z )
{
    for( const auto &m : overmap_buffer.monsters_at( x, y, z ) ) {
        if( m->horde ) {
            return true;
        }
    }

    return false;
}
예제 #3
0
int overmapbuffer::get_horde_size( const int x, const int y, const int z )
{
    int horde_size = 0;
    for( const auto &m : overmap_buffer.monsters_at( x, y, z ) ) {
        if( m->horde ) {
            if( !m->monsters.empty() ) {
                horde_size += m->monsters.size();
            } else {
                // We don't know how large this will actually be, because
                // population "1" can still result in a zombie pack.
                // So we double the population as an estimate to make
                // hordes more likely to be visible on the overmap.
                horde_size += m->population * 2;
            }
        }
    }

    return horde_size;
}