summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fprop.cc
blob: 5ab09c5279f176e1581fdfac8198791ad4f868ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * File:      envmap.cc
 * Summary:   Functions dealing with env.map_knowledge.
 */

#include "AppHdr.h"

#include "fprop.h"

#include "coord.h"
#include "env.h"
#include "stuff.h"

bool is_sanctuary(const coord_def& p)
{
    if (!map_bounds(p))
        return (false);
    return (testbits(env.pgrid(p), FPROP_SANCTUARY_1)
            || testbits(env.pgrid(p), FPROP_SANCTUARY_2));
}

bool is_bloodcovered(const coord_def& p)
{
    return (testbits(env.pgrid(p), FPROP_BLOODY));
}

int str_to_fprop ( const std::string &str)
{
    if (str == "bloody")
        return (FPROP_BLOODY);
    if (str == "no_cloud_gen")
        return (FPROP_NO_CLOUD_GEN);
    if (str == "no_rtele_into")
        return (FPROP_NO_RTELE_INTO);
    if (str == "no_ctele_into")
        return (FPROP_NO_CTELE_INTO);
    if (str == "no_tele_into")
        return (FPROP_NO_TELE_INTO);

    return (FPROP_NONE);
}