home · contact · privacy
Re-wrote map object system to use same structs for items and monsters, and switched...
[plomrogue] / src / map_object_actions.h
1 /* map_object_actions.h
2  *
3  * Routines for the actions available to map objects.
4  */
5
6 #ifndef MAP_OBJECT_ACTIONS_H
7 #define MAP_OBJECT_ACTIONS_H
8
9
10
11 #include "yx_uint16.h" /* for yx_uint16 coordinates */
12 struct World;
13 struct Map;
14 struct MapObj;
15
16
17
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
21  * contact action.
22  */
23 extern void move_monster(struct World * world, struct MapObj * monster);
24
25
26
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.
32  */
33 extern void move_player (struct World * world, enum dir d);
34
35
36
37 /* Make player wait one turn, i.e. only update_log with a "you wait" message
38  * and turn control over to the enemy.
39  */
40 extern void player_wait(struct World * world);
41
42
43
44 /* Check if coordinate pos on (or beyond) map is accessible to map object
45  * movement.
46  */
47 extern char is_passable (struct Map * map, struct yx_uint16 pos);
48
49
50
51 #endif