286 lines
12 KiB
C
286 lines
12 KiB
C
#include "defs.h"
|
|
|
|
lifeform_t *addlf(cell_t *cell, enum RACE rid, int level);
|
|
lifeform_t *real_addlf(cell_t *cell, enum RACE rid, int level, int controller);
|
|
job_t *addjob(enum JOB id, char *name);
|
|
race_t *addrace(enum RACE id, char *name, float weight, char glyph, int glyphcolour, enum MATERIAL mat, enum RACECLASS raceclass);
|
|
raceclass_t *addraceclass(enum RACECLASS id, char *name, char *pluralname, enum SKILL skill);
|
|
skill_t *addskill(enum SKILL id, char *name, char *desc);
|
|
void adjustdamlf(lifeform_t *lf, int *amt, enum DAMTYPE damtype);
|
|
void applywalkdam(lifeform_t *lf, int dam, enum DAMTYPE damtype, object_t *o);
|
|
int areallies(lifeform_t *lf1, lifeform_t *lf2);
|
|
int areenemies(lifeform_t *lf1, lifeform_t *lf2);
|
|
void autoskill(lifeform_t *lf);
|
|
void autotarget(lifeform_t *lf);
|
|
void autoweild(lifeform_t *lf);
|
|
int appearsrandomly(enum RACE rid);
|
|
void awardxpfor(lifeform_t *killed, float pct);
|
|
void bleed(lifeform_t *lf);
|
|
void breakallgrabs(lifeform_t *lf);
|
|
int calcxp(lifeform_t *lf);
|
|
int calcxprace(enum RACE rid);
|
|
int cancast(lifeform_t *lf, enum OBTYPE oid, int *mpcost);
|
|
int candrink(lifeform_t *lf, object_t *o);
|
|
int caneat(lifeform_t *lf, object_t *o);
|
|
int canhear(lifeform_t *lf, cell_t *c);
|
|
int canlearn(lifeform_t *lf, enum SKILL skid);
|
|
int canpickup(lifeform_t *lf, object_t *o, int amt);
|
|
int canpolymorphto(enum RACE rid);
|
|
int canpush(lifeform_t *lf, object_t *o, int dir);
|
|
int canquaff(lifeform_t *lf, object_t *o);
|
|
int cansee(lifeform_t *viewer, lifeform_t *viewee);
|
|
int cansleep(lifeform_t *lf);
|
|
int canwear(lifeform_t *lf, object_t *o, enum BODYPART where);
|
|
int canweild(lifeform_t *lf, object_t *o);
|
|
int cantakeoff(lifeform_t *lf, object_t *o);
|
|
int castspell(lifeform_t *lf, enum OBTYPE sid, lifeform_t *targlf, object_t *targob, cell_t *targcell);
|
|
void checkxp(enum RACE rid);
|
|
float comparelfs(lifeform_t *lf1, lifeform_t *lf2);
|
|
int countinnateattacks(lifeform_t *lf);
|
|
int countmoney(lifeform_t *lf);
|
|
int countnearbyallies(lifeform_t *lf);
|
|
int countnearbyhurtallies(lifeform_t *lf);
|
|
void debug(lifeform_t *lf);
|
|
void die(lifeform_t *lf);
|
|
void dumplev(void);
|
|
void dumplf(void);
|
|
void dumpxp(void);
|
|
int eat(lifeform_t *lf, object_t *o);
|
|
void enhanceskills(lifeform_t *lf);
|
|
object_t *eyesshaded(lifeform_t *lf);
|
|
int fall(lifeform_t *lf, lifeform_t *fromlf, int announce);
|
|
int fallasleep(lifeform_t *lf, int howlong);
|
|
void fightback(lifeform_t *lf, lifeform_t *attacker);
|
|
job_t *findjob(enum JOB jobid);
|
|
job_t *findjobbyname(char *name);
|
|
lifeform_t *findlf(map_t *m, int lfid);
|
|
race_t *findrace(enum RACE id);
|
|
race_t *findracebyname(char *name);
|
|
raceclass_t *findraceclass(enum RACECLASS id);
|
|
skill_t *findskill(enum SKILL id);
|
|
skill_t *findskillbyname(char *name);
|
|
enum SKILLLEVEL findskilllevbyname(char *name);
|
|
int flee(lifeform_t *lf);
|
|
void fleefrom(lifeform_t *lf, lifeform_t *enemy, int howlong);
|
|
int freezelf(lifeform_t *freezee, lifeform_t *freezer, int howlong);
|
|
void gainhp(lifeform_t *lf, int amt);
|
|
void gainlevel(lifeform_t *lf);
|
|
void gainmp(lifeform_t *lf, int amt);
|
|
void gainxp(lifeform_t *lf, long amt);
|
|
void genxplist(void);
|
|
int getactspeed(lifeform_t *lf);
|
|
enum ALLEGIENCE getallegiance(lifeform_t *lf);
|
|
int getallouterarmour(lifeform_t *lf, object_t **ob, int *nobs);
|
|
object_t *getarmour(lifeform_t *lf, enum BODYPART bp);
|
|
int getarmourrating(lifeform_t *lf);
|
|
int getattackspeed(lifeform_t *lf);
|
|
int getattpoints(lifeform_t *lf);
|
|
int getattr(lifeform_t *lf, enum ATTRIB attr);
|
|
int real_getattr(lifeform_t *lf, enum ATTRIB attr, int ignoreattrset);
|
|
int getavgdam(lifeform_t *lf, int forxp);
|
|
float getequippedweight(lifeform_t *lf);
|
|
int getevasion(lifeform_t *lf);
|
|
object_t *getbestthrowmissile(lifeform_t *lf);
|
|
object_t *getbestweapon(lifeform_t *lf);
|
|
object_t *getbestfirearm(lifeform_t *lf);
|
|
int getbodyparthitchance(enum BODYPART bp);
|
|
char *getbodypartname(enum BODYPART bp);
|
|
char *getbodypartequipname(enum BODYPART bp);
|
|
object_t *getequippedob(obpile_t *op, enum BODYPART bp);
|
|
object_t *getfirearm(lifeform_t *lf);
|
|
lifeform_t *getguntarget(lifeform_t *lf);
|
|
int getguntargetid(lifeform_t *lf);
|
|
//int gethealtime(lifeform_t *lf);
|
|
int gethearingrange(lifeform_t *lf);
|
|
int gethidemodifier(lifeform_t *lf);
|
|
int gethitdice(lifeform_t *lf);
|
|
int gethppct(lifeform_t *lf);
|
|
enum HUNGER gethungerlevel(int hunger);
|
|
char * gethungername(enum HUNGER hunger, char *buf);
|
|
int gethungerval(lifeform_t *lf);
|
|
job_t *getjob(lifeform_t *lf);
|
|
int getlastdir(lifeform_t *lf);
|
|
int getlfaccuracy(lifeform_t *lf, object_t *wep);
|
|
enum LFCONDITION getlfcondition(lifeform_t *lf);
|
|
int getnightvisrange(lifeform_t *lf);
|
|
char *getlfconditionname(enum LFCONDITION cond);
|
|
object_t *getouterequippedob(lifeform_t *lf, enum BODYPART bp);
|
|
enum LFCONDITION getseenlfconditioncutoff(lifeform_t *lf);
|
|
char *getseenlfconditionname(lifeform_t *lf, lifeform_t *viewer);
|
|
glyph_t *getlfglyph(lifeform_t *lf);
|
|
enum MATERIAL getlfmaterial(lifeform_t *lf);
|
|
enum SKILLLEVEL getlorelevel(lifeform_t *lf, enum RACECLASS rcid);
|
|
int getmaxattacks(lifeform_t *lf);
|
|
float getmaxcarryweight(lifeform_t *lf);
|
|
float getmaxliftweight(lifeform_t *lf);
|
|
int getmaxmp(lifeform_t *lf);
|
|
float getmaxpushweight(lifeform_t *lf);
|
|
int getmr(lifeform_t *lf);
|
|
int getvisrange(lifeform_t *lf);
|
|
int getmovespeed(lifeform_t *lf);
|
|
char *getmoveverb(lifeform_t *lf);
|
|
char *getmoveverbother(lifeform_t *lf);
|
|
lifeform_t *getnearbypeaceful(lifeform_t *lf);
|
|
char *getlfname(lifeform_t *lf, char *buf);
|
|
char *real_getlfname(lifeform_t *lf, char *buf, int usevis);
|
|
char *getlfnamea(lifeform_t *lf, char *buf);
|
|
char *real_getlfnamea(lifeform_t *lf, char *buf, int usevis);
|
|
enum LFSIZE getlfsize(lifeform_t *lf);
|
|
float getlfweight(lifeform_t *lf, int withobs);
|
|
object_t *getsecmeleeweapon(lifeform_t *lf);
|
|
object_t *getshield(lifeform_t *lf);
|
|
int getspellspeed(lifeform_t *lf);
|
|
char *getplayername(char *buf);
|
|
char *getplayernamefull(char *buf);
|
|
int getpoisondamchance(enum POISONTYPE ptype);
|
|
char *getpoisondamverb(enum POISONTYPE ptype);
|
|
char *getpoisondesc(enum POISONTYPE ptype);
|
|
char *getpoisonname(enum POISONTYPE ptype);
|
|
int getraceclass(lifeform_t *lf);
|
|
int getracerarity(map_t *map, enum RACE rid);
|
|
object_t *getrandomarmour(lifeform_t *lf);
|
|
//int getrandommonlevel(int depth);
|
|
race_t *getrandomrace(map_t *map, int forcedepth);
|
|
race_t *getreallyrandomrace(void);
|
|
object_t *getrestob(lifeform_t *lf);
|
|
enum SKILLLEVEL getskill(lifeform_t *lf, enum SKILL id);
|
|
char *getspeedname(int speed, char *buf);
|
|
char *getspeednameshort(int speed, char *buf);
|
|
float getstatmod(lifeform_t *lf, enum ATTRIB att);
|
|
enum CONBRACKET getconname(int str, char *buf);
|
|
enum STRBRACKET getstrname(int str, char *buf);
|
|
enum DEXBRACKET getdexname(int dex, char *buf);
|
|
enum IQBRACKET getiqname(int iq, char *buf);
|
|
char *getskilldesc(enum SKILL id );
|
|
char *getskillname(enum SKILL id );
|
|
char *getskilllevelname(enum SKILLLEVEL sl);
|
|
int getthrowspeed(int str);
|
|
object_t *getweapon(lifeform_t *lf);
|
|
long getxpforlev(int level);
|
|
void givejob(lifeform_t *lf, enum JOB jobid);
|
|
void giveobflags(lifeform_t *lf, object_t *o, enum FLAG whattype);
|
|
int giveskill(lifeform_t *lf, enum SKILL id);
|
|
int giveskilllev(lifeform_t *lf, enum SKILL id, enum SKILLLEVEL slev);
|
|
void givestartobs(lifeform_t *lf, flagpile_t *fp);
|
|
void givestartskills(lifeform_t *lf, flagpile_t *fp);
|
|
map_t *gotolev(lifeform_t *lf, int depth, object_t *fromstairs);
|
|
job_t *hasjob(lifeform_t *lf, enum JOB job);
|
|
int lfcanbestoned(lifeform_t *lf);
|
|
flag_t *lfhasflag(lifeform_t *lf, enum FLAG fid);
|
|
flag_t *lfhasflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2, char *text);
|
|
flag_t *lfhasknownflag(lifeform_t *lf, enum FLAG fid);
|
|
flag_t *lfhasknownflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2, char *text);
|
|
int lfproduceslight(lifeform_t *lf);
|
|
int lockpick(lifeform_t *lf, object_t *target, object_t *device);
|
|
void loseobflags(lifeform_t *lf, object_t *o, int kind);
|
|
int hasbp(lifeform_t *lf, enum BODYPART bp);
|
|
flag_t *hasactivespell(lifeform_t *lf, enum OBTYPE sid);
|
|
int haslof(cell_t *src, cell_t *dest, enum LOFTYPE loftype, cell_t **newdest);
|
|
int haslos(lifeform_t *viewer, cell_t *dest);
|
|
void initjobs(void);
|
|
void initrace(void);
|
|
void initskills(void);
|
|
void interrupt(lifeform_t *lf);
|
|
int isairborne(lifeform_t *lf);
|
|
int isbleeding(lifeform_t *lf);
|
|
int isblind(lifeform_t *lf);
|
|
enum BURDENED isburdened(lifeform_t *lf);
|
|
int ischarmable(lifeform_t *lf);
|
|
int isdead(lifeform_t *lf);
|
|
flag_t *isdrunk(lifeform_t *lf);
|
|
object_t *isdualweilding(lifeform_t *lf);
|
|
int isfleeing(lifeform_t *lf);
|
|
int isfreebp(lifeform_t *lf, enum BODYPART bp);
|
|
int isfriendly(lifeform_t *lf);
|
|
int isgenius(lifeform_t *lf);
|
|
int isimmobile(lifeform_t *lf);
|
|
flag_t *isimmuneto(flagpile_t *fp, enum DAMTYPE dt);
|
|
int isinbattle(lifeform_t *lf);
|
|
int isingunrange(lifeform_t *lf, cell_t *where);
|
|
int isloreskill(enum SKILL skid);
|
|
int ismaxedskill(lifeform_t *lf, enum SKILL skid);
|
|
int ispeaceful(lifeform_t *lf);
|
|
int ispetof(lifeform_t *lf, lifeform_t *owner);
|
|
int isplayer(lifeform_t *lf);
|
|
flag_t *ispoisoned(lifeform_t *lf);
|
|
flag_t *ispoisonedwith(lifeform_t *lf, enum POISONTYPE pt);
|
|
int ispolymorphed(lifeform_t *lf);
|
|
int isprone(lifeform_t *lf);
|
|
flag_t *isresistantto(flagpile_t *fp, enum DAMTYPE dt);
|
|
flag_t *isresting(lifeform_t *lf);
|
|
object_t *isstuck(lifeform_t *lf);
|
|
flag_t *isvulnto(flagpile_t *fp, enum DAMTYPE dt);
|
|
void killjob(job_t *job);
|
|
void killlf(lifeform_t *lf);
|
|
void killrace(race_t *race);
|
|
flag_t *levelabilityready(lifeform_t *lf);
|
|
void loseconcentration(lifeform_t *lf);
|
|
int losehp(lifeform_t *lf, int amt, enum DAMTYPE damtype, lifeform_t *fromlf, char *damsrc);
|
|
int losehp_real(lifeform_t *lf, int amt, enum DAMTYPE damtype, lifeform_t *fromlf, char *damsrc, int reducedam);
|
|
void losemp(lifeform_t *lf, int amt);
|
|
void makefriendly(lifeform_t *lf, int howlong);
|
|
int makenauseated(lifeform_t *lf, int amt, int howlong);
|
|
void makenoise(lifeform_t *lf, enum NOISETYPE nid);
|
|
void makepeaceful(lifeform_t *lf);
|
|
lifeform_t *makezombie(object_t *o);
|
|
void mayusespellschool(flagpile_t *fp, enum SPELLSCHOOL ss, enum FLAG how);
|
|
int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o);
|
|
int modattr(lifeform_t *lf, enum ATTRIB attr, int amt);
|
|
void modhunger(lifeform_t *lf, int amt);
|
|
float modifybystat(float num, lifeform_t *lf, enum ATTRIB att);
|
|
int needstorest(lifeform_t *lf, char *validchars);
|
|
void noise(cell_t *c, lifeform_t *noisemaker, char *text, char *seetext);
|
|
void outfitlf(lifeform_t *lf);
|
|
int pickup(lifeform_t *lf, object_t *what, int howmany, int fromground);
|
|
void poison(lifeform_t *lf, int howlong, enum POISONTYPE ptype, int power, char *fromwhat);
|
|
int poisoncausesvomit(enum POISONTYPE ptype);
|
|
int poisonthreatenslife(lifeform_t *lf, flag_t *f);
|
|
void practice(lifeform_t *lf, enum SKILL skid);
|
|
void precalclos(lifeform_t *lf);
|
|
int push(lifeform_t *lf, object_t *o, int dir);
|
|
int readytotrain(lifeform_t *lf);
|
|
void refreshlevelabilities(lifeform_t *lf);
|
|
void relinklf(lifeform_t *src, map_t *dst);
|
|
int rest(lifeform_t *lf, int onpurpose);
|
|
void startresting(lifeform_t *lf, int willtrain);
|
|
int rollcon(enum CONBRACKET bracket);
|
|
int rolldex(enum DEXBRACKET bracket);
|
|
int rolliq(enum IQBRACKET bracket);
|
|
int rollstr(enum STRBRACKET bracket);
|
|
int rollstat(lifeform_t *lf, enum ATTRIB attr);
|
|
int safetorest(lifeform_t *lf);
|
|
int scare(lifeform_t *lf, lifeform_t *scarer, int howlong, int scarerbonus);
|
|
int setammo(lifeform_t *lf, object_t *o);
|
|
void setattr(lifeform_t *lf, enum ATTRIB attr, int val);
|
|
void setguntarget(lifeform_t *lf, lifeform_t *targ);
|
|
void setrace(lifeform_t *lf, enum RACE rid, int frompolymorph);
|
|
void setlastdam(lifeform_t *lf, char *buf);
|
|
//void setlftarget(lifeform_t *lf, lifeform_t *victim);
|
|
int shoot(lifeform_t *lf);
|
|
int skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod);
|
|
int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *result);
|
|
int skillcheckvs(lifeform_t *lf1, enum CHECKTYPE ct1, int mod1, lifeform_t *lf2, enum CHECKTYPE ct2, int mod2);
|
|
int slipon(lifeform_t *lf, object_t *o);
|
|
void sortlf(map_t *map, lifeform_t *lf);
|
|
int stone(lifeform_t *lf);
|
|
void stopeating(lifeform_t *lf);
|
|
void stopresting(lifeform_t *lf);
|
|
void stoprunning(lifeform_t *lf);
|
|
int testammo(lifeform_t *lf, object_t *o);
|
|
int takeoff(lifeform_t *lf, object_t *o);
|
|
void taketime(lifeform_t *lf, long howlong);
|
|
int throwat(lifeform_t *thrower, object_t *o, cell_t *where);
|
|
void timeeffectslf(lifeform_t *lf);
|
|
void turneffectslf(lifeform_t *lf);
|
|
int touch(lifeform_t *lf, object_t *o);
|
|
void unpoison(lifeform_t *lf);
|
|
int unweild(lifeform_t *lf, object_t *o);
|
|
int useability(lifeform_t *lf, enum OBTYPE aid, lifeform_t *who, cell_t *where);
|
|
int useringofmiracles(lifeform_t *lf, int charges);
|
|
int usestairs(lifeform_t *lf, object_t *o);
|
|
int validateraces(void);
|
|
int wear(lifeform_t *lf, object_t *o);
|
|
int weild(lifeform_t *lf, object_t *o);
|
|
int willflee(lifeform_t *lf);
|
|
//int youhear(cell_t *c, char *text);
|