#include "defs.h" cell_t *addcell(map_t *map, int x, int y); void addhomeobs(lifeform_t *lf); map_t *addmap(void); lifeform_t *addmonster(cell_t *c, enum RACE raceid, int jobok, int amt, int autogen, int *nadded); object_t *addrandomob(cell_t *c); int addrandomthing(cell_t *c, int obchance, int *nadded); int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, int doorpct); int cellhaslos(cell_t *c1, cell_t *dest); void clearcell(cell_t *c); int dowaterspread(cell_t *c); cell_t *getcellat(map_t *map, int x, int y); int getcelldist(cell_t *src, cell_t *dst); int getcelldistorth(cell_t *src, cell_t *dst); void getcellglyph(glyph_t *g, cell_t *c, lifeform_t *viewer); enum DEPTH getcellwaterdepth(cell_t *c, lifeform_t *lf); int getdoorlockdiff(int depth); int getdoorsecretdiff(int depth); enum CELLTYPE getemptycelltype(enum HABITAT hab); enum CELLTYPE getwallcelltype(enum HABITAT hab); flag_t *getmapcoords(map_t *m, int *x, int *y); int getmapdifficulty(map_t *m); void getradiuscells(cell_t *centre, int radius, int dirtype, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells); void getroomedge(map_t *m, int roomid, int minx, int miny, int maxx, int maxy, int whichside, cell_t **retcell, int *ncells, int onlywantsolid); object_t *gettopobject(cell_t *where, int forglyph); void calclight(map_t *map); int calcroompos(map_t *map, int w, int h, int *bx, int *by); int countadjcellsoftype(cell_t *cell, int id); int countadjcellswithflag(cell_t *cell, enum FLAG fid); int countcellexits(cell_t *cell); void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir); void createforest(map_t *map, int depth, map_t *parentmap, int exitdir); void createmap(map_t *map, int depth, int region, int habitat, map_t *parentmap, int exitdir); int createroom(map_t *map, int roomid, int overrideminw, int overrideminh, int *retx, int *rety, int *retw, int *reth, int doorpct, int forcewalls); int createvault(map_t *map, int roomid, vault_t *v, int *retw, int *reth); int dirtox(int dt, int dir); int dirtoy(int dt, int dir); void dumpmap(map_t *map); void explodesinglecell(cell_t *c, int dam, int killwalls, object_t *o, cell_t *centre); void explodecells(cell_t *c, int dam, int killwalls, object_t *o, int range, int dirtype, int wantannounce); celltype_t *findcelltype(enum CELLTYPE cid); celltype_t *findcelltypebyname(char *name); map_t *findmap(int mid); map_t *findmapofdepth(int depth); cell_t *findmapentrypoint(map_t *m, int side, lifeform_t *lf); object_t *findobidinmap(map_t *m, long id); cell_t *findobinmap(map_t *m, enum OBCLASS oid); map_t *findregionmap(int region, int depth); void forgetcells(map_t *map, int amt); cell_t *getcellindir(cell_t *cell, int dir); int getnewdigdir(cell_t *cell, int lastdir, int turnpct, int *moved); int getobchance(int habitat); int getvaultchance(map_t *m); char getvaultchar(vault_t *v, int x, int y); int getthingchance(int habitat); cell_t *getrandomadjcell(cell_t *c, int wantempty, int allowexpand); cell_t *real_getrandomadjcell(cell_t *c, int wantempty, int allowexpand, enum LOFTYPE needlof, enum OBTYPE *dontwantob); cell_t *getrandomcell(map_t *map); cell_t *getrandomcelloftype(map_t *map, enum CELLTYPE id); int getrandomdir(int dirtype); cell_t *getrandomroomcell(map_t *map, int roomid); void getroomcells(map_t *m, int roomid, cell_t **retcell, int *ncells); int getslipperyness(cell_t *c, object_t **slipob); cell_t *getstairdestination(object_t *o); object_t *hasenterableobject(cell_t *c); object_t *hascloseddoor(cell_t *c); lifeform_t *haslf(cell_t *c); int hasknownobject(cell_t *c); int hasobject(cell_t *c); object_t *hastrailof(obpile_t *op, lifeform_t *lf, enum OBTYPE oid, flag_t **tflag, lifeform_t *viewer); int isadjacent(cell_t *src, cell_t *dst); int isdark(cell_t *c); int isdiggable(cell_t *c); int isdoor(object_t *o, int *isopen); int isempty(cell_t *c); int isinscanrange(cell_t *c, void **thing, char *desc, glyph_t *glyph); int islit(cell_t *c); int isloopdirok(cell_t *cell, int dir); int isnewcellok(cell_t *cell, char *err); int isonmap(map_t *map, int x, int y); int isoutdoors(map_t *m); int iswallindir(cell_t *cell, int dir); int linkexits(map_t *m, int roomid, int minx, int miny, int maxx, int maxy); int linkstairs(object_t *o); void makedoor(cell_t *cell); void makelit(cell_t *c, enum LIGHTLEV how, int howlong); void makelitradius(cell_t *c, int radius, enum LIGHTLEV how, int howlong); void setcellknown(cell_t *cell, int forcelev); void setcelltype(cell_t *cell, int id); void updateknowncells(void); int wallstoleftright(cell_t *c, int dir);