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" (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.
20 extern uint8_t move_actor(struct MapObj * actor, char d);
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.
26 extern void move_player(char d);
28 /* Make player wait one turn, i.e. only update_log with a "you wait" message
29 * and turn control over to the enemy.
31 extern void player_wait();
33 /* Check if coordinate pos on (or beyond) map is accessible to map object
36 extern char is_passable(struct Map * map, struct yx_uint16 pos);
38 /* Make player drop to ground map ojbect indexed by world.inventory_select. */
39 extern void player_drop();
41 /* Make player pick up map object from ground. */
42 extern void player_pick();