nexus/objects.h

301 lines
14 KiB
C

#ifndef __OBJECTS_H
#define __OBJECTS_H
#include "defs.h"
brand_t *addbrand(enum BRAND id, char *suffix, enum BODYPART bp, enum BLESSTYPE blessed, int blesschance);
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, enum RARITY rarity);
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 dolinks, 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 addomprefix(enum OBMOD id, char *altprefix);
void addobsinradius(cell_t *centre, int radius, int dirtype, char *name, int allowdupes, lifeform_t *creator);
objecttype_t *addot(enum OBTYPE id, char *name, char *description, int material, float weight, int obclassid, enum LFSIZE size);
recipe_t *addrecipe(enum OBTYPE result, ...);
void adjustdamhardness(int *dam, enum DAMTYPE damtype, enum MATERIAL mat);
void adjustdammaterial(int *dam, enum DAMTYPE damtype, enum MATERIAL mat);
void adjustdamob(object_t *o, 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 chargesknown(object_t *o);
int getcritprotection(object_t *o);
int checkobnames(char *haystack, char *needle);
void colourmatchob(object_t *o, lifeform_t *lf);
void copyobprops(object_t *dst, object_t *src);
int counthiddennames(enum OBCLASS ocid, char *text);
int countmoney(obpile_t *op);
int countnames(char **list);
int counthighestobflagvalue(obpile_t *op, enum FLAG fid);
int countobs(obpile_t *op, int onlyifknown);
int countobsoftype(obpile_t *op, enum OBTYPE oid);
int countobswithflag(obpile_t *op, enum FLAG flagid);
int countobswithflagval(obpile_t *op, enum FLAG flagid, int val0, int val1, int val2, char *text);
int countnoncosmeticobs(obpile_t *op, int onlyifknown, int includetrails);
int curseob(object_t *o);
void damageallobs(object_t *srcob, obpile_t *op, int howmuch, int damtype, lifeform_t *srclf);
int doobdieconvert(object_t *o, int wantannounce);
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
recipe_t *findrecipefor(enum OBTYPE result);
int fountain_will_dryup(object_t *o);
void fragments(cell_t *centre, char *what, int speed, int howfar);
void genhiddennames(void);
enum LFSIZE getarmoursize(object_t *o);
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 getdr(object_t *o);
int checkcritprotection(lifeform_t *lf, object_t *o);
int geteffecttime(int min, int max, enum BLESSTYPE isblessed);
int getflamingobs(obpile_t *op, object_t **retob, int *nretobs);
int getingredients(obpile_t *op, recipe_t *rec, object_t **retob, int *retcount, int *retconsume, int *nretobs, int promptformulti);
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, flag_t *tkthrow);
int getobaccuracy(object_t *wep, lifeform_t *weilder, int forthrow);
int getobbonus(object_t *o, int onlyknown);
lifeform_t *getobcreatedby(object_t *o);
int getoboffermod(object_t *o, lifeform_t *lf, char *why);
int getobpoints(object_t *o);
skill_t *getobskill(flagpile_t *fp);
enum LFSIZE getobsize(object_t *o);
int getobspellpower(object_t *o, lifeform_t *lf);
int getobvalue(object_t *o);
int real_getobvalue(object_t *o, int amt);
char *getoperateverb(object_t *o);
object_t *getoutercontainer(object_t *o);
object_t *getoutercontainerop(obpile_t *op);
//int getobtypevalue(objecttype_t *ot);
object_t *getammo(object_t *gun);
objecttype_t *getbasicweaponforskill(enum SKILL skid);
object_t *getrandomammo(lifeform_t *lf);
objecttype_t *getrandomammofor(object_t *o, int usefirst);
brand_t *getrandombrandfor(objecttype_t *ot);
int getrandomgrimoirelev(void);
objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity, lifeform_t *forlf);
enum OBTYPE getrandomtrapforob(void);
int getrustdampct(object_t *o);
int getfirearmrange(object_t *o);
int getfirearmspeed(object_t *o);
glyph_t *getglyph(object_t *o);
int gethardness(enum MATERIAL matid);
char *genhiddenname(enum OBCLASS id);
char *gethiddenname(object_t *o);
int getobattackdelay(object_t *o);
int getobhp(object_t *o, int *max);
float getobhppct(object_t *o);
int getobmaxhp(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 *getshardobname(enum MATERIAL mid, char *buf);
char *getshopobname(object_t *o, char *buf, int count);
char *getobnametrue(object_t *o, char *buf, int count);
char *getobnametruebase(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 wanttried, 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 forcedepth, int forcehabitat, enum LFSIZE maxsize, enum SKILL wepsk, int forpickup, ... );
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);
enum OBCLASS getrandomobclass(enum HABITAT hab);
int getobrarity(object_t *o, enum RARITY *rr);
enum SPELLSCHOOL getschool(enum OBTYPE sid);
int getshatterdam(object_t *o);
float getshopprice(object_t *o, lifeform_t *buyer, object_t *shop);
int getstairdirection(object_t *o);
enum SKILLLEVEL gettechlevel(enum OBTYPE oid);
int getthrowdam(object_t *o);
char *gettopobname(cell_t *c, char *retbuf);
enum BODYPART getweildloc(object_t *o, lifeform_t *lf, enum BODYPART *otherloc, int *twohanded);
int hasedibleob(obpile_t *op);
object_t *hasequippedobid(obpile_t *op, enum OBTYPE oid);
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);
object_t *hasobofmaterial(obpile_t *op, enum MATERIAL mid);
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);
object_t *hassecretdoor(obpile_t *op);
void identify(object_t *o);
void ignite(object_t *o);
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, lifeform_t *owner);
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 isfullycharged(object_t *o);
int isheatable(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, enum LFSIZE forcesize);
int ismagicalobtype(objecttype_t *ot);
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 israwmeat(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);
knowledge_t *istried(object_t *o);
knowledge_t *istriedot(objecttype_t *ot);
int istwohandedfor(object_t *o, lifeform_t *lf);
int isweapon(object_t *o);
int iswearable(object_t *o);
void killallobs(obpile_t *op);
int killallobsexcept(obpile_t *op, ...);
void killbrand(brand_t *b);
void killhiddenname(hiddenname_t *hn);
void killknowledge(knowledge_t *k);
void killmaterial(material_t *m);
void killob(object_t *o);
void killobmod(obmod_t *om);
void killobpile(obpile_t *o);
int killobsofid(obpile_t *op, enum OBTYPE oid, int includecontainers);
int killobswithflag(obpile_t *op, enum FLAG fid, int includecontainers);
void killobtype(object_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 makehot(object_t *o, int howmuch, int howlong);
void makeknown(enum OBTYPE otid);
void maketried(enum OBTYPE otid, char *triedon);
void makewet(object_t *o, int amt);
void modifybetterwepdam(object_t *o, lifeform_t *owner, int *dam);
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);
int obgoesinbones(object_t *o);
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);
enum RARITY pickrr(int whatfor);
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);
int removedeadobs(obpile_t *op);
int removeob(object_t *o, int howmany);
object_t *relinkob(object_t *src, obpile_t *dst);
void resizeobject(object_t *o, enum LFSIZE wantsize);
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);
int sizetonutrition(enum LFSIZE size);
object_t *splitob(object_t *o);
int takedamage(object_t *o, int howmuch, int damtype);
int real_takedamage(object_t *o, int howmuch, int damtype, int wantannounce);
int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, object_t *firearm);
int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, object_t *firearm, int announcethrow, enum OBTYPE fromspell, object_t **newobptr);
void timeeffectsob(object_t *o);
int touch_battle_spoils(object_t *o);
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 usecharges(object_t *o, int amt);
int usefountaincharge(object_t *o, flag_t *drinkflag);
int validatehiddennames(void);
int validateobs(void);
int wepdullable(object_t *o);
int cancrush(lifeform_t *lf, object_t *o);
int willshatter(enum MATERIAL mat);
#endif