1 /* map_object_actions.h
3 * Routines for the actions available to map objects.
6 #ifndef MAP_OBJECT_ACTIONS_H
7 #define MAP_OBJECT_ACTIONS_H
9 #include "yx_uint16.h" /* for yx_uint16 coordinates */
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.
20 extern uint8_t move_actor(struct MapObj * actor, enum dir d);
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.
28 extern void move_player(enum dir d);
32 /* Make player wait one turn, i.e. only update_log with a "you wait" message
33 * and turn control over to the enemy.
35 extern void player_wait();
39 /* Check if coordinate pos on (or beyond) map is accessible to map object
42 extern char is_passable(struct Map * map, struct yx_uint16 pos);
46 /* Make player drop to ground map ojbect indexed by world.inventory_select. */
47 extern void player_drop();
49 /* Make player pick up map object from ground. */
50 extern void player_pick();