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 "monster" in random direction. On contact with other monster,
19 * only bump. On contact with player, fight / reduce player's hitpoints,
20 * and thereby potentially trigger the player's death. Update the log for any
23 extern void move_monster(struct World * world, struct Monster * monster);
27 /* Try to move player in direction "d". On contact with monster, fight / reduce
28 * monster's hitpoints, and thereby potentially trigger the monster's death,
29 * create a corpse and increment the player's score by the amount of hitpoints
30 * the monster started with. Update the log on whatever the player did and turn
31 * control over to the enemy.
33 extern void move_player (struct World * world, enum dir d);
37 /* Make player wait one turn, i.e. only update_log with a "you wait" message
38 * and turn control over to the enemy.
40 extern void player_wait(struct World * world);
44 /* Check if coordinate pos on (or beyond) map is accessible to map object
47 extern char is_passable (struct Map * map, struct yx_uint16 pos);