1 /* map_object_actions.h
3 * Actions that can be performed my map objects / "actors". Note that apart
4 * from the consequences described below, each action may also trigger log
5 * messages and other minor stuff if the actor is equal to the player.
8 #ifndef MAP_OBJECT_ACTIONS_H
9 #define MAP_OBJECT_ACTIONS_H
11 #include <stdint.h> /* for uint8_t */
18 struct MapObjAct * next;
19 uint8_t id; /* unique id of map object action */
20 char * name; /* human-readable identifier */
21 uint8_t effort; /* how many turn the action takes */
22 void (* func) (struct MapObj *); /* function called after .effort turns */
27 /* Init MapObjAct chain at world.map_obj_acts from config/map_object_actions. */
28 extern void init_map_object_actions();
30 /* Free MapObjAct * chain starting at "moa". */
31 extern void free_map_object_actions(struct MapObjAct * moa);
33 /* Actor "mo" does nothing. */
34 extern void actor_wait(struct MapObj * mo);
36 /* Actor "mo" tries to move one step in direction described by char mo->arg
37 * (where east is 'E', north 'N') etc. Move either succeeds, or another actor is
38 * encountered and hit (which leads ot its lifepoint decreasing by one and
39 * eventually death), or the move fails due to an impassable target square.
41 extern void actor_move(struct MapObj * mo);
43 /* Actor "mo" tries to drop from inventory object indexed by number mo->args. */
44 extern void actor_drop(struct MapObj * mo);
46 /* Actor "mo" tries to pick up object from ground into its inventory. */
47 extern void actor_pick(struct MapObj * mo);
49 /* Actor "mo" tries to use inventory object indexed by number mo->args.
50 * (Currently the only valid use is consuming "MAGIC MEAT".
52 extern void actor_use(struct MapObj * mo);