#ifndef __DEFS_H #define __DEFS_H // MACROS #define MAXOF(a,b) (a > b ? a : b) #define PRACTICETIME 50 // #attempts it takes to learn new skill #define WETTIME 10 // how long it takes for things to dry #define POISONDAMCHANCE 33 // chance of vomitting when poisoned #define POISONDAM 2 // damage taken from vomiting when poisoned // ncurses colours enum COLOUR { 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, }; // save/load #define MAPDIR "data/maps" #define SAVEDIR "data/save" #define DUMMYCELLTYPE 0xabcd // SPECIAL NUMBERS/CONSTANTS #define UNLIMITED (-9876) #define ALL (-9875) #define NA (-9874) #define NOBODY (-1) #define ALLCONFERRED (-9873) enum GAMEMODE { GM_FIRST, GM_INIT, GM_VALIDATION, GM_LOADING, GM_LOADED, GM_GAMESTARTED, GM_GAMEOVER, }; enum ATTRIB { A_NONE = -1, A_STR = 0, A_DEX = 1, A_IQ = 2, A_CON = 3, }; #define MAXATTS 4 enum CHECKTYPE { SC_STR, SC_DEX, SC_IQ, SC_CON, ////////// SC_DODGE, SC_SLIP, SC_LISTEN, SC_MORALE, SC_OPENLOCKS, SC_POISON, SC_RESISTMAG, SC_STEALTH, SC_WILL, }; enum BURDENED { BR_NONE = 0, BR_BURDENED = 1, BR_STRAINED = 2, BR_OVERLOADED = 3, }; enum LFCONDITION { C_DEAD = 0, C_CRITICAL = 1, C_SERIOUS = 2, C_WOUNDED = 3, C_HURT = 4, C_HEALTHY = 5, }; // AI defs // if target lf is out of view for this many turns, abandon chase #define AI_FOLLOWTIME (10) // object confitions for random objects #define RO_NONE 0 #define RO_DAMTYPE 1 #define RO_OBCLASS 2 // for flags #define PERMENANT (-9873) #define FROMRACE (-9872) #define FROMJOB (-9871) #define FROMOBEQUIP (-9870) #define FROMOBHOLD (-9869) #define FROMOBACTIVATE (-9868) #define FROMMAT (-9867) #define FROMBLESSING (-9866) #define FROMBRAND (-9865) #define FROMOBMOD (-9864) #define FROMSPELL (-9863) #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 #define NOCONDITION (0) #define IFMONSTER (-9769) // used in v2 of f_ifpct job flags #define IFPLAYER (-9768) // used in v2 of f_ifpct job flags #define ANYROOM (-9770) #define TICK_INTERVAL (20) // STRINGS #define BUFLENSMALL 64 #define BUFLEN 128 #define HUGEBUFLEN 1024 #define MORESTRING "--More--" #define SOLDOUTSTRING "--SOLD OUT--" // hunger constant #define HUNGERCONST 10000 // LIMITS #define DEF_SCREENW 80 #define DEF_SCREENH 24 #define MAXPILEOBS 52 #define MAXRETCELLS 80 #define MAXCHOICES 150 #define MAXDEPTH 25 // max dungeon depth #define MAXRANDOMOBCANDIDATES 100 #define MAXRANDOMLFCANDIDATES 100 #define MAXCANDIDATES 200 //#define MAX_MAPW 80 //#define MAX_MAPH 50 #define MAX_MAPW 80 #define MAX_MAPH 20 //#define MAX_MAPROOMS 10 #define MIN_ROOMH 4 #define MIN_ROOMW 4 #define MAX_ROOMW (MAX_MAPW / 5) #define MAX_ROOMH (MAX_MAPH / 5) #define MAXDIR_ORTH 4 #define MAXDIR_COMPASS 8 #define MAXHISTORY 20 // max lines of history to keep // MAP BUILDING #define DEF_TURNPCT 40 //#define DEF_SPARSENESS 14 #define DEF_SPARSENESS 20 //#define DEF_SPARSENESS 0 //#define DEF_LOOPPCT 70 #define DEF_LOOPPCT 95 //#define DEF_LOOPPCT 0 #define MINROOMS 5 #define MAXROOMS 10 #define DEF_WINDOWPCT 5 // //#define ANIMDELAY (1000000 / 100) // 1/100 of a second #define ANIMDELAY (1000000 / 50) // 1/100 of a second #define MAXVISRANGE 10 // max visible range in full light // 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_EQUIPPEDARMOUR 128 #define AO_WEILDABLE 256 #define AO_SPECIFIED 512 #define AO_READABLE 1024 #define AO_ARMOUR 2048 #define AO_NOTKNOWN 4096 // askcoords target types #define TT_NONE 0 #define TT_MONSTER 1 #define TT_OBJECT 2 #define TT_DOOR 4 #define TT_PLAYER 8 // target requirements #define TR_NONE 0 #define TR_NEEDLOS 1 #define TR_NEEDLOF 2 // line of fire args enum LOFTYPE { LOF_DONTNEED = 0, LOF_WALLSTOP = 2, LOF_LFSSTOP = 4, LOF_NEED = 6, // walls AND lfs block }; // CONTROLLERS #define C_AI 0 #define C_PLAYER 1 // deafult //#define DEF_HEALTIME 100 // time to heal 1 hp // 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 // 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_FAST #define SPEED_PICKUP SP_FAST #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 // 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 // Cell types enum CELLTYPE { CT_WALL, CT_ROOMWALL, CT_CORRIDOR, CT_ROOM, CT_LOOPCORRIDOR, }; enum SPELLSCHOOL { SS_NONE, SS_DIVINE, SS_ABILITY, SS_ALLOMANCY, SS_AIR, SS_DEATH, SS_DIVINATION, SS_EARTH, SS_FIRE, SS_ICE, SS_GRAVITY, SS_LIFE, SS_MODIFICATION, SS_MENTAL, SS_SUMMONING, SS_TRANSLOCATION, SS_WILD, SS_LAST, }; enum STRBRACKET { ST_RANDOM = -1, ST_HELPLESS = 0, ST_FEEBLE = 1, ST_VWEAK = 2, ST_WEAK = 3, ST_AVERAGE = 4, ST_STRONG = 5, ST_MIGHTY = 6, ST_TITANIC = 7, }; enum DEXBRACKET { DX_RANDOM = -1, DX_INCOMPETENT = 0, DX_OAFISH = 1, DX_INEPT = 2, DX_CLUMSY = 3, DX_AWKWARD = 4, DX_AVERAGE = 5, DX_DEXTROUS = 6, DX_NIMBLE = 7, DX_AGILE = 8, DX_SWIFT = 9, DX_SUPERSONIC = 10, }; enum IQBRACKET { IQ_RANDOM = -1, IQ_MINDLESS = 0, IQ_VEGETABLE = 1, IQ_ANIMAL = 2, IQ_STUPID = 3, IQ_DIMWITTED = 4, IQ_DOPEY = 5, IQ_AVERAGE = 6, IQ_SMART = 7, IQ_ENLIGHTENED = 8, IQ_GENIUS = 9, }; enum CONBRACKET { CN_RANDOM = -1, CN_FRAIL = 0, CN_SICKLY = 1, CN_UNHEALTHY = 2, CN_UNFIT = 3, CN_AVERAGE = 4, CN_HEALTHY = 5, CN_FIT = 6, CN_HARDY = 7, }; // 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_NONE = 26, // for direclty dealt damage, not really any type }; #define MAXDAMTYPE 27 // Object Classes enum OBCLASS { OC_MONEY, OC_WEAPON, OC_ARMOUR, OC_MISSILE, OC_RING, OC_SCROLL, OC_POTION, OC_WAND, OC_FOOD, OC_CORPSE, OC_ROCK, OC_TOOLS, OC_TECH, OC_MISC, OC_SPELL, OC_ABILITY, OC_EFFECT, OC_DFEATURE, OC_BOOK, OC_NULL = -999 }; enum BLESSTYPE { B_UNCURSED = 0, B_BLESSED = 1, B_CURSED = -1 }; enum HABITAT { H_DUNGEON = 1, H_ALL = 999 }; #define RARITYVARIANCE (25) /* enum RARITY { RR_UNIQUE = 7, RR_NEVER = 6, RR_VERYRARE = 5, RR_RARE = 4, RR_UNCOMMON = 3, RR_COMMON = 2, RR_FREQUENT = 1, }; */ enum RACE { R_NONE, R_RANDOM, R_HUMAN, // monsters R_BEHOLDER, R_BUGBEAR, R_COCKATRICE, R_DARKMANTLE, R_EYEBAT, R_GIANTHILL, R_GIANTFIRE, R_GIANTFIREFC, R_GIANTFIRETITAN, R_GNOLL, R_GNOLLHM, R_GNOLLMR, R_GOBLIN, R_GOBLINWAR, R_GOBLINSHOOTER, R_GOBLINHEXER, R_HOBGOBLIN, R_HOBGOBLINWAR, R_KOBOLD, R_LIZARDMAN, R_LURKINGHORROR, R_OGRE, R_OGRESAVAGE, R_OGREWARHULK, R_OOZEGREY, R_ORC, R_ORCWARRIOR, R_ORK, R_POLTERGEIST, R_SHADOWCAT, R_SPRITEFIRE, R_TROGLODYTE, R_TROLL, R_XAT, // small animals R_ANT, R_ANTS, R_BAT, R_HAWK, R_HAWKYOUNG, R_HAWKBLOOD, R_HAWKFROST, R_NEWT, R_RAT, R_SNAKE, R_WOLF, // insects R_BUTTERFLY, R_GLOWBUG, R_GIANTFLY, R_GIANTBLOWFLY, // undead R_GHAST, R_GHOST, R_GHOUL, R_SKELETON, R_ZOMBIE, // special R_GASCLOUD, R_DANCINGWEAPON, }; enum JOB { J_NONE, J_GOD, J_ADVENTURER, J_ALLOMANCER, J_BARBARIAN, J_COMMANDO, J_PIRATE, J_PLUMBER, J_PRINCE, J_WIZARD, }; enum MATSTATE { MS_SOLID, MS_LIQUID, MS_GAS, MS_OTHER, }; // 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, }; // Object Types enum OBTYPE { OT_NONE, // dungeon features OT_BOULDER, OT_STATUE, OT_WOODENDOOR, OT_WOODENTABLE, OT_WOODENBARREL, OT_WOODENSTOOL, OT_STAIRSDOWN, OT_STAIRSUP, OT_VENDINGMACHINE, OT_PORTAL, // rocks OT_GOLD, OT_STONE, OT_ASH, OT_GEMOFSEEING, // food OT_BERRY, OT_NUT, OT_BANANA, OT_BANANASKIN, // not really food OT_APPLE, OT_MUSHROOM, OT_BREADSTALE, OT_CHEESE, OT_ROASTMEAT, OT_BREADFRESH, OT_CHOCOLATE, OT_CLOVER, // corpses OT_CORPSE, OT_HEAD, /* OT_CORPSEEYEBAT, OT_CORPSEBAT, OT_CORPSEFLY, OT_CORPSEGLOWBUG, OT_CORPSEGOBLIN, OT_CORPSEHUMAN, OT_CORPSELIZARD, OT_CORPSEOGRE, OT_CORPSEORK, OT_CORPSERODENT, OT_CORPSETROLL, OT_CORPSEWOLF, */ // potions OT_POT_ACID, OT_POT_ACROBATICS, OT_POT_AMBROSIA, OT_POT_BLOOD, OT_POT_BLOODC, OT_POT_COMPETENCE, OT_POT_ELEMENTENDURE, OT_POT_ELEMENTIMMUNE, OT_POT_ETHEREALNESS, OT_POT_EXPERIENCE, OT_POT_GASEOUSFORM, OT_POT_HEALING, OT_POT_HEALINGMIN, OT_POT_INVIS, OT_POT_INVULN, OT_POT_MAGIC, OT_POT_OIL, OT_POT_POISON, OT_POT_POLYMORPH, OT_POT_RESTORATION, OT_POT_SANCTUARY, OT_POT_SPEED, OT_POT_WATER, OT_POT_JUICE, // scrolls OT_MAP, 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_MINDSCAN, OT_SCR_PERMENANCE, OT_SCR_ENCHANT, OT_SCR_FREEZEOB, OT_SCR_REMOVECURSE, OT_SCR_TELEPORT, OT_SCR_TURNUNDEAD, OT_SCR_WISH, // BOOKS OT_MAN_ARMOUR, OT_MAN_ATHLETICS, OT_MAN_BACKSTAB, OT_MAN_FIRSTAID, OT_MAN_LISTEN, OT_MAN_LOCKPICKING, OT_MAN_MAGITEMUSAGE, OT_MAN_RESEARCH, OT_MAN_SHIELDS, OT_MAN_SPELLCASTING, OT_MAN_STEALTH, OT_MAN_TECHUSAGE, // manuals of weaponry OT_MAN_AXES, OT_MAN_CLUBS, OT_MAN_LONGBLADES, OT_MAN_POLEARMS, OT_MAN_SHORTBLADES, OT_MAN_STAVES, OT_MAN_UNARMED, // manuals of spells OT_MAN_SS_ALLOMANCY, OT_MAN_SS_AIR, OT_MAN_SS_DEATH, OT_MAN_SS_DIVINATION, OT_MAN_SS_FIRE, OT_MAN_SS_ICE, OT_MAN_SS_GRAVITY, OT_MAN_SS_LIFE, OT_MAN_SS_MODIFICATION, OT_MAN_SS_MENTAL, OT_MAN_SS_SUMMONING, OT_MAN_SS_TRANSLOCATION, OT_MAN_SS_WILD, // SPELLBOOKS // allomancy can't be learned from books // -- death OT_SB_ANIMATEDEAD, OT_SB_DRAINLIFE, OT_SB_PAIN, OT_SB_PARALYZE, OT_SB_POISONBOLT, OT_SB_INFINITEDEATH, OT_SB_WEAKEN, OT_SB_BLINDNESS, // -- divination OT_SB_DETECTAURA, OT_SB_DETECTLIFE, OT_SB_DETECTOBS, OT_SB_IDENTIFY, OT_SB_MAPPING, // -- elemental - air OT_SB_AIRBLAST, OT_SB_CLOUDKILL, // -- elemental - fire OT_SB_SPARK, OT_SB_FIREDART, OT_SB_FIREBALL, OT_SB_FLAMEPILLAR, OT_SB_FLAMEBURST, OT_SB_BURNINGWAVE, // -- elemental - ice OT_SB_CONECOLD, OT_SB_FREEZEOB, OT_SB_COLDBURST, // -- elemental - earth OT_SB_DIG, // -- gravity OT_SB_GRAVLOWER, OT_SB_GRAVBOOST, OT_SB_HASTE, OT_SB_FLIGHT, OT_SB_SLOW, OT_SB_LEVITATION, // -- life OT_SB_HEALING, OT_SB_HEALINGMIN, OT_SB_TURNUNDEAD, // -- mental / psionic OT_SB_MINDSCAN, OT_SB_SLEEP, OT_SB_TELEKINESIS, OT_SB_PACIFY, OT_SB_PSYARMOUR, OT_SB_CHARM, // -- modification OT_SB_GASEOUSFORM, OT_SB_KNOCK, OT_SB_INSCRIBE, OT_SB_INVISIBILITY, OT_SB_LIGHT, OT_SB_DARKNESS, OT_SB_PASSWALL, OT_SB_PETRIFY, OT_SB_POLYMORPH, // -- summoning OT_SB_CREATEMONSTER, // -- translocation OT_SB_BLINK, OT_SB_DISPERSAL, OT_SB_GATE, OT_SB_TELEPORT, // -- wild can't be learned from books // spells // -- allomancy OT_S_ABSORBMETAL, OT_S_ACCELMETAL, OT_S_ANIMATEMETAL, OT_S_EXPLODEMETAL, OT_S_PULLMETAL, OT_S_MAGSHIELD, OT_S_METALHEAL, // -- death OT_S_ANIMATEDEAD, OT_S_DRAINLIFE, OT_S_PAIN, OT_S_PARALYZE, OT_S_INFINITEDEATH, OT_S_WEAKEN, OT_S_BLINDNESS, OT_S_POISONBOLT, OT_S_POSSESSION, // -- divination OT_S_DETECTAURA, OT_S_DETECTLIFE, OT_S_DETECTOBS, OT_S_DETECTMAGIC, OT_S_IDENTIFY, OT_S_MAPPING, // -- elemental - air OT_S_AIRBLAST, OT_S_CLOUDKILL, OT_S_WINDSHIELD, // -- elemental - fire OT_S_SPARK, OT_S_FIREDART, OT_S_FIREBALL, OT_S_FLAMEPILLAR, OT_S_FLAMEBURST, OT_S_BURNINGWAVE, // -- elemental - ice OT_S_COLDBURST, OT_S_CONECOLD, OT_S_FREEZEOB, // -- elemental - earth OT_S_DIG, // -- gravity OT_S_GRAVLOWER, OT_S_GRAVBOOST, OT_S_HASTE, OT_S_SLOW, OT_S_LEVITATION, OT_S_FLIGHT, // -- life OT_S_HEALING, OT_S_HEALINGMIN, OT_S_TURNUNDEAD, // -- mental / psionic OT_S_MINDSCAN, OT_S_SLEEP, OT_S_TELEKINESIS, OT_S_PACIFY, OT_S_PSYARMOUR, OT_S_CHARM, // -- modification OT_S_ENCHANT, OT_S_GASEOUSFORM, OT_S_INSCRIBE, OT_S_INVISIBILITY, OT_S_KNOCK, OT_S_LIGHT, OT_S_DARKNESS, OT_S_PASSWALL, OT_S_PETRIFY, OT_S_POLYMORPH, OT_S_POLYMORPHRND, // -- summoning OT_S_CREATEMONSTER, // -- translocation OT_S_BLINK, OT_S_PULL, OT_S_DISPERSAL, OT_S_GATE, OT_S_TELEPORT, // -- wild OT_S_MANASPIKE, OT_S_DETONATE, OT_S_ENERGYBOLT, OT_S_ENERGYBLAST, OT_S_FLASH, // -- divine powers OT_S_WISH, OT_S_GIFT, OT_A_DEBUG, OT_A_ENHANCE, OT_A_LEARN, OT_A_LEVELUP, // abilities OT_A_GRAB, OT_A_CRUSH, OT_A_JUMP, OT_A_SPRINT, OT_A_SWOOP, OT_A_EMPLOY, OT_A_HEAVYBLOW, OT_A_INSPECT, OT_A_HURRICANESTRIKE, OT_A_POLYREVERT, OT_A_STINGACID, // need to define dam in f_canwill 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_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_POLYMORPH, OT_WAND_SLOW, OT_WAND_WEAKNESS, OT_WAND_WONDER, // tools OT_BLINDFOLD, OT_BUGLAMP, OT_CANDLE, OT_GUNPOWDER, OT_LAMPOIL, OT_LANTERNOIL, OT_LOCKPICK, OT_PICKAXE, OT_TORCH, // tech OT_POCKETWATCH, OT_C4, OT_CREDITCARD, OT_DIGITALWATCH, OT_FLASHBANG, OT_GRENADE, OT_INFOVISOR, OT_INSECTICIDE, OT_JETPACK, OT_LANTERNLED, OT_LOCKHACKER, OT_MOTIONSCANNER, OT_NVGOGGLES, OT_PAPERCLIP, OT_TELEPAD, OT_XRAYGOGGLES, // misc objects OT_BONE, OT_EMPTYFLASK, OT_EMPTYVIAL, OT_CALTROP, OT_BROKENGLASS, OT_ICECHUNK, OT_ICESHEET, OT_SPLASHWATER, OT_PUDDLEWATER, OT_PUDDLEWATERL, OT_ACIDPUDDLE, OT_ACIDPOOL, OT_SLIMEPOOL, OT_VOMITPOOL, OT_BLOODSTAIN, OT_BLOODSPLASH, OT_BLOODPOOL, OT_BLOODCSPLASH, OT_MELTEDWAX, OT_SOGGYPAPER, OT_FLESHCHUNK, // effects OT_FIRELARGE, OT_FIREMED, OT_FIRESMALL, OT_MAGICBARRIER, OT_STEAMCLOUD, OT_STEAMPUFF, OT_SMOKECLOUD, OT_SMOKEPUFF, OT_POISONCLOUD, OT_POISONPUFF, // armour - body OT_ARMOURLEATHER, OT_ARMOURRING, OT_ARMOURSCALE, OT_ARMOURCHAIN, OT_ARMOURSPLINT, OT_ARMOURPLATE, OT_FLAKJACKET, OT_OVERALLS, OT_COTTONSHIRT, OT_SILKSHIRT, OT_ROBE, OT_VELVETROBE, // armour - shoulders OT_CLOAK, // armour - waist OT_BELTLEATHER, // armour - legs OT_CLOTHTROUSERS, OT_RIDINGTROUSERS, OT_COMBATPANTS, // armour - feet OT_SANDALS, OT_SHOESLEATHER, OT_BOOTSLEATHER, OT_BOOTSRUBBER, OT_BOOTSSPIKED, // armour - hands OT_GLOVESCLOTH, OT_GLOVESLEATHER, OT_GAUNTLETS, // armour - head OT_SUNHAT, OT_PIRATEHAT, OT_CAP, OT_HELM, OT_GASMASK, OT_GOLDCROWN, OT_HELMBONE, OT_HELMFOOTBALL, // armour - eyes OT_SUNGLASSES, OT_EYEPATCH, // armour - shields OT_BUCKLER, OT_SHIELD, OT_SHIELDLARGE, OT_SHIELDTOWER, // rings OT_RING_INVIS, OT_RING_INVULN, OT_RING_LUCK, OT_RING_CONTROL, OT_RING_CON, OT_RING_DEX, OT_RING_IQ, OT_RING_STR, OT_RING_MANA, OT_RING_MIRACLES, OT_RING_MPREGEN, OT_RING_PROTFIRE, OT_RING_PROTCOLD, OT_RING_REGENERATION, OT_RING_RESISTMAG, OT_RING_SIGHT, OT_RING_WOUNDING, // innate / animal weapons OT_CLAWS, OT_FISTS, OT_HOOKHAND, // for pirate OT_STING, OT_TAIL, OT_TEETH, OT_TEETHSM, OT_TENTACLE, OT_ZAPPER, // monster weapons OT_ACIDATTACK, OT_TOUCHPARALYZE, OT_TOUCHPARALYZE2, // missiles / ammo OT_ARROW, OT_BOLT, OT_DART, OT_NANODART, OT_JAVELIN, OT_BULLET, OT_RUBBERBULLET, // axes OT_AXE, OT_HANDAXE, OT_BATTLEAXE, OT_GREATAXE, // short blades OT_COMBATKNIFE, OT_DAGGER, OT_KNIFE, OT_ORNDAGGER, OT_QUICKBLADE, OT_RAPIER, OT_SAI, OT_SHORTSWORD, OT_STEAKKNIFE, OT_SICKLE, // long swords OT_FALCHION, OT_GREATSWORD, OT_LONGSWORD, OT_ORNSWORD, OT_SCIMITAR, OT_CUTLASS, // polearms OT_GLAIVE, OT_GUISARME, OT_HALBERD, OT_LANCE, OT_RANSEUR, OT_SCYTHE, OT_SPEAR, OT_TRIDENT, // staves OT_QUARTERSTAFF, // clubs OT_CLUB, OT_FLAIL, OT_FLAILHEAVY, OT_GREATCLUB, OT_MACE, OT_MORNINGSTAR, OT_NUNCHAKU, OT_SPANNER, OT_STICK, // projectile weapons OT_BOW, OT_CROSSBOW, OT_CROSSBOWHAND, OT_LONGBOW, OT_REVOLVER, OT_SLING, // special weapons OT_HANDOFGOD, }; #define BP_NONE (-1) enum BODYPART { BP_WEAPON = 0, BP_SECWEAPON, BP_EYES, BP_HEAD, BP_SHOULDERS, BP_BODY, BP_HANDS, BP_WAIST, BP_LEGS, BP_FEET, BP_RIGHTHAND, BP_LEFTHAND, }; #define MAXBODYPARTS (12) // empty types #define WE_WALKABLE 1 #define WE_EMPTY 2 #define WE_PORTAL 3 enum NOISETYPE { N_GETANGRY, N_WALK, N_FLY, N_WARCRY, }; enum LFSIZE { 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 FLAG { F_NONE, // dummy flag // object flags F_DEAD, // object will be removed F_CREATEDBY, // object was made by lf id v0, text=real lfname F_ENCHANTABLE, // object can get +1/-1 ect 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_IDWHENUSED, // fully identify an object when worn/weilded/operated/etc // for items in shops F_SHOPITEM, // causes shops to show this item as identified F_VALUE, // how much an item is worth (over its base weight+material) // weapon/armour flags F_EQUIPPED, // val0 = where it is equipped. CLEAR WHEN OB MOVED! F_CURAMMO, // currently equipped ammo F_GOESON, // val0 = where it can be equipped. F_BONUS, // val0=bonus/penalty to damage/armour. ie. +1 sword F_THROWMISSILE, // weapon would make a good thrown missle - used by AI 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_NOPICKUP, // cannot pick this up F_IMPASSABLE, // cannot walk past this if your size if v0 or smaller F_CRUSHABLE, // if you are bigger than size v0, walking on this crushes it F_BLOCKSVIEW, // cannot see past this F_BLOCKSTHROW, // cannot throw past this F_DIETEXT, // 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, // val0 = what this turns into when dying F_NOBLESS, // can't be blessed or cursed F_NOQUALITY, // can't be masterwork / shoddy F_CORPSEOF, // this is a corpse of montype val0. F_DTCONVERT, // damtype val0 converts this to f->text 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 'mat' 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_HITCONFER, // hitting with this gives flagid=v0 // unless you pass a val1 skillcheck, diff val2 // with timeleft = text ("min-max") F_ACTIVATED, // val0 = is this object turned on? F_GRENADE, // this obkejct will drain charge when activated, then die F_EXPLODEONDEATH, // explodes when it dies, deals val0 vamage. // val1 = BIG means hit surrounding cells // val2 = ifactivated, only explodes if activated. F_EXPLODEONDAM, // explodes when it is damaged, deals val0 vamage. // val1 = BIG means hit surrounding cells // 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_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 // v0 is target requirements (los/lof) // 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 // technology flags F_TECHLEVEL, // v0 is a PR_xxx enum for tech usage skill // what can you do with this object? F_TAINTED, // will give food poisoning if you eat/drink it F_EDIBLE, // you can eat this. val1 = nutrition. 100 = a meal // -1 means "nutrition is weight x abs(val1)" F_DRINKABLE, // you can drink this. val1 = nutrition. 100 = a meal // -1 means "nutrition is weight x abs(val1)" F_OPERABLE, // can operate? 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 // doors F_DOOR, // this object is a door - ie. can open it F_OPEN, // is this door open? F_LOCKED,// door is locked F_JAMMED, // is this door jammed? // stairs / teleporters / portals F_CLIMBABLE, // this is a stiarcase, v0 = up/down/in // also use this for portals //F_STAIRDIR//, // val0 = direcion F_OPPOSITESTAIRS, // val0 = opposite kind of stairs F_MAPLINK, // val0 = map to link to. // v1/v2 = x/y // OR // text = obid to link to // ob interaction flags F_HARD, // object is hard (ie. punching it will hurt!) F_SHARP, // does damage when you step on it. v0/1 are min/max dam 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) F_CANGETWET, // object will get F_WET if hit by water // v0 = enum WETNESS. v1 = how long F_WET, // object is wet F_RUSTED, // object is rusty // v0 = enum RUSTINESS. // object mods/effects F_ONFIRE, // burning, also deals 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 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 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_CANHAVEOBMOD, // weapon can have obmod om_v0 applied F_ATTREQ, // requires attrib v0 to be at least bracket v1 //F_DAMTYPE, // val0 = damage type //F_DAM, // val0 = ndice, val1 = nsidesondie, val2 = mod F_DAM, // v0 = damtype, text = 1d1+1 F_MISSILEDAM, // val0 = dam if it hits (without speed multiplier) F_ACCURACY, // 100 - val0 = penalty to tohit% (ie. higher is better) F_UNARMEDWEP, // this is not a real weapon, ie. claws, teeth etc F_ARMOURPIERCE, // goes through armour F_TWOHANDED, // weapon uses two hands to weild F_TRIPATTACK, // weapon can trip the victim F_DISARMATTACK, // weapon can disarm the victim F_FIREARM, // this weapon is equipped in bp_secweapon, not _weapon. F_FIRESPEED, // how fast this weapon shoots projectiles F_AMMOOB, // what object this weapon fires F_RANGE, // range of projectile firing weapon F_FLAMESTRIKE, // causes fires where you hit F_BALANCE, // heals target if their maxhp < your maxhp F_REVENGE, // causes damage based on your hp // tech flags 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_DONTSHOWCHARGES, // don't show 'xx charges left' when id'd F_RECHARGEWHENOFF, // get power back when you turn it off F_REFILLWITH, // pour obj id val0 onto this to refill its charges // F_POWDER, // this item is a powder // ob appearance flags F_SHINY, // armour flags F_ARMOURRATING, // val0 * 2 = pct of damage reduced F_SHIELD, // this is a shield - use special bodyhitchance code 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 // scroll flags F_LINKSPELL, // val0 = spell this scroll will cast when read // v1 = spell power // book flags F_MANUALOF, // val0 = spellschool this book trains // ob identification flags F_HASHIDDENNAME, // whether this object class has a hidden name F_IDENTIFIED, // whether this object is fully identified // bad flags F_WALKDAM, // val0 = damtype, text = dam per sec // 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 if splev^2 F_ONGOING, // this spell has an ongoing cost //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 F_AICASTTOATTACK, // AI can cast this spell to attack // v0 is who to target 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 // player only flags F_DONEDARKMSG, // tells the game not to say 'it is very dark here' // lifeform flags / lf flags F_DEBUG, // debugging enabled F_ACCURACYMOD, // modify your accuracy by val0 F_SHIELDPENALTY, // lower your accuracy by val0 due to a cumbersome // shield F_LEVRACE, // at level v0, this race is promoted to race v1 // must apply this to the BASE race. 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_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_AUTOCMD, // val0 = how many times to repeat this F_LASTCMD, // text[0] = last command performed, v0/1 = x/y of cell, v2=various F_CANLEARN, // lf is able to learn skill val0 F_STARTOB, // val0 = %chance of starting with it, text = ob name // val1,2 = min/max amounts. if NA, min=max=1. F_STARTSKILL, // val0 = skill id F_STARTOBDT, // val0 = %chance of starting with damtype val1 F_STARTOBCLASS, // val0 = %chance of starting with obclass val1 F_STARTJOB, // val0 = %chance of starting with it, v1 = jobid F_STARTATT, // val0 = A_xxx, val0 = start bracket (ie. IQ_GENIUS) F_CORPSETYPE, // text field specifies what corpse obtype to leave F_MYCORPSE, // text field contains obid of my corpse. // (for ghosts) F_NOCORPSE, // monster's body crumbles to dust after death F_LFSUFFIX, // text = suffix. eg. "skeleton" F_VISRANGE, // how far you can see (in the light) F_VISRANGEMOD, // modifications to visrange F_GUNTARGET, // current projectile weapon target F_CASTINGSPELL, // set while the player is casting a spell // v0 is spell id F_AVOIDCURSEDOB, // for AI animals - they will avoid walking on obid 'text' // (text is a long) // ABILITY/SPELL FLAGS / ability flags / spell flags F_FAILEDINSPECT, // lf has failed an inspect check for item id v0 F_BOOSTSPELL, // v0 is active boost spell F_SWOOPRANGE, // v0 = how far a flying creature can swoop // MONSTER AI FLAGS F_XPVAL, // force xp val for killing this lf to v0 // ...OR if applied to an ability... // monsters with this abil are worth // v0 more xp. F_XPMULTIPLY, // multiply xp val for killing this lf by v0 F_PETOF, // this lf is a pet of lfid v0 // v1/2 = last known location of my owner. F_ALLYOF, // this lf is a ally of lfid v0 // v1/2 = last known location of my owner. // difference between this an 'petof' will be that // you don't get alignment penalties etc for your // ally dying. F_HOSTILE, // lf will attack the player if in sight F_FRIENDLY, // lf will attack all non-players if in sight 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_TARGET, // lf will attack lfid v0. lastknown x/y is v1/v2 F_TARGETCELL, // lf will go towards this place. val0=x,val1=y 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_NOISETEXT, // val0 is a enum NOISETYPE // text is "verb^noun" // eg. "shouts^a shout" F_SPELLCASTTEXT, // text is announcement for spellcast F_NODEATHANNOUNCE, // don't say 'the xx dies' if this lf dies F_BEHEADED, // use special corpse drop code F_SILENTMOVE, // lf makes no noise when walking/flying 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 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, // val0: # d4 to roll for maxhp per level. val1: +xx F_MPDICE, // val0: # d4 to roll for maxmp per level. val1: +xx F_JOB, // val0 = player's class/job F_NAME, // text = player's name F_XPMOD, // add/subtract this much from calculated xpval F_BLOODOB, // text = type of object to drop for blood 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_SHORTCUT, // spell keyboard shortcut. // v0=slot (0-9) // text=spell text // for monsters F_HUMANOID, // this race can wear armour / use weapons F_INSECT, // this race is classed as an insect F_ANIMAL, // this race is classed as an animal F_UNDEAD, // this race is classed as undead F_COLDBLOOD, // this race is coldblooded F_NOBODYPART, // this race doesn't have bodypart val0 F_NOPACK, // this race cannot hold objects F_NOSPELLS, // this race cannot cast spells F_INDUCEFEAR, // causes fear when you attack it F_POISONOUS, // 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 matching f->text next // to the victim F_PHALANX, // gain v0 AR if v2 or more adj monsters matching f->text F_MORALE, // gain +v0 in morale checks. // INTRINSICS F_MAGICARMOUR,// armour is magically boosted. f->text is the description // ie 'magic armour', 'force field' F_ASLEEP, // is asleep F_BEINGSTONED,// turn to stone when v0 drops to zero. (drops 1/turn) F_BLIND, // cannot see anything F_DEAF, // cannot hear 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_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? 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 in orthog dist v0 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! F_EXTRAMP, // lf has +v0 % extra maxmp F_FLYING, // lf is flying F_FASTACT, // modifier for action speed F_FASTMOVE, // modifier for move speed F_POISONED, // has food poisoning. text = what from.eg'a bad egg' F_FREEZINGTOUCH,// next thing touched turns to ice! F_GRABBEDBY,// you've been grabbed by lf id v0 F_GRABBING, // you are grabbing lf id v0 F_HEAVYBLOW, // next attack is a heavy blow F_INVISIBLE, // lifeform is invisible F_INVULNERABLE,// immune to most damage F_QUICKBITE, // deals v0 d d1 + d2 damage when you hit a bleeding victim // (bypasses armour) F_GRAVBOOSTED,// cannot walk or throw stuff F_PAIN, // take damage if you walk. v0=damtype,text is damage (xdy+z). F_PARALYZED,// cannot do anything F_FROZEN, // made of ice 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 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_RISEASGHOST, // become a ghost when you die. F_SEEINDARK, // nightvis range is val0 F_SEEINVIS, // can see invisible things F_SEEWITHOUTEYES, // doesn't need eyes to see F_STABILITY, // doesn't slip over F_STENCH, // creatures within v0 gain f_nauseated = v1 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_SLOWMOVE, // modifier for move speed F_XRAYVIS, //val0=num of walls we can see through F_CANSEETHROUGHMAT, //val0=kind of material you can see through F_SPRINTING, // v0=true: you are sprinting. false=you are tired F_TIRED, // you are too tired to sprint 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 F_PERCEPTION, // v0 = 0-20. perception level. // skills F_HASSKILL, // lf has skill v0 at level v1 F_PRACTICINGSKILL, // lf is pract skill v0 // COMBAT F_MAXATTACKS, // v0 = max # attacks this lf can make per round F_HASATTACK, // v0 = obid to use when attacking unarmed // if text is set, it overrides the damage F_EVASION, // % chance of evading an attack // healing/resting/training 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_RESTING, // are we resting? cleared on any action other than rest. // v2 = if not, NA it is the training counter. // when it hits 0, you finish trainign. F_RESTUNTILHP, // resting until we have full hp F_RESTUNTILMP, // resting until we have full mp // F_RUNNING, // are we running? // nutrition F_HUNGER, // val0 = hunger, higher = hungrier // for jobs 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_LEVFLAG, // at level v0, this job gains flagid v1, flagval0=v2, // flagtext = text // F_NULL = -1 }; // 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 }; // probabilities //#define CH_DEADENDOB 35 //#define CH_EMPTYCELLOB 3 #define CH_PILLAR 5 // Booleans #define B_FALSE (0) #define B_TRUE (-1) //#define B_TEMP (-1) //#define B_PERM (-2) //#define B_NOT (-3) enum LIGHTLEV { L_PERMDARK = -1, L_NOTLIT = 0, L_TEMP = 1, L_PERMLIGHT = 2, }; // spell targets enum SPELLTARGET { 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 }; #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 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_BIG (-1) // errors enum ERROR { E_OK = 0, E_WALLINWAY = 1, E_LFINWAY = 2, E_NOSPACE = 3, E_SELNOTHING = 4, E_ALREADYUSING = 5, E_WEARINGSOMETHINGELSE = 6, E_NOUNARMEDATTACK = 7, E_NOTEQUIPPED = 8, E_NOPICKUP = 9, E_MONSTERNEARBY = 10, E_NOEFFECT = 11, E_FAILED = 12, E_WRONGCELLTYPE = 13, E_OBINWAY = 14, E_TOOHEAVY = 15, E_NOHANDS = 16, E_NOPACK = 17, E_INSUBSTANTIAL = 18, E_WRONGOBTYPE = 19, E_CURSED = 20, E_NOLOS = 21, E_NOLOF = 22, E_IMPOSSIBLE = 23, E_NOTARGET = 24, E_NOAMMO = 25, E_GRAVBOOSTED = 26, E_NOMP = 27, E_AVOIDOB = 28, E_FROZEN = 29, E_TOOBIG = 30, E_NOTREADY = 31, E_BLIND = 32, E_GRABBEDBY = 33, E_CANTMOVE = 34, E_NOTKNOWN = 35, E_TOOPOWERFUL = 36, E_NEEDGRAB = 37, E_DOORINWAY = 38, E_NOCANNIBUL = 39, E_LOWCON = 40, E_LOWDEX = 41, E_LOWIQ = 42, E_LOWSTR = 43, E_WONT = 44, E_OFFMAP = 45, // charm failure reasons // LOWIQ = 42 E_UNDEAD = 46, }; 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_OPERATE, CMD_PICKLOCK, 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, }; // command types typedef struct command_s { enum COMMAND id; char ch; char *desc; struct command_s *next, *prev; } command_t; typedef struct map_s { int id; int depth; char *name; // name of this map enum HABITAT habitat; // eg. dungeon, forest, etc 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_ORTH]; // which map is in each direction int beingcreated; struct lifeform_s *lf,*lastlf; struct map_s *next, *prev; } map_t; //////////////// remember to modify save/load for new props!! typedef struct cell_s { map_t *map; // pointer back to map int x,y; // map coords int roomid; struct celltype_s *type; struct obpile_s *obpile; enum LIGHTLEV lit; enum LIGHTLEV origlit; int origlittimer; int littimer; char *writing; // lifeform pile struct lifeform_s *lf; // known to player? int known; // FOR CONSTRUCTION int visited; } cell_t; typedef struct glyph_s { char ch; int colour; } glyph_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? struct material_s *material; struct flagpile_s *flags; struct celltype_s *next, *prev; } celltype_t; typedef struct race_s { enum RACE id; enum RACE baseid; struct material_s *material; char *name; struct glyph_s glyph; float weight; struct flagpile_s *flags; // 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; long xp; int skillpoints; int hp,maxhp; int mp,maxmp; int alive; char *lastdam; enum DAMTYPE lastdamtype; int timespent; int sorted; int att[MAXATTS]; int baseatt[MAXATTS]; float forgettimer; struct obpile_s *pack; struct flagpile_s *flags; int created; // set to TRUE once lf creation is done. int polyrevert; // about to revert form a polymorph? // for loading long oblist[MAXPILEOBS]; int x,y; int nlos; cell_t **los; // set to TRUE after lf has being created int born; // for ai movement - don't need to save. struct cell_s *ignorecell; struct cell_s *cell; struct lifeform_s *next, *prev; } lifeform_t; typedef struct obpile_s { lifeform_t *owner;// } Only one of these cell_t *where; // } should be 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; } flagpile_t; typedef struct flag_s { enum FLAG id; int nvals; int val[3]; char *text; long obfrom; // for conferred flags, link to object->id. -1 if not conferred. // 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; #define SK_NONE -1 enum SKILL { SK_ARMOUR, SK_ATHLETICS, SK_BACKSTAB, SK_FIRSTAID, SK_LISTEN, SK_LOCKPICKING, SK_MAGITEMUSAGE, SK_RESEARCH, SK_SHIELDS, SK_SPELLCASTING, SK_STEALTH, SK_TECHUSAGE, // weaponry SK_AXES, SK_CLUBS, SK_LONGBLADES, SK_POLEARMS, SK_SHORTBLADES, SK_STAVES, SK_UNARMED, // spell schools SK_SS_ALLOMANCY, SK_SS_AIR, SK_SS_DEATH, SK_SS_DIVINATION, SK_SS_EARTH, SK_SS_FIRE, SK_SS_ICE, SK_SS_GRAVITY, SK_SS_LIFE, SK_SS_MODIFICATION, SK_SS_MENTAL, SK_SS_SUMMONING, SK_SS_TRANSLOCATION, SK_SS_WILD, }; #define MAXSKILLS 33 // 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, }; typedef struct skill_s { enum SKILL id; char *name; char *desc; 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; typedef struct knowledge_s { enum OBTYPE id; char *hiddenname; int known; struct knowledge_s *next, *prev; } knowledge_t; typedef struct job_s { enum JOB id; char *name; flagpile_t *flags; struct job_s *next, *prev; } job_t; typedef struct objectclass_s { enum OBCLASS id; char *name; char *desc; 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; 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; flagpile_t *flags; 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_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_NIMBLENESS, BR_FEEBLENESS, BR_FLIGHT, BR_GIANTSTRENGTH, BR_HEALTH, BR_IMPACT, BR_THINKING, BR_KNOWLEDGE, BR_LEVITATION, BR_FEATHERFALL, BR_ANTIMAG, BR_CONCEALMENT, BR_SHARPNESS, BR_PYROMANIA, BR_REVENGE, BR_SLOTH, BR_SPEED, BR_POWER, BR_SWIFTNESS, BR_TELEKINESIS, BR_TELEPATHY, BR_WEAKNESS, }; typedef struct brand_s { enum BRAND id; char *description; char *suffix; flagpile_t *flags; enum BODYPART bp; 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; char *desc; void *data; int heading; int valid; // used in askchoicestr } choice_t; #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