summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-act.h
blob: d0f3f0e376eb7b3e14dcbd4d9091abda4297c034 (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
/**
 * @file
 * @brief Monsters doing stuff (monsters acting).
**/

#ifndef MONACT_H
#define MONACT_H

struct bolt;

class MonsterActionQueueCompare
{
public:
    bool operator() (pair<monster*, int> m1, pair<monster*, int> m2)
    {
        return m1.second < m2.second;
    }
};

bool mon_can_move_to_pos(const monster* mons, const coord_def& delta,
                         bool just_check = false);
bool mons_can_move_towards_target(const monster* mon);
bool monster_swaps_places(monster* mon, const coord_def& delta, bool takes_time = true);

bool handle_throw(monster* mons, bolt &beem, bool teleport, bool check_only);

void handle_monsters(bool with_noise = false);
void handle_monster_move(monster* mon);

void queue_monster_for_action(monster* mons);

#define ENERGY_SUBMERGE(entry) (max(entry->energy_usage.swim / 2, 1))

#endif