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
11 #include "yx_uint16.h" /* for yx_uint16 coordinates */
18 /* Try to move "actor" one step in direction "d" and handle the consequences:
19 * either the move succeeds, or another actor is encountered and hit (which leads
20 * to its lifepoint decreasing by one and potentially its death), or the target
21 * square is not passable and the move fails.
23 extern uint8_t move_actor(struct World * world, struct MapObj * actor,
28 /* Wrapper for using move_actor() on the MapObj representing the player; updates
29 * the game log with appropriate messages on the move attempt and its results;
30 * turns over to turn_over() when finished.
32 extern void move_player(struct World * world, enum dir d);
36 /* Make player wait one turn, i.e. only update_log with a "you wait" message
37 * and turn control over to the enemy.
39 extern void player_wait(struct World * world);
43 /* Check if coordinate pos on (or beyond) map is accessible to map object
46 extern char is_passable(struct Map * map, struct yx_uint16 pos);