home · contact · privacy
46dc92c13ec8239cac7d8c8d334264ab7ecef202
[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" and handle the consequences:
16  * either the move succeeds, or another actor is encountered and hit (which
17  * leads to its lifepoint decreasing by one and potentially its death), or the
18  * target square is not passable and the move fails.
19  */
20 extern uint8_t move_actor(struct MapObj * actor, enum dir d);
21
22
23
24 /* Wrapper for using move_actor() on the MapObj representing the player; updates
25  * the game log with appropriate messages on the move attempt and its results;
26  * turns over to turn_over() when finished.
27  */
28 extern void move_player(enum dir d);
29
30
31
32 /* Make player wait one turn, i.e. only update_log with a "you wait" message
33  * and turn control over to the enemy.
34  */
35 extern void player_wait();
36
37
38
39 /* Check if coordinate pos on (or beyond) map is accessible to map object
40  * movement.
41  */
42 extern char is_passable(struct Map * map, struct yx_uint16 pos);
43
44
45
46 /* Make player drop to ground map ojbect indexed by world.inventory_select. */
47 extern void player_drop();
48
49 /* Make player pick up map object from ground. */
50 extern void player_pick();
51
52
53
54 #endif