From 2b61d7e66cb59d4189d5873022fb1a1ea60177f3 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Mon, 5 Mar 2012 10:32:29 +0000 Subject: [PATCH] adding extra headers --- ORIG.defs.h | 4205 ++++++++++++++++++++++++++++++++++++++++++++++++ ORIG.lf.h | 445 +++++ ORIG.objects.h | 298 ++++ findleak.h | 37 + 4 files changed, 4985 insertions(+) create mode 100644 ORIG.defs.h create mode 100644 ORIG.lf.h create mode 100644 ORIG.objects.h create mode 100644 findleak.h diff --git a/ORIG.defs.h b/ORIG.defs.h new file mode 100644 index 0000000..ac8a4df --- /dev/null +++ b/ORIG.defs.h @@ -0,0 +1,4205 @@ +#ifndef __DEFS_H +#define __DEFS_H + +//#include "findleak.h" + +// MACROS +#define MAXOF(a,b) (a > b ? a : b) +#define MINOF(a,b) (a < b ? a : b) +#define OB1(o,one,many) (o->amt == 1) ? one : many +#define OBS1(o) (o->amt == 1) ? "s" : "" +#define OBNOS1(o) (o->amt == 1) ? "" : "s" + +// #define PRACTICETIME 15 // #attempts it takes to learn new weapon skill + +// Probabilities +#define ONEIN_FOUNTAINDRYUP 3 +#define PCTCH_PILLAR 5 + +// Text +#define TEXT_WARN_ATTACK_NOXP "You will not gain experience until you train. Really attack?" +#define TEXT_WARN_CLIMB "Really attempt to climb without Climbing skill?" +#define TEXT_WARN_FLY "Warning: while airborne you will not map your surroundings." +#define TEXT_WARN_MUTABLE "(you can now gain attributes by eating corpses)" +#define TEXT_WARN_NOXP_GOODVSPEACEFUL "Warning: Only Evil players gain XP for peaceful kills." + +// Defaults +#define DEF_AIFOLLOWTIME (50) // if target lf is out of view + +#define DEF_BURNTIMEMIN (3) +#define DEF_BURNTIMEMAX (6) + // for this many turns, abandon chase +//#define DEF_ANIMDELAY (1000000 / 50) // 1/100 of a second +#define DEF_ANIMDELAY (1000000 / 25) // 1/50 of a second +#define DEF_RESTHEALTIME (3) + +#define DEF_SCREENW 80 +#define DEF_SCREENH 24 + +#define DEF_RAGETIME 10 +//#define DEF_SHOPIDENTPRICE (50) // cost to identify a just-purchased item +#define DEF_VAULTMARGIN (3) +#define DEF_VISRANGE (9) + + +// Map building defaults +#define DEF_LOOPPCT 95 +#define DEF_SPARSENESS 20 +#define DEF_TURNPCT 40 +#define DEF_WINDOWPCT 5 + +#define DEF_WARNINGTIME 20 + +// lifeform defaults +#define DEF_HITDICE "1d4" + +// unicode chars +#define UNI_SOLID 0x2588 +#define UNI_SHADELIGHT 0x2591 +#define UNI_SHADEMED 0x2592 +#define UNI_SHADEDARK 0x2593 +//#define UNI_SOLID '#' + +// getrandomemptycell() params +#define WE_WALKABLE 1 +#define WE_EMPTY 2 +#define WE_PORTAL 3 +#define WE_NOTWALL 4 +#define WE_NOLF 5 +#define WE_SOLID 6 + +// Booleans +#define B_FALSE (0) +#define B_TRUE (-1) +#define B_MAYBE (-2) + +#define B_FORCE (-2) +#define B_ONPURPOSE (-1) +#define B_CHANGEDIR (-1) +#define B_VIS (1) +#define B_UNKNOWN (0) +#define B_NOVIS (-1) +#define B_KEEPLOF (-1) +#define B_MALE (0) +#define B_FEMALE (-1) +#define B_MAYCHASE (-1) +#define B_NODOORS (0) +#define B_DONTKILL (-1) +#define B_APPENDYOU (-1) +#define B_SPLATTER (-1) +#define B_FROMINJURY (-2) +#define B_KEEPDIR (-2) +#define B_VERT (0) +#define B_HORZ (1) + + +//#define B_TEMP (-1) +//#define B_PERM (-2) +//#define B_NOT (-3) + +#define B_DIEONFAIL (-1) +#define B_BLUNTONFAIL (-2) + +#define B_COVETS (-1) +#define B_ANY (0) + +#define B_SINGLE (0) +#define B_MULTI (-1) +#define B_MULTIPLE (-1) + +#define B_NOOBS (0) +#define B_WITHOBS (-1) + +#define B_UNKNOWN (0) +#define B_KNOWN (-1) +#define B_TRIED (1) + +#define B_NOBADMOVES (0) +#define B_BADMOVESOK (1) + +#define B_NOSTACK (0) +#define B_STACK (-1) +#define B_STACKOK (-1) + +#define NOOWNER (NULL) +#define NOLOC (NULL) +#define NOOB (NULL) + +#define B_NOTSOLID (0) +#define B_EMPTY (0) +#define B_SOLID (-1) + +#define B_OPAQUE (0) +#define B_TRANSPARENT (-1) +#define B_TRANS (-1) + +#define B_ALLOWEXPAND (-1) +#define B_NOEXPAND (0) + +#define B_IFACTIVATED (-1) +#define B_ALWAYS (-2) +#define B_IFNOTBLESSED (-3) + +#define B_BIG (-1) + +// Limits + +// must be >= max # of spells/abilities AND +// >= max # of cells on the map +#define MAXCANDIDATES 2048 + +#define MAXCHOICES 400 +#define MAXDEPTH 25 // max dungeon depth +#define MAXDIR_ORTH 4 +#define MAXDIR_COMPASS 8 +#define MAXFLAGS 500 +#define MAXFOLLOWLFS 15 // max # of lfs who will follow you up/down stairs +#define MAXHISTORY 20 // max lines of history to keep + +#define MAX_MAPW 80 +#define MAX_MAPH 30 + +#define MAXPILEOBS 52 +#define MAXRANDOMOBCANDIDATES 100 +#define MAXRANDOMLFCANDIDATES 100 +#define MAXRETCELLS 80 +#define MAXSPELLLEV 6 +#define MAXVISRANGE 10 // max visible range in full light +#define MAXVISLIMIT (MAXVISRANGE*20) +#define MAX_EYEADJ 20 + +#define MINCLEARINGRADIUS 2 +#define MAXCLEARINGRADIUS 5 + + +#define MAX_ATTRIBVAL 100 + +#define MAXMAPROOMS 80 + +#define MINROOMS 5 +#define MAXROOMS 10 +#define MIN_ROOMH 4 +#define MIN_ROOMW 4 +#define MAX_ROOMW (MAX_MAPW / 3) +#define MAX_ROOMH (MAX_MAPH / 3) + +// askobject options +#define AO_NONE 0 +#define AO_INCLUDENOTHING 1 +#define AO_ONLYEQUIPPED 2 +#define AO_EDIBLE 4 +#define AO_NOTIDENTIFIED 8 +#define AO_WEARABLE 16 +#define AO_OPERABLE 32 +#define AO_POURABLE 64 +#define AO_EQUIPPEDNONWEAPON 128 +#define AO_WEILDABLE 256 +#define AO_SPECIFIED 512 +#define AO_READABLE 1024 +#define AO_ARMOUR 2048 +#define AO_NOTKNOWN 4096 +#define AO_DAMAGED 8192 +#define AO_DRINKABLE 16384 + +// askcoords target types +#define TT_NONE 0 +#define TT_MONSTER 1 +#define TT_OBJECT 2 +#define TT_DOOR 4 +#define TT_PLAYER 8 +#define TT_ALLY 16 +#define TT_IMPASSABLE 32 + +// target requirements +#define TR_NONE 0 +#define TR_NEEDLOS 1 +#define TR_NEEDLOF 2 + +// CONTROLLERS +#define C_AI 0 +#define C_PLAYER 1 + +// speeds +#define SP_GODLIKE 1 +#define SP_ULTRAFAST 5 +#define SP_VERYFAST 10 +#define SP_FAST 15 +#define SP_NORMAL 20 +#define SP_SLOW 25 +#define SP_VERYSLOW 30 +#define SP_ULTRASLOW 35 +#define SP_SLOWEST 40 + +#define SPEEDUNIT 5 + +// experience +#define SKILLXPPERPOINT 150 + +// speed settings (lower is faster) +#define SPEED_ATTACK SP_NORMAL +#define SPEED_DEAD 50 +#define SPEED_ACTION SP_NORMAL +#define SPEED_MOVE SP_NORMAL +#define SPEED_DROP SP_ULTRAFAST +#define SPEED_PICKUP SP_ULTRAFAST +#define SPEED_THROW SP_FAST +#define SPEED_WAIT SP_NORMAL +#define SPEED_READ SP_NORMAL +#define SPEED_DRINK SP_FAST + + +// DIRECTION TYPES +#define DT_ORTH 0 +#define DT_COMPASS 1 + +// DIRECTIONS +#define D_NONE -1 +#define D_UNKNOWN -2 +#define D_ALL -3 + +// Orthogonal directions +#define D_N 0 +#define D_E 1 +#define D_S 2 +#define D_W 3 + +// Compass directions +#define DC_N 4 +#define DC_NE 5 +#define DC_E 6 +#define DC_SE 7 +#define DC_S 8 +#define DC_SW 9 +#define DC_W 10 +#define DC_NW 11 + +// altitude directions +#define D_UP 12 +#define D_DOWN 13 +#define D_IN 14 + +#define MAXDIR_MAP 15 + +// relative directions +enum RELATIVEDIR { + RD_FORWARDS, + RD_BACKWARDS, + RD_SIDEWAYS, +}; + +enum REGIONNAMEFORMAT { + RF_SHORT, // %s + RF_WITHLEVEL, // %s (L%d) + RF_LONG, // on level %d of %s + +}; + +enum TURNDIR { + TD_RIGHT, + TD_LEFT +}; + +enum TRADEINFOTYPE { + TI_SKILL, + TI_SPELL, +}; + +enum SHOPACTION { + SA_BUY, + SA_SELL, +}; + +/////////////////////////////////////// +// STRINGS +/////////////////////////////////////// +// String buffer lengths +#define BUFLENTINY 10 +#define BUFLENSMALL 64 +#define BUFLEN 256 +#define BIGBUFLEN 512 +#define HUGEBUFLEN 1024 +#define MAXPNAMELEN 12 // max player name length +// file i/o +#define DATADIR "data" +#define SAVEDIR "data" +#define VAULTDIR "data/vaults" +// rank, score, name, job, killer +#define HISCOREFORMAT "%-4s%-7s%-10s%-23s" + +// game strings +#define MORESTRING "--More--" +#define MSGMORESTRING "^n--More--" +#define SOLDOUTSTRING "--SOLD OUT--" + +// COMMAND CHARACTERS +#define CH_TURN_W (8) // ctrl-h +#define CH_TURN_N (10) // ctrl-j +#define CH_TURN_S (11) // ctrl-k +#define CH_TURN_E (12) // ctrl-l +#define CH_TURN_NW (25) // ctrl-y +#define CH_TURN_NE (21) // ctrl-u +#define CH_TURN_SW (2) // ctrl-b +#define CH_TURN_SE (14) // ctrl-n +#define CH_HISTORY (16) // ctrl-p +#define CH_BREAK (3) // ctrl-c + +// SPECIAL NUMBERS/CONSTANTS +#define DUMMYCELLTYPE 0xabcd +#define UNLIMITED (-9876) +#define ALL (-9875) +#define NA (-9874) +#define NOBODY (-1) +#define ALLCONFERRED (-9873) +#define PCT (65432) // must be POSITIVE +#define RANDOM (-2610) +#define AUTO (-7654) +#define HEAVYWEPKG (5) + +// how quickly the game clock increments +// 1 = roughly 30 secs per turn +#define TIMECONST (3) +// hunger constant - this is how many turns +// it will take to go from 'normal' to 'peckish' etc +// ... try to make this roughly 4 hours (check TIMECONST. +#define HUNGERCONST 500 + +#define STAMREGEN (0.3) // base amount of stamina to regain each turn +#define STAMTOATTACK ((float)STAMREGEN+0.2) // base amount of stamina to attack + +// Time periods +#define TM_DRUNKTIME (10) // how long it takes for alcohol to wear off +#define TM_WETTIME (10) // how long it takes for things to dry +#define TM_SCENT (30) // how long scents take to fade +#define TM_FOOTPRINT (35) // how long footprints take to fade + +// object conditions for random objects +#define RO_NONE 0 +#define RO_DAMTYPE 1 +#define RO_OBCLASS 2 +#define RO_HOLDABLE 3 + +// flag lifetimes +#define PERMENANT (-9873) +#define FROMSPELL (-9863) +#define FROMPOISON (-9862) + +// flag lifetimes - external sources (ie. don't kill them) +#define FROMEXTERNAL_HIGH (-7000) +#define FROMRACE (-7872) +#define FROMJOB (-7871) +#define FROMOBEQUIP (-7870) +#define FROMOBHOLD (-7869) +#define FROMOBACTIVATE (-7868) +#define FROMMAT (-7867) +#define FROMBLESSING (-9866) +#define FROMBRAND (-7865) +#define FROMOBMOD (-7864) +#define FROMSKILL (-7863) +#define FROMGODGIFT (-7862) +#define FROMEXTERNAL_LOW (-7999) +#define LEVABILITYDONE (-8000) + +#define IFKNOWN (-9772) // used by f_xxconfer. only confer a flag if item is known. +#define IFACTIVE (-9771) // used by f_prodeuceslight. only does so if object is activated + +// Misc constants +#define ANYROOM (-9770) +#define FALLTHRU (-8765) // for walkdambp +#define TICK_INTERVAL (20) +#define DAYSECS (86400) // # seconds in a day + + + +// ncurses colours +#define C_NONE (-1) +enum COLOUR { + C_RANDOM = -1, + C_BLACK = 0, + C_RED = 1, + C_GREEN = 2, + C_BROWN = 3, + C_BLUE = 4, + C_MAGENTA = 5, + C_CYAN = 6, + C_GREY = 7, + // bolded colours + C_YELLOW = 8, + C_WHITE = 9, + C_BOLDCYAN = 10, + C_BOLDBLUE = 11, + C_BOLDMAGENTA = 12, + C_ORANGE = 13, + C_BOLDGREEN = 14, + C_DARKGREY = 15, +}; + +#define C_FIRST C_RED +#define C_LAST C_DARKGREY + +#define BLACKBG 0 +#define BLUEBG 16 +#define GREENBG 32 +#define REDBG 48 + +enum CASTTYPE { + CT_NORMAL = 0, + CT_GAZE, + CT_EYESPIT +}; + +enum DRAINTYPE { + DR_NONE = 0, + DR_FROMBITE, + DR_FROMWEP +}; + +enum GODANGERREASON { + GA_ATTACKALLY, + GA_ATTACKHELPLESS, // attacked someone who was sleeping etc + GA_ATTACKOBJECT, // attacked or broke an object + GA_ASSAULT, // attacked someone peaceful + GA_COWARD, // acted in a cowardly manner + GA_EAT, // ate something the god doesn't like + GA_HERESY, // blessed or cursed an object + GA_MERCY, // allowed something to flee + GA_MONEY, // paid money to someone + GA_MURDER, // killed someone peaceful + GA_POISON, // used poison + GA_PRAY, // pestering through constant prayer + GA_RACE, // prayed while a hated race. + GA_SPELL, // cast a spell from the wrong school + GA_GODSTONE, // picked up this god's godstone +}; + +enum NOISECLASS { + NC_NONE = 0, + NC_MOVEMENT = 1, + NC_SPEECH = 2, + NC_FIGHTING = 3, + NC_OTHER = 4, +}; + +enum QUADRANT { + Q_NONE = -1, + Q_NNE = 0, + Q_ENE = 1, + Q_ESE = 2, + Q_SSE = 3, + Q_SSW = 4, + Q_WSW = 5, + Q_WNW = 6, + Q_NNW = 7, +}; + +enum SAYPHRASE { + SP_ALLY_ATTACK, + SP_ALLY_ATTACKUNSEEN, + SP_ALLY_INPAIN, + SP_ALLY_TARGETKILL, + SP_BEG, + SP_BEGATTACK, + SP_BEGTHANKS, + SP_DIE, + SP_DRUNK, + SP_MERCYACCEPT, + SP_INFO_ACCEPT, + SP_INFO_ASKPRICE, + SP_INFO_REFUSE, + SP_INFO_REFUSE_AGAIN, + SP_INFO_DECLINE_WONTPAY, + SP_PAYWARN, + SP_PAYTHREAT, + SP_PAYTHANKS, + SP_RECRUIT_ACCEPT, + SP_RECRUIT_ASKPRICE, + SP_RECRUIT_DECLINE, + SP_RECRUIT_DECLINE_CANTPAY, + SP_RECRUIT_DECLINE_WONTPAY, + SP_ROBBED, + SP_SORRY, + SP_THANKS, + SP_TRADEINFO_ACCEPT, + SP_TRADEINFO_CANCEL, + SP_TRADEINFO_DECLINE_ALREADYDONE, + SP_TRADEINFO_DECLINE_OTHERBAD, + SP_TRADEINFO_DECLINE_PLAYERBAD, +}; + +enum SPEECHVOL { + SV_SILENT = 0, + SV_WHISPER = 1, + SV_TALK = 2, + SV_SHOUT = 3, + SV_CAR = 4, + SV_TRUCK = 5, + SV_PLANE = 6, +}; + +enum SKILL { + SK_NONE = 0, + SK_ARMOUR = 1, + SK_ATHLETICS, + SK_BACKSTAB, + SK_CARTOGRAPHY, + SK_CHANNELING, + SK_CLIMBING, + SK_COOKING, + SK_EVASION, + SK_FIRSTAID, + SK_LISTEN, + SK_LOCKPICKING, + SK_METALWORK, + SK_PERCEPTION, + SK_RANGED, + SK_SEWING, + SK_SHIELDS, + SK_SPEECH, + SK_STEALTH, + SK_SWIMMING, + SK_TECHUSAGE, + SK_THIEVERY, + SK_THROWING, + SK_TRAPS, + SK_TWOWEAPON, + // knowledge + SK_LORE_ARCANA, + SK_LORE_DEMONS, + SK_LORE_DRAGONS, + SK_LORE_HUMANOID, + SK_LORE_NATURE, + SK_LORE_UNDEAD, + // weaponry + SK_AXES, + SK_CLUBS, + SK_EXOTICWEPS, + SK_LONGBLADES, + SK_POLEARMS, + SK_SHORTBLADES, + SK_STAVES, + SK_UNARMED, + // spell schools + SK_SS_ALLOMANCY, + SK_SS_MENTAL, + SK_SS_NATURE, + SK_SS_AIR, + SK_SS_DEATH, + SK_SS_DIVINATION, + SK_SS_ENCHANTMENT, + SK_SS_FIRE, + SK_SS_COLD, + SK_SS_GRAVITY, + SK_SS_LIFE, + SK_SS_MODIFICATION, + SK_SS_SUMMONING, + SK_SS_TRANSLOCATION, + SK_SS_WILD, +}; +#define MAXSKILLS 54 + +// proficiency levels +enum SKILLLEVEL { + PR_INEPT = 0, + PR_NOVICE = 1, + PR_BEGINNER = 2, + PR_ADEPT = 3, + PR_SKILLED = 4, + PR_EXPERT = 5, + PR_MASTER = 6, +}; +#define MAXSKILLLEVEL 7 + + +enum GAMEMODE { + GM_FIRST, + GM_INIT, + GM_VALIDATION, + GM_LOADING, + GM_LOADED, + GM_CHARGEN, + GM_GAMESTARTED, + GM_GAMEOVER, + GM_CLEANUP, +}; + +enum WINGAMETYPE { + WT_NONE = 0, + WT_GOD, + WT_DEMIGOD, +}; + +enum ATTRIB { + A_NONE = -1, + A_STR = 0, + A_AGI = 1, + A_WIS = 2, + A_IQ = 3, + A_CON = 4, + A_CHA = 5, +}; +#define MAXATTS 6 + +enum CHECKTYPE { + SC_STR, + SC_DEX, + SC_IQ, + SC_CON, + SC_CHA, + SC_WIS, + ////////// + SC_CLIMB, + SC_DISARM, + SC_DODGE, + SC_SHIELDBLOCK, + SC_FALL, + SC_SLIP, + SC_LEARNMAGIC, + SC_LISTEN, + SC_MORALE, + SC_OPENLOCKS, + SC_POISON, + SC_RESISTMAG, + SC_SEARCH, + SC_SPEECH, + SC_STEAL, + SC_STEALTH, + SC_TUMBLE, + SC_WILL, +}; + +enum BURDENED { + BR_NONE = 0, + BR_BURDENED = 1, + BR_STRAINED = 2, + BR_OVERLOADED = 3, +}; + +enum HELPLESSTYPE { + HL_NONE = 0, + HL_CANTSEE = 1, + HL_FLEEING = 2, +}; + + +enum LFCONDITION { + C_DEAD = 0, + C_CRITICAL = 1, + C_SERIOUS = 2, + C_WOUNDED = 3, + C_HURT = 4, + C_HEALTHY = 5, +}; + +enum SENSE { + S_HEARING, + S_SIGHT, + S_SMELL, + S_TASTE, + S_TOUCH, +}; + + +enum FLAGCONDITION { + FC_NOCONDITION = 0, + FC_IFPLAYER, + FC_IFMONSTER, +}; + +enum MSGCHARCOL { + CC_VBAD, + CC_BAD, + CC_NORMAL, + CC_GOOD, + CC_VGOOD, +}; + + +enum MODTYPE { + M_PCT, + M_VAL, +}; + + + +// line of fire args +enum LOFTYPE { + LOF_DONTNEED = 0, + LOF_WALLSTOP = 2, + LOF_LFSSTOP = 4, + LOF_NEED = 6, // walls AND lfs block +}; + +// Cell types +enum CELLTYPE { + CT_NONE = 0, + // walls + CT_WALL, + CT_WALLBRICK, + CT_WALLDIRT, + CT_WALLFLESH, + CT_WALLGLASS, + CT_WALLMETAL, + CT_WALLWOOD, + // empty + CT_CORRIDOR, + CT_DIRT, + CT_VILLAGEGROUND, + CT_FAKE, + CT_FLOORFLESH, + CT_FLOORCARPET, + CT_FLOORSHOP, + CT_FLOORTILE, + CT_FLOORWOOD, + CT_GRASS, + CT_LOOPCORRIDOR, + CT_LOWFLOOR, + CT_VLOWFLOOR, +}; + +enum SPELLSCHOOL { + SS_NONE, + SS_DIVINE, + SS_ABILITY, + SS_ALLOMANCY, + SS_AIR, + SS_DEATH, + SS_DIVINATION, + SS_ENCHANTMENT, + SS_FIRE, + SS_COLD, + SS_GRAVITY, + SS_LIFE, + SS_MODIFICATION, + SS_MENTAL, + SS_NATURE, + SS_SUMMONING, + SS_TRANSLOCATION, + SS_WILD, + SS_LAST, +}; + +enum ATTRBRACKET { + AT_RANDOM = -99, + AT_EXLOW = -4, + AT_VLOW = -3, + AT_LOW = -2, + AT_LTAVERAGE = -1, + AT_AVERAGE = 0, + AT_GTAVERAGE = 1, + AT_HIGH = 2, + AT_VHIGH = 3, + AT_EXHIGH = 4, +}; + +#define IQ_MINDLESS AT_EXLOW +#define IQ_ANIMAL AT_VLOW + +// damage type +enum DAMTYPE { + DT_ALL = -1, + DT_PIERCE = 0, + DT_SLASH = 1, + DT_FIRE = 2, + DT_COLD = 3, + DT_BASH = 4, + DT_BITE = 5, + DT_CHOP = 6, + DT_PROJECTILE = 7, + DT_HOLY = 8, + DT_WATER = 9, + DT_ACID = 10, + DT_MELT = 11, + DT_DIRECT = 12, // eg. from f_obhpdrain flag + DT_ELECTRIC = 13, + DT_EXPLOSIVE = 14, + DT_DECAY = 15, + DT_MAGIC = 16, + DT_TOUCH = 17, + DT_POISONGAS = 18, + DT_UNARMED = 19, + DT_LIGHT = 20, + DT_CRUSH = 21, + DT_FALL = 22, + DT_PETRIFY = 23, + DT_POISON = 24, + DT_NECROTIC = 25, + DT_SONIC = 26, + DT_HEAT = 27, + DT_NONE = 28, // for direclty dealt damage, not really any type +}; +#define MAXDAMTYPE 29 + +// Object Classes +enum OBCLASS { + OC_NONE, + OC_ABILITY, + OC_ARMOUR, + OC_BOOK, + OC_BUILDING, + OC_CORPSE, + OC_DFEATURE, + OC_EFFECT, + OC_FLORA, + OC_FOOD, + OC_FURNITURE, + OC_GODSTONE, + OC_MISC, + OC_MISSILE, + OC_MONEY, + OC_POTION, + OC_RING, + OC_ROCK, + OC_SCROLL, + OC_TECH, + OC_TERRAIN, + OC_TOOLS, + OC_TRAP, + OC_SPELL, + OC_WAND, + OC_WEAPON, + OC_NULL = -999 +}; + +enum BLESSTYPE { + B_UNCURSED = 0, + B_BLESSED = 1, + B_CURSED = -1 +}; + +#define RARITYVARIANCELF (1) +#define RARITYVARIANCEOB (10) + +enum RARITY { + RR_UNIQUE = 7, + RR_NEVER = 6, + RR_VERYRARE = 5, + RR_RARE = 4, + RR_UNCOMMON = 3, + RR_COMMON = 2, + RR_FREQUENT = 1, + RR_NONE = 0, +}; + +// for genericising weapons, etc +enum GOODNESS { + G_NA = 0, + G_AVERAGE, + G_GOOD, + G_GREAT, + G_EXCELLENT, +}; + +enum RACECLASS { + RC_ANY, // not actually ever defined + RC_ANIMAL, + RC_AQUATIC, + RC_DEMON, + RC_DRAGON, + RC_GOD, + RC_HUMANOID, + RC_INSECT, + RC_SLIME, + RC_MAGIC, + RC_OTHER, + RC_PLANT, + RC_UNDEAD, +}; + +#define R_GODFIRST R_GODPURITY +#define MAXGODS 9 + +enum RACE { + R_NONE = 0, + R_RANDOM, R_SPECIFIED, + // unique monstesr + R_JAILER, + // playable races + R_ASHKARI, + R_AVIAD, + R_CYBORG, + R_DWARF, + R_ELF, + R_HUMAN, + R_MAMMOAN, + // human monsters + R_BANDITLDR, + R_BANDIT, + R_BEGGAR, + R_DRUNK, + R_PRISONER, + R_TOWNGUARD, + // gods + R_GODPURITY, // amberon - R_FIRSTGOD + R_GODTHIEVES, // felix + R_GODDEATH, // hecta + R_GODFIRE, // klikirak + R_GODLIFE, // glorana + R_GODMERCY, // yumi + R_GODNATURE, // ekrub + R_GODBATTLE, // bjorn + R_GODMAGIC, // lumara + // monsters + R_BEHOLDER, + R_BUGBEAR, + R_COCKATRICE, + R_CREEPINGCLAW, + R_CRYMIDIA, + R_DARKMANTLE, + R_EYEBAT, + R_GIANTHILL, + R_GIANTFIRE, + R_GIANTFIREFC, + R_GIANTFIRETITAN, + R_GNOLL, + R_GNOLLHM, + R_GOBLIN, + R_GOBLINR, + R_GOBLINS, + R_GOBLINHEXER, + R_GOBLINKING, + R_GOBLINWAR, + R_GOBLINSHOOTER, + R_GREMLIN, + R_HOBGOBLIN, + R_HOBGOBLINWAR, + R_KOBOLD, + R_LEPRECHAUN, + R_LIZARDMAN, + R_MINOTAUR, + R_OGRE, + R_OGREWARHULK, + R_OOZEGREY, + R_ORCB, + R_ORC, + R_ORCGREY, + R_ORCGRAND, + R_ORCN, + R_ORK, + R_PEGASUS, + R_POLTERGEIST, + R_PRIMALFIRE, + R_PRIMALFIREL, + R_PRIMALSTONE, + R_PRIMALSTONEL, + R_SANDMAN, + R_SATYR, + R_SHADOWCAT, + R_SINKMITE, + R_SKOOB, + R_SPRITEFIRE, + R_SPRITEGRAVE, + R_SPRITEICE, + R_TRICLOPS, + R_TROGLODYTE, + R_TROLL, + R_TROLLSNOW, + R_VAMPIRE, + R_XAT, + // fish + R_CRAB, + R_MERLOCH, + R_PIRANHA, + R_PIRANHAKING, + R_EELELEC, + R_EELGIANT, + // plants + R_CACTUS, + R_IVYRAPID, + R_FUNGUSDREAM, + R_FUNGUSRAGE, + R_NUTTER, + R_SAWGRASS, + // animals + R_ANT, + R_ANTS, + R_ANTLION, + R_BAT, + R_BATMUTATED, + R_BATVAMPIRE, + R_BEAR, + R_BEARCUB, + R_BEARGRIZZLY, + R_BILCO, + R_CHICKEN, + R_DOG, + R_DOGBLINK, + R_DOGDEATH, + R_DOGWAR, + R_HAWK, + R_HAWKYOUNG, + R_HAWKBLOOD, + R_HAWKFROST, + R_FROG, + R_LEECH, + R_NEWT, + R_PORCUPINE, + R_RAT, + R_SLUG, + R_SNAIL, + R_SNAKE, + R_SNAKECARPET, + R_SNAKECOBRABLACK, + R_SNAKECOBRAGOLDEN, + R_SNAKECONSTRICTOR, + R_SNAKETREE, + R_SNAKEWATER, + R_SPIDER, + R_SPIDERFUNNELWEB, + R_SPIDERREDBACK, + R_WOLFYOUNG, + R_WOLF, + R_WOLFWINTER, + R_WORMGLUT, + // dragons + R_DRAGONBLUE, + R_DRAGONBLUEY, + R_DRAGONBLUEA, + R_DRAGONRED, + R_DRAGONREDY, + R_DRAGONREDA, + R_DRAGONWHITE, + R_DRAGONWHITEY, + R_DRAGONWHITEA, + R_WYVERN, + // insects + R_BLASTBUG, + R_BUTTERFLY, + R_CENTIPEDE, + R_FIREBUG, + R_GLOWBUG, + R_GIANTFLY, + R_GIANTBLOWFLY, + R_STINKBUG, + R_STIRGE, + // demons + R_DRETCH, + R_GRIDDLER, + R_LURKINGHORROR, + R_ICEDEMON, + R_NECRONTRAPPER, + R_NECRONREAPER, + R_NECRONSOWER, + R_NECRONEXTERMINATOR, + R_NECRONHARVESTER, + R_QUASIT, + // undead + R_GHAST, + R_GHOST, + R_GHOUL, + R_MUMMY, + R_MUMMYG, + R_SKELETON, + R_SKELETONFIRE, + R_WRAITHICE, + R_ZOMBIE, + // special + R_DANCINGWEAPON, + R_FLOATINGDISC, + R_GASCLOUD, + R_HECTASSERVANT, + R_TOOTH, +}; + +enum JOB { + J_NONE, + J_GOD, + J_ADVENTURER, + J_ALLOMANCER, + J_WARRIOR, + J_CHEF, + J_COMMANDO, + J_DRUID, + J_HUNTER, + J_MECHANIC, + J_MONK, + J_NINJA, + J_PIRATE, + J_PRINCE, + J_ROGUE, + //J_SHOPKEEPER, + J_WIZARD, + // monster jobs + J_GUARD, +}; +#define J_RANDOM J_NONE + +enum MATSTATE { + MS_SOLID, + MS_LIQUID, + MS_GAS, + MS_OTHER, + MS_ALL, +}; + +// Object Materials +enum MATERIAL { + MT_NOTHING = 0, + MT_BONE = 1, + MT_STONE = 2, + MT_FIRE = 3, + MT_PLASTIC = 4, + MT_METAL = 5, + MT_GLASS = 6, + MT_FLESH = 7, + MT_WOOD = 8, + MT_GOLD = 9, + MT_PAPER = 10, + MT_WETPAPER = 11, + MT_ICE = 12, + MT_WATER = 13, + MT_BLOOD = 14, + MT_LEATHER = 15, + MT_CLOTH = 16, + MT_FOOD = 17, + MT_RUBBER = 18, + MT_MAGIC = 19, + MT_GAS = 20, + MT_SLIME = 21, + MT_WAX = 22, + MT_ACID = 23, + MT_SILK = 24, + MT_OIL = 25, + MT_PLANT = 26, + MT_WIRE = 27, + MT_SILVER = 28, + MT_DRAGONWOOD = 29, + MT_DIRT = 30, +}; + +// Object Types +enum OBTYPE { + OT_NONE, + // dungeon features + OT_BOULDER, + OT_GRATINGFLOOR, + OT_GRATINGROOF, + OT_ICICLE, + OT_STATUE, + OT_DOORWOOD, + OT_DOORIRON, + OT_FENCEWOOD, + OT_FOUNTAIN, + OT_GATEIRON, + OT_GATEWOOD, + OT_SIGN, + OT_HOLYCIRCLE, + OT_PENTAGRAM, + OT_HOLEINGROUND, + OT_HOLEINROOF, + OT_STAIRSDOWN, + OT_STAIRSUP, + OT_TUNNELDOWN, + OT_TUNNELUP, + OT_PORTAL, + OT_STOMACHEXIT, + // buildings - rememebr to update MAXBUILDINGTYPES! + OT_MOTEL, + OT_SHOPARMOUR, + OT_SHOPBOOK, + OT_SHOPFOOD, + OT_SHOPGENERAL, + OT_SHOPHARDWARE, + OT_SHOPPOTION, + OT_SHOPRING, + OT_SHOPWEAPON, + OT_TEMPLE, + // terrain + OT_WATERDEEP, + // traps + OT_TRAPALARM, + OT_TRAPARROW, + OT_TRAPARROWP, + OT_TRAPEBLAST, + OT_TRAPFIRE, + OT_TRAPGAS, + OT_TRAPLIGHTNING, + OT_TRAPMINE, + OT_TRAPNEEDLEP, + OT_TRAPPIT, + OT_TRAPROCK, + OT_TRAPSUMMON, + OT_TRAPTELEPORT, + OT_TRAPTRIP, + OT_TRAPWIND, + // rocks + OT_STONE, + OT_ASH, + OT_ASHEXPLODE, + OT_ASHCONCEAL, + OT_ASHINVIS, + OT_ASHSLEEP, + OT_GEMOFSEEING, + // gems + OT_AQUAMARINE, + OT_AMETHYST, + OT_DIAMOND, + OT_EMERALD, + OT_OPAL, + OT_PEARL, + OT_RUBY, + OT_SAPPHIRE, + OT_TOPAZ, + // money + OT_GOLD, + // godstones + OT_GODSTONE_DESTRUCTION, + OT_GODSTONE_LIFE, + OT_GODSTONE_MERCY, + OT_GODSTONE_PURITY, + OT_GODSTONE_REVENGE, + // flora + OT_FLOWER, + OT_LEAF, + OT_MISTLETOE, + OT_MOSSMOON, + OT_MOSSSUN, + OT_SHRUB, + OT_STUMP, + OT_TREE, + // food + OT_APPLE, + OT_BANANA, + OT_BANANASKIN, // not really food + OT_BERRY, + OT_BREADFRESH, + OT_BREADGARLIC, + OT_BREADSTALE, + OT_CACFRUIT, + OT_CAKEFRUIT, + OT_CARROT, + OT_CHEESE, + OT_CHOCOLATE, + OT_CLOVER, + OT_CURADOUGH, + OT_GARLIC, + OT_HOTDOG, + OT_JERKY, + OT_MUSHROOMSHI, + OT_MUSHROOMTOAD, + OT_MUSHROOMSTUFFED, + OT_NUT, + OT_PASSIONFRUIT, + OT_POISONSAC, + OT_PSITRUFFLE, + OT_ROASTMEAT, + OT_RUMBALL, + OT_SALT, + OT_SANDWICHCHEESE, + OT_SANDWICHPB, + OT_SUGAR, + OT_TOMATO, + // corpses + OT_CORPSE, + OT_FINGER, + OT_HEAD, + // potions + OT_POT_ACID, + OT_POT_ACROBATICS, + OT_POT_AMBROSIA, + OT_POT_BLOOD, + OT_POT_BLOODC, + OT_POT_CANINETRACKING, + OT_POT_COFFEE, + OT_POT_COMPETENCE, + OT_POT_ELEMENTIMMUNE, + OT_POT_ETHEREALNESS, + OT_POT_EXPERIENCE, + OT_POT_FURY, + OT_POT_GASEOUSFORM, + OT_POT_GROWTH, + OT_POT_HEALING, + OT_POT_HEALINGMIN, + OT_POT_HEALINGMAJ, + OT_POT_INVIS, + OT_POT_INVULN, + OT_POT_LEVITATION, + OT_POT_MAGIC, + OT_POT_OIL, + OT_POT_POISON, + OT_POT_POLYMORPH, + OT_POT_RESTORATION, + OT_POT_RUM, + OT_POT_SANCTUARY, + OT_POT_SLEEP, + OT_POT_SPEED, + OT_POT_SPIDERCLIMB, + OT_POT_WATER, + OT_POT_JUICE, + // soup from recipes + OT_POT_SOUPCHICKEN, + OT_POT_SOUPMUSHROOM, + OT_POT_SOUPTOMATO, + OT_POT_STROGONOFF, + OT_POT_SUGARWATER, + // scrolls + OT_MAP, + OT_GRAPHPAPER, + OT_SCR_AMNESIA, + OT_SCR_AWARENESS, + OT_SCR_NOTHING, + OT_SCR_CREATEMONSTER, + OT_SCR_DETECTAURA, + OT_SCR_DETECTLIFE, + OT_SCR_DETECTOBS, + OT_SCR_DETECTMAGIC, + OT_SCR_FLAMEPILLAR, + OT_SCR_FLAMEBURST, + OT_SCR_IDENTIFY, + OT_SCR_KNOCK, + OT_SCR_LIGHT, + OT_SCR_MAPPING, + OT_SCR_MENDING, + OT_SCR_MINDSCAN, + OT_SCR_PERMENANCE, + OT_SCR_ENCHANT, + OT_SCR_FREEZEOB, + OT_SCR_REMOVECURSE, + OT_SCR_REPLENISHMENT, + OT_SCR_TELEPORT, + OT_SCR_TURNUNDEAD, + OT_SCR_WISH, + // BOOKS + OT_MANUAL, + OT_SPELLBOOK, + // spells + // -- allomancy + OT_S_ABSORBMETAL, + OT_S_ACCELMETAL, + OT_S_ALCHEMY, + OT_S_ANIMATEMETAL, + OT_S_EXPLODEMETAL, + OT_S_HEATMETAL, + OT_S_PULLMETAL, + OT_S_MAGSHIELD, + OT_S_METALHEAL, + // -- death magic / necromency + OT_S_ANIMATEDEAD, + OT_S_COMMANDUNDEAD, + OT_S_CURSE, + OT_S_DRAINLIFE, + OT_S_FEAR, + OT_S_FLAYFLESH, + OT_S_HECTASSERVANT, + OT_S_PAIN, + OT_S_PARALYZE, + OT_S_PROTGOOD, + OT_S_INFINITEDEATH, + OT_S_WEAKEN, + OT_S_FEEBLEMIND, + OT_S_BLINDNESS, + OT_S_POISONBOLT, + OT_S_POSSESSION, + OT_S_SMITEGOOD, + OT_S_STENCH, + // -- divination + OT_S_AWARENESS, + OT_S_CANINETRACKING, + OT_S_DETECTAURA, + OT_S_DETECTLIFE, + OT_S_DETECTOBS, + OT_S_DETECTMAGIC, + OT_S_IDENTIFY, + OT_S_LOCATEOBJECT, + OT_S_LORE, + OT_S_MAPPING, + OT_S_REVEALHIDDEN, + OT_S_SEEINVIS, + OT_S_SIXTHSENSE, + // -- elemental - air + OT_S_JOLT, + OT_S_AIRBLAST, + OT_S_CHAINLIGHTNING, + OT_S_CLOUDKILL, + OT_S_GUSTOFWIND, + OT_S_MIST, + OT_S_SHATTER, + OT_S_TAILWIND, + OT_S_WINDSHIELD, + // -- elemental - fire + OT_S_BLADEBURN, + OT_S_BURNINGFEET, + OT_S_BURNINGWAVE, + OT_S_FIREDART, + OT_S_FIREBALL, + OT_S_FLAMEPILLAR, + OT_S_FLAMEBURST, + OT_S_IMMOLATE, + OT_S_METEOR, + OT_S_PYROMANIA, + OT_S_SPARK, + OT_S_SUPERHEAT, + // -- elemental - ice + OT_S_ABSOLUTEZERO, + OT_S_CHILL, + OT_S_COLDBURST, + OT_S_COLDRAY, + OT_S_CRYSTALARM, + OT_S_CRYSTALSHIELD, + OT_S_FREEZEOB, + OT_S_FROSTBITE, + OT_S_GLACIATE, + OT_S_ICECRUST, + OT_S_ICICLE, + OT_S_SLIDE, + OT_S_SHARDSHOT, + OT_S_SNAPFREEZE, + OT_S_SNOWBALL, + OT_S_WALLOFICE, + // -- gravity + OT_S_EQANDOP, + OT_S_FLIGHT, + OT_S_FORCESPHERE, + OT_S_GRAVLOWER, + OT_S_GRAVBOOST, + OT_S_HASTE, + OT_S_LEVITATION, + OT_S_SLOW, + OT_S_TRUESTRIKE, + OT_S_WHATGOESUP, + // -- life magic / cleric + OT_S_HEALING, + OT_S_HEALINGMIN, + OT_S_HEALINGMAJ, + OT_S_HEAVENARM, + OT_S_HOLYAURA, + OT_S_PROTEVIL, + OT_S_RESTORATION, + OT_S_RESSURECTION, + OT_S_SMITEEVIL, + OT_S_SPEAKDEAD, + OT_S_TURNUNDEAD, + // -- mental / psionic + OT_S_BAFFLE, + OT_S_CHARM, + OT_S_DISORIENT, + OT_S_HUNGER, + OT_S_LETHARGY, + OT_S_LOWERMETAB, + OT_S_MINDSCAN, + OT_S_MIRRORIMAGE, + OT_S_PACIFY, + OT_S_PSYARMOUR, + OT_S_SLEEP, + OT_S_STUN, + OT_S_STUNMASS, + OT_S_TELEKINESIS, + // -- modification + OT_S_ANIMATESTATUE, + OT_S_DARKNESS, + OT_S_ENCHANT, + OT_S_GASEOUSFORM, + OT_S_GREASE, + OT_S_HOLDPORTAL, + //OT_S_INSCRIBE, + OT_S_INVISIBILITY, + OT_S_KNOCK, + OT_S_LIGHT, + OT_S_MENDING, + OT_S_OBJECTGROWTH, + OT_S_PASSWALL, + OT_S_PETRIFY, + OT_S_POLYMORPH, + OT_S_POLYMORPHRND, + OT_S_QUICKENSTONE, + OT_S_SHAPESHIFT, + OT_S_SIZEUP, + OT_S_SIZEDOWN, + // nature / enviromancy + OT_S_BARKSKIN, + OT_S_CALLLIGHTNING, + OT_S_CALLWIND, + OT_S_CALMANIMALS, + OT_S_CALMINGSCENT, + OT_S_CHARMANIMAL, + OT_S_CUREPOISON, + OT_S_DETECTPOISON, + OT_S_DIG, + OT_S_EARTHQUAKE, + OT_S_EVAPORATE, + OT_S_EXCAVATE, + OT_S_WEB, + OT_S_ENDUREELEMENTS, + OT_S_ENTANGLE, + OT_S_FLOOD, + OT_S_HAILSTORM, + OT_S_LIGHTNINGBOLT, + OT_S_LIGHTNINGSTORM, + OT_S_PURIFYFOOD, + OT_S_QUENCH, + OT_S_LESSENPOISON, + OT_S_REPELINSECTS, + OT_S_SATEHUNGER, + OT_S_SLEETSTORM, + OT_S_SOFTENEARTH, + OT_S_STICKTOSNAKE, + OT_S_SUMMONANIMALSSM, + OT_S_SUMMONANIMALSMD, + OT_S_SUMMONANIMALSLG, + OT_S_SUMMONDEMON, + OT_S_THORNS, + OT_S_WARPWOOD, + OT_S_WATERJET, + // -- summoning + OT_S_CLONE, + OT_S_CREATEFOOD, + OT_S_FLOATINGDISC, + OT_S_FRIENDS, + OT_S_GLYPHWARDING, + OT_S_CLEARLEVEL, + OT_S_CREATEMONSTER, + OT_S_SUMMONWEAPON, + // -- translocation + OT_S_APPORTATION, + OT_S_BLINK, + OT_S_BLINKASS, + OT_S_DISPERSAL, + OT_S_GATE, + OT_S_INSTANTDISROBE, + OT_S_PLANESHIFT, + OT_S_SUCK, + OT_S_TELEPORT, + OT_S_TWIDDLE, + // -- wild + OT_S_ALARM, + OT_S_MANASPIKE, + OT_S_DETONATE, + OT_S_DETONATEDELAY, + OT_S_ENERGYBOLT, + OT_S_ENERGYBLAST, + OT_S_FLASH, + OT_S_NULLIFY, + OT_S_REPLENISH, + // -- divine powers + OT_S_CREATEVAULT, + OT_S_GIFT, + OT_S_WISH, + OT_S_WISHLIMITED, + OT_A_BLINDALL, + OT_S_CONFISCATE, + OT_A_DEBUG, + OT_A_ENHANCE, + OT_A_LEARN, + OT_A_LEVELUP, + // abilities + OT_A_AIMEDSTRIKE, + OT_A_ALTERATTACK, + OT_A_CHECKSTAIRS, + OT_A_CLIMB, + OT_A_COOK, + OT_A_DARKWALK, + OT_A_DISARM, // disarm a trap + OT_A_DISARMLF, // disarm an opponent + OT_A_DRAGUNDERGROUND, + OT_A_ENHANCEOB, + OT_A_FEIGNDEATH, + OT_A_FLIP, + OT_A_FLURRY, + OT_A_GRAB, + OT_A_CHARGE, + OT_A_COMBOSTRIKE, + OT_A_CRUSH, + OT_A_JUMP, + OT_A_PRAY, + OT_A_RAGE, + OT_A_REPAIR, + OT_A_RESIZE, + OT_A_SHIELDBASH, + OT_A_SNATCH, + OT_A_SONICBOLT, + OT_A_SPRINT, + OT_A_STUDYSCROLL, + OT_A_STINGACID, // need to define dam in f_canwill + OT_A_STRIKETOKO, + OT_A_SUCKBLOOD, + OT_A_SWALLOW, + OT_A_SWOOP, + OT_A_TRIPLF, // trip an opponent + OT_A_EMPLOY, + OT_A_EXPOSEDSTRIKE, + OT_A_HEAVYBLOW, + OT_A_HIDE, + OT_A_INSPECT, + OT_A_HURRICANESTRIKE, + OT_A_PICKLOCK, + OT_A_POLYREVERT, + OT_A_QUIVERINGPALM, + OT_A_STEAL, + OT_A_THRUST, // attack up to 2 cells away with a piercing weapon. + OT_A_TRAIN, + OT_A_TUMBLE, + OT_A_WARCRY, // uses F_NOISETEXT -> N_WARCRY if it is there. + // otherwise 'shouts a blood-curdling war cry' + // wands + OT_WAND_COLD, + OT_WAND_CREATEFOOD, + OT_WAND_DETONATION, + OT_WAND_DIGGING, + OT_WAND_DISPERSAL, + OT_WAND_FIRE, + OT_WAND_FIREBALL, + OT_WAND_HASTE, + OT_WAND_INVIS, + OT_WAND_KNOCK, + OT_WAND_LIGHT, + OT_WAND_NULLIFY, + OT_WAND_POLYMORPH, + OT_WAND_REVEALHIDDEN, + OT_WAND_SLOW, + OT_WAND_TURNUNDEAD, + OT_WAND_WEAKNESS, + OT_WAND_WONDER, + // tools - unique + OT_ORBDUNGEONEXIT, + // tools + OT_BAGOFHOLDING, + OT_BAGOFHOLDINGLARGE, + OT_BAGOFHOLDINGHUGE, + OT_BANDAGE, + OT_BLANKET, + OT_BLINDFOLD, + OT_BUGLAMP, + OT_CANDLE, + OT_FRIDGE, + OT_GUNPOWDER, + OT_LAMPOIL, + OT_LANTERNOIL, + OT_LOCKPICK, + OT_PANPIPES, + OT_PICKAXE, + OT_ROPE, + OT_SACK, + OT_SACKLARGE, + OT_SACKHUGE, + OT_SAFEBOX, + OT_TORCH, + OT_TOWEL, + // tech l0 + OT_CREDITCARD, + OT_PAPERCLIP, + OT_SLEEPINGBAG, + // tech l1 + OT_BUTANETORCH, + OT_POCKETWATCH, + OT_DIGITALWATCH, + OT_INSECTICIDE, + OT_LANTERNLED, + OT_SOLDERINGIRON, + // tech l2 + OT_BATTERY, + OT_C4, + OT_FLASHBANG, + OT_GRENADE, + OT_GRENADESMOKE, + OT_MOTIONSCANNER, + OT_NVGOGGLES, + OT_STYPTIC, + OT_TENT, + // tech l3 + OT_INFOVISOR, + OT_LOCKHACKER, + OT_PORTLADDER, + // tech l4 + OT_JETPACK, + // tech l5 + OT_TELEPAD, + OT_XRAYGOGGLES, + // tech l6 + // none yet. + // furniture + OT_ARMOURRACK, + OT_BED, + OT_BOOKSHELF, + OT_CANDELABRUM, + OT_COFFIN, + OT_FIREPLACE, + OT_WEAPONRACK, + OT_WOODENTABLE, + OT_WOODENBARREL, + OT_WOODENSTOOL, + // misc objects + OT_BONE, + OT_CHEST, + OT_EMPTYFLASK, + OT_EMPTYVIAL, + OT_CALTROP, + OT_BROKENGLASS, + OT_ICECHUNK, + OT_ICESHEET, + OT_MUDPOOL, + OT_PUDDLEOIL, + OT_SPLASHWATER, + OT_PUDDLEWATER, + OT_PUDDLEWATERL, + OT_ACIDSPLASH, + OT_ACIDPUDDLE, + OT_ACIDPOOL, + OT_SLIMEPUDDLE, + OT_SLIMEPOOL, + OT_VOMITPOOL, + OT_BLOODSTAIN, + OT_BLOODSPLASH, + OT_BLOODPOOL, + OT_BLOODCSPLASH, + OT_MELTEDWAX, + OT_SOGGYPAPER, + OT_FLESHCHUNK, + // trail objects + OT_FOOTPRINT, + OT_SCENT, + // effects + OT_DUSTCLOUD, + OT_DUSTPUFF, + OT_FIRELARGE, + OT_FIREMED, + OT_FIRESMALL, + OT_HAILSTORM, + OT_ICEWALL, + OT_MAGICBARRIER, + OT_STEAMCLOUD, + OT_STEAMPUFF, + OT_SLEETSTORM, + OT_MIST, + OT_SMOKECLOUD, + OT_SMOKEPUFF, + OT_METHANEPUFF, + OT_POISONCLOUD, + OT_POISONPUFF, + OT_VIBCLOUD, + OT_VINE, + OT_WEB, + // armour - multipart + OT_WETSUIT, + // armour - body + OT_APRON, + OT_ARMOURDEMON, + OT_ARMOURLEATHER, + OT_ARMOURRING, + OT_ARMOURSCALE, + OT_ARMOURCHAIN, + OT_ARMOURSPLINT, + OT_ARMOURPLATE, + OT_FLAKJACKET, + OT_OVERALLS, + OT_CHEFJACKET, + OT_COTTONSHIRT, + OT_SILKSHIRT, + OT_ROBE, + OT_VELVETROBE, + // armour - shoulders + OT_CLOAK, + OT_CLOAKFUR, + // armour - waist + OT_BELTLEATHER, + // armour - legs + OT_CLOTHTROUSERS, + OT_COMBATPANTS, + OT_GREAVES, + OT_RIDINGTROUSERS, + // armour - feet + OT_SANDALS, + OT_SHOESLEATHER, + OT_BOOTSLEATHER, + OT_BOOTSMETAL, + OT_BOOTSRUBBER, + OT_BOOTSSPIKED, + // armour - hands + OT_GLOVESCLOTH, + OT_GLOVESLEATHER, + OT_GAUNTLETS, + // armour - head + OT_SUNHAT, + OT_PIRATEHAT, + OT_POINTYHAT, + OT_BALACLAVA, + OT_CAP, + OT_CHEFHAT, + OT_HELM, + OT_GASMASK, + OT_GOLDCROWN, + OT_HELMBONE, + OT_HELMFOOTBALL, + // armour - ears + OT_EARPLUGS, + // armour - eyes + OT_SAFETYGLASSES, + OT_SPECTACLES, + OT_EYEPATCH, + OT_SUNGLASSES, + // armour - shields + OT_BUCKLER, + OT_SHIELD, + OT_SHIELDHIDE, + OT_SHIELDLARGE, + OT_SHIELDTOWER, + // rings + OT_RING_ENDURANCE, + OT_RING_GREED, + OT_RING_INVIS, + OT_RING_INVULN, + OT_RING_LUCK, + OT_RING_CONTROL, + OT_RING_CON, + OT_RING_DECELERATION, + OT_RING_DETECTLIFE, + OT_RING_DEX, + OT_RING_EDUCATION, + OT_RING_HUNGER, + OT_RING_IQ, + OT_RING_STR, + OT_RING_MANA, + OT_RING_MEDITATION, + OT_RING_MIRACLES, + OT_RING_MPBOOST, + OT_RING_MPREGEN, + OT_RING_NOINJURY, + OT_RING_PROTFIRE, + OT_RING_PROTCOLD, + OT_RING_REFLECTION, + OT_RING_REGENERATION, + OT_RING_RESISTMAG, + OT_RING_SIGHT, + OT_RING_STENCH, + OT_RING_WATERBREATHING, + OT_RING_WOUNDING, + // innate / animal weapons + OT_BEAK, + OT_CLAWS, + OT_DRILL, + OT_FISTS, + OT_HOOKHAND, // for pirate + OT_STING, + OT_BUTT, + OT_HOOF, + OT_TAIL, + OT_TEETH, + OT_TEETHSM, + OT_TENTACLE, + OT_TONGUE, + OT_ZAPPER, + // monster weapons + OT_ACIDATTACK, + OT_TOUCHBURN, + OT_TOUCHCHILL, + OT_TOUCHHOLY, + OT_TOUCHNECROTIC, + OT_TOUCHPARALYZE, + OT_TOUCHPARALYZE2, + // missiles / ammo + OT_ARROW, + OT_BOLT, + OT_DART, + OT_DARTNANO, + OT_DARTTRANQ, + OT_MANRIKI, + OT_NEEDLE, + OT_NET, + OT_JAVELIN, + OT_BULLET, + OT_RUBBERBULLET, + OT_SHURIKEN, + // axes + OT_AXE, + OT_HANDAXE, + OT_HATCHET, + OT_BATTLEAXE, + OT_GREATAXE, + OT_WARAXE, + // short blades + OT_COMBATKNIFE, + OT_DAGGER, + OT_FORK, + OT_KNIFE, + OT_MEATCLEAVER, + OT_ORNDAGGER, + OT_QUICKBLADE, + OT_RAPIER, + OT_SAI, + OT_SHORTSWORD, + OT_STEAKKNIFE, + OT_SICKLE, + // long swords + OT_BASTARDSWORD, + OT_FALCHION, + OT_GREATSWORD, + OT_KATANA, + OT_LONGSWORD, + OT_ORNSWORD, + OT_SCIMITAR, + OT_CUTLASS, + // polearms + OT_GLAIVE, + OT_GUISARME, + OT_HALBERD, + OT_LANCE, + OT_PITCHFORK, + OT_RANSEUR, + OT_SCYTHE, + OT_SPEAR, + OT_TRIDENT, + // staves + OT_QUARTERSTAFF, + OT_BAMBOOSTAFF, + OT_IRONSTAFF, + OT_BLADEDSTAFF, + OT_WIZARDSTAFF, + OT_WIZARDSTAFF2, + OT_WIZARDSTAFF3, + OT_WIZARDSTAFF4, + OT_WIZARDSTAFF5, + OT_WIZARDSTAFF6, + // clubs + OT_CLUB, + OT_FLAIL, + OT_FLAILHEAVY, + OT_GREATCLUB, + OT_MACE, + OT_MORNINGSTAR, + OT_NUNCHAKU, + OT_SHILLELAGH, + OT_SPANNER, + OT_STICK, + // projectile weapons + OT_BLOWGUN, + OT_BOW, + OT_CROSSBOW, + OT_CROSSBOWHAND, + OT_LONGBOW, + OT_REVOLVER, + OT_SHOTGUN, + OT_SLING, + // special weapons + OT_ENERGYBLADE, + OT_HANDOFGOD, + OT_ICEARMOUR, + OT_ICEBOOTS, + OT_ICEGLOVES, + OT_ICEHELMET, + OT_ICESHIELD, + // special obs + OT_PLAYERSTART, + OT_PUSHN, + OT_PUSHE, + OT_PUSHS, + OT_PUSHW, +}; + +#define MAXBUILDINGTYPES (10) + + +#define BP_NONE (-1) +enum BODYPART { + // humanoid parts + BP_WEAPON = 0, + BP_SECWEAPON = 1, + BP_EARS = 2, + BP_EYES = 3, + BP_HEAD = 4, // <- core bodypart + BP_SHOULDERS = 5, + BP_BODY = 6, // <- core bodypart + BP_HANDS = 7, // <- core bodypart + BP_WAIST = 8, + BP_LEGS = 9, // <- core bodypart + BP_FEET = 10, + BP_RIGHTFINGER = 11, + BP_LEFTFINGER = 12, + // others... + BP_BACKLEGS = 13, + BP_FRONTLEGS = 14, + BP_WINGS = 15, // <- core bodypart + BP_TAIL = 16, // <- core bodypart +}; +#define MAXBODYPARTS (17) + +// depth on a human + +#define DP_MAX DP_OVERHEAD4 +#define DP_FIRST DP_TOE +enum DEPTH { +/* + DP_HEAD = 4, + DP_SHOULDERS = 3, + DP_WAIST = 2, + DP_FEET = 1, + DP_NONE = 0, +*/ + DP_OVERHEAD4 = 15, + DP_OVERHEAD3 = 14, + DP_OVERHEAD2 = 13, + DP_OVERHEAD = 12, + DP_HEAD = 11, + DP_SHOULDERS = 10, + DP_CHEST = 9, + DP_BELLY = 8, + DP_WAIST = 7, + DP_THIGH = 6, + DP_KNEE = 5, + DP_CALF = 4, + DP_FEET = 3, + DP_ANKLE = 2, + DP_TOE = 1, + DP_NONE = 0, +}; + +enum NOISETYPE { + N_GETANGRY, + N_WALK, + N_FLY, + N_LOWHP, + N_FRUSTRATED, + N_SONICBOLT, + N_WARCRY, + N_SPELLCAST, +}; + +enum LFSIZE { + SZ_ANY = -2, + SZ_MIN = -1, + SZ_MINI = 0, // ie. fly + SZ_TINY = 1, // ie. mouse + SZ_SMALL = 2, // ie. cat + SZ_MEDIUM = 3, // ie. wolf/dog + SZ_HUMAN = 4, // ie. human-sized + SZ_LARGE = 5, // ie. bear/horse + SZ_HUGE = 6, // ie. elephant, dragon, giant + SZ_ENORMOUS = 7, // ie. ??? kraken, titan + SZ_MAX = 100 +}; + +enum ALLEGIENCE { + AL_HOSTILE, // will attack you on sight + AL_PEACEFUL, // won't attack you on sight + AL_FRIENDLY, // will help you fight +}; + +enum ALIGNMENT { + AL_NONE, + AL_GOOD, + AL_NEUTRAL, + AL_EVIL, +}; + +enum POISONSEVERITY { + PS_DISEASE, + PS_POISON, + PS_CURSE, +}; + +enum POISONTYPE { + P_COLD, + P_FOOD, + P_FOODBAD, + P_GAS, + P_ROT, + P_VENOM, + P_WEAKNESS, +}; + + +enum RANGEATTACK { + RA_NONE = 0, + RA_GUN, + RA_THROW, + RA_WAND, +}; + +enum SLEEPTYPE { + ST_ASLEEP = 0, + ST_MEDITATING, + ST_KO, +}; + +enum FLAG { + F_NONE = 0, // dummy flag + // map flags + F_MAPCOORDS, // v0+v1 are x/y coords for this map area + F_MAPSHAPE, // v0 = enum MAPSHAPE + F_ROOMEXIT, // there is an exit from room v0 at x=v1,y=v2 + F_NEWWATERDEPTH, // temp flag for the spread of f_deepwater obs. + // v0+1 are x/y, v2 is new depth. + F_STOMACHOF, // this map is the stomach of lf id V0, name = f->text + F_CELLTYPESOLID, // use celltype v0 for solid cells (walls) + F_CELLTYPEEMPTY, // use celltype v0 for empty cells (corridors/rooms) + // object flags + F_BADOBJECT, // this object is dangerous. ie. potion of poison, + // potion of sleep, etc. + F_BATTLESPOILS, // this obejct was dropped by a monster which the + // player killed, and has not yet been touched. + F_BEINGUSED, // this object is currently being used + F_DEAD, // object will be removed + F_ONEPERCELL, // only one of these objects can exist per cell + F_ONLYINROOM, // object nay only appear in rooms (not corridors) + F_CREATEDBY, // object was made by lf id v0, text=real lfname + F_CREATEDBYSPELL, // object was made by spell id v0 + F_ENCHANTABLE, // object can get +1/-1 ect + F_GEM, // this object is a gem. + F_GODGIFT, // this was a gift form god with race v0. + F_NOSHATTER, // object will not shatter, even if it's material should. + F_STACKABLE, // can stack multiple objects togethr + F_NO_PLURAL, // this obname doesn't need an 's' for plurals (eg. gold, money) + F_NO_A, // this obname doesn't need to start with 'a' for singular (eg. gold) + F_CONTAINSOB, // for vending machiens. v0 is ob letter + // text is an object it contains. + F_MAPTO, // this object is a map to a regionlink.: + // v0=region containing entrance + // v1=depth of entrance + // v2=regionthing ID of RT_REGIONLINK thing + // text = what this is a map to ie. "the goblin caves" + F_SIGNTEXT, // for 'sign' objects. f->text is what is says. + F_IDWHENUSED, // fully identify an object when worn/weilded/operated/etc + F_STARTBLESSED, // v0 = b_blessed or b_cursed + F_REPELBLESSED, // v0 = b_blessed or b_cursed. repels other obejcts + // of this blesstype. + // if v1 == b_blessed or b_cursed, will ID these blessings/curses + F_TRAIL, // this object denotes the trail left by a lf. + // v0 = raceid of lf who left it + // v1 = direction the lf moved out of this cell + // v2 = enum sense used to see this (ie. s_smell, s_sight) + // (optional) text = lfid of lf who left this. + // should only be used for SCENT, not footprints. + F_NOFEEL, // when blind, don't show "you can feel xxx" + F_FEELTEXT, // when blind, show "you can feel"+f->text + // for items in shops + F_VENDITEM, // causes vending machine to show this item as identified + //F_SHOPITEM, // v0 is object value. + // v1 is the shop it is from + // causes shops to show (worth $xx) after the ob's name. + // also used for detecting theft! + F_VALUE, // how much an item is worth (over its base weight+material) + F_NOPOINTS, // object is worth 0 points (but might still have a + // monetary value) + // for object brands + F_ONLYFOROBTYPE, // brand can only go on obtype v0 + F_ONLYFOROBCLASS, // brand can only go on obclass v0 + F_ONLYFOROBWITHFLAG, // brand can only go on obs with flag v0 + F_ONLYFORDAMTYPE, // brand can only go on obs with damtype v0 + F_ONLYFORWEPSKILL, // brand can only go on obclass v0 + // weapon/armour flags + F_EQUIPPED, // val0 = where it is equipped. CLEAR WHEN OB MOVED! + F_SECONDARY, // this object is player's secondary weapon. + F_GOESON, // val0 = where it can be equipped. + F_GOESONMULTI, // ob is equipped on _ALL_ F_GOESON flags, rather than + // equipped on _ONE OF_ the. + F_BONUS, // val0=bonus/penalty to damage+accuracy/armour. ie. +1 sword + F_THROWMISSILE, // weapon would make a good thrown missle - used by AI + F_CANHOME, // this object can have the 'homing' flag + F_UNIQUE, // only one may appear + F_GLYPH, // override the glyph with the first char of text. + // v0 is either NA (white) or colourid (C_xxx). + F_NOGLYPH, // this object doesn't appear normally + F_COSMETIC, // this object is mostly cosmetic, don't say 'you see xx' + // also don't stop the player running past it. + F_INVISOB, // this object cannot be seen + F_NOPICKUP, // cannot pick this up + F_ATTACKABLE, // can attack this with 'A' + F_IMPASSABLE, // cannot walk past this if your size is between v0 and v1 + // (inclusive) + F_REALLYIMPASSABLE, // even gaseous form etc won't let you get through + // this. + F_CRUSHABLE, // if you are bigger than size v0, walking on this crushes it + F_CAUSESCOUGH, // being in this ob's cell will make you cough unless + // immune to gas. + // v0 = con skillcheck difficulty. + F_BLOCKSVIEW, // if v0 = true, cannot see past this + // if v0 > 0, reduces your vision by v0. + F_BLOCKSLOF, // this object interrupts line of fire + F_THEREISHERE, // announce "there is xx here!", not "you see xx here" + // text[0] is punctuation to use. + F_OBDIETEXT, // text when the object dies + F_DIECONVERTTEXT, // text when the object converts. eg. "melts" + F_DIECONVERTTEXTPL, // text when the object converts, if there are more than 1. eg. "melt" + F_DIECONVERT, // text = what this turns into when dying + // v0 = radius to scatter new object in (0 or NA means + // just convert the object) + F_NOBLESS, // can't be blessed or cursed + F_NOQUALITY, // can't be masterwork / shoddy + F_NOSTEAL, // this object can't be stolen, blown away, etc. + F_SALTED, // this corpse has been salted and will not decay. + F_CORPSEOF, // this is a corpse of montype val0. + // v1 is its level when it died + // text is how it died. + F_REVIVETIMER, // v0 = cur, v1 = max. v0 incremenets each tick. + // when v0 == v1, this object changes into lf of race + // v2. + F_DTCONVERT, // damtype val0 converts this to f->text + F_DTCREATEOB, // damtype val0 creates object f->text here + // v1 = radius to burst in + // v2 = dirtype + F_NODTCONVERT, // overrides DTCONVERT . + F_NOMATCONVERT, // overrides MATCONVERT . + F_MATCONVERT, // touching material id val0 converts this to f->text + F_MATCONVERTTEXT, // description when F_MATCONVERT happens. ie. "is consumed in flame" + F_MATCONVERTTEXTPL, // plural for matconverttext. + F_DTIMMUNE, // immune to damtype val0 + F_DTRESIST, // half dam from damtype val0 + F_DTVULN, // double dam from damtype val0 + // if dam=0, set dam to textfield dice (eg.text="2d6") + F_MATIMMUNE, // immune to damage from obs with material 'v0' + F_MATVULN, // vulnarable to damage from obs with material 'v0' + // v1 = this % of damage is done. ie. 110% + F_PURIFIESTO, // v0 = new obid after purify food spell + F_DAMAGABLE, // this ob can be damaged via takedamage() + F_TINTED, // when worn on eyes, protects against bright lights + F_HASBRAND, // has the object mod v0 (ie. OM_FLAMESTRIKE) + F_HOLDCONFER, // gives flag v0+v1 when carried. v2 specifies if it must be id'd. + F_EQUIPCONFER, // gives flag v0+v1 when weilded/worn. v2 specifies if it must be id'd. + F_ACTIVATECONFER, // gives flag v0+v1 when activated. v2 specifies if it must be id'd. + F_ACTIVATEPREFIX, // when activated, prefix this objects name with + // text + + F_CRITKNOCKDOWN, // lf knocks down victims on a critical hit + F_HITCONFER, // hitting with this gives flagid=v0 + // with timeleft = text ("min-max") + // unless you pass a val1 skillcheck, diff val2 + // if val1 = SC_NONE, no check. + // MUST ALSO HAVE HITCONFERVALS. + F_HITCONFERVALS,// specifies values for conferred flag. + F_ACTIVATED, // val0 = is this object turned on? + F_GRENADE, // this object will drain charge when activated, then die + F_EXPLODEONDEATH, // explodes when it dies, deals TEXT damage. + // val1 = explosion radius (dtorth) + // val2 = ifactivated, only explodes if activated. + F_EXPLODEONDAM, // explodes when it is damaged, deals TEXT damage. + // v0 = damage type which makes it explode. + // NA means 'any damage type' + // val1 = explosion radius (dtorth) + // val2 = ifactivated, only explodes if activated. + F_FLASHONDEATH, // produce a bright flash when it dies,v0=range + F_FLASHONDAM, // produces a bright flash when it is damaged,v0=range,v2=ifacctivated + F_LASTDAMTYPE, // object equivilant of lf->lastdamtype + F_SCROLLNEEDSOB, // this scroll targets an object + // v0 = B_ALWAYS (always targets an ob) + // v0 = B_IFNOTBLESSED (only targets an ob if unblessed) + F_OPERONOFF, // operating this will just turn it on/off + F_OPERUSECHARGE, // operating this will use 1 charge + F_OPERNEEDTARGET, // need to ask for a target of type val0 when opering + // v1 is bitmask of: + // TR_NEEDLOS, TR_NEEDLOF, TR_NONE + // optional v2 is range (otherwise unlimited) + // text is prompt + F_OPERNEEDDIR, // need to ask a direction when operating this. text is prompt + + // tool flags + F_LIGHTSOURCE, // a light source like a torch, lantern etc + F_CHARGELOWMSG, // text = msg when charges are nearly out + F_CHARGEOUTMSG, // text = msg when charges are gone + F_HELPSCLIMB, // object gives v0 bonus to sc_climb checks. + F_HELPSDIG, // object can dig. does v0 dam to cells. + F_HELPSDISARM, // object gives v0 bonus to disarm trap checks. + F_HELPSREST, // makes you heal mp/hp faster when using 'R' + // reduces skillcheck difficulty by v0. + // optional v1 = how many less turns between + // skillchecks. should not go more than + // DEFAULTRESTHEALTIME. + F_DONTSHOWDEST, // don't show destination of this stair + // object. ie say "staircase", not "staircase + // to level 4" + // technology flags + F_TECHLEVEL, // v0 is a PR_xxx enum for tech usage skill + F_RNDCHARGES, // ob starts with between val0 and val1 charges + // this will cause F_CHARGES to be filled in + F_CHARGES, // generally the number of uses left,v0=min, v1=max + F_REPLENISHABLE, // the 'replenish' spell works on this object + F_DONTSHOWCHARGES, // don't show 'xx charges left' when id'd + F_RECHARGEWHENOFF, // get power back when you turn it off + F_RECHARGE, // get v0 charges back each turn. + F_REFILLWITH, // pour obj id val0 onto this to refill its charges + F_PLAYERMISSILE, // this was a missile fired/thrown by the player + // used with the 'autopickup used missiles' option. + // what can you do with this object? + F_TAINTED, // will give food poisoning if you eat/drink it + F_PREPARED, // raw meat has been prepared using cooking skill + F_ISMEAT, // this food contains meat parts - not suitable for + // vegetarians + F_EDIBLE, // you can eat this. val1 = nutrition. 100 = a meal + // -1 means "nutrition is weight x abs(val1)" + // v2 = nutrition left when partially eaten + F_DRINKABLE, // you can drink this. val1 = nutrition. 100 = a meal + // -1 means "nutrition is weight x abs(val1)" + // if v2=DONTKILL, this object does NOT die when drunk. + F_OPERABLE, // can operate? + F_OPERWITHOUTID, // can operate without knowing what it is? + F_NOTRIED, // don't show '[tried]' or update knowledge + // after you have tried this object. + F_POURABLE, // can pour? + F_PUSHABLE, // can push this object + F_PICKLOCKS, // can pick locks? val0=% change, + // val1=b_false, f_dieonfail, f_bluntonfail + F_LOCKABLE,// this object can be locked + F_CANBEDIFFMAT, // v0 is different material id which this ob could be + // v1 is the chance of it being this material + F_CANBETRAPPED, // this object might start with a trap + // v0 = base pct chance + // v1 = extra pct chance every 5 levels + // v2 = max trap chance + F_CANBELOCKED, // this object might start off locked + // v0 = base pct chance + // v1 = extra pct chance every 5 levels + F_TRAPPED, // this object HAS a trap. + // v0 is the trap object type + // v1 - 'curtime' when this trap was last triggered + // v2 = TRUE means we've spotted this. + F_TRAP, // this object _IS_ a trap. v0 is sc_disarm/sc_spot difficulty. + // (NA = impossible) + // if v1 = true, trap will go off if you fail your 2nd disarm + // check. + // v2 = sc_dodge difficulty + // if text == "groundonly", then this trap only goes off + // if you're on the ground (ie not flying) + F_OBJECTTRAP, // this trap can go onto an object (door, chest, etc) + F_SMELLY, // lfs with enhacned scent can smell this object + F_MAKESNOISE, // object periodically makes noise. + // v0 = % chance of noise. + // v1 = volume. + // f->text is the sound made. ie. "a splash." + // shops + F_BANNEDLF, // lfid v0 is not allowed to enter this shop + F_SHOP, // this object is a shop + F_SHOPDONATED, // v0 = how much gold worth you have donated + F_SHOPACCEPTSFLAG, // v0 = can sell items with flag v0 to this shop, for + // v1 percent of full value. + // v2 = must be this objectclass (or NA) + F_SHOPMENU, // defines a menu for interaction with a shop + // v0 = (menuid*100) + itemorder + // ie. menu0 would have 0, 1, 2, 3 + // menu1 would have 100, 101, 102, 103 + // etc. + // v1 = enum MENUACTION + // v2 = value for action (optional) + // text = "x:whatever" (x is letter to press) + + + // doors + F_DOOR, // this object is a door - ie. can open it + // v0 and v1 are like F_IMPASSABLE + F_OPEN, // is this door open? + F_LOCKED,// door is locked + // v1 is difficulty to disarm + F_JAMMED, // is this door jammed? v0 is # turns it'll take to open it. + // v1 = have we tried this door yet? + F_SECRET, // this object is secret. v0 is sc_search difficulty + // to find it. + // NA means 'can never find this' + // stairs / teleporters / portals + F_CLIMBABLE, // this is a stiarcase, v0 = up/down/in + // also use this for portals + // text = you climb down XXXX + // OPTIONAL v1 = id of region to link to. + F_PIT, // this is a pit which we can fall down. + // v0 = up/down + //F_STAIRDIR//, // val0 = direcion + F_OPPOSITESTAIRS, // val0 = opposite kind of stairs + F_MAPLINK, // val0 = map id to link to. + // v1/v2 = x/y + // OR + // text = obid to link to + + // ob interaction flags + F_REDUCEMOVEMENT, // time to move off here is multiplied by v0. + F_RESTRICTMOVEMENT, // must pass a diff=v0 STR check to move off it. + // if v1 is B_TRUE, then it takes 1 damage if you fail. + // if v2 is TRUE, it affects flying creatures + // + // for multiple objects, each one adds half its difficulty + + F_RODSHAPED, // for sticks-to-snakes + F_SHARP, // does damage when you step on it. v0/1 are min/max dam + F_SCARY, // gives other lfs a penalty to morale checks against you, + // v0 = penalty amt. + F_SLIPPERY, // you might slip when stepping on it. v0 is amt + F_SLIPMOVE, // if someone slips on this, it will move to an adj cell + F_FLAMMABLE, // object will catch alight if burnt (ie fire damage) + // v0 = how long it will burn for + // text (optional) = what it will convert to + // instead of just being set alight + F_FLAMMABLELF, // lf is covered in something flammable + // if hurt by dt_fire, object id v0 will apepar under + // them. + // f->Text is what you are covered with (for desc) + F_CANGETWET, // object will get F_WET if hit by water + // v0 = enum WETNESS. v1 = how long + F_WATERPROOF, // object doesn't get wet. note: overrides CANGETWET! + F_WET, // object is wet + F_RUSTED, // object is rusty + // v0 = enum RUSTINESS. + // object mods/effects + F_ONFIRE, // burning, also deals extra fire damage + // option text = xdx amount of extra damage to deal for + // weapons. + F_HOT, // object is very hot to the touch. + // v0 = amt of damage to deal if touched while gloveless + // text = amt of extra damage for weapons to deal + F_ENCHANTED, // weapon also deals 'text' extra fire damage + F_HEADLESS, // for corpses. can go on LFs too. + F_MASTERWORK, // weps do higher damager, armour protects better + F_SHODDY, // weps do less damage, armour protects less. + // weapon flags + F_ATTACKVERB, // text=verb for attacking. ie. "hit" "slash" "sting" etc + // if v0/v1 are set, only use this text if dam AMOUNT (not pct) is + // between v0 and v1. + // should always be singular + F_KILLVERB, // text=verb for a fatal attacking. ie. "kill" "behead" + // if v0/v1 are set, only use this text if dam PCT (not amount) is + // between v0 and v1. + // should always be singular + F_OBATTACKDELAY, // how long weapon takes to attack + F_USESSKILL, // weapon needs skill sk_v0 + F_MAGICBOOST, // boost power of all spells by v0 + F_CANHAVEOBMOD, // weapon can have obmod om_v0 applied + // optional: v1 is chance of randomly having it + F_ATTREQ, // requires attrib v0 to be at least v1 + // v2 = "boostlev" + // text = scalepct. + // if attrib is less than v1, apply "scalepct" % penalty + // per 10 points under. + // if v2 != NA, and attrib is >= v2, apply "scalepct"% bonus + // per 10 points over. + // (up to a max of 20 points higher/lower) + // + // if scalepct == 0, then you MUST meet the base req. + //F_DAMTYPE, // val0 = damage type + F_CRITCHANCE, // v0 = %chance of critical hit with this weapon + F_CRITPROTECTION, // v0 = %chance of preventing critical hits + //F_DAM, // v0 = damtype, text = 1d1+1 + F_DAM, // v0 = damtype, + // v1=DR (this takes precedence) + F_ALTDAM, // this weapon deal multiple damage types. + // v0 = damtype + // v1 = DR + // (add this flag multiple times for each damtype, + // and remember to include the one listed in its + // F_DAM) + F_MISSILEDAM, // val0 = dam if it hits (without speed multiplier) + F_TANGLEMISSILE, // this object will trip anyone it is thrown at + // (if it hits), unless they pass a SC_SLIP + // check of difficulty v0 + // if V1/V2 are set, then F_RESTRICTMOVEMENT + // v1->v0, v2->v1 is added to this object after it hits. + F_ACCURACY, // 100 - val0 = modify to tohit% (ie. higher is better) + F_UNARMEDWEP, // this is not a real weapon, ie. claws, teeth etc + F_ARMOURIGNORE, // armour has no effect + F_ARMOURPIERCE, // goes through armour. armour can't reduce the + // damage dealt to less than v0. + F_TWOHANDED, // weapon uses two hands to weild + F_NEEDSSPACE, // weapon needs space to swing - 75% chance of hitting + // a wall if used with < 3 empty cells around you + // gun flags + F_FIREARM, // this weapon is equipped in bp_secweapon, not _weapon. + F_FIRESPEED, // how fast this weapon shoots projectiles + F_AMMOOB, // v0 = what object this weapon fires. can have multiple types. + F_AMMOCAPACITY, // v0 = max ammo that can be loaded + F_RANGE, // range of projectile firing weapon + F_RELOADTURNS, // # actions it takes to reload this gun + // end gun flags + F_FLAMESTRIKE, // causes fires where you hit + F_BALANCE, // heals target if their maxhp < your maxhp + F_HOMING, // missile always hits + F_MERCIFUL, // puts to sleep instead of killing. + F_REVENGE, // causes damage based on your hp + // + F_POWDER, // this item is a powder + // ob appearance flags + F_SHINY, + // armour flags + F_MULTISIZE, // this object comes in varying sizes - calculate and + // assign a random f_armoursize on creation. + F_ARMOURSIZE, // v0 = sz_xxx, can be "medium", "human" or "large". + F_ARMOURRATING, // val0 * 2 = pct of damage reduced + F_SHIELD, // this is a shield - use special bodyhitchance code + F_CANBLOCK, // this objcet can block damtype xxx + F_OBHP, // val0 = object health, val1 = object maxhealth + F_OBHPDRAIN, // val0 = amt hp to lose each second. val1 = NA or damtype + // if no damtype specified, it will be DT_DIRECT + F_NOOBDAMTEXT, // don't anounce damage to this object + F_NOOBDIETEXT, // don't anounce destruction of this object + F_NODIECONVERTTEXT, // don't anounce when this object changes + // misc flags + F_LINKOB, // val0 = linked object id + F_LINKRACE, // val0 = linked race id + F_LINKGOD, // val0 = linked god race id + // scroll flags + F_LINKSPELL, // val0 = spell this scroll will cast when read + // v1 = spell power (optional) + // book flags + F_MANUALOF, // val0 = skill this book trains + F_LINKSCHOOL, // val0 = spellschool this book has spells from + // ob identification flags + F_HASHIDDENNAME, // whether this object class has a hidden name + // text is the name if you don't know what it is + F_IDENTIFIED, // whether this object is fully identified + F_KNOWNBAD, // you know this object is somehow bad + F_MOVELFS, // v0 = dir which this object will move lfs + // bad flags + F_DEEPWATER, // v0 = depth. + F_WALKDAM, // val0 = damtype, text = dam per sec + F_WALKDAMBP, // v0 = bodypart, v1 = damtype, text = dam per sec + // if v2 == FALLTHRU, damage falls through to lf if + // no armour is there. + // abilities + F_NEEDSGRAB, // this ability needs to to grab someone first. + F_NOANNOUNCE, // don't announce when you gain/lose this ability + // magic + F_SPELLSCHOOL, // val0 = SPELLSCHOOL enum + F_SPELLLEVEL, // val0 = difficulty level of spell + F_VARPOWER, // can cast this spell at variable power level + // for spells with this flag, the MP cost goes up + // based on the power level. + F_MAXPOWER, // val0 = max power of this spell (1-10) + F_MPCOST, // v0=mp cost of spell. if missing, mpcost is splev^2 + F_STAMCOST, // v0=stamina cost of ability. default is 0. + F_ONGOING, // this spell has an ongoing cost + F_CASTINGTIME, // this spell takes v0 turns to cast + F_EXTRADESC, // text=extra descriptions for this object + // v0 is the order in which these are displayed (0-5) + F_BONDESC, // text=extra description for playable races. + // v0 is the display order. + // v1=true means 'don't display this one during + // player race selection) + F_PENDESC, // text=extra description for playable races. + // v0 is the display order. + // v1=true means 'don't display this one during + // player race selection) + //F_SPELLLETTER, // text[0] = letter to cast this spell + F_AICASTTOFLEE, // AI can cast this spell to help flee/heal + // v0 is who to target + // v1 is pct chance of using this + F_AICASTTOATTACK, // AI can cast this spell to attack + // v0 is who to target + // v1 is pct chance of using this + F_AIBOOSTITEM, // ai will use this item to boost/buff itself. + // if using this on wands, update aiobok() ! + F_AIHEALITEM, // ai will use this item when low on hp + F_AIFLEEITEM, // ai will use this item when fleeing + // if using this on wands, update aiobok() ! + // object AND lifeform flags + F_NOSTRDAMMOD, // this object/lf does not have attacks modified + // using their strength + F_HARDNESS, // must do >= v0 damage to hurt this + F_EATCONFER, // if you eat this lf's corpse, you have a + // text% chance of gaining flag v0. + // with vals v1,v2,text. + // OR + // eating this object gives it. + // player only flags + F_DONEDARKMSG, // tells the game not to say 'it is very dark here' + F_DONELISTEN, // supress further 'you hear xx' messages this turn. + // lifeform flags / lf flags / monster flags + + F_ARBOOST, // modify lf's armour rating by v0 + // this is slightly different from f_armourrating. + // f_armourrating is used for innate armour. + // f_arboost is used by objects "of protection" which + // enhance your armour rating. + F_DONEPICKUP, // lf has used their free pickup/drop for this turn. + F_DONEKNOWLEDGETRADE, // you've already traded knowledge with this + // person. + F_FOLLOWTIME, // v0 = how long will ai chase you for? defaults to + // DEF_AIFOLLOWTIME. + F_FOUNDGODSTONE, // this flag is added once the player picks up their + // first godstone, and a god appears. + F_WINNER, // player has won the game! + // if you won by becoming a god, v1 = godid + // if you won by becoming a demigod, v1 = godid + // text = copied F_GODFLAG text from god. + F_BEHAVIOUR, // textual field describing special behaviour for this + // lf + F_NOSMELL, // lf can't smell. not affected by stench, and + // can't get enhancesmell. + F_RESTINGINMOTEL, // sounds will not wake up this lf. monster won't + // see them. + // v0 = max time allowed to rest before checkout + // v1 = total time rested + // text = obid of hotel + F_ALIGNMENT, // v0 = al_good, al_neutral, al_evil. default neutral. + // if al_none is selected for the player, they + // can pick what alignment they want to be. + // text shows the choices ("g", "n" or "e") + F_PIETY, // for god lifeforms - tracks player's piety with them + F_HOMEMAP, // which map did this lf get created on? + F_TOOKACTION, // lf purposely took action in their last turn. + F_JUSTENTERED, // lf just entered a new map. + F_DAMAGEGROUNDOBS, // lf causes v0 damage of type v1 to ground objects + // if v2 is TRUE, this happens even when lf is airborne + F_MOVED, // lf purposely walked/flew/swum/moved in prev turn + F_HASBEENMOVED, // an object moved this lf since their last turn. + F_HOTFEET, // target takes v0 damage of type v1 unless they move. + // text = killed by xxx + F_WASROBBED, // your stuff was stolen while you were + // unconscious. announce it when you wake up. + F_WOKENBY, // at the start of your next turn, you will wake up + // due to actions taken by lf id v0. + // if text is set, and it was the player waking up, + // then print this text. + F_TURNED, // lf turned this turn. + F_PRAYEDTO, // player has prayed to this god before. + F_GODBLOCKED, // player may NOT pray to this god + F_HPDRAIN, // lf loses v0 hit points eath turn. + // v1 = damtype + // text = killer damage string + F_GAVEMONEY, // v0 tracks how much money we gave away this turn + // used for r_godgreed anger effects. + F_CLIMBING, // lf is currently climbing a wall + F_COUNTER, // generic counter flag for race abilities. + F_DEBUG, // debugging enabled + F_ACCURACYMOD, // modify your accuracy by val0 + F_PLAYABLE, // player can select to be this race. + F_RACESLAY, // deal 4x damage to creatures of raceclass v0 + F_VAMPIRIC, // when on a lf: + // successful bite attacks from this lf will heal it + // when on an object + // successful attacks with this weapon will heal lf + F_VEGETARIAN, // this lf will not eat meat. + F_PARTVEGETARIAN,// this lf will only eat if hunger >= 'hungry' + F_CARNIVORE, // this lf will only eat meat. + F_SHIELDPENALTY, // lower your acc/ev by val0 due to a cumbersome + // shield. lowered by sk_shield skill. + // v0 is accuracy penalty, v1 is evasion penalty. + F_ARMOURPENALTY, // lower your acc/ev by val0 due to cumbersome + // armour. lowered by sk_armour skill. + // v0 is accuracy penalty, v1 is evasion penalty. + F_MISCASTCHANCE, // lf has +v0% chance of spell failure + F_LEVRACE, // at level v0, this race is promoted to race v1 + // must apply this to the BASE race. + F_JOBATTRMOD, // add v1 to attr v0. only used in jobs. + F_ATTRMOD, // modify attribute val0 by val1. ie. 0=A_STR,1=-3 + F_ATTRSET, // forces attribute val0 to be val1. ie. 0=A_STR,1=18 + F_SIZE, // val0 = lf size (enum LFSIZE) + F_SIZETIMER, // lf weill resize to LFSIZE val0 in val1 turns. + F_UNSEENATTACKER, // this lf attacked lfid v0 while lfid v0 couldn't + // see them. used to mark 'X' on the player's map + // for unseen attackers. + F_USEDPOISON, // this lf used a poisoned weapon to attack + F_RANDOMTALKPCT, // v0 = chance of randomly saying something each turn + F_RANDOMTALK, // EITHER: + // v0 = sp_xxx for what to say when we randomly talk. + // v1/v2 are min/max volume + // OR + // text = what to say + // v1/v2 are min/max volume + // + // can have multiple of these flags, if so then + // randomly select one each time. + F_RESTCOUNT, // val0 = how long you've been resting for + F_RESTHEALTIME, // val0 = how long to rest before healing hp + F_RESTHEALAMT, // val0 = how many hp to gain after resting x turns + F_RESTHEALMPAMT, // val0 = how many MP to gain after resting x turns + F_HOMEOB, // when this monster is auto generated on a level, place + // this object underneath them. + // text = object name + F_HOMELEVOB, // when this monster is auto generated on a level, place + // between v0 and v1 objects of type 'text' somewhere on + // the level. + F_CAREFULMOVE, // moving slowly on purpose to avoid slipping. + F_AUTOCMD, // val0 = how many times to repeat this + F_LASTCMD, // text[0] = last command performed, v0/1 = x/y of cell, v2=various + F_WILLTHROW, // this lf will treat obid v0 as a thrown missile. + F_CANLEARN, // lf is able to learn skill val0 + // v1 = max lev + F_STARTOB, // val0 = %chance of starting with it, text = ob name + // val1,2 = min/max amounts. if NA, min=max=1. + F_STARTOBDT, // val0 = %chance of starting with damtype val1 + // option val2 = addition to map depth for rarity + // calculation + F_STARTOBCLASS, // val0 = %chance of starting with obclass val1 + // option val2 = addition to map depth for rarity + // calculation + F_STARTOBRND, // val0 = %chance of starting with a random ob + // v1 = depth modifier. can use 'RANDOM' + F_STARTOBWEPSK, // val0 = %chance of starting with wepskill val1 + // v1 = wepskill of object + // optional val2 = addition to map depth for rarity + // calculation + // optional text = prefix for ob name. + // eg "good" "branded" "cursed" etc + F_CONTAINER, // this object is a container - you can use 'o' + // to take stuff out or put it in. + F_HOLDING, // this container is a xxx of holding and makes objects + // inside become weightless + F_STARTJOB, // val0 = %chance of starting with it, v1 = jobid + F_STARTSKILL, // val0 = skill id + F_STARTATT, // val0 = A_xxx, val0 = start bracket (ie. IQ_GENIUS) + // if text is set, it overrides val0. + // text can be: + // x (single number) + // x-y (range) + F_STARTASLEEPPCT, // v0=pct chance this mosnter starts off asleep + F_STARTHIDDENPCT, // val0 = pct chance auto-generated monster will + // start off hidden + F_CORPSETYPE, // text field specifies what corpse obtype to leave + F_CORPSEFLAG, // add flag v0 to our corpse. + // v1->v0, v2->v1, text->text + F_EXTRACORPSE, // text field specifies what additional corpse + // obtype to leave + // v0 = pct change for this to happen. NA = 100. + F_MYCORPSE, // text field contains obid of my corpse. + // (for ghosts) + F_NOCORPSE, // monster's body crumbles to dust after death + F_NOCTURNAL, // monster sleeps during the day + F_DIURNAL, // monster sleeps at night + F_NOSLEEP, // monster doesn't sleep + F_NOSKILL, // lifeform CANNOT ever learn skill v0 + F_LFSUFFIX, // text = suffix. eg. "skeleton" + F_VISRANGE, // how far you can see (in the light) + F_VISRANGEMOD, // v0:modifications to visrange + F_NIGHTVISRANGEMOD, // v0:modifications to nightvisrange + F_GUNTARGET, // current projectile weapon target + // v0 is guntarget id. + // text is targetting string (ie. Orc [50%]) + F_THROWING, // set while the player is throwing/firing something + // f->text = obid of what we're throwing + // if f->text is NULL, we're using a firearm. + F_CASTINGSPELL, // set while the player is casting a spell + // for instant spells: + // v0 is spell id + // for noninstant spells: + // v0 is spell id + // v1 is spell power + // v2 is counter until casting + // text is: "targlfid;targobid;mapid;cellx;celly;" + + F_AVOIDOB, // for AI - they will avoid walking on obid 'text' + // (text is a long) + // if v0 is not NA, then only avoid it if its blessed + // value == v0. + F_AVOIDOBTYPE, // AI won't walk on top of obtype v0. + // if v1 == B_TRUE, then avoid lfs weilding this + // object too. + F_AVOIDCELL, // AI won't walk on top of cell x/y = v0/v1 + F_STAYINHABITAT, // lf will not walk onto a cell of a different + // habitat + F_STAYINROOM, // lf will not walk out of roomid v0 + // if v0 is not set, we won't leave our current room. + // if v1 is set (not NA), then we are allowed to chase + // our targets out of the room. + F_FALLDISTANCE, // how many floors this lf has fallen through. + // ABILITY/SPELL FLAGS / ability flags / spell flags + F_FAILEDINSPECT, // lf has failed an inspect check for objecttype v0 + F_TARGETTEDSPELL, // this spell needs you to specify a target cell + // v0 is the tt_targettype + // if V1/v2 are set, then this is only spells with + // power in the range v1-v2 are targetted. + F_BOOSTSPELL, // v0 is active boost spell, v1 is ongoing mpcost, v2 is power + F_SWOOPRANGE, // v0 = how far a flying creature can swoop + F_LOSLOF, // v0 = whether this spell needs line of sight + // v1 = whether this spell needs line of fire + // MONSTER AI FLAGS + F_CASTCHANCE, // this lf has v0% chance of using spell/abil + // (default is 15%) + F_DEMANDSBRIBE, // lf will demand gold from the player. + F_NOSWAP, // other mosnters won't swap with this one. + // cleared at start of turn. + F_VARLEVEL, // lf is generated with random level between + // 1 and its map dificulty/depth. + // if v0 is set, this is the max level. + F_MINION, // v0=lfid of minion + F_NOSCORE, // denotes that the player received 0 points. + // ie. cheating or they quit. + F_XPVAL, // force xp val for killing this lf to v0 + // ...OR if applied to an ability... + // monsters with this abil/spell are worth + // v0 more xp. + F_XPMULTIPLY, // multiply xp val for killing this lf by v0 + F_HIRABLE, // this job/lf can be recruited by chatting and paying + F_TAMABLE, // this lf can be made into a pet by giving objects + // which they want. + // must pass SC_SPEECH of difficulty v0 + F_HIREPRICE, // how much it costs to hire this lf. + F_NOHIRE, // this lf will not be hired. + F_INFOPRICE, // v0=price this lf wants to share info + F_NOINFO, // this lf will NOT share info + F_KNOWSABOUT, // text is a list of things this lf knows about: + // e = exits + // s = shops + // t = traps + // o = rare Objects + // m = rare Monsters + // eg: text=="st" means they know of shops+traps + F_NOJOBTEXT, // this lf's name is 'a xxx', not 'a xxx wizard' etc + F_LASTDIR, // this is the last direction we moved. + //F_OWNERLASTDIR, // for pets, this it the last dir our owner moved + // when we could see them. + F_ISPRISONER, // this lf wants to escape to the surface + F_PETOF, // this lf is a pet of lfid v0 + // v1/2 = last known location of my owner. + // optional text is last known movement dir. + // note: can also go on corpse objects to show that this + // is the corpse of a pet. + F_SUMMONEDBY, // this lf was summoned by lfid v0. if they die, we + // vanish. + // v1 is lifetime left. this decrements each turn. + // when at zero, lf vanishes. + //F_OWNSSHOP, // v0 is roomid of the shop which this shopkeeper owns. + F_GUARD, // this lf is a guard, who can be called by shopkeepers + F_HATESALL, // lf will attack ALL other lfs on sight + F_HATESRACE, // lf will attack lfs with race=v0 or baseid=v0 on + // sight + F_HATESRACECLASS, // lf will attack lfs with raceclass->id=v0 + F_HATESRACEWITHFLAG, // lf will attack lfs with flag v0 on sight + F_TERRITORIAL, // lf will attack ALL other visible lfs within range v0 + F_HARMLESS, // it is safe to rest around this lf + F_RNDHOSTILE, // v0% chance of being hostile. + F_HOSTILE, // lf will attack the player if in sight + F_FRIENDLY, // lf will attack all non-players if in sight + F_FATALFOOD, // if lf eats food with id = v0, they die. + F_NATURALFLIGHT, // lf can fly natural using wings or similar + F_WANTS, // lf will try to pick up object type val0. if + // val1 = B_COVETS, will even abandon attacks + // for it! + F_WANTSOBFLAG, // lf will look for obs with this flag. val1=covets + F_WANTSBETTERWEP, // lf will look for better weapons, val1=covets + F_WANTSBETTERARM, // lf will look for better armour, val1=covets + F_FLEEONDAM, // lf will run away instead of counterattacking + F_FLEEONHPPCT, // lf will run away if its hp drop to v0% or lower + F_NOFLEE, // lf will not run away + F_ATTACKRANGE, // v0/v1 = min/max celldist to stay away + // from f_targetlf (ie. lf we are attacking) + F_FOLLOWRANGE, // v0/v1 = min/max celldist to stay away + // from pet's master + F_FEIGNFOOLEDBY, // lf shouldn't attack lf id v0 because they + // are feigning death + F_TARGETLF, // lf will attack lfid v0. lastknown x/y is v1/v2 + // optional text is last known movement dir. + F_IGNORECELL, // won't accept targetcells of v0=x v1=y + // this is cleared at start of turn. + F_TARGETCELL, // lf will go towards this place. val0=x,val1=y + // optional: v2 = mr_lf or mr_ob. text=lf or ob id. + F_PHANTASM, // this lf is a phantasm - can deal no damage, and + // uses v0 as a fake hp counter. + F_STABBEDBY, // lf has been stabbed by lfid v0. can't be stabbed + // by them again until they go out of sight. + F_FLEEFROM, // lf will run away from this lf id + F_NOFLEEFROM, // lf can not get f_fleefrom lfid v0 + + // TEMP FLAGS + F_KILLEDBYPLAYER, // did the player kill this lf? + // monster noise flags + F_WALKVERB, // text is verb for moving. 'walk' 'slither' + // 'bounce' 'hop' etc + F_NOISETEXT, // val0 is a enum NOISETYPE + // val1 is the volume of the noise + // text is "verb^noun" + // eg. "shouts^a shout" + // if this flag occurs more than once with + // the same v0, a random one is selected. + F_SPELLCASTTEXT, // text is announcement for spellcast + // if text is empty, then don't announce + // this lf's spell casting at all. + // if v0 != OT_NONE, only use text for spellid v0 + // if v2 is 'appendyou' " at xxx" will + // be appended. + F_AISPELLTARGETOVERRIDE, // when casting spellid v0, this lf will + // use v1 (ST_xxx) instead of what the AICASTTOxxx + // flag specifies. + F_NODEATHANNOUNCE, // don't say 'the xx dies' if this lf dies + F_NODEATHSPEECH, // lf doesn't talk when dying + F_BEHEADED, // use special corpse drop code + F_MOVESPEED, // override default move speed + F_ACTIONSPEED, // override default action speed + F_SPELLSPEED, // override default spellcast speed (ie. movespeed) + F_RARITY, // val[0] = habitat, val[1] = rarity% + // val[2] = commonality (enum RARITY RR_xxx) + // NA means rr_common + + F_NUMAPPEAR, // when randomly appearing, can have > 1. val[0] = min, val[1] = max + F_MINIONS, // val0 % chance of appearing with v1-v2 lf of type text + F_HITDICE, // text = xdy+z to roll for maxhp per level. + F_MAXHPMOD, // maxhp = pctof(v0, maxhp) + F_MPDICE, // val0: # d4 to roll for maxmp per level. val1: +xx + F_JOB, // val0 = player's class/job + F_GODOF, // text = what this lf is the god of. use capitals. + // if v0 is b_true, means this is a goddess + F_GODLIKES, // text = something this god likes (ie. incs piety) + F_GODDISLIKES, // text = something this god likes (ie. decs piety) + F_GODPOISON, // v0=TRUE: god likes using poison. gain v1 piety + // v0=FALSE: god hates using poison. lose v1 piety + // for all sacrifice flags: + // v2: amt of piety for each sacrifice + // text: "the xxx disappears in yyyy" + // (yyyy is text) + // IS is replaced with "is" or "are" + // OB is replace with object name + F_SACRIFICEOBWITHFLAG, // v0 = can sacrifice obs with flag v0 to this go + F_SACRIFICEOB, // v0 = can sacrifice obtype v0 to this god + // if v1 is set, object must be the + // corpse of something with raceclass v1. + F_SACRIFICEOBCLASS, // v0 = can sacrifice obclass v0 to this god + F_SACRIFICEOBBLESSED, // v0 = can sacrifice obs with ->blessed=v0 and blessknown! + + F_NAME, // text = lf's name + F_XPMOD, // add/subtract this much from calculated xpval + F_BLOODOB, // text = type of object to drop for blood + F_UNSUMMONOB, // text = type of object to drop when this creature + // uis unsummoned. + F_DIESPLATTER, // this lf will splatter objcets of type 'text' + // when it dies. + // v0 = max distance to splatter (or UNLIMITED) + // v1 = how fast to shoot objects (0 = just place them) + // text = type of object to splatter + F_OBESE, // double base weight for race! + F_ORIGRACE, // original player race (if you polymorphed) + F_ORIGJOB, // original player job (if you polymorphed) + F_POLYMORPHED, // lf has been polymorphed + F_RETAINHPONPOLY, // don't take on hp/mp of what you polymorph + // into + F_SHORTCUT, // spell keyboard shortcut. + // v0=slot (0-9) + // text=spell text + // for monsters + F_MPMOD, // this race gains/loses v0 mp each level + F_DOESNTMOVE, // this race doesn't move (but can still attack) + F_CANTALK, // this lf can talk, even if its raceclass normally + // wouldn't be able to. + F_AQUATIC, // this race can attack normally in water and suffers no + // movement penalties + F_AVIAN, // this race is an avian + F_CANINE, // this race is a canine + F_HUMANOID, // this race is a humanoid + // (can wear armour / use weapons) + F_INSECT, // this race is classed as an insect + F_UNDEAD, // this race is classed as undead + F_COLDBLOOD, // this race is coldblooded + F_NOBODYPART, // this race doesn't have bodypart val0 + // if v0 is true or b_frominjury, you can regrow it + // via a healing potion. + F_NOINJURIES, // this race cannot sustain injuries. + F_NOPACK, // this race cannot hold objects + F_NOSPELLS, // this race cannot cast spells + F_NOPRINTS, // this race doesn't leave footprints + F_INDUCEFEAR, // causes fear when you attack it + F_POISONCORPSE, // lf's corpse will be poisonous + F_AUTOCREATEOB, // produces obtype 'text' wherever it walks, v0=radius + // (only if ob of that type not already there) + F_PACKATTACK, // deal v0 extra damage of type v1 if there are + // v2 or more monsters of the same baseid + // next to the attacker + F_PHALANX, // gain v0 AR if v2 or more adj monsters matching f->text + F_MORALE, // gain +v0 in morale checks. + F_SPOTTED, // you have spotted hiding lf id v0. you lsoe this if they + // go out of sight. + F_TIMID, // monster will only move close if behind its target. + F_VULNTOSALT, // salt kills this monster + // special attack flags + F_AIMEDSTRIKE, // next attack is an aimed strike + F_COMBOSTRIKE, // lf is performing a combination strike + F_HEAVYBLOW, // next attack is a heavy blow + F_QUIVERINGPALM, // your next strike will be a quivpalm attack + F_STRIKETOKO, // your attacks will never kill, just KO. + F_TKTHROW, // when you throw an object, use your + // attrib = v0 and skilltype = v1 + // rather than AGI and SK_THROWING like normal + F_TRUESTRIKE, // your attacks ALWAYS hit. turnsleft=v0 + F_HURRICANESTRIKE, // lf is performing a hurricane strike + F_PROTALIGN, // attacks from lfs with aligh = v1 are repelled. + // turnsleft=v0 + // INTRINSICS + F_MAGICARMOUR,// armour is magically boosted. f->text is the description + // ie 'magic armour', 'force field' + // v0 is power left. + F_ANONYMOUS, // when worn on eyes, shopkeepers can't ban you + F_ASLEEP, // lf is asleep. + // v1 is enum sleeptype st_xxx + // if v2 is set, means we are sleeping on + // purpose and will wake up when at full hp/mp/etc. + // ie. "resting" + // text = obid of light source which you turned off. + F_ATTACHEDTO, // you are attached to lf id v0, and will move with it + F_AWARENESS, // you can see 360 degrees around yourself + F_BEINGSTONED,// turn to stone when v0 drops to zero. (drops 1/turn) + F_BLIND, // cannot see anything + F_CONFUSED, // move randomly about + F_DEAF, // cannot hear + F_NEEDOBFORSPELLS, // lf can only cast spells if it has object v0 + F_CASTTYPE, // lf uses enum CASTTYPE v0 for spells + // optional v1 is colour for casttype-based animations + // (ie. spit spells) + F_CAFFEINATED, // can't sleep. + F_CANEATRAW, // lf can eat raw food with no issues + F_CANCAST, // can cast the spell val0 (need MP) + F_CANHEARLF, // you can hear lifeform id v0 (show their glyph) + // this flag does not get announced. + F_LOWHPABIL, // will automatically use the ability v0 when + // this lf starts bleeding. + F_BREATHWATER, // can breath normally underwater + F_CANWILL, // can cast the spell/ability val0 without using MP + // v1 is counter untiluse + // v2 is what you need to use it + // ie. when v1 == v2, ability is ready. + // text is other options, semicolon seperated: + // pw:xx; cast the spell at power xx + // dam:xdy+b; damage + // needgrab:xx; do you need to grab first? + // range:xx; + // gaze (this is a gaze spell) + F_CHARMEDBY,// you've been charmed by lf id v0 + F_CONTROL,// you control polymorphs, teleports and createmonsters + F_DETECTAURAS, // autodetect bless/curse + F_DETECTLIFE, // autodetect nearby lifeforms in orthogonal dist v0 + // if v1 is true, actual lf glyphs are shown. + // otherwise just an indicative size is shown + F_DETECTMAGIC, // autodetect magic/special objects + F_DETECTMETAL, // autodetect nearby metal + F_DETECTOBS, // autodetect nearby obs of type v1 in orthog dist v0 + // v1 = NA means everything. + F_DISEASEIMMUNE, // lf can't be diseased + F_DRUNK, // v0 is drunknness - 1-5. + F_ENHANCESEARCH, // gives v0 bonus on search checks. + F_ENHANCESMELL, // can 'see' scents with v0 range. + F_EXTRADAM, // do 'text' extra damage of damtype v0 when you hit + // if v1 is TRUE, also deal extra damage based on + // the flagpile's F_BONUS flag. + F_EXTRAINFO, // knows extra info + F_EXTRALUCK, // lf gets +v0 to all skill checks! + // higher chance of rare objects + // lower chance of rare monsters + F_EXTRAMP, // lf has +v0 % extra maxmp + F_FEIGNINGDEATH, // lf is pretending to be dead + F_FLYING, // lf is flying + F_FASTACT, // modifier for action speed + F_FASTMETAB, // hunger counter increases faster, poison cures faster. + // v0 is multiplier. + F_FASTMOVE, // modifier for move speed + F_FASTACTMOVE, // modifier for action and move speed + F_POISONED, // has poisoning. v0 = poison type, + // v1 = power + // text = what from.eg'a bad egg' + F_FREEZINGTOUCH,// next thing touched turns to ice! + // v1 = power + // v2 is save difficulty + F_GRABBEDBY,// you've been grabbed by lf id v0 + F_GRABBING, // you are grabbing lf id v0 + F_HIDING, // lifeform is hiding. v0 is modifier to stealth checks. + F_ICESLIDE, // lf has "slide" spell active. + // v0 = timeleft (since 'lifetime' is used for FROMSPELL) + F_INJURY, // v0 = enum injury, v1 = where (enum bp), v2 = damtype + // text is desc, ie "rib is cracked" + F_INVISIBLE, // lifeform is invisible + F_INVULNERABLE,// immune to most damage + // this can apply to objects too! + F_QUICKBITE, // deals v0 d d1 + d2 damage when you hit a bleeding victim + // (bypasses armour) + F_GRAVBOOSTED,// cannot walk or throw stuff + F_GRAVLESSENED,// knockback maeks you go further, can jump further + // your current load is reduce by v0 * 15kg. + F_MEDITATES, // meditates instead of sleeping. + F_MUTABLE, // you can mutate by eating corpses. + F_NEEDSWATER, // cannot survive out of deep water + F_PAIN, // take damage if you walk. v0=damtype,text is damage (xdy+z). + // if text not set, default dam is 1d2 + F_PARALYZED,// cannot do anything + F_PRONE, // lying on the ground + F_FROZEN, // made of ice + F_HEAVENARM, // prevent the next v0 damage received. + // when v0 drops to <= 0, flag goes. + // text = name of armour. + F_HOLYAURA, // holy aura - attacks deal holy damage to vulnerable + // enemies. + F_LEARNBOOST, // +v0% xp and skillxp + F_LEVITATING, // like flying but uncontrolled + F_MAGSHIELD,// magnetic shield + F_NAUSEATED, // lf has a stench penalty of v0 (-v0*10 to hit). + F_NONCORPOREAL,// can walk through walls + // when this comes from the passwall spell, 'obfrom' + // be set to the ot_s_passwall. + F_OMNIPOTENT, // knows extra info + F_PHOTOMEM, // you don't forget your surroundings + F_REGENERATES, // regenerate HP at val0 per turn + F_RESISTMAG, // immunity to magic effects. v0=amt (1-20) + F_MPREGEN, // regenerate MP at val0 per turn + F_RAGE, // you are enraged. v0/v1 will be set to player's old hp/maxhp + F_REFLECTION, // missiles are reflected back at thrower + F_RETALIATE, // deal damage to anyone who hits you + // v0=ndice, v1=dsides, v2=damtype, text=obname + // text must have at least TWO words + F_RISEASGHOST, // become a ghost when you die. + F_SEEINDARK, // nightvis range is val0 + F_SEEINVIS, // can see invisible things + F_SPIDERCLIMB, // lf can climb at 100% success rate + F_SILENTMOVE, // lf makes no noise when walking/flying + F_SIXTHSENSE, // warned about nearby enemies. v0 = power. + F_STABILITY, // doesn't slip over + F_STAMREGEN, // boost stamina regeneration at 'text' per turn + // (this is a float) + F_STENCH, // on lifeforms: + // creatures within v0 gain f_nauseated = v1 + // on objects: + // creatures standing on it gain f_nauseated = v1 + F_STUNNED, // cannot attack or cast spells + F_TREMORSENSE, // doesn't need eyes to see, can see in dark with v0 + F_PRODUCESLIGHT, // produces light of val0 radius. + // (but not for obs in pack) + // if val2 is true, will only make light if ob + // is activated! + F_SLOWACT, // modifier for action speed + F_SLOWMETAB, // hunger counter increases slower, poison cures slower. + // v0 is multiplier + F_SLOWMOVE, // modifier for move speed + F_SLOWACTMOVE, // modifier for move and action speed + F_XRAYVIS, //val0=num of walls we can see through + F_CANSEETHROUGHMAT, //val0=kind of material you can see through + F_CANSEETHROUGHLF, // larger lifeforms don't block los for us + F_SPRINTING, // you are sprinting. + F_WINDSHIELD,// has a windshield protecting against missiles of speed + // v0 or lower. + F_DODGES, // you dodge missed attacks + F_NOTIME, // this lf's actions don't take time + // skills + F_HASSKILL, // lf has skill v0 at level v1 + // if v2 is B_TRUE, it means we've used this + // skill since gaining/increasing it. + // (ie. it's a candidate for a random increase + // at levelup) + F_PRACTICINGSKILL, // lf is practicing skill v0 + // COMBAT + F_MAXATTACKS, // v0 = min # attacks this lf can make per round + // v1 = max # attacks this lf can make per round + F_HASATTACK, // v0 = obid to use when attacking unarmed + // if v1 is set, it overrides DR(damagerating) + // if text is set, it overrides the damage + F_EVASION, // % chance of evading an attack + + // healing/resting/training + F_HASNEWLEVEL, // we have a new xp lev, but haven't trained yet. + F_STATGAINREADY, // ready to increase str/int etc. v2 is how many times + // we can do it. + F_INTERRUPTED, // somethign interrupted our rest. stop! + F_EATING, // lf is eating obid v0 + F_DIGGING, // v0/v1 = cell where lf is digging. + // v2 is how much to dig per turn. + F_TRAINING, // are we training? cleared on any action other than rest. + // v0 = current training amount + // v1 = training target. + // when v0 == v1 , you finish trainign. + F_RESTUNTILBETTER, // resting until we have full mp/hp/stam + //F_RESTUNTILHP, // resting until we have full hp + //F_RESTUNTILMP, // resting until we have full mp + F_RESTUNTILALLIES, // resting until allies have full hp + // + F_RUNNING, // are we running? (shift+dir) + // v0 is last dir moved. + // v1 is whether we have turned yet. + // v2 = what walls to our left and right are: + // 0 = l+r cells clear + // 1 = l cell walled, r cell clear + // 2 = l cell clear, r cell walled + // 3 = l+r cells walled + // nutrition + F_HUNGER, // val0 = hunger, higher = hungrier + + // for jobs (job flags) + F_SELECTWEAPON, // this job gets to pick their starting weapon + F_NOPLAYER, // players can't pick this job + F_HASPET, // this job starts with a pet of race f->text + //F_IFPCT, // only add the NEXT job flag if rnd(1,100) <= v0. + //F_ELSE, + //F_IFPLAYER, + //F_IFMONSTER, + //F_ENDIFPLAYER, + //F_ENDIFMONSTER, + F_LEVSKILL, // at level v0, this job gains 1 point in skill v1 + F_LEVABIL, // at level v0, this job gains f_canwill v1. + // v2 = how often you can do it (or NA for unlimited) + // text = options + F_LEVSPELL, // at level v0, this job gains f_cancast v1. + F_LEVSPELLSCHOOL, // at level v0, this job gains f_cancast for a spell + // of their choice from school v1. if v1 is SS_NONE, they can + // pick from any school they are skilled in. + // if v0 is >100, this triggers every (v0-100) levels. + F_LEVSPELLSCHOOLFROMX, // at level v0, this job gains f_cancast for a + // spell from school v1. you can pick one from + // v2. if v1 is SS_NONE, they can + // pick from any school they are skilled in. + // if v0 is >100, this triggers every (v0-100) levels. + F_LEVFLAG, // at level v0, this job gains flagid v1, flagval0=v2, + // flagtext = text + + // vault flags + F_AUTODOORS, // automatically create at least one door + // v0 is pct chance of door (as opposed to empty + // doorway with no door). + F_AUTOPOPULATE, // fill this vault with obs/mons/pillars like normal rooms + F_MAINTAINEDGE, // when calling fixreachability(), only allow + // corridors to enter this vault through cells + // marked as exits. + F_NORANDOM, // this vault does not randomly appear + // OR this spell doesn't apear in books + F_MONSTERSSTAY, // monsters in this vault won't leave it + F_VAULTATOB, // v0/1=x/y, v2=pctchance, text=obname + F_VAULTATLF, // v0/1=x/y, v2=pctchance, text=lfname + F_VAULTATCELL, // v0/1=x/y, v2=pctchance, text=cellname + F_VAULTATONEOF, // v0=thingtype, v1 = pctchance + // text=(x,y)(x,y)(x,y)...(x,y) thingname + F_VAULTBOX, // v0=thingtype, v1=pctchance, v2=fill?, text=x1,y1,x2,y2,thingname + F_VAULTENTERTEXT, // text = what to show when player enters + F_VAULTDLEVMIN, // v0 = mininum map depth/difficulty for this vault + F_VAULTDLEVMAX, // v0 = maximum map depth/difficulty for this vault + F_VAULTEXIT, // v0/1=x,y for exit. + F_VAULTGOESIN, // this vault randomly appears in habitat type v0. + // can be repeated multiple times + // if a vault doesnt have this flag, it can go anywhere + F_VAULTISPLAYERSTART, // player can start in this vault + //F_VAULTISSHOP, // this vault is a shop, so add f_shopitem to objects + // here. + F_VAULTISSHRINE, // this vault is a godstone shrine + F_VAULTRARITY, // v0=rr_xxx + F_VAULTSCATTER, // v0=thingtype, v1=pctchance + // text=x1,y1,x2,y2,mincount-maxcount,thingname + // if maxcount is PCT, mincount is a percentage + // of the total space. + F_VAULTTAG, // vault has tag 'text'. for use with + // vt_rndvaultwithtag. + F_VAULTMAYROTATE, // may rotate this vault in 90degree increments. + F_VAULTMAYFLIPX, // may flip this vault horizontally + F_VAULTMAYFLIPY, // may flip this vault vertically + F_VAULTNOLINK, // this vault doesn't have to be connected to the + // rest of the map. + F_VAULTRANDOMMAP, // v0=minwidth, v1=minheight. this vault's map is + // v0/1 can be NA. + // OPTIONAL: v2 = floor cell type id + // OPTIONAL: text = wall cell type id (int) + // just a normal random room + F_KEEPMARGIN, // this vault must be at least v0 from e/w of map + // and at least v1 from n/s of map + F_NULL = -1 +}; + +// move reasons +enum MOVEREASON { + MR_OTHER, + MR_LF, + MR_OB, +}; + + +// hunger levels +enum HUNGER { + H_STUFFED = -2, + H_FULL = -1, + H_NONE = 0, + H_PECKISH = 1, + H_HUNGRY = 2, + H_VHUNGRY = 3, + H_STARVING = 4, + H_STARVED = 5 +}; + +// injuries +enum INJURY { + IJ_NONE, + // bashing + IJ_ANKLESWOLLEN, + IJ_HANDSWOLLEN, + IJ_BLACKEYE, + IJ_CONCUSSION, + IJ_FINGERBROKEN, + IJ_LEGBROKEN, + IJ_LEGBRUISE, + IJ_NOSEBROKEN, + IJ_RIBBROKEN, // can be from explosive too + IJ_RIBCRACKED, // can be from explosive too + IJ_SHOULDERDISLOCATED, + IJ_TAILBRUISED, + IJ_TAILBROKEN, + IJ_TORSOBRUISED, + IJ_TORSOBRUISEDBAD, + IJ_WINDED, + IJ_WINDPIPECRUSHED, + IJ_WINGBRUISED, + // slashing + IJ_ARTERYPIERCE, + IJ_CHESTBLEED, + IJ_HAMSTRUNG, + IJ_HANDBLEED, + IJ_LEGBLEED, + IJ_TENDONCUT, + IJ_FINGERMISSING, + IJ_EYELIDSCRAPED, + IJ_EYEDESTROYED, + IJ_TAILBLEED, + IJ_WINGBLEED, + IJ_WINGTORN, + // explosive + IJ_EARSRINGING, + IJ_HANDMISSING, + IJ_LUNGCOLLAPSED, + IJ_TAILLACERATED, + IJ_WINGDESTROYED, +}; + + +#define PIETYPRAYLOSS 75 + +#define PIETY_MIN -200 +#define PIETY_MAX 400 +enum PIETYLEV { + PL_ENRAGED = -4, + PL_FURIOUS = -3, + PL_ANGRY = -2, + PL_TOLERATED = -1, + PL_INDIFFERENT = 0, + PL_PLEASED = 1, + PL_DELIGHTED = 2, + PL_ECSTATIC = 3, +}; + +enum LIGHTLEV { + L_PERMDARK = -1, + L_NOTLIT = 0, + L_TEMP = 1, + L_PERMLIGHT = 2, +}; + + +// spell targets +enum SPELLTARGET { + ST_NONE = 0, // dont cast at all. for debugging. + ST_VICTIM, // cast at victim + ST_ADJVICTIM, // cast at victim who is next to us + ST_SELF, // cast at myself + ST_ADJSELF, // cast at self, while next to victim + ST_ANYWHERE, // cast anywere + ST_SPECIAL, // spell targetting will be hardcoded +}; + + +// errors +enum ERROR { + E_OK = 0, + E_WALLINWAY = 1, + E_LFINWAY, + E_NOSPACE, + E_BADCLIMBDIR, + E_STOPCLIMBING, + E_SELNOTHING, + E_ALREADYUSING, + E_WEARINGSOMETHINGELSE, + E_NOUNARMEDATTACK, + E_NOTEQUIPPED, + E_NOPICKUP, + E_STUCK, + E_MONSTERNEARBY, + E_NOEFFECT, + E_FAILED, + E_WRONGCELLTYPE, + E_OBINWAY, + E_TOOHEAVY, + E_TOOHARD, + E_NOHANDS, + E_NOPACK, + E_INSUBSTANTIAL, + E_WRONGOBTYPE, + E_CURSED, + E_NOLOS, + E_NOLOF, + E_IMPOSSIBLE, + E_NOTARGET, + E_NOAMMO, + E_GRAVBOOSTED, + E_NOMP, + E_NOSTAM, + E_AVOIDOB, + E_FROZEN, + E_TOOBIG, + E_TOOSMALL, + E_NOTREADY, + E_BLIND, + E_GRABBEDBY, + E_CANTMOVE, + E_NOTKNOWN, + E_TOOPOWERFUL, + E_NEEDGRAB, + E_DOORINWAY, + E_NOCANNIBUL, + E_LOWCON, + E_LOWDEX, + E_LOWIQ, + E_LOWSTR, + E_LOWCHA, + E_LOWWIS, + E_WONT, + E_OFFMAP, + E_STUNNED, + // charm failure reasons + // LOWIQ + E_UNDEAD, + E_DRUNK, + // + E_NOBP, + E_DOESNTFIT, + E_VEGETARIAN, + E_PARTVEGETARIAN, + E_CARNIVORE, + E_NOOB, + E_LEVITATING, + E_PRONE, + E_PENTAGRAM, + E_SWIMMING, + E_CLIMBING, + E_DANGEROUS, + E_INJURED, +}; + + +enum COMMAND { + CMD_AIM, + CMD_CLOSE, + CMD_COMMS, + CMD_DOWN, + CMD_DROP, + CMD_DROPMULTI, + CMD_EAT, + CMD_FIRE, + CMD_FIRENEW, + CMD_FORCEATTACK, + CMD_HELP, + CMD_INFOARMOUR, + CMD_INFOKNOWLEDGE, + CMD_INFOPLAYER, + CMD_INV, + CMD_LOOKAROUND, + CMD_LOOKHERE, + CMD_MAGIC, + CMD_MEMMAGIC, + CMD_MSGHIST, + CMD_OFFER, + CMD_OPERATE, + CMD_PICKUP, + CMD_POUR, + CMD_QUAFF, + CMD_QUIT, + CMD_READ, + CMD_REST, + CMD_RESTFULL, + CMD_SAVEQUIT, + CMD_TAKEOFF, + CMD_THROW, + CMD_UP, + CMD_WEAR, + CMD_WEILD, + CMD_EXCHANGE, +}; + + +typedef struct npcname_s { + char *name; + int valid; +} npcname_t; + +typedef struct coord_s { + int x,y; +} coord_t; + +enum BODYTYPE { + BT_BIRD, + BT_FISH, + BT_HUMANOID, + BT_QUADRAPED, + BT_SNAKE, + BT_SPIDER, +}; + +typedef struct bodypart_s { + enum BODYPART id; + char *name; + int armourok; +} bodypart_t; + +// command types +typedef struct command_s { + enum COMMAND id; + char ch; + char *desc; + struct command_s *next, *prev; +} command_t; + +typedef struct warning_s { + char *text; + int lifetime; + struct warning_s *next, *prev; +} warning_t; + +enum OPTION { + OPT_ALWAYSSHOWTRAILS, + OPT_AUTORELOAD, + OPT_RETRIEVE_MISSILES, + OPT_STOPRUNONNOISE, +}; + +typedef struct option_s { + enum OPTION id; + char *text; + int letter; + int enabled; + int def; + struct option_s *next, *prev; +} option_t; + +enum REGIONTYPE { + RG_CAVE, + RG_WORLDMAP, + RG_MAINDUNGEON, + RG_HEAVEN, + RG_PIT, + RG_SEWER, + RG_STOMACH, +}; + +enum HABITAT { + H_CAVE = 1, + H_DUNGEON = 2, + H_FOREST = 3, + H_HEAVEN = 4, + H_PIT = 5, + H_VILLAGE = 6, + H_SEWER = 7, + H_STOMACH = 8, + H_SWAMP = 9, + H_ALL = 999 +}; + +typedef struct regiontype_s { + enum REGIONTYPE id; + enum HABITAT defaulthabitat; + char *name; + int pluralname; + int maxdepth; + int stairsperlev; + int deeperdir; + int majorbranch; + int depthmod; + struct regiontype_s *next, *prev; +} regiontype_t; + +enum REGIONTHING { + RT_HABITAT, // val is habitat + RT_OBJECT, // what is object name + RT_REGIONLINK, // val is enum regiontype to link to. + // what is stair object type + RT_VAULT, // what is vaultname + RT_RNDVAULTWITHFLAG, // val is wantedflag + RT_RNDVAULTWITHTAG, // what is wanted tag +}; + +typedef struct regionthing_s { + struct regionoutline_s *parent; + int id; + int depth; // only need depth OR x,y + int x,y; + enum REGIONTHING whatkind; + int value; + char *what; +} regionthing_t; + +#define MAXOUTLINETHINGS 60 +typedef struct regionoutline_s { + int id; + regiontype_t *rtype; + regionthing_t thing[MAXOUTLINETHINGS]; + int nthings; + struct regionoutline_s *next, *prev; +} regionoutline_t; + +// a region is a link of a regiontype and an outline +typedef struct region_s { + int id; + regiontype_t *rtype; + regionoutline_t *outline; + struct region_s *parentregion; + int nthings; // is this used??? + int depthmod; + int createdbymapid; // which map ID created this region ? + // used to figure out which regions to delete + // if/when we have to regenerate a map. + // -1 means "Created at start of game" + struct region_s *next, *prev; +} region_t; + +typedef struct habitat_s { + enum HABITAT id; + char *name; + int randthingpct; // % chance each empty cell has something + int randobpct; // % chance that 'something' is an ob rather than monster + int randvaultpct; // % chance that a room will be a vault + int maxvisrange; + enum OBTYPE upstairtype, downstairtype; + enum CELLTYPE emptycelltype,solidcelltype; + struct habitat_s *next, *prev; +} habitat_t; + +typedef struct poisontype_s { + enum POISONTYPE id; + char *name; + char *desc; + char *damverb; // can use macros: YOU YOUR and #S + enum OBTYPE vomitob; + int dam; + int dampct; + enum POISONSEVERITY severity; + struct poisontype_s *next, *prev; +} poisontype_t; + +typedef struct room_s { + int id; + int x1,y1,x2,y2; + struct vault_s *vault; + int exitslinked; // don't need to save this. +} room_t; + +enum ILLUMINATION { + IL_FULLLIT, // all cells are light + IL_WELLLIT, // dark, candelabras in every room, moss every 4 steps + IL_DIM, // dark, torches in every room, moss every 6 steps + IL_SHADOWY, // dark, torches in some rooms, moss every 8 steps + IL_FULLDARK, // occasionally moss in rooms +}; + +typedef struct map_s { + int id; + region_t *region; + int depth; + enum ILLUMINATION illumination; + struct room_s room[MAXMAPROOMS]; + int nrooms; // how many rooms on this map + char *name; // name of this map + habitat_t *habitat; + long lastplayervisit; + unsigned int seed; + int w,h; // width/height of this map + struct cell_s *cell[MAX_MAPW*MAX_MAPH]; // list of cells in this map + int nextmap[MAXDIR_MAP]; // which map is in each direction + int beingcreated; + int nfixedrooms; // used for map creation only, not saved. + + struct lifeform_s *lf,*lastlf; + + struct flagpile_s *flags; + + struct map_s *next, *prev; +} map_t; //////////////// remember to modify save/load for new props!! + +#define MAXVAULTARGS 10 + +enum VAULTSTATE { + VS_ALLOCATED, + VS_NOID, + VS_LOADING, + VS_LOADINGMAP, + VS_LOADINGLEGEND, + VS_LOADINGFLAGS, +}; + +enum VAULTTHING { + VT_NONE, + VT_EXIT, + VT_OB, + VT_LF, + VT_CELL, +}; + +typedef struct vlegend_s { + char ch; + enum VAULTTHING tt; + char *what; + int pct; + struct vault_s *vault; + struct vlegend_s *next, *prev; +} vlegend_t; + +// in map[0], data is the real data +// in others, data is an index into map[0] +typedef struct vaultmap_s { + int data[MAX_MAPW*MAX_MAPH]; + int mlen; + int w,h; +} vaultmap_t; + +typedef struct vault_s { + char *filename; + char *id; + int numid; + int valid; + int state; + struct vaultmap_s map[4]; + int nmaps; + struct vlegend_s *legend, *lastlegend; + struct vault_s *next, *prev; + struct flagpile_s *flags; +} vault_t; + +typedef struct glyph_s { + int ch; + int colour; +} glyph_t; + +typedef struct buildingusage_s { + enum OBTYPE oid; + int count; +} buildingusage_t; + +typedef struct hiddennamewithcol_s { + char *name; + enum COLOUR col; +} hiddennamewithcol_t; + +enum MAPSHAPE { + MS_NORMAL, + MS_CROSS, + MS_CIRCLE, + MS_TURRET, +}; +#define MAXMAPSHAPES (4) + +enum CORRIDORTYPE { + CDT_NORMAL, // make corridors, remove deadends, add rooms, autolink + CDT_SIMPLE, // add rooms, autolink +}; + +typedef struct cell_s { + map_t *map; // pointer back to map + int x,y; // map coords + struct room_s *room; + struct celltype_s *type; + struct obpile_s *obpile; + enum LIGHTLEV lit; + enum LIGHTLEV origlit; // for timed light + enum LIGHTLEV lastlit; + habitat_t *habitat; + int origlittimer; + int littimer; + int hp; + + char *writing; + int writinglifetime; + + int locked; // cannot make rooms on top of this. + + // lifeform pile + struct lifeform_s *lf; + // known to player? + int known; + struct glyph_s knownglyph; + int knowntime; + int isroomwall; + + // FOR CONSTRUCTION + int visited; + int filled; +} cell_t; + +typedef struct celltype_s { + int id; // eg. dungeonfloor, wall, door + struct glyph_s glyph; + /* + char glyph; // how to display it + int colour; // which colour? + */ + char *name; // name of cell type + int solid; // can you walk through it? + int transparent; // can you see through it? + int floorheight; // 0 is default. <0 is low. + int hp; // hit points left. <0 = invulnerable + struct material_s *material; + + struct flagpile_s *flags; + + struct celltype_s *next, *prev; + +} celltype_t; + +typedef struct raceclass_s { + enum RACECLASS id; + char *name; + char *pluralname; + enum SKILL skill; + struct raceclass_s *next, *prev; +} raceclass_t; + +typedef struct race_s { + enum RACE id; + enum RACE baseid; + struct raceclass_s *raceclass; + struct material_s *material; + char *name; + char *desc; + struct glyph_s glyph; + float weight; + struct flagpile_s *flags; + struct bodypart_s bodypart[MAXBODYPARTS]; + int nbodyparts; + int known; + + // speed modifiers + // hit dice + struct race_s *next, *prev; +} race_t; + +typedef struct lifeform_s { + int id; + int controller; + struct race_s *race; + int level; + int newlevel; + long xp,skillxp; + int skillpoints; + long totskillpoints; + int hp,maxhp; + int mp,maxmp; + float stamina; + int alive; + int lastdamlf; // id of lf who just hurt us + char *lastdam; + char *killverb; + struct material_s *material; + enum DAMTYPE lastdamtype; + + int timespent; + int sorted; + + int att[MAXATTS]; + int baseatt[MAXATTS]; + int origatt[MAXATTS]; + + float forgettimer; + + struct obpile_s *pack; + struct obpile_s *polypack; // for melded objects when polymorphed + + struct flagpile_s *flags; + + int created; // set to TRUE once lf creation is done. + + int polyrevert; // about to revert form a polymorph? + + int turnsskipped; // don't need to save this + + // for loading + long oblist[MAXPILEOBS]; + int x,y; + + int facing; // which way are we facing + int turncounter; // keeps track of # direction changes in a row + + int losdirty; + int nlos; // cells which we can see + cell_t **los; + int nlosdark; // cells which we'd be able to see if they + cell_t **losdark; // were lit. + //int *viscell; + int visw; + int visrange; + int eyeadjustment; // have your eyes adjusted to the dark? + // your nightvision is increased by eyeadj / 10 + // max is MAX_EYEADJ + + int damlastturn; // for hp bar. not saved. + int mplastturn; // for mp bar. not saved. + float stamlastturn; // for stam bar. not saved. + int bartimer; // not saved. + + // set to TRUE after lf has being created + int born; + + // for ai movement and pushers. DO save these. + struct cell_s *prevcell[2]; + + struct cell_s *cell; + struct lifeform_s *next, *prev; +} lifeform_t; + + +typedef struct obpile_s { + lifeform_t *owner;// } Only one of + cell_t *where; // } these should be + struct object_s *parentob; // } filled in + struct object_s *first,*last; + + // for loading + long oblist[MAXPILEOBS]; +} obpile_t; + + +typedef struct flagpile_s { + lifeform_t *owner; + struct object_s *ob; + struct flag_s *first,*last; + + struct flag_s *item[MAXFLAGS]; + int nitems; +} flagpile_t; + +typedef struct altflagval_s { + enum FLAG id; + int val[3]; + char *text; +} altflagval_t; + +typedef struct flag_s { + enum FLAG id; + int nvals; + int val[3]; + char *text; + struct altflagval_s *altval; // don't need to save this. + enum FLAGCONDITION condition; + int chance; + + long obfrom; // for conferred flags, link to object->id. -1 if not conferred. + // also used for godgifts, in which case it is thr race->id of + // the god who gifted you this flag. + + // + int known; + int lifetime; + + struct flagpile_s *pile; + struct flag_s *next, *prev; +} flag_t; + + +typedef struct material_s { + enum MATERIAL id; + char *name; + float weightrating; + struct flagpile_s *flags; + struct material_s *next,*prev; +} material_t; + + +typedef struct skill_s { + enum SKILL id; + char *name; + char *desc; + enum SKILLLEVEL skilldesclev[MAXSKILLLEVEL*2]; + char *skilldesctext[MAXSKILLLEVEL*2]; + int skilldescmsg[MAXSKILLLEVEL*2]; + int nskilldesc; + int traintime; + struct skill_s *next, *prev; +} skill_t; + +typedef struct hiddenname_s { + enum OBCLASS obclass; + char *text; + int used; + struct hiddenname_s *next, *prev; +} hiddenname_t; + + +#define MAXRECIPEINGREDIENTS 5 +typedef struct recipe_s { + int ningredients; + enum OBTYPE ingredient[MAXRECIPEINGREDIENTS]; + int count[MAXRECIPEINGREDIENTS]; + int consume[MAXRECIPEINGREDIENTS]; + enum OBTYPE result; + struct recipe_s *next, *prev; +} recipe_t; + +typedef struct knowledge_s { + enum OBTYPE id; + char *hiddenname; + int known; + char *triedon; + struct knowledge_s *next, *prev; +} knowledge_t; + +typedef struct job_s { + enum JOB id; + char *name; + char *desc; + flagpile_t *flags; + struct job_s *next, *prev; +} job_t; + +#define MAXOCNOUNS 5 +typedef struct objectclass_s { + enum OBCLASS id; + enum RARITY rarity; + char *name; + char *desc; + char *noun[MAXOCNOUNS]; + int nnouns; + glyph_t glyph; + struct flagpile_s *flags; + struct objectclass_s *next, *prev; +} objectclass_t; + +typedef struct objecttype_s { + enum OBTYPE id; + char *name; + char *desc; + struct objectclass_s *obclass; + material_t *material; + enum LFSIZE size; + float weight; // in kilograms + struct flagpile_s *flags; + struct objecttype_s *next, *prev; +} objecttype_t; + +typedef struct object_s { + long id; // unique for every ob in the game! + struct objecttype_s *type; + struct obpile_s *pile; // reverse pointer back to pile + // these variables are initially + // inherited from objecttype: + material_t *material; + float weight; // in kilograms + // flags + // these variables are NOT inherited + char *inscription; + char letter; + enum BLESSTYPE blessed; + int blessknown; + int amt; // for stackable objects + long birthtime; + int dying; // not saved, just used to avoid flag messages for dying + // objects. + flagpile_t *flags; + + struct obpile_s *contents; + + struct object_s *next, *prev; +} object_t; + +// wetness +enum WETNESS { + W_DRY = 0, + W_DAMP = 1, + W_WET = 2, + W_SOAKED = 3, +}; +enum RUSTINESS { + R_RUSTY = 1, + R_VRUSTY = 2, + R_TRUSTY = 3, +}; + +enum OBMOD { + OM_BLOODSTAINED, + OM_ENCHANTED, + OM_FLAMING, + OM_FROZEN, + OM_HEADLESS, + OM_MASTERWORK, + OM_POISONED, + OM_SHODDY, + OM_WET1, + OM_WET2, + OM_WET3, + OM_RUSTY1, + OM_RUSTY2, + OM_RUSTY3, +}; +#define MAXOBMODS 4 + +enum BRAND { + BR_BALANCE, + BR_MERCY, + BR_NIMBLENESS, + BR_FEEBLENESS, + BR_FLIGHT, + BR_GIANTSTRENGTH, + BR_HEALTH, + BR_HOMING, + BR_IMPACT, + BR_THINKING, + BR_KNOWLEDGE, + BR_LEVITATION, + BR_LIFESUCK, + BR_PROTECTION, + BR_FEATHERFALL, + BR_ANTIMAG, + BR_CONCEALMENT, + BR_SHARPNESS, + BR_PUNISHMENT, + BR_PYROMANIA, + BR_REVENGE, + BR_REFLECTION, + BR_SHADOWS, + BR_SLOTH, + BR_SPEED, + BR_SPIDERCLIMB, + BR_STEALTH, + BR_POWER, + BR_SWIFTNESS, + BR_TELEKINESIS, + BR_TELEPATHY, + BR_WEAKNESS, + BR_SLAY_ANIMAL, + BR_SLAY_DRAGON, + BR_SLAY_MAGIC, + BR_SLAY_PLANT, + BR_SLAY_UNDEAD, +}; + +typedef struct brand_s { + enum BRAND id; + char *description; + char *suffix; + flagpile_t *flags; + enum BODYPART bp; + enum BLESSTYPE blessed; + int blesschance; + struct brand_s *next, *prev; +} brand_t; + +typedef struct obmod_s { + enum OBMOD id; + char *prefix; + flagpile_t *flags; + struct obmod_s *next, *prev; +} obmod_t; + +typedef struct choice_s { + char ch; + char *text; // what you type to select this one + char *desc; // what is displayed on the screen + char *longdesc; // what to display once you've selected this + void *data; + int heading; + int shortcutslot; // used when selecting spells/abilities + int valid; // used in askchoicestr +} choice_t; + + +enum MENUACTION { + MA_NONE = 0, + MA_GOTOMENU, + MA_QUIT, +}; + +// special shop menus - must all be < 0 +enum SHOPMENU { + // shops + SM_PURCHASEITEMS = -1, + SM_DONATE = -2, + SM_SELLITEMS = -3, + // temples + SM_ABSOLVE = -4, + SM_BLESS = -5, + SM_DETECTCURSE = -6, + SM_MIRACLE = -7, + // motels + SM_REST = -8, + // weapon/armour shops + SM_RESIZE = -9, + SM_REPAIR = -10, +}; + +enum SHOPRETURN { + SR_BACK, + SR_CONTINUE, + SR_QUIT +}; + +#define MAXPROMPTQUESTIONS 5 +typedef struct prompt_s { + char *q[MAXPROMPTQUESTIONS]; + int nqs; + int whichq; + void *result; + choice_t choice[MAXCHOICES]; + int selection; + int nchoices; + int maycancel; +} prompt_t; + + +#endif + diff --git a/ORIG.lf.h b/ORIG.lf.h new file mode 100644 index 0000000..cb33b58 --- /dev/null +++ b/ORIG.lf.h @@ -0,0 +1,445 @@ +lifeform_t *real_addlf(cell_t *cell, enum RACE rid, int level, int controller); +poison_t *addpoisontype(enum POISONTYPE id, char *name, char *text, int causesvomit, int dampct, enum POISONSEVERITY severity); +job_t *addjob(enum JOB id, char *name, char *desc); +race_t *addrace(enum RACE id, char *name, float weight, char glyph, int glyphcolour, enum MATERIAL mat, enum RACECLASS raceclass, char *desc); +raceclass_t *addraceclass(enum RACECLASS id, char *name, char *pluralname, enum SKILL skill); +skill_t *addskill(enum SKILL id, char *name, char *desc, int traintime); +void addskilldesc(enum SKILL id, enum SKILLLEVEL lev, char *text, int wantmsg); +object_t *addtrail(lifeform_t *lf, cell_t *where, int dir, int doprints, int doscents); +void adjustdamlf(lifeform_t *lf, int *amt, enum DAMTYPE damtype); +void adjustspeedforwater(lifeform_t *lf, int *speed); +void age(lifeform_t *lf, int pct); +void adjustdamforblessings(int *dam, lifeform_t *victim, int blessed); +void applylfdammod(int *dam, lifeform_t *lf, object_t *wep); +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); +int armourfits(lifeform_t *lf, object_t *o, enum ERROR *reason); +int askforinfo(lifeform_t *lf, int diffmod); +//int askforpayment(lifeform_t *shk, lifeform_t *lf); +char *assignnpcname(lifeform_t *lf); +void autoshortcut(lifeform_t *lf, enum OBTYPE spellid); +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, int splatter); +int bleedfrom(lifeform_t *lf, enum BODYPART bp, int splatter); +int bpcantakearmour(lifeform_t *lf, enum BODYPART bp); +void breakgrabs(lifeform_t *lf, int fromme, int tome); +void breakaitargets(lifeform_t *lf, int onlylowerlev); +long calcscore(lifeform_t *lf); +int calcxp(lifeform_t *lf); +int calcxprace(enum RACE rid); +void callguards(lifeform_t *caller, lifeform_t *victim); +int canattack(lifeform_t *lf); +int cancast(lifeform_t *lf, enum OBTYPE oid, int *mpcost); +int cancook(lifeform_t *lf, recipe_t *rec, enum ERROR *reason); +int canclimb(lifeform_t *lf, enum ERROR *reason); +int candrink(lifeform_t *lf, object_t *o); +int caneat(lifeform_t *lf, object_t *o); +int canhaverandombehaviour(lifeform_t *lf); +int canhear(lifeform_t *lf, cell_t *c, int volume); +int canlearn(lifeform_t *lf, enum SKILL skid); +int canmakerecipe(lifeform_t *lf, recipe_t *rec); +int canopendoors(lifeform_t *lf); +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 canreach(lifeform_t *lf, lifeform_t *victim, int *reachpenalty); +int canreachbp(lifeform_t *lf, lifeform_t *victim, enum BODYPART bp); +int cansee(lifeform_t *viewer, lifeform_t *viewee); +int cansee_real(lifeform_t *viewer, lifeform_t *viewee, int uselos); +int cansleep(lifeform_t *lf); +int canuseweapons(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 cantalk(lifeform_t *lf); +int castspell(lifeform_t *lf, enum OBTYPE sid, lifeform_t *targlf, object_t *targob, cell_t *targcell, object_t *fromob, int *seen); +int celllitfor(lifeform_t *lf, cell_t *c, int maxvisrange, int nightvisrange); +int celltransparentfor(lifeform_t *lf, cell_t *c, int *xray, int *rangemod); +int checkburdened(lifeform_t *lf, int preburdened); +int checkfordrowning(lifeform_t *lf, object_t *o); +int check_rest_ok(lifeform_t *lf); +//void checkxp(enum RACE rid); +float comparelfs(lifeform_t *lf1, lifeform_t *lf2); +int confuse(lifeform_t *lf, int howlong); +int continuedigging(lifeform_t *lf); +int countinnateattacks(lifeform_t *lf); +int countnearbyallies(lifeform_t *lf); +int countnearbyhurtallies(lifeform_t *lf); +int countplantsinsight(lifeform_t *lf); +void debug(lifeform_t *lf); +int demandbribe(lifeform_t *lf); +void die(lifeform_t *lf); +int digcell(lifeform_t *lf, cell_t *c, object_t *o); +int digdown(lifeform_t *lf, object_t *o); +int digup(lifeform_t *lf, object_t *o); +void do_eyesight_adjust(lifeform_t *lf); +void dumplev(void); +void dumplf(void); +void dumpmonsters(void); +void dumpxp(void); +int eat(lifeform_t *lf, object_t *o); +void endlfturn(lifeform_t *lf); +void enhancerandomskill(lifeform_t *lf); +void enhanceskills(lifeform_t *lf); +int exchangeweapon(lifeform_t *lf); +void extinguishlf(lifeform_t *lf); +object_t *eyesshaded(lifeform_t *lf); +int fall(lifeform_t *lf, lifeform_t *fromlf, int announce); +int fallasleep(lifeform_t *lf, enum SLEEPTYPE how, int howlong); +int fall_from_air(lifeform_t *lf); +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); +lifeform_t *findlfunique(enum RACE rid); +poisontype_t *findpoisontype(enum POISONTYPE id); +race_t *findrace(enum RACE id); +race_t *findracebyname(char *name); +raceclass_t *findraceclass(enum RACECLASS id); +//lifeform_t *findshopkeeper(map_t *m, int roomid); +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 onpurpose); +int fovlist_contains(int *endx, int *endy, int nendcells, int x, int y); +int freezelf(lifeform_t *freezee, lifeform_t *freezer, int howlong); +void gainhp(lifeform_t *lf, int amt); +void gainlevel(lifeform_t *lf, int autotrain); +void gainmp(lifeform_t *lf, int amt); +void gainxp(lifeform_t *lf, long amt); +void genareaknowledge(flagpile_t *fp, int chancemod); +void genxplist(void); +int get_adjacent_quadrants(int dir, enum QUADRANT *start, enum QUADRANT *end); +int get_circular_fov_endpoints(lifeform_t *lf, int maxvisrange, int *endx, int *endy, int *nendcells); +int getactspeed(lifeform_t *lf); +int getadjenemies(lifeform_t *lf, lifeform_t **adjlf, int *nadjlfs); +void getwhowillfollow(lifeform_t *lf, object_t *stairob, lifeform_t **adjally, int *seen, int *nadjallies); +enum ALIGNMENT getalignment(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 getarmournoise(lifeform_t *lf); +int getarmourrating(lifeform_t *lf, object_t **hitob, int *hitchance, enum BODYPART *hitbp, int *narms); +int getattackspeed(lifeform_t *lf); +float getattackstamloss(lifeform_t *lf); +float getattackstamloss(lifeform_t *lf); +int getattpoints(lifeform_t *lf); +int getattr(lifeform_t *lf, enum ATTRIB attr); +enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, /*@null@*/char *buf); +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, lifeform_t *target); +object_t *getbestweapon(lifeform_t *lf); +object_t *getbestfirearm(lifeform_t *lf); +int getbodyparthitchance(enum BODYPART bp); +char *getbodypartname(lifeform_t *lf, enum BODYPART bp); +char *getbodypartequipname(enum BODYPART bp); +object_t *getequippedob(obpile_t *op, enum BODYPART bp); +int getexposedlimbs(lifeform_t *lf); +object_t *getfirearm(lifeform_t *lf); +enum LOFTYPE getfirearmloftype(lifeform_t *lf); +int getfootprinttime(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 gethitdice(lifeform_t *lf); +int gethitdicerace(race_t *r); +int gethitstokill(lifeform_t *lf, lifeform_t *victim, int useevasion, int usearmour); +int gethppct(lifeform_t *lf); +enum COLOUR gethungercol(enum HUNGER hlev); +enum HUNGER gethungerlevel(int hunger); +char *gethungername(lifeform_t *lf, enum HUNGER hunger, char *buf); +int gethungerval(lifeform_t *lf); +job_t *getjob(lifeform_t *lf); +int getlastdir(lifeform_t *lf); +int getleftrightwalls(lifeform_t *lf); +int getlfaccuracy(lifeform_t *lf, object_t *wep); +char getlfcol(lifeform_t *lf, enum MSGCHARCOL cc); +enum LFCONDITION getlfcondition(lifeform_t *lf); +int getflightsizemod(lifeform_t *lf); +enum SKILLLEVEL getmaxskilllevel(lifeform_t *lf, enum SKILL skid); +int getminions(lifeform_t *lf, lifeform_t **minion, int *nminions); +int getmiscastchance(lifeform_t *lf); +int getmorale(lifeform_t *lf); +int getnightvisrange(lifeform_t *lf); +int getnoisedetails(lifeform_t *lf, enum NOISETYPE nid, char *heartext,char *seetext, int *volume); +char *getlfconditionname(enum LFCONDITION cond); +object_t *getouterequippedob(lifeform_t *lf, enum BODYPART bp); +//int getowing(lifeform_t *buyer, int shopid, int *retnitems); +enum LFCONDITION getseenlfconditioncutoff(lifeform_t *lf); +char *getseenlfconditionname(lifeform_t *lf, lifeform_t *viewer); +int getsmellrange(lifeform_t *lf); +glyph_t *getlfglyph(lifeform_t *lf); +enum MATERIAL getlfmaterial(lifeform_t *lf); +enum SKILLLEVEL getlorelevel(lifeform_t *lf, enum RACECLASS rcid); +int getattacks(lifeform_t *lf, int *min, int *max); +float getmaxcarryweight(lifeform_t *lf); +float getmaxliftweight(lifeform_t *lf); +int getmaxmp(lifeform_t *lf); +float getmaxpushweight(lifeform_t *lf); +float getmaxstamina(lifeform_t *lf); +int getmr(lifeform_t *lf); +int getvisrange(lifeform_t *lf, int useambient); +void idxtoxy(lifeform_t *lf, int idx, int *x, int *y); +//void setviscell(lifeform_t *lf, cell_t *cell, int how); +//int getviscell(lifeform_t *lf, cell_t *cell); +int xytoidx(lifeform_t *lf, int x, int y); +int getmovespeed(lifeform_t *lf); +char *getmoveverb(lifeform_t *lf); +char *getmoveverbother(lifeform_t *lf); +lifeform_t *getnearbypeaceful(lifeform_t *lf); +char *getpitverb(lifeform_t *lf, int dir, int onpurpose, int climb); +char *getlfname(lifeform_t *lf, char *buf); +char *real_getlfname(lifeform_t *lf, char *buf, int usevis, int showall); +char *getlfnamea(lifeform_t *lf, char *buf); +char *real_getlfnamea(lifeform_t *lf, char *buf, int usevis, int showall); +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, enum DAMTYPE dt); +int getallshields(lifeform_t *lf, enum DAMTYPE damtype, object_t **retob, int *checkmod, int *nretobs); +int getshieldblockmod(lifeform_t *lf, object_t *o); +int getspellspeed(lifeform_t *lf); +int getstamina(lifeform_t *lf); +float getstamregen(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); +//enum POISONSEVERITY getpoisonseverity(enum POISONTYPE ptype); +int getraceclass(lifeform_t *lf); +int getracerarity(map_t *map, enum RACE rid, enum RARITY *rr); +object_t *getrandomarmour(lifeform_t *lf, lifeform_t *attacker); +enum BODYPART getrandomcorebp(lifeform_t *lf, lifeform_t *attacker); +race_t *getrandomcorpserace(cell_t *c); +job_t *getrandomjob(int onlyplayerjobs); +int getrandommonlevel(race_t *r, map_t *m); +race_t *getrandomrace(cell_t *c, int forcedepth); +race_t *getreallyrandomrace(enum RACECLASS wantrc); +enum SKILL getrandomskill(void); +object_t *getrestob(lifeform_t *lf); +enum SKILLLEVEL getskill(lifeform_t *lf, enum SKILL id); +int getskilllevcost(enum SKILLLEVEL slev); +int getsounddist(int volume); +char *getspeedname(int speed, char *buf); +char *getspeednameshort(int speed, char *buf); +long getspforpoint(lifeform_t *lf); +float getstatmod(lifeform_t *lf, enum ATTRIB att); +char *getskilldesc(enum SKILL id ); +char *getskillname(enum SKILL id ); +char *getskilllevelname(enum SKILLLEVEL sl); +int getteachableskills(lifeform_t *teacher, lifeform_t *student, int *info, enum TRADEINFOTYPE *tradetype, int *ninfo ); +char *gettradeinfoname(int what, enum TRADEINFOTYPE tradetype, char *buf); +int getthrowspeed(lifeform_t *lf); +int getturnspeed(lifeform_t *lf); +void getwantdistance(lifeform_t *lf, lifeform_t *victim, int *min, int *max, int attacking); +object_t *getweapon(lifeform_t *lf); +int getweapons(lifeform_t *lf, object_t **wep, flag_t **damflag, int *lastweaponidx, obpile_t **op, int *nweps); +enum SKILLLEVEL getweaponskill(lifeform_t *lf, object_t *o); +long getxpforlev(int level); +void givejob(lifeform_t *lf, enum JOB jobid); +int givemoney(lifeform_t *from, lifeform_t *to, int amt); +void giveobflags(lifeform_t *lf, object_t *o, enum FLAG whattype); +int giverandomobs(lifeform_t *lf, int amt); +flag_t *giveskill(lifeform_t *lf, enum SKILL id); +flag_t *giveskilllev(lifeform_t *lf, enum SKILL id, enum SKILLLEVEL slev); +void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp); +void givestartskills(lifeform_t *lf, flagpile_t *fp); +map_t *gotolev(lifeform_t *lf, int depth, object_t *fromstairs); +int gotosleep(lifeform_t *lf, int onpurpose); +flag_t *hasbleedinginjury(lifeform_t *lf, enum BODYPART bp); +int hasfreeaction(lifeform_t *lf); +int real_hasfreeaction(lifeform_t *lf, enum FLAG exception); +int hashealableinjuries(lifeform_t *lf); +job_t *hasjob(lifeform_t *lf, enum JOB job); +void inc_quad_range(enum QUADRANT *start, enum QUADRANT *end, int howmuch); +int injure(lifeform_t *lf, enum BODYPART where, enum DAMTYPE damtype); +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, /*@null@*/ char *text); +int lfproduceslight(lifeform_t *lf); +int lockpick(lifeform_t *lf, cell_t *targcell, 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 haslof_real(cell_t *src, cell_t *dest, enum LOFTYPE loftype, cell_t **newdest, lifeform_t *srclf, int walllfsok); +int haslos(lifeform_t *viewer, cell_t *dest); +int haslosdark(lifeform_t *viewer, cell_t *dest); +int haslos_fast(lifeform_t *viewer, cell_t *dest); +void interrupt(lifeform_t *lf); +enum FLAG isairborne(lifeform_t *lf); +int isaquatic(lifeform_t *lf); +flag_t *isasleep(lifeform_t *lf); +int isbehind(lifeform_t *lf, lifeform_t *otherlf); +int isbleeding(lifeform_t *lf); +int isblind(lifeform_t *lf); +enum BURDENED isburdened(lifeform_t *lf); +int ischarmable(lifeform_t *lf); +int isclimbing(lifeform_t *lf); +int isdead(lifeform_t *lf); +int isdeaf(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 isfullyhealed(lifeform_t *lf); +int isgenius(lifeform_t *lf); +int isgod(lifeform_t *lf); +int ishelplessvictim(lifeform_t *victim, lifeform_t *attacker, enum HELPLESSTYPE *how); +flag_t *ishidingfrom(lifeform_t *hider, lifeform_t *seeker); +int ishirable(lifeform_t *lf); +int isimmobile(lifeform_t *lf); +flag_t *isimmuneto(flagpile_t *fp, enum DAMTYPE dt, int onlytemp); +int isinbattle(lifeform_t *lf, int includedistant); +int isingunrange(lifeform_t *lf, cell_t *where); +int isloreskill(enum SKILL skid); +int islowhp(lifeform_t *lf); +int isspellskill(enum SKILL skid); +int ismadeofice(lifeform_t *lf); +int ismaxedskill(lifeform_t *lf, enum SKILL skid); +int ispeaceful(lifeform_t *lf); +int ispetof(lifeform_t *lf, lifeform_t *owner); +flag_t *ispetortarget(lifeform_t *lf, lifeform_t *ownertarget); +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, int onlytemp); +flag_t *isresting(lifeform_t *lf); +int issleepingtimefor(lifeform_t *lf); +object_t *isstuck(lifeform_t *lf); +int issmellablelf(lifeform_t *lf); +int isswimming(lifeform_t *lf); +int isunconscious(lifeform_t *lf); +int isundead(lifeform_t *lf); +flag_t *isvulnto(flagpile_t *fp, enum DAMTYPE dt, int onlytemp); +int isweaponskill(enum SKILL skid); +enum FLAG iswoozy(lifeform_t *lf); +void killjob(job_t *job); +void killlf(lifeform_t *lf); +void killpoisontype(poisontype_t *pt); +void killrace(race_t *race); +flag_t *levelabilityready(lifeform_t *lf); +int loadfirearm(lifeform_t *lf, object_t *gun, object_t *ammo); +int loadfirearmfast(lifeform_t *lf, int onpurpose); +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, object_t *fromob, int retaliate); +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 *causedby); +lifeform_t *makezombie(object_t *o); +void mayusespellschool(flagpile_t *fp, enum SPELLSCHOOL ss, enum FLAG how, int overridepower); +int meetsallattreqs(lifeform_t *lf, object_t *o); +int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *modpct); +int mightflee(lifeform_t *lf); +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); +void modmorale(lifeform_t *lf, int howmuch); +void modstamina(lifeform_t *lf, float howmuch); +int movecausesnoise(lifeform_t *lf); +int needstorest(lifeform_t *lf, char *validchars); +void noarmouron(race_t *r, enum BODYPART bp); +int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nt, int volume, char *text, char *seetext); +enum NOISECLASS noisetypetoclass(enum NOISETYPE nt); +void outfitlf(lifeform_t *lf); +void petify(lifeform_t *lf, lifeform_t *owner); +int pickup(lifeform_t *lf, object_t *what, int howmany, int fromground, int antannounce); +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, int amt); +//void precalclos_old(lifeform_t *lf); +void precalclos(lifeform_t *lf); +void preparecorpse(lifeform_t *lf, object_t *corpse); +int push(lifeform_t *lf, object_t *o, int dir); +int readytotrain(lifeform_t *lf); +int recruit(lifeform_t *lf); +void refreshlevelabilities(lifeform_t *lf); +void relinklf(lifeform_t *src, map_t *dst); +int resizelf(lifeform_t *lf, enum LFSIZE newsize); +int rest(lifeform_t *lf, int onpurpose); +void setskillused(lifeform_t *lf, enum SKILL skid); +void spot_hiding_lf(lifeform_t *lf, lifeform_t *hider); +int startclimbing(lifeform_t *lf); +int startresting(lifeform_t *lf, int willtrain); +int rollattr(enum ATTRBRACKET bracket); +int rollstat(lifeform_t *lf, enum ATTRIB attr); +int safetorest(lifeform_t *lf); +int say(lifeform_t *lf, char *text, int volume); +int sayphrase(lifeform_t *lf, enum SAYPHRASE what, int volume, int val0, char *text); +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 setbodypartname(race_t *r, enum BODYPART bp, char *name); +void setbodytype(race_t *r, enum BODYTYPE bt); +int setfacing(lifeform_t *lf, int dir); +void setfollowdistance(lifeform_t *lf, int min, int max); +void setguntarget(lifeform_t *lf, lifeform_t *targ); +void setkillverb(lifeform_t *lf, char *buf); +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 setlfmaterial(lifeform_t *lf, enum MATERIAL id, int wantannounce); +void setlosdirty(lifeform_t *lf); +void setstamina(lifeform_t *lf, float howmuch); +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); +void startlfturn(lifeform_t *lf); +int steal(lifeform_t *lf, obpile_t *op, enum FLAG wantflag); +int stone(lifeform_t *lf); +int stopclimbing(lifeform_t *lf, int onpurpose); +void stopeating(lifeform_t *lf); +void stopresting(lifeform_t *lf); +void stoprunning(lifeform_t *lf); +void stopsprinting(lifeform_t *lf); +int stun(lifeform_t *lf, int nturns); +lifeform_t *summonmonster(lifeform_t *caster, cell_t *c, enum RACE rid, char *racename, int lifetime, int wantfriendly); +//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); +int tradeknowledge(lifeform_t *lf); +int tryclimb(lifeform_t *lf, cell_t *where, char *towhat, int onpurpose); +int touch(lifeform_t *lf, object_t *o); +void turntoface(lifeform_t *lf, cell_t *dstcell); +void unequipeffects(lifeform_t *lf, object_t *o); +void unpoison(lifeform_t *lf); +void unsummon(lifeform_t *lf, int vanishobs); +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 onpurpose, int climb); +int validateraces(void); +void wakeup(lifeform_t *lf, int howmuch); +int wear(lifeform_t *lf, object_t *o); +int weild(lifeform_t *lf, object_t *o); +int willbackstab(lifeform_t *lf, lifeform_t *victim, object_t *wep); +int willbleedfrom(lifeform_t *lf, enum BODYPART bp); +int willburden(lifeform_t *lf, object_t *o, int howmany); +int willeatlf(lifeform_t *eater, lifeform_t *eatee); +//int youhear(cell_t *c, char *text); diff --git a/ORIG.objects.h b/ORIG.objects.h new file mode 100644 index 0000000..1803537 --- /dev/null +++ b/ORIG.objects.h @@ -0,0 +1,298 @@ +#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 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); +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 getobbonus(object_t *o, int onlyknown); +lifeform_t *getobcreatedby(object_t *o); +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); +brand_t *getrandombrandfor(objecttype_t *ot); +objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity, lifeform_t *forlf); +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); +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 *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 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); +char *getschoolname(enum SPELLSCHOOL sch); +char *getschoolnameshort(enum SPELLSCHOOL sch); +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, 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 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); +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); +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 + diff --git a/findleak.h b/findleak.h new file mode 100644 index 0000000..44f593d --- /dev/null +++ b/findleak.h @@ -0,0 +1,37 @@ +#define uint unsigned int +#define cchar const char +#define OutFile "/tmp/MemLeakInfo.txt" // Just Suppose +#define MAX_FILENAME_LENGTH 256 +#define calloc(objs, nSize) MyCalloc (objs, nSize, __FILE__, __LINE__) +#define malloc(nSize) MyMalloc (nSize, __FILE__, __LINE__) +#define DOMALLOC(nSize) MyMalloc (sizeof(nSize), __FILE__, __LINE__) +#define free(rMem) MyFree(rMem) + +// This structure is keeping info about memory leak +struct InfoMem +{ + void *addr; + uint nSize; + char fileName[MAX_FILENAME_LENGTH]; + uint lineNumber; +}; +typedef struct InfoMem infoMem; + +//This is link list of InfoMem which keeps a List of memory Leak in a source file +struct LeakMem +{ + infoMem memData; + struct LeakMem *nxt; +}; +typedef struct LeakMem leakMem; + +void WriteMemLeak(void); +void SubAddMemInfo(void *rMem, uint nSize, cchar *file, uint lno); +void SubAdd(infoMem alloc_info); + +void ResetInfo(uint pos); //erase +void DeleteAll(void); //clear(void); +void *MyMalloc(uint size, cchar *file, uint line); +void *MyCalloc(uint elements, uint size, cchar * file, uint lno); +void MyFree(void * mem_ref); +