#include "defs.h" cell_t *addcell(map_t *map, int x, int y); habitat_t *addhabitat(enum HABITAT id, char *name, enum CELLTYPE emptycell, enum CELLTYPE solidcell, int thingchance, int obchance, int vaultchance, int maxvisrange); void addhomeobs(lifeform_t *lf); map_t *addmap(void); lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int amt, int autogen, int *nadded); object_t *addrandomob(cell_t *c); int addrandomthing(cell_t *c, int obchance, int *nadded); region_t *addregion(enum REGIONTYPE rtype, region_t *parent, int outlineid); regionoutline_t *addregionoutline(enum REGIONTYPE rtype); regionthing_t *addregionthing(regionoutline_t *ro, int depth, int x, int y, enum REGIONTHING whatkind, int value, char *what); regiontype_t *addregiontype(enum REGIONTYPE id, char *name, enum HABITAT defaulthabitat, int maxdepth, int stairsperlev, int deeperdir, int major); void adjustcellglyphforlight(cell_t *c, glyph_t *col); int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, int doorpct, int dooropenchance); int cellhaslos(cell_t *c1, cell_t *dest); void clearcell(cell_t *c); void clearcell_exceptflags(cell_t *c, ...); int doelementspread(cell_t *c); int fix_reachability(map_t *m); int fix_unreachable_cell(cell_t *badcell); void floodfill(cell_t *startcell); 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); cell_t *get_closest_adjcell(cell_t *src, cell_t *dst); int getdoorlockdiff(int depth); int getdoorsecretdiff(int depth); flag_t *getmapcoords(map_t *m, int *x, int *y); int getmapdifficulty(map_t *m); map_t *getmapindir(map_t *src, int dir); int getmapmaxvisrange(map_t *m); void getradiuscells(cell_t *centre, int radius, int dirtype, int outsideonly, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells, int scatterdensity); int getroomid(cell_t *c); 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 xmargin, int ymargin, int *bx, int *by, int force); int countadjcellsoftype(cell_t *cell, int id); int countadjrooms(cell_t *cell); int countadjcellswithflag(cell_t *cell, enum FLAG fid, int dirtype); int countadjwalls(cell_t *cell); int countcellexits(cell_t *cell); int countcellexitsfor(lifeform_t *lf); int countmapobs(map_t *m, enum OBTYPE oid); void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createfakes(map_t *map, cell_t *cell); void createforest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob, int nclearings); void createhabitat(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createheaven(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int exitdir, object_t *entryob); void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createregionlink(map_t *m, cell_t *c, object_t *o, char *obname, enum REGIONTYPE newregiontype, region_t *parent); void createregionthing(map_t *map, regionthing_t *rt); void createriver(map_t *m); int createroom(map_t *map, int roomid, int overrideminw, int overrideminh, int xmargin, int ymargin, 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 *retx, int *rety); int dirtox(int dt, int dir); int dirtoy(int dt, int dir); void dumpmap(map_t *map, int showrooms); 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); habitat_t *findhabitat(enum HABITAT id); habitat_t *findhabitatbyname(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 OBTYPE oid); regionoutline_t *findoutline(int id); region_t *findregion(int regionid); region_t *findregionbytype(enum REGIONTYPE rtid); map_t *findregionmap(int regionid, int depth); regiontype_t *findregiontype(enum REGIONTYPE rtype); room_t *findroom(map_t *m, int roomid); map_t *findsurfaceexitmap(map_t *m); void forgetcells(map_t *map, int amt); cell_t *getcellindir(cell_t *cell, int dir); vault_t *getcellvault(cell_t *c); cell_t *getclosestroomcell(lifeform_t *lf, int roomid); int getnewdigdir(cell_t *cell, int lastdir, int turnpct, int *moved); int getobchance(int habitat); char *getregionname(char *buf, map_t *m, int withlevel); 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); int getrandomdirexcept(int dirtype, int exception); 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, int *madenewmap); 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); void initmap(void); 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 isnighttime(void); int isonmap(map_t *map, int x, int y); int isoutdoors(map_t *m); int isroom(cell_t *c); int iswallindir(cell_t *cell, int dir); void killfakes(map_t *map, cell_t *cell); int linkexit(cell_t *c, int wantfilled, int *ncellsadded); int linkexits(map_t *m, int roomid); int linkholes(map_t *map); int linkstairs(object_t *o, object_t *o2); void makedoor(cell_t *cell, int openchance); void makelit(cell_t *c, enum LIGHTLEV how, int howlong); void makelitradius(cell_t *c, int radius, enum LIGHTLEV how, int howlong); void mapentereffects(map_t *m); void moveobtoclearcell(object_t *o); enum RACE parserace(char *name, flagpile_t *wantflags, enum JOB *wantjob); int remove_deadends(map_t *m, int howmuch); void set_scanned_glyph(int targettype, void *what, char *descappend, char *desc, glyph_t *glyph); void setcellknown(cell_t *cell, int forcelev); void setcellknownradius(cell_t *centre, int forcelev, int radius, int dirtype); void setcelltype(cell_t *cell, enum CELLTYPE id); int shattercell(cell_t *c, lifeform_t *fromlf, char *damstring); int unlinkstairsto(map_t *unlinkmap); void updateknowncells(void); int validateregions(void); int validateregionthing(regionthing_t *thing); int wallstoleftright(cell_t *c, int dir);