nexus/objects.h

161 lines
6.8 KiB
C
Raw Normal View History

2010-12-02 12:17:54 +11:00
#ifndef __OBJECTS_H
#define __OBJECTS_H
#include "defs.h"
2011-02-01 06:16:13 +11:00
object_t *addemptyob(obpile_t *where, object_t *o);
2010-12-07 18:34:26 +11:00
knowledge_t *addknowledge(enum OBCLASS id, char *hiddenname, int known);
2011-02-01 06:16:13 +11:00
material_t *addmaterial(enum MATERIAL id, char *name, float weightrating);
2010-12-07 18:34:26 +11:00
objectclass_t *addoc(enum OBCLASS id, char *name, char *desc, char glyph);
2010-12-02 12:17:54 +11:00
object_t *addob(obpile_t *where, char *name);
object_t *addobject(obpile_t *where, char *name, int canstack);
obmod_t *addobmod(enum OBMOD id, char *suffix, enum BODYPART bp);
2010-12-02 12:17:54 +11:00
obpile_t *addobpile(lifeform_t *owner, cell_t *where);
objecttype_t *addot(int id, char *name, char *description, int material, float weight, int obclassid);
2011-02-01 06:16:13 +11:00
void adjustdammaterial(unsigned int *dam, enum DAMTYPE damtype, enum MATERIAL mat);
void adjustdamob(object_t *o, unsigned int *dam, enum DAMTYPE damtype);
//void adjustprice(objecttype_t *ot, float *price );
void appendinscription(object_t *o, char *text);
int blessob(object_t *o);
void brightflash(cell_t *centre, int range, lifeform_t *immunelf);
2010-12-02 12:17:54 +11:00
object_t *canstackob(obpile_t *op, object_t *match);
object_t *canstacknewot(obpile_t *op, objecttype_t *match);
2011-02-01 06:16:13 +11:00
int changemat(object_t *o, enum MATERIAL mat);
2010-12-02 12:17:54 +11:00
void copyobprops(object_t *dst, object_t *src);
2010-12-07 18:34:26 +11:00
int countnames(char **list);
2010-12-02 12:17:54 +11:00
int countobs(obpile_t *op);
2011-02-01 06:16:13 +11:00
int curseob(object_t *o);
void damageallobs(object_t *exception, obpile_t *op, int howmuch, int damtype);
void explodeob(object_t *o, flag_t *f, int bigness);
void extinguish(object_t *o);
2010-12-02 12:17:54 +11:00
material_t *findmaterial(int id);
objectclass_t *findoc(int id);
object_t *findobbyid(obpile_t *op, long oid);
2010-12-02 12:17:54 +11:00
object_t *findobl(obpile_t *op, char let); // find object by letter
obmod_t *findobmod(enum OBMOD id);
2010-12-07 18:34:26 +11:00
objecttype_t *findot(enum OBTYPE id);
2010-12-02 12:17:54 +11:00
objecttype_t *findotn(char *name); // find objecttype by name
void fragments(cell_t *centre, char *what, int speed);
2010-12-07 18:34:26 +11:00
void genhiddennames(void);
2011-02-01 06:16:13 +11:00
int getcharges(object_t *o);
int geteffecttime(int min, int max, enum BLESSTYPE isblessed);
objecttype_t *getlinkspell(object_t *o);
2011-02-01 06:16:13 +11:00
int getmissileaccuracy(lifeform_t *thrower, cell_t *where, object_t *missile, object_t *firearm, enum ATTRIB whichatt);
int getobaccuracy(object_t *wep);
int getobvalue(object_t *o);
//int getobtypevalue(objecttype_t *ot);
char *getaccuracyname(int accpct);
object_t *getammo(lifeform_t *lf);
object_t *getrandomammo(lifeform_t *lf);
2010-12-07 18:34:26 +11:00
char *getdamname(enum DAMTYPE damtype);
2011-02-01 06:16:13 +11:00
char *getdamnamenoun(enum DAMTYPE damtype);
char *getfillingname(int nutrition);
int getfirearmrange(object_t *o);
int getfirearmspeed(object_t *o);
2010-12-07 18:34:26 +11:00
char getglyph(object_t *o);
char *genhiddenname(enum OBCLASS id);
char *gethiddenname(object_t *o);
int getobattackdelay(object_t *o);
2010-12-02 12:17:54 +11:00
int getletindex(char let);
2011-02-01 06:16:13 +11:00
int getmaterialvalue(enum MATERIAL mat );
int getmaxthrowrange(lifeform_t *lf, object_t *o);
2010-12-02 12:17:54 +11:00
char getnextletter(obpile_t *op, char *wantletter);
2011-02-01 06:16:13 +11:00
int getnumshards(object_t *o);
int getnutritionbase(object_t *o);
int getnutrition(object_t *o);
char *getobdesc(object_t *o, char *buf);
cell_t *getoblocation(object_t *o);
2010-12-02 12:17:54 +11:00
char *getobname(object_t *o, char *buf, int count);
2011-02-01 06:16:13 +11:00
char *real_getobname(object_t *o, char *buf, int count, int wantcondition, int adjustforblind, int wantblesscurse);
float getobpileweight(obpile_t *op);
char *getobconditionname(object_t *o, char *buf);
char *getobhurtname(object_t *o, enum DAMTYPE damtype);
float getobweight(object_t *o);
float getobunitweight(object_t *o);
objecttype_t *getoppositestairs(objecttype_t *ot);
char *real_getrandomob(map_t *map, char *buf, int cond, int cval, int forcedepth);
2010-12-02 12:17:54 +11:00
char *getrandomob(map_t *map, char *buf);
2010-12-07 18:34:26 +11:00
char *getrandomobwithdt(map_t *map, enum DAMTYPE damtype, char *buf);
2011-02-01 06:16:13 +11:00
char *getrandomobwithclass(map_t *map, enum OBCLASS cid, char *buf);
char *getschoolname(enum SPELLSCHOOL sch);
int getshatterdam(object_t *o);
int getthrowdam(object_t *o);
int hasedibleob(obpile_t *op);
2010-12-07 18:34:26 +11:00
object_t *hasknownob(obpile_t *op, enum OBTYPE oid);
2010-12-02 12:17:54 +11:00
object_t *hasob(obpile_t *op, enum OBTYPE oid);
2011-02-01 06:16:13 +11:00
object_t *hasobofclass(obpile_t *op, enum OBCLASS cid);
object_t *hasobmulti(obpile_t *op, enum OBTYPE *oid, int noids);
object_t *hasobwithflag(obpile_t *op, enum FLAG flagid);
object_t *hasobwithflagval(obpile_t *op, enum FLAG flagid, int val0, int val1, int val2, char *text);
2010-12-07 18:34:26 +11:00
object_t *hasobid(obpile_t *op, int id);
2011-02-01 06:16:13 +11:00
void identify(object_t *o);
2010-12-02 12:17:54 +11:00
void initobjects(void);
2011-02-01 06:16:13 +11:00
flag_t *isarmour(object_t *o);
int isactivated(object_t *o);
int isammofor(object_t *ammo, object_t *gun);
int isbetterarmourthan(object_t *a, object_t *b);
int isbetterwepthan(object_t *a, object_t *b);
int isblessed(object_t *o);
int isblessknown(object_t *o);
int iscorpse(object_t *o);
int iscursed(object_t *o);
int isdangerousob(object_t *o, lifeform_t *lf, int onlyifknown);
2010-12-07 18:34:26 +11:00
int isdrinkable(object_t *o);
2011-02-01 06:16:13 +11:00
int isedible(object_t *o);
flag_t *isequipped(object_t *o);
int isequippedon(object_t *o, enum BODYPART bp);
int isfirearm(object_t *o);
int isflammable(object_t *o);
2010-12-07 18:34:26 +11:00
int isknown(object_t *o);
2011-02-01 06:16:13 +11:00
int isidentified(object_t *o);
int ismetal(enum MATERIAL mat);
int ismissile(object_t *o);
int isoperable(object_t *o);
2010-12-02 12:17:54 +11:00
int isplainob(object_t *o);
2011-02-01 06:16:13 +11:00
int ispourable(object_t *o);
int ispushable(object_t *o);
2010-12-07 18:34:26 +11:00
int isreadable(object_t *o);
2011-02-01 06:16:13 +11:00
int isrotting(object_t *o);
int isweapon(object_t *o);
int iswearable(object_t *o);
2010-12-02 12:17:54 +11:00
void killmaterial(material_t *m);
void killob(object_t *o);
2011-02-01 06:16:13 +11:00
void killobpile(obpile_t *o);
2010-12-02 12:17:54 +11:00
void killoc(objectclass_t *oc);
void killot(objecttype_t *ot);
2011-02-01 06:16:13 +11:00
lifeform_t *makeanimated(lifeform_t *lf, object_t *o, int level);
2010-12-07 18:34:26 +11:00
void makeknown(enum OBTYPE otid);
2010-12-02 12:17:54 +11:00
object_t *moveob(object_t *src, obpile_t *dst, int howmany);
void modbonus(object_t *o, int amt);
//object_t *newobeffects(object_t *o);
2011-02-01 06:16:13 +11:00
void obaction(object_t *o, char *text);
2010-12-07 18:34:26 +11:00
object_t *obexists(enum OBTYPE obid);
2011-02-01 06:16:13 +11:00
void obdie(object_t *o);
2010-12-02 12:17:54 +11:00
int obfits(object_t *o, obpile_t *op);
2011-02-01 06:16:13 +11:00
enum DAMTYPE oblastdamtype(object_t *o);
int obmodappliesto(obmod_t *om, objecttype_t *ot);
2011-02-01 06:16:13 +11:00
flag_t *obproduceslight(object_t *o);
2010-12-02 12:17:54 +11:00
int obpropsmatch(object_t *a, object_t *b);
2011-02-01 06:16:13 +11:00
int obotpropsmatch(object_t *a, objecttype_t *b);
int operate(lifeform_t *lf, object_t *o, cell_t *where);
2010-12-02 12:17:54 +11:00
int pilehasletter(obpile_t *op, char let);
2011-02-01 06:16:13 +11:00
void potioneffects(lifeform_t *lf, enum OBTYPE oid, enum BLESSTYPE isblessed, int *seen);
int pour(lifeform_t *lf, object_t *o);
2010-12-07 18:34:26 +11:00
void quaff(lifeform_t *lf, object_t *o);
2011-02-01 06:16:13 +11:00
void readsomething(lifeform_t *lf, object_t *o);
void removedeadobs(obpile_t *op);
2010-12-07 18:34:26 +11:00
int removeob(object_t *o, int howmany);
2010-12-02 12:17:54 +11:00
object_t *relinkob(object_t *src, obpile_t *dst);
2011-02-01 06:16:13 +11:00
void setblessed(object_t *o, enum BLESSTYPE wantbless);
void setinscription(object_t *o, char *text);
object_t *splitob(object_t *o);
int takedamage(object_t *o, unsigned int howmuch, int damtype);
int fireat(lifeform_t *thrower, object_t *o, cell_t *where, int speed, object_t *firearm);
void timeeffectsob(object_t *o);
void turnoff(lifeform_t *lf, object_t *o);
void turnon(lifeform_t *lf, object_t *o);
int usecharge(object_t *o);
int validateobs(void);
2010-12-07 18:34:26 +11:00
int willshatter(enum MATERIAL mat);
2010-12-02 12:17:54 +11:00
#endif
2010-12-07 18:34:26 +11:00