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
20 * leads to its lifepoint decreasing by one and potentially its death), or the
21 * target 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);
50 /* Make player drop to ground map ojbect indexed by world.inventory_select. */
51 extern void player_drop(struct World * world);
53 /* Make player pick up map object from ground. */
54 extern void player_pick(struct World * world);