252 lines
11 KiB
C
252 lines
11 KiB
C
#ifndef __OBJECTS_H
|
|
#define __OBJECTS_H
|
|
#include "defs.h"
|
|
|
|
brand_t *addbrand(enum BRAND id, char *suffix, enum BODYPART bp);
|
|
object_t *addemptyob(obpile_t *where, object_t *o);
|
|
hiddenname_t *addhiddenname(enum OBCLASS obclass, char *text);
|
|
knowledge_t *addknowledge(enum OBCLASS id, char *hiddenname, int known);
|
|
material_t *addmaterial(enum MATERIAL id, char *name, float weightrating);
|
|
objectclass_t *addoc(enum OBCLASS id, char *name, char *desc, char glyph, int glyphcolour);
|
|
void addocnoun(objectclass_t *oc, char *text);
|
|
object_t *addob(obpile_t *where, char *name);
|
|
object_t *addobfast(obpile_t *where, enum OBTYPE oid);
|
|
object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes, enum OBTYPE forceoid);
|
|
int addobburst(cell_t *where, int range, int dirtype, char *name, lifeform_t *fromlf, enum LOFTYPE needlof);
|
|
obmod_t *addobmod(enum OBMOD id, char *prefix);
|
|
obpile_t *addobpile(lifeform_t *owner, cell_t *where, object_t *parentob);
|
|
void addobsinradius(cell_t *centre, int radius, int dirtype, char *name, int allowdupes);
|
|
objecttype_t *addot(enum OBTYPE id, char *name, char *description, int material, float weight, int obclassid, enum LFSIZE size);
|
|
void adjustdamhardness(unsigned int *dam, enum DAMTYPE damtype, enum MATERIAL mat);
|
|
void adjustdammaterial(unsigned int *dam, enum DAMTYPE damtype, enum MATERIAL mat);
|
|
void adjustdamob(object_t *o, unsigned int *dam, enum DAMTYPE damtype);
|
|
int adjustarmourpenalty(lifeform_t *lf, float amt);
|
|
int adjustshieldpenalty(lifeform_t *lf, float amt);
|
|
//void adjustprice(objecttype_t *ot, float *price );
|
|
void appendinscription(object_t *o, char *text);
|
|
void applyobmod(object_t *o, obmod_t *om);
|
|
int blessob(object_t *o);
|
|
void brightflash(cell_t *centre, int range, lifeform_t *immunelf);
|
|
void calcshopprice(object_t *o, flag_t *shopitemflag);
|
|
int canbepoisoned(enum OBTYPE oid);
|
|
int canseeob(lifeform_t *lf, object_t *o);
|
|
object_t *canstackob(obpile_t *op, object_t *match);
|
|
object_t *canstacknewot(obpile_t *op, objecttype_t *match);
|
|
int changemat(object_t *o, enum MATERIAL mat);
|
|
int checkobnames(char *haystack, char *needle);
|
|
void colourmatchob(object_t *o, lifeform_t *lf);
|
|
void copyobprops(object_t *dst, object_t *src);
|
|
int countnames(char **list);
|
|
int countobs(obpile_t *op, int onlyifknown);
|
|
int countobsoftype(obpile_t *op, enum OBTYPE oid);
|
|
int countnoncosmeticobs(obpile_t *op, int onlyifknown);
|
|
int curseob(object_t *o);
|
|
void damageallobs(object_t *srcob, obpile_t *op, int howmuch, int damtype);
|
|
int doobtraps(object_t *o, lifeform_t *lf);
|
|
void dumpobrarity(void);
|
|
void explodeob(object_t *o, flag_t *f, int bigness);
|
|
void extinguish(object_t *o);
|
|
material_t *findmaterial(int id);
|
|
objectclass_t *findoc(int id);
|
|
object_t *findobbyid(obpile_t *op, long oid);
|
|
object_t *findobl(obpile_t *op, char let); // find object by letter
|
|
brand_t *findbrand(enum BRAND id);
|
|
obmod_t *findobmod(enum OBMOD id);
|
|
objecttype_t *findot(enum OBTYPE id);
|
|
objecttype_t *findotn(char *name); // find objecttype by name
|
|
void fragments(cell_t *centre, char *what, int speed, int howfar);
|
|
void genhiddennames(void);
|
|
object_t *getbestcontainer(obpile_t *op);
|
|
int getchargeinfo(object_t *o, int *cur, int *max);
|
|
int getcharges(object_t *o);
|
|
int getcritchance(lifeform_t *lf, object_t *o, lifeform_t *victim);
|
|
int geteffecttime(int min, int max, enum BLESSTYPE isblessed);
|
|
objecttype_t *getlinkspell(object_t *o);
|
|
enum COLOUR getmaterialcolour(enum MATERIAL mat );
|
|
enum MATSTATE getmaterialstate(enum MATERIAL mat);
|
|
int getmissileaccuracy(lifeform_t *thrower, cell_t *where, object_t *missile, object_t *firearm, enum ATTRIB whichatt);
|
|
int getobaccuracy(object_t *wep, lifeform_t *weilder);
|
|
int getobbonus(object_t *o);
|
|
int getobpoints(object_t *o);
|
|
skill_t *getobskill(object_t *o);
|
|
enum LFSIZE getobsize(object_t *o);
|
|
int getobspellpower(object_t *o, lifeform_t *lf);
|
|
int getobvalue(object_t *o);
|
|
char *getoperateverb(object_t *o);
|
|
object_t *getoutercontainer(object_t *o);
|
|
object_t *getoutercontainerop(obpile_t *op);
|
|
//int getobtypevalue(objecttype_t *ot);
|
|
char *getaccuracyname(int accpct);
|
|
object_t *getammo(object_t *gun);
|
|
objecttype_t *getbasicweaponforskill(enum SKILL skid);
|
|
object_t *getrandomammo(lifeform_t *lf);
|
|
objecttype_t *getrandomammofor(object_t *o);
|
|
brand_t *getrandombrandfor(objecttype_t *ot);
|
|
objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity);
|
|
enum OBTYPE getrandomtrapforob(void);
|
|
char *getdamname(enum DAMTYPE damtype);
|
|
char *getdamnamenoun(enum DAMTYPE damtype);
|
|
char *getfillingname(int nutrition);
|
|
int getfirearmrange(object_t *o);
|
|
int getfirearmspeed(object_t *o);
|
|
glyph_t *getglyph(object_t *o);
|
|
char *genhiddenname(enum OBCLASS id);
|
|
char *gethiddenname(object_t *o);
|
|
int getobattackdelay(object_t *o);
|
|
float getobhppct(object_t *o);
|
|
int getletindex(char let);
|
|
int getmaterialvalue(enum MATERIAL mat );
|
|
int getmaxthrowrange(lifeform_t *lf, object_t *o);
|
|
char getnextletter(obpile_t *op, char *wantletter);
|
|
int getnumshards(object_t *o);
|
|
int getnutritionbase(object_t *o);
|
|
int getnutrition(object_t *o);
|
|
enum DEPTH getobdepth(object_t *o, lifeform_t *lf);
|
|
char *getobdesc(object_t *o, char *buf);
|
|
char *getobequipinfo(object_t *o, char *buf);
|
|
char *getobextrainfo(object_t *o, char *buf);
|
|
cell_t *getoblocation(object_t *o);
|
|
cell_t *getobpilelocation(obpile_t *op);
|
|
char *getobname(object_t *o, char *buf, int count);
|
|
char *getobnametrue(object_t *o, char *buf, int count);
|
|
char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wantcondition, int adjustforblind, int wantblesscurse, int showall);
|
|
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, int forcehabitat, enum LFSIZE maxsize);
|
|
char *getrandomob(map_t *map, char *buf);
|
|
char *getrandomobofsize(map_t *map, char *buf, enum LFSIZE maxsize);
|
|
char *getrandomobwithdt(map_t *map, enum DAMTYPE damtype, char *buf);
|
|
char *getrandomobwithclass(map_t *map, enum OBCLASS cid, char *buf, int depthmod);
|
|
int getobrarity(object_t *o, enum RARITY *rr);
|
|
enum SPELLSCHOOL getschool(enum OBTYPE sid);
|
|
char *getschoolname(enum SPELLSCHOOL sch);
|
|
char *getschoolnameshort(enum SPELLSCHOOL sch);
|
|
int getshatterdam(object_t *o);
|
|
float getshopprice(object_t *o, lifeform_t *buyer);
|
|
enum SKILLLEVEL gettechlevel(enum OBTYPE oid);
|
|
int getthrowdam(object_t *o);
|
|
char *gettopobname(cell_t *c, char *retbuf);
|
|
enum BODYPART getweildloc(object_t *o, enum BODYPART *otherloc, int *twohanded);
|
|
int hasedibleob(obpile_t *op);
|
|
object_t *hasknownob(obpile_t *op, enum OBTYPE oid);
|
|
object_t *hasob(obpile_t *op, enum OBTYPE oid);
|
|
object_t *hasobletter(obpile_t *op, char letter);
|
|
object_t *hasobofclass(obpile_t *op, enum OBCLASS cid);
|
|
int hasobmod(object_t *o, obmod_t *om);
|
|
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);
|
|
object_t *hasobid(obpile_t *op, long id);
|
|
void identify(object_t *o);
|
|
void ignite(object_t *o);
|
|
void initobjects(void);
|
|
flag_t *isarmour(object_t *o);
|
|
int isactivated(object_t *o);
|
|
int isammofor(objecttype_t *ammo, object_t *gun);
|
|
int isbadfood(object_t *o);
|
|
int isunknownbadobject(object_t *o);
|
|
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 isdamaged(object_t *o);
|
|
int isdangerousob(object_t *o, lifeform_t *lf, int onlyifknown);
|
|
int isdeadob(object_t *o);
|
|
int isdrinkable(object_t *o);
|
|
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);
|
|
int isknown(object_t *o);
|
|
int isknownot(objecttype_t *ot);
|
|
int isheavyweapon(object_t *o);
|
|
int isidentified(object_t *o);
|
|
int isimpassableob(object_t *o, lifeform_t *lf);
|
|
int ismagical(object_t *o);
|
|
int ismeleeweapon(object_t *o);
|
|
int ismetal(enum MATERIAL mat);
|
|
int isthrowmissile(object_t *o);
|
|
int isoperable(object_t *o);
|
|
int isplainob(object_t *o);
|
|
int ispourable(object_t *o);
|
|
int ispushable(object_t *o);
|
|
int isreadable(object_t *o);
|
|
int isrotting(object_t *o);
|
|
flag_t *issecretdoor(object_t *o);
|
|
flag_t *isshield(object_t *o);
|
|
int issmellableob(object_t *o);
|
|
int isthrownmissile(object_t *o);
|
|
int istried(object_t *o);
|
|
int istriedot(objecttype_t *ot);
|
|
int isweapon(object_t *o);
|
|
int iswearable(object_t *o);
|
|
void killallobs(obpile_t *op);
|
|
void killmaterial(material_t *m);
|
|
void killob(object_t *o);
|
|
void killobpile(obpile_t *o);
|
|
void killoc(objectclass_t *oc);
|
|
void killot(objecttype_t *ot);
|
|
int knockbackob(object_t *o, int dir, int howfar, int power, lifeform_t *pusher);
|
|
lifeform_t *makeanimated(lifeform_t *lf, object_t *o, int level);
|
|
int makeduller(object_t *o, int howmuch);
|
|
void makeknown(enum OBTYPE otid);
|
|
void maketried(enum OBTYPE otid);
|
|
void makewet(object_t *o, int amt);
|
|
object_t *moveob(object_t *src, obpile_t *dst, int howmany);
|
|
object_t *real_moveob(object_t *src, obpile_t *dst, int howmany, int stackok);
|
|
void modbonus(object_t *o, int amt);
|
|
//object_t *newobeffects(object_t *o);
|
|
void obaction(object_t *o, char *text);
|
|
object_t *obexists(enum OBTYPE obid);
|
|
void obdie(object_t *o);
|
|
int obfits(object_t *o, obpile_t *op);
|
|
enum DAMTYPE oblastdamtype(object_t *o);
|
|
int brandappliesto(brand_t *om, objecttype_t *ot);
|
|
int obmatchescondition(object_t *o, long opts);
|
|
int obproduceslight(object_t *o);
|
|
int obpropsmatch(object_t *a, object_t *b);
|
|
int obotpropsmatch(object_t *a, objecttype_t *b);
|
|
flag_t *obrestrictsmovement(object_t *o, lifeform_t *lf);
|
|
int obsfallthrough(cell_t *c, object_t *pit);
|
|
int operate(lifeform_t *lf, object_t *o, cell_t *where);
|
|
int pilehasletter(obpile_t *op, char let);
|
|
void potioneffects(lifeform_t *lf, enum OBTYPE oid, object_t *o, enum BLESSTYPE potlessed, int *seen);
|
|
int pour(lifeform_t *lf, object_t *o);
|
|
void quaff(lifeform_t *lf, object_t *o);
|
|
int readsomething(lifeform_t *lf, object_t *o);
|
|
void removedeadobs(obpile_t *op);
|
|
int removeob(object_t *o, int howmany);
|
|
object_t *relinkob(object_t *src, obpile_t *dst);
|
|
void rrtorarity(enum RARITY r, int *minr, int *maxr);
|
|
void setblessed(object_t *o, enum BLESSTYPE wantbless);
|
|
int sethiddenname(objecttype_t *o, char *text);
|
|
void setinscription(object_t *o, char *text);
|
|
void setobcreatedby(object_t *o, lifeform_t *lf);
|
|
void setwaterdepth(cell_t *c, int depth);
|
|
int shatter(object_t *o, int hitlf, char *damstring, lifeform_t *fromlf);
|
|
void shufflehiddennames(void);
|
|
object_t *splitob(object_t *o);
|
|
int takedamage(object_t *o, unsigned int howmuch, int damtype);
|
|
int real_takedamage(object_t *o, unsigned int howmuch, int damtype, int wantannounce);
|
|
int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, object_t *firearm);
|
|
void timeeffectsob(object_t *o);
|
|
//void trapeffects(object_t *trapob, enum OBTYPE oid, lifeform_t *lf);
|
|
void trapeffects(object_t *trapob, enum OBTYPE oid, cell_t *c);
|
|
void turnoff(lifeform_t *lf, object_t *o);
|
|
void turnon(lifeform_t *lf, object_t *o);
|
|
int uncurseob(object_t *o, int *seen);
|
|
int usecharge(object_t *o);
|
|
int usefountaincharge(object_t *o, flag_t *drinkflag);
|
|
int validateobs(void);
|
|
int wepdullable(object_t *o);
|
|
int willshatter(enum MATERIAL mat);
|
|
#endif
|
|
|