X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=src%2Fserver%2Fmap_object_actions.h;h=7b5283fc9cff33f4254626ca79c3b686cb9c2dab;hb=539f4419afa0966d67b341dc6b30a6174bd3f844;hp=eec0087672a0eb90136b26bb78bd951677de4925;hpb=e03020342a74aef143b1ec38c18966dac64181b5;p=plomrogue diff --git a/src/server/map_object_actions.h b/src/server/map_object_actions.h index eec0087..7b5283f 100644 --- a/src/server/map_object_actions.h +++ b/src/server/map_object_actions.h @@ -8,24 +8,29 @@ #ifndef MAP_OBJECT_ACTIONS_H #define MAP_OBJECT_ACTIONS_H -#include /* uint8_t */ +#include /* uint8_t, uint23_t */ +#include /* FILE */ struct MapObj; +struct EntrySkeleton; struct MapObjAct { + uint8_t id; /* unique id of map object action; must be >0 */ struct MapObjAct * next; void (* func) (struct MapObj *); /* function called after .effort turns */ char * name; /* human-readable identifier */ - uint8_t id; /* unique id of map object action; must be >0 */ uint8_t effort; /* how many turns the action takes */ }; -/* Init MapObjAct chain at world.map_obj_acts. */ -extern void init_map_object_actions(); +/* Read-in to "entry" multi-line entry from MapObjAct config "file", using + * pre-allocated "line", "linemax" and "context" as input for err_try_fgets(). + */ +extern void read_map_object_action(char * line, uint32_t linemax,char * context, + struct EntrySkeleton * entry, FILE * file); /* Free MapObjAct * chain starting at "moa". */ extern void free_map_object_actions(struct MapObjAct * moa); @@ -50,8 +55,7 @@ extern void actor_drop(struct MapObj * mo); extern void actor_pick(struct MapObj * mo); /* Actor "mo" tries to use inventory object indexed by number mo->args. - * (Currently the only valid use is consuming an item named "MAGIC MEAT", - * which increments the actors lifepoints.) + * (Currently the only valid use is consuming items defined as consumable.) */ extern void actor_use(struct MapObj * mo);