home · contact · privacy
8e0af47a928ba30e2097ad117c3d292132d4c116
[plomrogue] / src / map_object_actions.h
1 /* map_object_actions.h
2  *
3  * Routines for the actions available to map objects.
4  */
5
6 #ifndef MAP_OBJECT_ACTIONS_H
7 #define MAP_OBJECT_ACTIONS_H
8
9 #include "yx_uint16.h" /* for yx_uint16 coordinates */
10 struct Map;
11 struct MapObj;
12
13
14
15 /* Try to move "actor" one step in direction "d" (where east is 'E', north 'N'
16  * etc.) and handle the consequences: either the move succeeds, or another actor
17  * is encountered and hit (which leads to its lifepoint decreasing by one and
18  * potentially its death), or the target square is not passable, the move fails.
19  */
20 extern uint8_t move_actor(struct MapObj * actor, char d);
21
22 /* Wrapper for using move_actor() on the MapObj representing the player; updates
23  * the game log with appropriate messages on the move attempt and its results;
24  * turns over to turn_over() when finished.
25  */
26 extern void move_player(char d);
27
28 /* Make player wait one turn, i.e. only update_log with a "you wait" message
29  * and turn control over to the enemy.
30  */
31 extern void player_wait();
32
33 /* Check if coordinate pos on (or beyond) map is accessible to map object
34  * movement.
35  */
36 extern char is_passable(struct Map * map, struct yx_uint16 pos);
37
38 /* Make player drop to ground map ojbect indexed by world.inventory_select. */
39 extern void player_drop();
40
41 /* Make player pick up map object from ground. */
42 extern void player_pick();
43
44
45
46 #endif