nexus/map.h

67 lines
2.9 KiB
C

#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);
void addrandomob(cell_t *c);
void addrandomthing(cell_t *c, int obchance);
int cellhaslos(cell_t *c1, cell_t *dest);
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 CELLTYPE getemptycelltype(enum HABITAT hab);
enum CELLTYPE getwallcelltype(enum HABITAT hab);
object_t *gettopobject(cell_t *where);
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 createmap(map_t *map, int depth, int habitat);
void createroom(map_t *map, int minx, int miny, int w, int h, int roomid);
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);
map_t *findmap(int mid);
map_t *findmapofdepth(int depth);
object_t *findobidinmap(map_t *m, long id);
cell_t *findobinmap(map_t *m, enum OBCLASS oid);
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);
cell_t *getrandomadjcell(cell_t *c, int wantempty, int allowexpand);
cell_t *real_getrandomadjcell(cell_t *c, int wantempty, int allowexpand, enum OBTYPE *dontwantob);
cell_t *getrandomcell(map_t *map);
cell_t *getrandomcelloftype(map_t *map, int 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);
lifeform_t *haslf(cell_t *c);
int hasobject(cell_t *c);
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 iswallindir(cell_t *cell, int dir);
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 setcelltype(cell_t *cell, int id);
void updateknowncells(void);