diff --git a/ai.c b/ai.c index a189d2d..6030525 100644 --- a/ai.c +++ b/ai.c @@ -302,6 +302,11 @@ object_t *aigetrangedattack(lifeform_t *lf, lifeform_t *target, enum RANGEATTACK if (ra) *ra = RA_NONE; return NULL; } + if (lfhasflag(lf, F_FEIGNINGDEATH) && target && (getcelldist(lf->cell, target->cell) == 1)) { + if (db) dblog(".oO { no ranged attack because i am feigning death and adj to my target }"); + if (ra) *ra = RA_NONE; + return NULL; + } iqb = getattrbracket(getattr(lf, A_IQ), A_IQ, NULL); if (iqb <= IQ_ANIMAL) { diff --git a/attack.c b/attack.c index 34fd82e..38ed569 100644 --- a/attack.c +++ b/attack.c @@ -881,7 +881,8 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag) // blocked by defender's shield? sprintf(attackname, "%s%s attack", attackername, getpossessive(attackername)); //difficulty = 20 + ((gethitdice(lf) - gethitdice(victim)) ); - difficulty = 20 + gethitdice(lf); + //difficulty = 20 + gethitdice(lf); + difficulty = 20 + (gethitdice(lf)*2) - gethitdice(victim); if (check_for_block(lf, victim, dam[i], damtype[i], difficulty, attackname)) { blocked = B_TRUE; break; // stop processing damage now. @@ -1283,6 +1284,9 @@ int attackob(lifeform_t *lf, object_t *o, object_t *wep, flag_t *damflag) { maxhp = 1; } + if (hasflag(wep->flags, F_UNARMEDWEP)) { + isunarmed = B_TRUE; + } getobname(wep, wepname, 1); diff --git a/data.c b/data.c index 7987887..b21efba 100644 --- a/data.c +++ b/data.c @@ -10,6 +10,7 @@ #include "spell.h" extern command_t *firstcommand,*lastcommand; +extern option_t *firstoption,*lastoption; extern map_t *firstmap; extern race_t *firstrace, *lastrace; extern raceclass_t *firstraceclass, *lastraceclass; @@ -44,6 +45,36 @@ void addbonustext(flagpile_t *fp, enum FLAG fid, char *text) { addflag(fp, fid, idx+1, NA, NA, text); } +option_t *addoption(enum OPTION id, char *text, int def) { + option_t *a; + int thisletter = '\0'; + + // add to the end of the list + if (firstoption == NULL) { + firstoption = malloc(sizeof(celltype_t)); + a = firstoption; + a->prev = NULL; + thisletter = 'a'; + } else { + // go to end of list + a = lastoption; + a->next = malloc(sizeof(option_t)); + a->next->prev = a; + a = a->next; + thisletter = lastoption->letter + 1; + } + lastoption = a; + a->next = NULL; + + // set props + a->text = strdup(text); + a->def = def; + a->enabled = def; + a->letter = thisletter; + + return a; +} + command_t *addcommand(enum COMMAND id, char ch, char *desc) { command_t *a; @@ -148,7 +179,6 @@ void initjobs(void) { addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blocks of chocolate"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 vials of ambrosia"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "10 blessed scrolls of identify"); - addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "newt corpse"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "potion of water"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "salt"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather armour"); @@ -1141,6 +1171,7 @@ void initobjects(void) { addoc(OC_FURNITURE, "Furniture", "Various kinds of mundane (or not so mundane) furnishings.", '\\', C_BROWN, RR_FREQUENT); addocnoun(lastobjectclass, "furniture"); addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_RARITY, H_CAVE, RR_RARE, NA, NULL); // override for habitat addoc(OC_TERRAIN, "Terrain", "Water, etc.", '\\', C_GREY, RR_NEVER); addoc(OC_TRAP, "Trap", "Fiendish traps.", '^', C_GREY, RR_RARE); addocnoun(lastobjectclass, "trap"); @@ -1229,10 +1260,12 @@ void initobjects(void) { addflag(lastobjectclass->flags, F_RARITY, H_SEWER, NA, RR_COMMON, NULL); addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_RARITY, H_CAVE, RR_UNCOMMON, NA, NULL); // override for habitat addoc(OC_TOOLS, "Tools", "Useful items, from the common to the obscure.", ']', C_GREY, RR_RARE); addocnoun(lastobjectclass, "tool"); addflag(lastobjectclass->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addflag(lastobjectclass->flags, F_RARITY, H_CAVE, RR_UNCOMMON, NA, NULL); // override for habitat addoc(OC_MISC, "Miscellaneous", "This could be anything.", '\\', C_GREY, RR_COMMON); addoc(OC_EFFECT, "Environmental Effects", "Smoke, fire, etc.", '}', C_GREY, RR_NEVER); addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1288,6 +1321,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_BLUE, '_', NA, NULL); addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 90, RR_UNCOMMON, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DTCONVERT, DT_COLD, NA, NA, "sheet of ice"); @@ -1354,6 +1388,7 @@ void initobjects(void) { addot(OT_HOLEINGROUND, "hole in the ground", "A gaping hole in the ground.", MT_NOTHING, 0, OC_DFEATURE, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_GLYPH, C_BLUE, '^', NA, NULL); addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, NULL); addflag(lastot->flags, F_DONTSHOWDEST, B_TRUE, NA, NA, NULL); @@ -1373,6 +1408,19 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL); + addot(OT_TUNNELDOWN, "tunnel leading down", "A wide tunnel leading downwards.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE); + addflag(lastot->flags, F_GLYPH, C_BROWN, '>', NA, NULL); + addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, NULL); + addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TUNNELUP, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addot(OT_TUNNELUP, "tunnel leading up", "A wide tunnel leading upwards.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE); + addflag(lastot->flags, F_GLYPH, C_BROWN, '<', NA, NULL); + addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, NULL); + addflag(lastot->flags, F_OPPOSITESTAIRS, OT_TUNNELDOWN, NA, NA, NULL); + addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); + addot(OT_STAIRSDOWN, "staircase going down", "A stone staircase winding downwards.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE); addflag(lastot->flags, F_GLYPH, NA, '>', NA, NULL); addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, NULL); @@ -1390,7 +1438,8 @@ void initobjects(void) { // buildings addot(OT_MOTEL, "motel", "A small structure providing cheap overnight rooms for rent", MT_METAL, 500, OC_BUILDING, SZ_LARGE); - addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_SHOPMENU, 0, MA_GOTOMENU, SM_REST, "a:rent a room"); addflag(lastot->flags, F_SHOPMENU, 1, MA_GOTOMENU, SM_PURCHASEITEMS, "b:buy provisions"); @@ -1403,6 +1452,7 @@ void initobjects(void) { addot(OT_SHOPARMOUR, "armour store", "A small kiosk dealing in armour.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_SHOPMENU, 0, MA_GOTOMENU, SM_PURCHASEITEMS, "a:buy something"); addflag(lastot->flags, F_SHOPMENU, 1, MA_GOTOMENU, SM_DONATE, "d:donate something"); @@ -1412,6 +1462,7 @@ void initobjects(void) { } addot(OT_SHOPBOOK, "book store", "A small kiosk dealing in books.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_VERYRARE, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); make_basic_shop(lastot->flags); for (i = 0; i < 10; i++) { @@ -1421,6 +1472,7 @@ void initobjects(void) { } addot(OT_SHOPFOOD, "food vendor", "A small kiosk dealing in food.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); make_basic_shop(lastot->flags); for (i = 0; i < 10; i++) { @@ -1428,6 +1480,7 @@ void initobjects(void) { } addot(OT_SHOPGENERAL, "general store", "A small kiosk which sells various objects.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); make_basic_shop(lastot->flags); for (i = 0; i < 10; i++) { @@ -1435,6 +1488,7 @@ void initobjects(void) { } addot(OT_SHOPHARDWARE, "hardware store", "A small kiosk which sells tools and technology.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); make_basic_shop(lastot->flags); for (i = 0; i < 10; i++) { @@ -1444,6 +1498,7 @@ void initobjects(void) { } addot(OT_SHOPPOTION, "potion store", "A small kiosk dealing in liqour and potions.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); make_basic_shop(lastot->flags); for (i = 0; i < 10; i++) { @@ -1451,6 +1506,7 @@ void initobjects(void) { } addot(OT_SHOPRING, "jewellery store", "A small kiosk dealing in rings and amulets.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_VERYRARE, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); make_basic_shop(lastot->flags); for (i = 0; i < 10; i++) { @@ -1458,6 +1514,7 @@ void initobjects(void) { } addot(OT_SHOPWEAPON, "weapon store", "A small kiosk dealing in weapons.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_SHOPMENU, 0, MA_GOTOMENU, SM_PURCHASEITEMS, "a:buy something"); addflag(lastot->flags, F_SHOPMENU, 1, MA_GOTOMENU, SM_DONATE, "d:donate something"); @@ -1467,6 +1524,7 @@ void initobjects(void) { } addot(OT_TEMPLE, "temple", "A small structure dedicated to one of the gods.", MT_METAL, 500, OC_BUILDING, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_MAKESNOISE, 33, 3, NA, "voices chanting."); addflag(lastot->flags, F_SHOPMENU, 0, MA_GOTOMENU, 1, "a:speak to a deacon (earthly concerns)"); @@ -1538,6 +1596,7 @@ void initobjects(void) { addot(OT_TRAPARROW, "arrow trap", "A pressure plate which causes arrows to shoot at you.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 25, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 76, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 76, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1548,6 +1607,7 @@ void initobjects(void) { addot(OT_TRAPARROWP, "poison arrow trap", "A pressure plate which causes poisoned arrows to shoot at you.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 25, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 69, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 69, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1558,6 +1618,7 @@ void initobjects(void) { addot(OT_TRAPPIT, "pit trap", "A pressure plate which causes the floor to drop away.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 20, B_TRUE, 22, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 85, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_SECRET, 20, NA, NA, NULL); @@ -1566,6 +1627,7 @@ void initobjects(void) { addot(OT_TRAPROCK, "falling rock trap", "A pressure plate which causes heavy rocks to drop from the ceiling.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 20, B_TRUE, 22, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 85, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1576,6 +1638,7 @@ void initobjects(void) { addot(OT_TRAPSUMMON, "summoning trap", "A magical trap which causes a monster to appear.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 60, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREEN, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1586,6 +1649,7 @@ void initobjects(void) { addot(OT_TRAPTRIP, "tripwire", "A thin wire at ankle height.", MT_WIRE, 0.1, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 15, B_FALSE, 20, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 90, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1614,6 +1678,7 @@ void initobjects(void) { addot(OT_TRAPALARM, "alarm trap", "A trap which sounds a loud siren.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 18, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); @@ -1625,6 +1690,7 @@ void initobjects(void) { addot(OT_TRAPEBLAST, "energy blast trap", "A magical trap which blasts its victim with energy.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_MAGENTA, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); @@ -1636,6 +1702,7 @@ void initobjects(void) { addot(OT_TRAPFIRE, "fire trap", "A trap which fires a pillar of flame.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 59, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 59, NA, NULL); addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); @@ -1647,6 +1714,7 @@ void initobjects(void) { addot(OT_TRAPGAS, "gas trap", "A trap which releases poisonous gas.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 27, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 69, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 69, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1658,6 +1726,7 @@ void initobjects(void) { addot(OT_TRAPMINE, "landmine trap", "A buried, pressure-sensitive explosive device.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); addflag(lastot->flags, F_TRAP, 30, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 50, NA, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 20, NA, NULL); addflag(lastot->flags, F_OBJECTTRAP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); @@ -1670,6 +1739,7 @@ void initobjects(void) { addot(OT_TRAPTELEPORT, "teleportation trap", "A magical dispersal field.", MT_NOTHING, 0, OC_TRAP, SZ_LARGE); addflag(lastot->flags, F_TRAP, NA, B_TRUE, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_GLYPH, C_MAGENTA, '^', NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -1689,7 +1759,8 @@ void initobjects(void) { // rocks addot(OT_BOULDER, "boulder", "A massive stone boulder.", MT_STONE, 80, OC_ROCK, SZ_HUGE); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, ""); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_GLYPH, NA, '\'', NA, NULL); addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL); @@ -1715,6 +1786,7 @@ void initobjects(void) { addot(OT_STATUE, "statue", "A stone statue of a monster.", MT_STONE, 80, OC_ROCK, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, ""); addflag(lastot->flags, F_RARITY, H_VILLAGE, 80, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_GLYPH, NA, '\'', NA, NULL); addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); // will be overridden addflag(lastot->flags, F_PUSHABLE, B_TRUE, NA, NA, NULL); @@ -1727,6 +1799,7 @@ void initobjects(void) { addot(OT_STONE, "stone", "A medium-sized roundish stone.", MT_STONE, 0.5, OC_ROCK, SZ_TINY); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); @@ -1737,6 +1810,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_WHITE, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_COMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 250, NA, NA, NULL); @@ -1744,6 +1818,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_MAGENTA, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_COMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 15, NA, NA, NULL); @@ -1751,6 +1826,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_WHITE, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_UNCOMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 1000, NA, NA, NULL); @@ -1758,6 +1834,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_GREEN, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_UNCOMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 650, NA, NA, NULL); @@ -1765,6 +1842,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_GREY, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_COMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 70, NA, NA, NULL); @@ -1772,6 +1850,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_WHITE, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_COMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 30, NA, NA, NULL); @@ -1779,6 +1858,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_RED, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_COMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 110, NA, NA, NULL); @@ -1786,6 +1866,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_CYAN, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_UNCOMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 850, NA, NA, NULL); @@ -1793,6 +1874,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_BLUE, '*', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_STOMACH, 100, RR_COMMON, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 60, NA, NA, NULL); @@ -1802,6 +1884,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FEELTEXT, NA, NA, NA, "some ash"); @@ -1810,6 +1893,7 @@ void initobjects(void) { addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_EXPLODEONDAM, NA, NA, NA, "1d6"); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); @@ -1819,6 +1903,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, RR_RARE, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); @@ -1829,6 +1914,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, RR_RARE, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_POWDER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "pile of ash"); @@ -1916,7 +2002,8 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_YELLOW, '%', NA, NULL); addflag(lastot->flags, F_EDIBLE, B_TRUE, 50, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); - addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_RARE, NULL); addot(OT_BANANASKIN, "banana skin", "A slippery banana skin.", MT_FOOD, 0.1, OC_FOOD, SZ_TINY); addflag(lastot->flags, F_GLYPH, C_YELLOW, '%', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); @@ -1927,6 +2014,7 @@ void initobjects(void) { addflag(lastot->flags, F_EDIBLE, B_TRUE, 8, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_NUMAPPEAR, 1, 15, NA, ""); addot(OT_BREADFRESH, "loaf of fresh bread", "A freshly-baked loaf of bread.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); addflag(lastot->flags, F_GLYPH, C_BROWN, '%', NA, NULL); @@ -1970,11 +2058,13 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_YELLOW, '%', NA, NULL); addflag(lastot->flags, F_EDIBLE, B_TRUE, 85, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addot(OT_GARLIC, "clove of garlic", "A very pungent clove of raw garlic. ", MT_FOOD, 0.1, OC_FOOD, SZ_TINY); addflag(lastot->flags, F_GLYPH, C_BROWN, '%', NA, NULL); addflag(lastot->flags, F_EDIBLE, B_TRUE, 5, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); addot(OT_HOTDOG, "hot dog", "A chunk of meat sandwiched between two pieces of bread. Temporarily increases strength, and provides some healing.", MT_FOOD, 0.5, OC_FOOD, SZ_TINY); addflag(lastot->flags, F_GLYPH, C_RED, '%', NA, NULL); @@ -1989,6 +2079,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_FREQUENT, NULL); addflag(lastot->flags, F_RARITY, H_SWAMP, 100, RR_FREQUENT, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "mushroom"); addot(OT_MUSHROOMTOAD, "toadstool", "A poisonous variety of mushroom.", MT_FOOD, 0.2, OC_FOOD, SZ_TINY); @@ -1997,6 +2088,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_FREQUENT, NULL); addflag(lastot->flags, F_RARITY, H_SWAMP, 100, RR_FREQUENT, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "mushroom"); addot(OT_MUSHROOMSTUFFED, "stuffed mushroom", "A large brown mushroom stuffed with breadcrumbs. This healthy food slightly increases your maximum hit points..", MT_FOOD, 0.2, OC_FOOD, SZ_TINY); @@ -3798,91 +3890,93 @@ void initobjects(void) { // books addot(OT_MANUAL, "manual", "Teaches you one level of its subject matter.", MT_PAPER, 1.5, OC_BOOK, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_VERYRARE, NULL); addot(OT_SPELLBOOK, "spellbook", "Teaches you the spells contained within.", MT_PAPER, 1.5, OC_BOOK, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_VERYRARE, NULL); // wands addot(OT_WAND_CREATEFOOD, "wand of culinary abundance", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_CREATEFOOD, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_NONE, NA, NA, NULL); addot(OT_WAND_KNOCK, "wand of opening", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_UNCOMMON, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_KNOCK, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_DOOR, NA, NA, NULL); addot(OT_WAND_LIGHT, "wand of light", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 83, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 83, RR_UNCOMMON, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_LIGHT, 3, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, TR_NEEDLOF, NA, NULL); addot(OT_WAND_NULLIFY, "wand of nullification", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 83, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 83, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_NULLIFY, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, TR_NEEDLOF, NA, NULL); addot(OT_WAND_REVEALHIDDEN, "wand of reveal hidden", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_UNCOMMON, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_REVEALHIDDEN, NA, NA, NULL); addot(OT_WAND_SLOW, "wand of slowness", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_SLOW, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addot(OT_WAND_DIGGING, "wand of digging", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_DIG, NA, NA, NULL); //addflag(lastot->flags, F_OPERNEEDTARGET, TT_NONE, NA, NA, NULL); addot(OT_WAND_COLD, "wand of cold", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 73, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_COLDRAY, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addot(OT_WAND_FIRE, "wand of fire", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 73, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_FIREDART, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addot(OT_WAND_HASTE, "wand of haste", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 70, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_HASTE, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); addot(OT_WAND_WEAKNESS, "wand of enfeeblement", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 70, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_WEAKEN, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addot(OT_WAND_WONDER, "wand of wonder", "Produces random effects.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 70, RR_RARE, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_NONE, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addot(OT_WAND_INVIS, "wand of invisibility", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 65, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_INVISIBILITY, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, NA, NA, NULL); addot(OT_WAND_DISPERSAL, "wand of dispersal", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 65, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_DISPERSAL, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER|TT_OBJECT, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); addot(OT_WAND_FIREBALL, "wand of fireball", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 65, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_FIREBALL, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addot(OT_WAND_DETONATION, "wand of detonation", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 60, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_DETONATE, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER|TT_DOOR, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); addot(OT_WAND_POLYMORPH, "wand of polymorph", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 60, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_POLYMORPH, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addot(OT_WAND_TURNUNDEAD, "wand of turn undead", "A limited-use magical wand which casts the imbued spell.", MT_METAL, 0.5, OC_WAND, SZ_SMALL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 72, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 72, RR_RARE, NULL); addflag(lastot->flags, F_LINKSPELL, OT_S_TURNUNDEAD, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDTARGET, TT_MONSTER, NA, NA, NULL); @@ -3909,7 +4003,8 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_BLIND, B_TRUE, NA, NULL); addflag(lastot->flags, F_VALUE, 15, NA, NA, NULL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addot(OT_CALTROP, "caltrop", "Connected metal spikes arranged such that one will always point upwards.", MT_METAL, 0.2, OC_TOOLS, SZ_TINY); addflag(lastot->flags, F_STACKABLE, NA, NA, NA, NULL); @@ -4005,12 +4100,14 @@ void initobjects(void) { addflag(lastot->flags, F_PICKLOCKS, 10, B_DIEONFAIL, NA, NULL); addot(OT_PANPIPES, "set of panpipes", "A set of musical pipes.", MT_METAL, 0.5, OC_TOOLS, SZ_TINY); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastot->flags, F_VALUE, 75, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addot(OT_PICKAXE, "pickaxe", "A heavy tool for breaking rock.", MT_METAL, 8, OC_TOOLS, SZ_MEDIUM); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastot->flags, F_VALUE, 75, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_HELPSDIG, 10, NA, NA, NULL); @@ -4018,6 +4115,7 @@ void initobjects(void) { addot(OT_ROPE, "rope", "A long length of strong rope.", MT_CLOTH, 5, OC_TOOLS, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastot->flags, F_VALUE, 35, NA, NA, NULL); addflag(lastot->flags, F_HELPSCLIMB, 3, NA, NA, NULL); @@ -4120,6 +4218,7 @@ void initobjects(void) { addot(OT_SAFEBOX, "safebox", "A small metal container for safely storing valuables.", MT_METAL, 2, OC_TOOLS, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 77, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastot->flags, F_VALUE, 150, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_YELLOW, '(', NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); @@ -4560,6 +4659,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, ',', NA, NULL); // should really be dark grey addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FLAMMABLE, 5, NA, NA, "medium fire"); addflag(lastot->flags, F_DRINKABLE, B_TRUE, NA, NA, NULL); @@ -4577,6 +4677,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_BLUE, ',', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_RARITY, H_SWAMP, 90, RR_FREQUENT, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); @@ -4592,6 +4693,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_BROWN, '~', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 90, NA, NULL); addflag(lastot->flags, F_RARITY, H_SWAMP, 90, RR_COMMON, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); @@ -4607,6 +4709,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_BLUE, ',', NA, NULL); addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 90, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_SWAMP, 90, RR_FREQUENT, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); @@ -4628,6 +4731,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, C_BLUE, '~', NA, NULL); addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 85, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_SWAMP, 90, RR_FREQUENT, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); @@ -4647,6 +4751,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_RED, ',', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 60, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_COSMETIC, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); @@ -4655,7 +4760,8 @@ void initobjects(void) { addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); - addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 50, RR_UNCOMMON, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_SLIPPERY, 1, NA, NA, NULL); addflag(lastot->flags, F_OBDIETEXT, NA, NA, NA, "evaporates"); @@ -4672,6 +4778,7 @@ void initobjects(void) { addflag(lastot->flags, F_GLYPH, NA, ',', NA, NULL); addflag(lastot->flags, F_RARITY, H_VILLAGE, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_SLIPPERY, 1, NA, NA, NULL); addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "blood stain"); @@ -4690,6 +4797,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, NA, '~', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 65, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_SLIPPERY, 3, NA, NA, NULL); addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "blood stain"); @@ -4747,6 +4855,7 @@ void initobjects(void) { addot(OT_CANDELABRUM, "candelabrum", "A large (and heavy) decorative candle, about human height.", MT_METAL, 60, OC_FURNITURE, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_YELLOW, '\\', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 85, RR_RARE, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERONOFF, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACTIVATEPREFIX, NA, NA, NA, "lit"); @@ -4772,11 +4881,13 @@ void initobjects(void) { addot(OT_FIREPLACE, "fireplace", "A roaring fireplace.", MT_STONE, 200, OC_FURNITURE, SZ_LARGE); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_RARE, NULL); addflag(lastot->flags, F_GLYPH, C_RED, '\\', NA, NULL); addflag(lastot->flags, F_PRODUCESLIGHT, 6, NA, IFACTIVE, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ONFIRE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_ONLYINROOM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); @@ -5075,6 +5186,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, '^', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 86, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 86, NA, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 88, NA, NULL); addflag(lastot->flags, F_RESTRICTMOVEMENT, 25, B_TRUE, B_TRUE, NULL); addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); @@ -5844,6 +5956,7 @@ void initobjects(void) { addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_MISSILEDAM, 1, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); @@ -5855,6 +5968,7 @@ void initobjects(void) { addflag(lastot->flags, F_MISSILEDAM, 1, NA, NA, ""); addflag(lastot->flags, F_ARMOURPIERCE, 10, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 67, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); @@ -5863,6 +5977,7 @@ void initobjects(void) { addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_MISSILEDAM, 0, NA, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_NUMAPPEAR, 1, 4, NA, NULL); addflag(lastot->flags, F_HITCONFER, F_ASLEEP, SC_CON, 27, "20-30"); addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, ST_ASLEEP, NA, NULL); @@ -5880,6 +5995,7 @@ void initobjects(void) { addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_MISSILEDAM, 1, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 25, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); @@ -5889,6 +6005,7 @@ void initobjects(void) { addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_MISSILEDAM, 0, NA, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_NUMAPPEAR, 1, 2, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); @@ -5900,6 +6017,7 @@ void initobjects(void) { addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_MISSILEDAM, 3, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 90, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 2, NA, ""); addflag(lastot->flags, F_OBHP, 3, 3, NA, ""); addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); @@ -5907,6 +6025,7 @@ void initobjects(void) { addot(OT_ARROW, "arrow", "A sharp wooden arrow.", MT_WOOD, 0.1, OC_MISSILE, SZ_SMALL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 85, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); @@ -5918,6 +6037,7 @@ void initobjects(void) { addot(OT_BOLT, "bolt", "A sharp metal spike, meant for firing from a crossbow.", MT_METAL, 0.25, OC_MISSILE, SZ_SMALL); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_NOOBDIETEXT, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CANHAVEOBMOD, OM_POISONED, 17, NA, NULL); @@ -5927,6 +6047,7 @@ void initobjects(void) { addot(OT_BULLET, "bullet", "A regular gun bullet.", MT_METAL, 0.1, OC_MISSILE, SZ_MINI); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); @@ -5937,6 +6058,7 @@ void initobjects(void) { addot(OT_RUBBERBULLET, "rubber bullet", "A rubber gun bullet - does not do much damage.", MT_RUBBER, 0.05, OC_MISSILE, SZ_MINI); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, NA, RR_COMMON, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 10, NA, ""); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); @@ -5948,6 +6070,7 @@ void initobjects(void) { addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_MISSILEDAM, 4, NA, NA, ""); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, ""); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, ""); addflag(lastot->flags, F_NUMAPPEAR, 1, 3, NA, ""); addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 15, NA, NULL); @@ -5955,6 +6078,7 @@ void initobjects(void) { // axes addot(OT_AXE, "axe", "A short pole with a heavy, wedge-shaped blade for chopping.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 90, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 4, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_CHOP, 6, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 4, NA, NULL); @@ -5964,6 +6088,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addot(OT_BATTLEAXE, "battleaxe", "An large axe specifically designed for combat.", MT_METAL, 8, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 8, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_CHOP, 11, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 5, NA, NULL); @@ -5973,6 +6098,7 @@ void initobjects(void) { addflag(lastot->flags, F_ATTREQ, A_STR, 13, 10, NULL); addot(OT_GREATAXE, "greataxe", "An enormous axe made designed for combat.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 50, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 180, NA, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 10, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_CHOP, 18, NA, NULL); @@ -5984,6 +6110,7 @@ void initobjects(void) { addflag(lastot->flags, F_ATTREQ, A_STR, 15, 15, NULL); addot(OT_HANDAXE, "hand axe", "A fast one-handed axe, ideal for throwing.", MT_METAL, 2.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 4, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_CHOP, 7, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); @@ -5994,6 +6121,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addot(OT_HATCHET, "hatchet", "Similar to a handaxe but weighted at the head. A fast one-handed axe, ideal for throwing.", MT_METAL, 4, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 6, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_CHOP, 8, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); @@ -6003,6 +6131,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 6, NA, NA, NULL); addot(OT_WARAXE, "war axe", "An axe made for combat.", MT_METAL, 7, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 8, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_CHOP, 12, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 5, NA, NULL); @@ -6013,6 +6142,7 @@ void initobjects(void) { // short blades addot(OT_COMBATKNIFE, "combat knife", "A sharp knife designed for military use.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 65, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 65, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 5, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 3, NA, NULL); @@ -6025,6 +6155,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); addot(OT_CUTLASS, "cutlass", "An accurate, light-weight pirate blade.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 8, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 4, NA, NULL); @@ -6035,6 +6166,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_DAGGER, "dagger", "A short stabbing weapon with a pointed blade.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 90, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 4, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_SLASH, 4, NA, NULL); @@ -6049,6 +6181,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBEDIFFMAT, MT_BONE, 10, NA, NULL); addot(OT_FORK, "fork", "A common kitchen fork.", MT_METAL, 0.2, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 2, NA, NULL); addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); @@ -6056,6 +6189,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addot(OT_KNIFE, "knife", "A moderately sharp stabbing tool.", MT_METAL, 0.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 3, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 3, NA, NULL); @@ -6067,12 +6201,14 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addot(OT_MEATCLEAVER, "meat cleaver", "A short, heavy kitchen knife. Not very accurate but its weight makes it capable of dealing critical blows.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 4, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 15, NA, NA, NULL); addot(OT_ORNDAGGER, "ornamental dagger", "This dagger is pretty, but not particularly effective.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 50, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL); addflag(lastot->flags, F_SHINY, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 3, NA, NULL); @@ -6082,6 +6218,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addot(OT_QUICKBLADE, "quickblade", "A short blade of exceptional quality and balance, it allows its bearar to attack faster than would seem possible.", MT_METAL, 3.0, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 73, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 4, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_SLASH, 4, NA, NULL); @@ -6091,6 +6228,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_RAPIER, "rapier", "A long, narrow French sword lacking a cutting edge. Made for stabbing.", MT_METAL, 3.5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 7, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); @@ -6100,6 +6238,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_PIERCE, NA, NA, NULL); addot(OT_SHORTSWORD, "gladius", "A short gladiator blade. Designed for stabbing rather than slashing.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 90, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 6, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_SLASH, 6, NA, NULL); addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); @@ -6110,6 +6249,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_SICKLE, "sickle", "A hand-held agricultural tool with a curved blade.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 60, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 6, NA, NULL); addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); @@ -6117,6 +6257,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); addot(OT_STEAKKNIFE, "steak knife", "A common kitchen knife.", MT_METAL, 0.2, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 50, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 2, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 2, NA, NULL); @@ -6131,6 +6272,7 @@ void initobjects(void) { // long blades addot(OT_BASTARDSWORD, "bastard sword", "Very large, heavy sword.", MT_METAL, 8, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 2, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_SLASH, 12, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 12, NA, NULL); @@ -6142,6 +6284,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 5, NA, NULL); addot(OT_FALCHION, "falchion", "A single-edged heavy sword made for chopping.", MT_METAL, 6.5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 61, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 61, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 4, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_CHOP, 11, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6150,6 +6293,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addot(OT_GREATSWORD, "greatsword", "A massive two-handed sword.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 55, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 55, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 180, NA, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 2, NA, NA, ""); addflag(lastot->flags, F_DAM, DT_SLASH, 15, NA, NULL); @@ -6162,6 +6306,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); addot(OT_LONGSWORD, "longsword", "Standard issue long slashing weapon.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 9, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 9, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6173,6 +6318,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_ORNSWORD, "ornamental sword", "A gleaming (but quite blunt) blade.", MT_METAL, 6, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 50, NA, NULL); addflag(lastot->flags, F_SHINY, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 5, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); @@ -6180,6 +6326,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_SCIMITAR, "scimitar", "A fast, sharp, curved blade.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 90, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 8, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6191,6 +6338,7 @@ void initobjects(void) { // polearms addot(OT_GLAIVE, "glaive", "A single-edged blade attached to a long pole.", MT_METAL, 10, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 73, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 12, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 6, NA, NULL); @@ -6202,6 +6350,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addot(OT_GUISARME, "guisarme", "A hooked polearm, made by attaching a hook to a spear shaft.", MT_METAL, 10, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 67, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_TRIPLF, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); @@ -6215,6 +6364,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addot(OT_HALBERD, "halberd", "A spiked axe blade mounted on a long shaft, with a hook on the back.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 71, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 71, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 130, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_TRIPLF, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 4, NA, NA, ""); @@ -6229,6 +6379,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); addot(OT_LANCE, "lance", "A pole weapon designed for use while mounted.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 67, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 140, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 11, NA, NULL); @@ -6240,6 +6391,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addot(OT_RANSEUR, "ranseur", "A long spear and cross hilt, resembling a pole-mounted sai. Good for disarming.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 67, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_DISARMLF, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 120, NA, NA, NULL); @@ -6252,6 +6404,7 @@ void initobjects(void) { addflag(lastot->flags, F_ATTREQ, A_AGI, 13, 5, NULL); addot(OT_SCYTHE, "scythe", "An agricultural hand tool for mowing grass, or reaping crops.", MT_METAL, 6, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 8, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); @@ -6260,6 +6413,7 @@ void initobjects(void) { addflag(lastot->flags, F_ATTREQ, A_STR, 9, 3, NULL); addot(OT_SPEAR, "spear", "A long pole with a sharpened head.", MT_METAL, 9, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 140, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 10, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 6, NA, NULL); @@ -6273,6 +6427,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addot(OT_TRIDENT, "trident", "A three-pronged stabbing weapon.", MT_METAL, 5, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 10, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6284,6 +6439,7 @@ void initobjects(void) { // staves addot(OT_QUARTERSTAFF, "quarterstaff", "A long, stout pole.", MT_WOOD, 4, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 8, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); @@ -6296,6 +6452,7 @@ void initobjects(void) { addot(OT_BAMBOOSTAFF, "bamboo staff", "A long hard pole made from bamboo.", MT_WOOD, 3, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 85, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 9, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); @@ -6308,6 +6465,7 @@ void initobjects(void) { addot(OT_BLADEDSTAFF, "bladed staff", "A long wooden pole with blades on either end.", MT_WOOD, 5, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 85, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 12, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 8, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); @@ -6321,6 +6479,7 @@ void initobjects(void) { addot(OT_IRONSTAFF, "iron staff", "A long, stout metal pole.", MT_METAL, 8, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 60, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 10, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); @@ -6337,6 +6496,7 @@ void initobjects(void) { addot(OT_WIZARDSTAFF, "neophyte staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_BROWN, ')', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_RARE, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6349,6 +6509,7 @@ void initobjects(void) { addot(OT_WIZARDSTAFF2, "enchanter staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_BROWN, ')', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_RARE, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6362,6 +6523,7 @@ void initobjects(void) { addot(OT_WIZARDSTAFF3, "sorcerer staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_BROWN, ')', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_RARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_RARE, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6374,6 +6536,7 @@ void initobjects(void) { addot(OT_WIZARDSTAFF4, "spellbinder staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_BROWN, ')', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_VERYRARE, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6387,6 +6550,7 @@ void initobjects(void) { addot(OT_WIZARDSTAFF5, "warlock staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_BROWN, ')', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_VERYRARE, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6400,6 +6564,7 @@ void initobjects(void) { addot(OT_WIZARDSTAFF6, "archmagi staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_BROWN, ')', NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_VERYRARE, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, RR_VERYRARE, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 100, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6413,6 +6578,7 @@ void initobjects(void) { // clubs (bashing) addot(OT_CLUB, "club", "A heavy, blunt wooden instrument to hit things with.", MT_WOOD, 8, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 6, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); @@ -6421,6 +6587,7 @@ void initobjects(void) { addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); addot(OT_FLAIL, "flail", "A flexible chain attached to a heavy weight.", MT_METAL, 9, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 8, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); @@ -6430,6 +6597,7 @@ void initobjects(void) { addflag(lastot->flags, F_OBATTACKDELAY, 125, NA, NA, NULL); addot(OT_FLAILHEAVY, "heavy flail", "A flexible chain attached to a very heavy weight.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 115, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 10, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6440,6 +6608,7 @@ void initobjects(void) { addflag(lastot->flags, F_OBATTACKDELAY, 125, NA, NA, NULL); addot(OT_GREATCLUB, "great club", "An enormous, very heavy, blunt instrument to hit things with.", MT_STONE, 15, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 50, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 200, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 15, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6448,6 +6617,7 @@ void initobjects(void) { addflag(lastot->flags, F_ATTREQ, A_STR, 15, 15, NULL); addot(OT_MACE, "mace", "A weapon with a heavy head on a solid shaft used to bludgeon opponents.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 90, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 9, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 4, NA, NA, ""); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6457,6 +6627,7 @@ void initobjects(void) { addflag(lastot->flags, F_OBATTACKDELAY, 125, NA, NA, NULL); addot(OT_MORNINGSTAR, "morningstar", "A heavy, spiked mace. Its weight makes it good for penetrating armour.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 12, NA, NULL); addflag(lastot->flags, F_ARMOURPIERCE, 6, NA, NA, ""); @@ -6477,12 +6648,14 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); addot(OT_SHILLELAGH, "shillelagh", "An small cudgel with a strap, lightweight yet surprisingly effective. Irish in origin.", MT_WOOD, 2, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 5, NA, NULL); addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_STICK, "stick", "A sturdy wooden stick. It's brown and sticky.", MT_WOOD, 0.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 2, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); @@ -6494,6 +6667,7 @@ void initobjects(void) { // exotic weapons addot(OT_KATANA, "katana", "A long, finely balanced blade. Less raw power then a standard longsword, but its weight gives it a higher critical chance.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 70, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, 6, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 6, NA, NULL); addflag(lastot->flags, F_ALTDAM, DT_BASH, 3, NA, NULL); @@ -6506,6 +6680,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_PIERCE, NA, NA, NULL); addot(OT_NUNCHAKU, "nunchaku", "Two stout sticks connected with a short chain. Good for disarming.", MT_WOOD, 4.5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_DISARMLF, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, 7, NA, NULL); addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); @@ -6515,6 +6690,7 @@ void initobjects(void) { addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_SAI, "sai", "A dagger with two long prongs on either side, made to trap opponents' weapons.", MT_METAL, 1.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 81, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 81, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, 4, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_DISARMLF, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); @@ -6525,6 +6701,7 @@ void initobjects(void) { // projectile weapons addot(OT_BOW, "short bow", "A weapon which projects arrows via its elasticity.", MT_WOOD, 5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FIRESPEED, 6, NA, NA, NULL); @@ -6538,6 +6715,7 @@ void initobjects(void) { addot(OT_CROSSBOW, "crossbow", "A standard crossbow. Very powerful, but slow to reload and needs high strength to use.", MT_WOOD, 8, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FIRESPEED, 10, NA, NA, NULL); @@ -6550,6 +6728,7 @@ void initobjects(void) { addot(OT_CROSSBOWHAND, "hand crossbow", "A small wrist-mounted crossbow. Less powerful and accurate than its full-sized sibling, the hand crossbow's primary strength is its ability to fire multiple shots before reloading.", MT_WOOD, 3, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FIRESPEED, 5, NA, NA, NULL); @@ -6561,6 +6740,7 @@ void initobjects(void) { addot(OT_LONGBOW, "longbow", "A very large (human-sized) bow, capable of firing arrows with great power.", MT_WOOD, 7, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FIRESPEED, 8, NA, NA, NULL); @@ -6573,6 +6753,7 @@ void initobjects(void) { addot(OT_REVOLVER, "revolver", "Basic one-handed firearm.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 60, NA, NULL); addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); //addflag(lastot->flags, F_DAMTYPE, DT_BASH, NA, NA, NULL); @@ -6587,6 +6768,7 @@ void initobjects(void) { addot(OT_SHOTGUN, "shotgun", "Powerful but short-ranged gun.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 60, NA, NULL); addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); @@ -6599,6 +6781,7 @@ void initobjects(void) { addot(OT_SLING, "sling", "Stretchy piece of rubber for launching projectiles.", MT_RUBBER, 0.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); + addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); addflag(lastot->flags, F_FIREARM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_FIRESPEED, 4, NA, NA, NULL); @@ -6744,6 +6927,10 @@ void initobjects(void) { OT_NONE); } +void initoptions(void) { + addoption(OPT_ALWAYSSHOWTRAILS, "always show trail objects", B_FALSE); +} + void initrace(void) { race_t *r; flag_t *f; @@ -6977,6 +7164,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_VARLEVEL, NA, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); @@ -7412,6 +7600,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_VERYRARE, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "12d4+4"); @@ -7443,6 +7632,7 @@ void initrace(void) { setbodypartname(lastrace, BP_LEFTFINGER, "left foreclaw"); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4+5"); @@ -7471,6 +7661,7 @@ void initrace(void) { addbodypart(lastrace, BP_TAIL, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "splash of cockatrice blood"); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); @@ -7518,6 +7709,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_CON, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "7d4"); addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); @@ -7548,6 +7740,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); @@ -7750,6 +7943,7 @@ void initrace(void) { addflag(lastrace->flags, F_NUMAPPEAR, 2, 3, NA, ""); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); @@ -7787,6 +7981,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "10d4"); @@ -7821,6 +8016,7 @@ void initrace(void) { addflag(lastrace->flags, F_CANWILL, OT_A_FEIGNDEATH, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 87, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, 87, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 87, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 87, RR_COMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); @@ -7855,6 +8051,7 @@ void initrace(void) { addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse"); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 75, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 75, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); @@ -7887,6 +8084,7 @@ void initrace(void) { addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse"); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 70, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 70, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); @@ -7921,6 +8119,7 @@ void initrace(void) { addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "goblin corpse"); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 63, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 63, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 63, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); @@ -7979,9 +8178,10 @@ void initrace(void) { setbodytype(lastrace, BT_HUMANOID); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); - addflag(lastrace->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); - addflag(lastrace->flags, F_RARITY, H_FOREST, 73, NA, NULL); - addflag(lastrace->flags, F_RARITY, H_SWAMP, 73, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, 73, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, 73, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_SWAMP, 73, RR_COMMON, NULL); addflag(lastrace->flags, F_NUMAPPEAR, 1, 2, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4+3"); @@ -8016,6 +8216,7 @@ void initrace(void) { addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 60, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 60, NA, NULL); addflag(lastrace->flags, F_NUMAPPEAR, 1, 2, NA, NULL); @@ -8056,6 +8257,7 @@ void initrace(void) { addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 95, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 95, RR_COMMON, NULL); addflag(lastrace->flags, F_POISONCORPSE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, ""); @@ -8178,6 +8380,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 62, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); addflag(lastrace->flags, F_HATESRACE, R_GNOLL, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4+3"); @@ -8210,6 +8413,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, 60, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 66, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 66, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "7d4+0"); @@ -8244,6 +8448,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 45, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, 45, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 50, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 50, RR_VERYRARE, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "12d4+0"); @@ -8277,6 +8482,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 78, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, 78, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 80, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 80, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+3"); @@ -8312,6 +8518,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 81, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, 81, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 81, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+3"); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); @@ -8453,6 +8660,7 @@ void initrace(void) { addrace(R_PRIMALSTONE, "stone primality", 200, 'E', C_GREY, MT_STONE, RC_HUMANOID, "A living mass of stone, animated by powerful magic."); setbodytype(lastrace, BT_HUMANOID); addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, 72, RR_RARE, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_EXLOW, NA, NULL); @@ -8477,6 +8685,7 @@ void initrace(void) { addrace(R_PRIMALSTONEL, "lesser stone primality", 120, 'E', C_GREY, MT_STONE, RC_HUMANOID, "A living mass of stone, animated by powerful magic."); setbodytype(lastrace, BT_HUMANOID); addflag(lastrace->flags, F_ALIGNMENT, AL_NONE, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, 72, RR_RARE, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_EXLOW, NA, NULL); @@ -8561,6 +8770,7 @@ void initrace(void) { addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 80, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_FREQUENT, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+0"); addflag(lastrace->flags, F_MOVESPEED, SP_VERYSLOW, NA, NA, NULL); @@ -8583,6 +8793,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4"); addflag(lastrace->flags, F_DTIMMUNE, DT_PROJECTILE, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_FALL, NA, NA, NULL); @@ -8631,6 +8842,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); addflag(lastrace->flags, F_EVASION, 15, NA, NA, NULL); @@ -8692,6 +8904,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "5d4+0"); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); @@ -8753,6 +8966,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); @@ -8778,6 +8992,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); @@ -8795,6 +9010,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+2"); @@ -8829,6 +9045,7 @@ void initrace(void) { addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); @@ -8860,6 +9077,7 @@ void initrace(void) { addbodypart(lastrace, BP_BODY, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HARMLESS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); @@ -8875,6 +9093,7 @@ void initrace(void) { addrace(R_FUNGUSRAGE, "ragefungus", 0.5, 'F', C_RED, MT_PLANT, RC_PLANT, "This deep red fungus protects itself by explelling rage-inducing pheremones, causing predators to attack each other instead of it."); addbodypart(lastrace, BP_BODY, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HARMLESS, B_TRUE, NA, NA, NULL); @@ -8892,6 +9111,7 @@ void initrace(void) { addrace(R_IVYRAPID, "rapid ivy", 1, 'F', C_CYAN, MT_PLANT, RC_PLANT, "A strain of ivy which reproduces with incredible speed. Farmers find it difficult to remove due to its sharp spines."); addbodypart(lastrace, BP_BODY, "stalk"); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_RARE, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); @@ -8908,12 +9128,15 @@ void initrace(void) { addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_BASH, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_S_CLONE, 0, 100, "pw:1;"); - addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_CLONE, NA, NA, "grows"); + addflag(lastrace->flags, F_CANWILL, OT_S_ENTANGLE, 50, 50, "pw:2; range:1;"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_CLONE, NA, NA, "expands"); + addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_ENTANGLE, NA, NA, "writhes"); addrace(R_NUTTER, "nutter", 0.5, 'F', C_BROWN, MT_PLANT, RC_PLANT, "Nutters are dense brown bushes covered by clumps of hard-shelled nuts. When threatened, they can propel these nuts towards their predators at very high speeds."); addbodypart(lastrace, BP_BODY, NULL); addbodypart(lastrace, BP_HANDS, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); @@ -8957,6 +9180,7 @@ void initrace(void) { addrace(R_BAT, "giant bat", 3, 'B', C_BROWN, MT_FLESH, RC_ANIMAL, "A larger (and more savage) version of your average household bat."); setbodytype(lastrace, BT_BIRD); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); @@ -8979,6 +9203,7 @@ void initrace(void) { addrace(R_BATMUTATED, "mutated bat", 3, 'B', C_MAGENTA, MT_FLESH, RC_ANIMAL, "Bats exposed to toxic radiation become mutated, and their sonic navigation skills turn deadly."); setbodytype(lastrace, BT_BIRD); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_RARE, NULL); @@ -9003,6 +9228,7 @@ void initrace(void) { addrace(R_BATVAMPIRE, "vampire bat", 6, 'B', C_BLUE, MT_FLESH, RC_ANIMAL, "Bats which suck the blood of their victims."); setbodytype(lastrace, BT_BIRD); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); @@ -9028,6 +9254,7 @@ void initrace(void) { setbodytype(lastrace, BT_QUADRAPED); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_STARTASLEEPPCT, 80, NA, NA, NULL); // hibernating @@ -9055,6 +9282,7 @@ void initrace(void) { lastrace->baseid = R_BEAR; addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_STARTASLEEPPCT, 80, NA, NA, NULL); // hibernating @@ -9083,6 +9311,7 @@ void initrace(void) { lastrace->baseid = R_BEAR; addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+3"); @@ -9107,6 +9336,7 @@ void initrace(void) { lastrace->baseid = R_ANT; addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_ARMOURRATING, 4, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); @@ -9128,6 +9358,7 @@ void initrace(void) { lastrace->baseid = R_ANT; addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_ARMOURRATING, 9, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); @@ -9151,6 +9382,7 @@ void initrace(void) { lastrace->baseid = R_ANT; addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_ARMOURRATING, 4, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); @@ -9455,6 +9687,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+1"); @@ -9501,6 +9734,7 @@ void initrace(void) { addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+1"); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 4, NA, NULL); addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); @@ -9518,6 +9752,7 @@ void initrace(void) { addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_FAST, NA, NA, ""); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "0d4+1"); @@ -9531,7 +9766,7 @@ void initrace(void) { addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 5, NA, NA, NULL); addflag(lastrace->flags, F_CANEATRAW, B_TRUE, NA, NA, NULL); - addrace(R_SLUG, "dragon slug", 150, 'P', C_GREY, MT_FLESH, RC_ANIMAL, "While dragon slugs lack the protective shell of their snail cousings, their rubbery flesh is extremely resilient. Their acid-based attacks also make them much more dangerous."); + addrace(R_SLUG, "acid slug", 150, 'P', C_GREY, MT_FLESH, RC_ANIMAL, "While acid slugs lack the protective shell of their snail cousings, their rubbery flesh is extremely resilient. Their acid-based attacks also make them much more dangerous."); addbodypart(lastrace, BP_BODY, NULL); addbodypart(lastrace, BP_HEAD, NULL); addbodypart(lastrace, BP_EYES, NULL); @@ -9542,6 +9777,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_VERYSLOW, NA, NA, ""); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "7d4+1"); @@ -9558,7 +9794,7 @@ void initrace(void) { addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_CANEATRAW, B_TRUE, NA, NA, NULL); - addrace(R_SNAIL, "dragon snail", 150, 'P', C_BROWN, MT_FLESH, RC_ANIMAL, "An enormous snail, protected by a hard, scaled shell and gifted with long, sharp fangs."); + addrace(R_SNAIL, "mottled snail", 150, 'P', C_BROWN, MT_FLESH, RC_ANIMAL, "An enormous snail, protected by a hard, scaled shell and gifted with long, sharp fangs."); addbodypart(lastrace, BP_BODY, NULL); addbodypart(lastrace, BP_HEAD, NULL); addbodypart(lastrace, BP_EYES, NULL); @@ -9569,6 +9805,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_VERYSLOW, NA, NA, ""); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_FREQUENT, NULL); addflag(lastrace->flags, F_RARITY, H_SEWER, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+1"); @@ -9581,6 +9818,8 @@ void initrace(void) { addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_BREATHWATER, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_CANEATRAW, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_AUTOCREATEOB, 0, NA, NA, "puddle of slime"); + addflag(lastrace->flags, F_DIESPLATTER, 3, NA, NA, "puddle of slime"); addrace(R_SNAKE, "brown snake", 3, 's', C_BROWN, MT_FLESH, RC_ANIMAL, "Common venomous snakes."); setbodytype(lastrace, BT_SNAKE); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); @@ -9785,6 +10024,7 @@ void initrace(void) { setbodytype(lastrace, BT_SPIDER); lastrace->baseid = R_SPIDER; addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); @@ -9813,6 +10053,7 @@ void initrace(void) { setbodytype(lastrace, BT_SPIDER); lastrace->baseid = R_SPIDER; addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSMELL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); @@ -9905,6 +10146,7 @@ void initrace(void) { addflag(lastrace->flags, F_ENHANCESMELL, 2, NA, NA, NULL); addflag(lastrace->flags, F_TREMORSENSE, 2, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_VERYRARE, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "7d4"); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); //addflag(lastrace->flags, F_WANTSOBFLAG, F_RARITY, NA, NA, NULL); // ie. everything @@ -10469,6 +10711,7 @@ void initrace(void) { addbodypart(lastrace, BP_LEGS, NULL); addbodypart(lastrace, BP_FEET, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); @@ -10497,6 +10740,7 @@ void initrace(void) { addflag(lastrace->flags, F_CANWILL, OT_S_FLIGHT, NA, NA, NULL); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_FLIGHT, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); addflag(lastrace->flags, F_EVASION, 60, NA, NA, NULL); @@ -10521,6 +10765,7 @@ void initrace(void) { addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); @@ -10570,6 +10815,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_LARGE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+0"); addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); @@ -10722,7 +10968,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTOBWEPSK, 50, SK_AXES, NA, NULL); addflag(lastrace->flags, F_STARTOB, 25, NA, NA, "buckler"); addflag(lastrace->flags, F_DTVULN, DT_BASH, NA, NA, NULL); - addflag(lastrace->flags, F_DTVULN, DT_FALL, NA, NA, "2d3"); + addflag(lastrace->flags, F_DTVULN, DT_FALL, NA, NA, "1d3+3"); addflag(lastrace->flags, F_DTRESIST, DT_PIERCE, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); @@ -10737,6 +10983,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4+2"); addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); @@ -10763,6 +11010,7 @@ void initrace(void) { addflag(lastrace->flags, F_CANWILL, OT_S_FLIGHT, NA, NA, NULL); addflag(lastrace->flags, F_SPELLCASTTEXT, OT_S_FLIGHT, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_RARE, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_RARE, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TOUCHCHILL, 4, NA, NULL); @@ -10789,6 +11037,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOCORPSE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); + addflag(lastrace->flags, F_RARITY, H_CAVE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_STENCH, 3, 1, NA, NULL); @@ -11036,7 +11285,7 @@ void initskills(void) { addskilldesc(SK_ATHLETICS, PR_NOVICE, "^gYou gain the 'sprint' ability.^n", B_FALSE); addskilldesc(SK_ATHLETICS, PR_ADEPT, "^gYou gain the 'tumble' ability.^n", B_FALSE); addskilldesc(SK_ATHLETICS, PR_EXPERT, "^gYou gain the 'jump' ability.^n", B_FALSE); - addskill(SK_BACKSTAB, "Backstab", "Lets you inflict massive damage with stabs when unseen.", 50); + addskill(SK_BACKSTAB, "Backstabbing", "Lets you inflict massive damage with stabs when unseen.", 50); addskilldesc(SK_BACKSTAB, PR_NOVICE, "^gYour unseen attacks inflict double damage.^n", B_FALSE); addskilldesc(SK_BACKSTAB, PR_BEGINNER, "^gYour unseen attacks inflict triple damage.^n", B_FALSE); addskilldesc(SK_BACKSTAB, PR_ADEPT, "^gYour unseen attacks inflict quadruple damage.^n", B_FALSE); @@ -11103,7 +11352,7 @@ void initskills(void) { addskilldesc(SK_LISTEN, PR_MASTER, "^gYou can now locate monsters based on sound.^n", B_TRUE); addskill(SK_LOCKPICKING, "Lockpicking", "Enhances your ability to pick locks.", 50); addskilldesc(SK_LOCKPICKING, PR_NOVICE, "^gYou gain the 'pick locks' ability.^n", B_FALSE); - addskill(SK_METALWORK, "Metalwork", "Lets you repair metal objects.", 100); + addskill(SK_METALWORK, "Metalwork", "Lets you repair metal objects.", 25); addskilldesc(SK_METALWORK, PR_NOVICE, "^gYou can repair metal items up to 40% condition.^n", B_FALSE); addskilldesc(SK_METALWORK, PR_BEGINNER, "^gYou can repair metal items up to 60% condition.^n", B_FALSE); addskilldesc(SK_METALWORK, PR_ADEPT, "^gYou can repair metal items up to 80% condition.^n", B_FALSE); @@ -11121,7 +11370,7 @@ void initskills(void) { addskilldesc(SK_RANGED, PR_EXPERT, "^gYour ranged accuracy decreases by 8%% per cell.^n", B_FALSE); addskilldesc(SK_RANGED, PR_MASTER, "^gYour ranged attacks now deal 50% more damage.^n", B_TRUE); addskilldesc(SK_RANGED, PR_MASTER, "^gYour ranged accuracy decreases by 6%% per cell.^n", B_FALSE); - addskill(SK_SEWING, "Sewing", "Lets you repair cloth or leather objects.", 100); + addskill(SK_SEWING, "Sewing", "Lets you repair cloth or leather objects.", 25); addskilldesc(SK_SEWING, PR_NOVICE, "^gYou can repair cloth items up to 40% condition.^n", B_FALSE); addskilldesc(SK_SEWING, PR_BEGINNER, "^gYou can repair cloth items up to 60% condition.^n", B_FALSE); addskilldesc(SK_SEWING, PR_ADEPT, "^gYou can repair cloth items up to 80% condition.^n", B_FALSE); @@ -11194,10 +11443,10 @@ void initskills(void) { addskilldesc(SK_TWOWEAPON, PR_EXPERT, "^gYou gain the 'flurry attack' ability.^n", B_FALSE); addskilldesc(SK_TWOWEAPON, PR_MASTER, "^gYou can now deflect attacks with your second weapon.^n", B_TRUE); // knowledge - addskill(SK_LORE_ARCANA, "Lore:Arcana", "Allows you a chance of recognising magical objects and creatures.", 0); + addskill(SK_LORE_ARCANA, "Lore:Arcana", "Allows you a chance of recognising magical objects and creatures.", 5); addskilldesc(SK_LORE_ARCANA, PR_NOVICE, "^gYou can attempt to identify objects with the 'inspect' ability.^n", B_FALSE); addskilldesc(SK_LORE_ARCANA, PR_ADEPT, "^gYou gain the 'study scrolls' ability.", B_FALSE); - addskill(SK_LORE_DEMONS, "Lore:Demonology", "Determines your knowledge about demons.", 0); + addskill(SK_LORE_DEMONS, "Lore:Demonology", "Determines your knowledge about demons.", 5); addskilldesc(SK_LORE_DEMONS, PR_INEPT, "At each skill level, more information about related creatures will be shown.", B_FALSE); addskilldesc(SK_LORE_DEMONS, PR_INEPT, "Each level also gives +10% damage and accuracy against related creatures.", B_FALSE); addskilldesc(SK_LORE_DEMONS, PR_NOVICE, "^gExact attributes, armour rating and evasion are revealed.^n", B_FALSE); @@ -11205,7 +11454,7 @@ void initskills(void) { addskilldesc(SK_LORE_DEMONS, PR_ADEPT, "^gExact remaining hit points and stamina are shown and an approximate threat level is calculated.^n", B_FALSE); addskilldesc(SK_LORE_DEMONS, PR_SKILLED, "^gExact turns to kill are shown.", B_FALSE); addskilldesc(SK_LORE_DEMONS, PR_MASTER, "^gYou can view complete information about skills, magic and abilities.^n", B_FALSE); - addskill(SK_LORE_DRAGONS, "Lore:Dragons", "Determines your knowledge about dragons.", 0); + addskill(SK_LORE_DRAGONS, "Lore:Dragons", "Determines your knowledge about dragons.", 5); addskilldesc(SK_LORE_DRAGONS, PR_INEPT, "At each skill level, more information about related creatures will be shown.", B_FALSE); addskilldesc(SK_LORE_DRAGONS, PR_INEPT, "Each level also gives +10% damage and accuracy against related creatures.", B_FALSE); addskilldesc(SK_LORE_DRAGONS, PR_NOVICE, "^gExact attributes, armour rating and evasion are revealed.^n", B_FALSE); @@ -11213,7 +11462,7 @@ void initskills(void) { addskilldesc(SK_LORE_DRAGONS, PR_ADEPT, "^gExact remaining hit points and stamina are shown and an approximate threat level is calculated.^n", B_FALSE); addskilldesc(SK_LORE_DRAGONS, PR_SKILLED, "^gExact turns to kill are shown.", B_FALSE); addskilldesc(SK_LORE_DRAGONS, PR_MASTER, "^gYou can view complete information about skills, magic and abilities.^n", B_FALSE); - addskill(SK_LORE_HUMANOID, "Lore:Humanoid", "Determines your knowledge about humanoid (bipedal) creatures.", 0); + addskill(SK_LORE_HUMANOID, "Lore:Humanoid", "Determines your knowledge about humanoid (bipedal) creatures.", 5); addskilldesc(SK_LORE_HUMANOID, PR_INEPT, "At each skill level, more information about related creatures will be shown.", B_FALSE); addskilldesc(SK_LORE_HUMANOID, PR_INEPT, "Each level also gives +10% damage and accuracy against related creatures.", B_FALSE); addskilldesc(SK_LORE_HUMANOID, PR_NOVICE, "^gExact attributes, armour rating and evasion are revealed.^n", B_FALSE); @@ -11221,7 +11470,7 @@ void initskills(void) { addskilldesc(SK_LORE_HUMANOID, PR_ADEPT, "^gExact remaining hit points and stamina are shown and an approximate threat level is calculated.^n", B_FALSE); addskilldesc(SK_LORE_HUMANOID, PR_SKILLED, "^gExact turns to kill are shown.", B_FALSE); addskilldesc(SK_LORE_HUMANOID, PR_MASTER, "^gYou can view complete information about skills, magic and abilities.^n", B_FALSE); - addskill(SK_LORE_NATURE, "Lore:Nature", "Determines your knowledge of plants, animals and insects.", 0); + addskill(SK_LORE_NATURE, "Lore:Nature", "Determines your knowledge of plants, animals and insects.", 5); addskilldesc(SK_LORE_NATURE, PR_INEPT, "At each skill level, more information about related creatures will be shown.", B_FALSE); addskilldesc(SK_LORE_NATURE, PR_INEPT, "Each level also gives +10% damage and accuracy against related creatures.", B_FALSE); addskilldesc(SK_LORE_NATURE, PR_NOVICE, "^gExact attributes, armour rating and evasion are revealed.^n", B_FALSE); @@ -11229,7 +11478,7 @@ void initskills(void) { addskilldesc(SK_LORE_NATURE, PR_ADEPT, "^gExact remaining hit points and stamina are shown and an approximate threat level is calculated.^n", B_FALSE); addskilldesc(SK_LORE_NATURE, PR_SKILLED, "^gExact turns to kill are shown.", B_FALSE); addskilldesc(SK_LORE_NATURE, PR_MASTER, "^gYou can view complete information about skills, magic and abilities.^n", B_FALSE); - addskill(SK_LORE_UNDEAD, "Lore:Undead", "Determines your knowledge of the undead.", 0); + addskill(SK_LORE_UNDEAD, "Lore:Undead", "Determines your knowledge of the undead.", 5); addskilldesc(SK_LORE_UNDEAD, PR_INEPT, "At each skill level, more information about related creatures will be shown.", B_FALSE); addskilldesc(SK_LORE_UNDEAD, PR_INEPT, "Each level also gives +10% damage and accuracy against related creatures.", B_FALSE); addskilldesc(SK_LORE_UNDEAD, PR_NOVICE, "^gExact attributes, armour rating and evasion are revealed.^n", B_FALSE); @@ -11238,7 +11487,6 @@ void initskills(void) { addskilldesc(SK_LORE_UNDEAD, PR_SKILLED, "^gExact turns to kill are shown.", B_FALSE); addskilldesc(SK_LORE_UNDEAD, PR_MASTER, "^gYou can view complete information about skills, magic and abilities.^n", B_FALSE); - // weaponry addskill(SK_AXES, "Axes", "Helps you use chopping weapons like axes.", 50); addskill(SK_CLUBS, "Clubs", "Helps you use bashing weapons like maces or clubs.", 50); @@ -11399,6 +11647,33 @@ void initskills(void) { } } +void killoption(option_t *w) { + option_t *nextone, *lastone; + + // free mem + if (w->text) free(w->text); + + // remove from list + nextone = w->next; + if (nextone != NULL) { + nextone->prev = w->prev; + } else { /* last */ + lastoption = w->prev; + } + + if (w->prev == NULL) { + /* first */ + nextone = w->next; + free(firstoption); + firstoption = nextone; + } else { + lastone = w->prev; + free (lastone->next ); + lastone->next = nextone; + } +} + + void killcommand(command_t *cmd) { command_t *nextone, *lastone; diff --git a/data.h b/data.h index e5ffbe8..7c73b6f 100644 --- a/data.h +++ b/data.h @@ -1,12 +1,15 @@ #include "defs.h" void addbonustext(flagpile_t *fp, enum FLAG fid, char *text); +option_t *addoption(enum OPTION id, char *text, int def); command_t *addcommand(enum COMMAND id, char c, char *desc); void initcommands(void); void initjobs(void); void initobjects(void); +void initoptions(void); void initrace(void); void initskills(void); void killcommand(command_t *cmd); +void killoption(option_t *o); void make_basic_shop(flagpile_t *fp); void sortcommands(void); diff --git a/data/hiscores.db b/data/hiscores.db index e66f7d1..b30f505 100644 Binary files a/data/hiscores.db and b/data/hiscores.db differ diff --git a/defs.h b/defs.h index 1375ed5..3e90c29 100644 --- a/defs.h +++ b/defs.h @@ -17,6 +17,7 @@ // 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?" // Defaults #define DEF_AIFOLLOWTIME (50) // if target lf is out of view @@ -663,11 +664,12 @@ enum CELLTYPE { CT_NONE = 0, // walls CT_WALL, - CT_WALLFLESH, - CT_WALLGLASS, - CT_WALLMETAL, - CT_WALLWOOD, - CT_ROOMWALL, + CT_WALLDIRT, + CT_WALLFLESH, + CT_WALLGLASS, + CT_WALLMETAL, + CT_WALLWOOD, + CT_ROOMWALL, // empty CT_CORRIDOR, CT_DIRT, @@ -1087,6 +1089,8 @@ enum OBTYPE { OT_HOLEINROOF, OT_STAIRSDOWN, OT_STAIRSUP, + OT_TUNNELDOWN, + OT_TUNNELUP, OT_PORTAL, OT_STOMACHEXIT, // buildings - rememebr to update MAXBUILDINGTYPES! @@ -1980,6 +1984,7 @@ enum FLAG { 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 @@ -2078,9 +2083,9 @@ enum FLAG { 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_ACTIVATECONFER, // gives flag v0+v1 when activated. v2 specifies if it must be id'd. F_CRITKNOCKDOWN, // lf knocks down victims on a critical hit F_HITCONFER, // hitting with this gives flagid=v0 @@ -2859,7 +2864,11 @@ enum FLAG { F_NOTIME, // this lf's actions don't take time // skills F_HASSKILL, // lf has skill v0 at level v1 - F_PRACTICINGSKILL, // lf is pract skill v0 + // 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 @@ -3209,9 +3218,23 @@ typedef struct warning_s { struct warning_s *next, *prev; } warning_t; +enum OPTION { + OPT_ALWAYSSHOWTRAILS, +}; + +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_FIRSTDUNGEON, + RG_MAINDUNGEON, RG_HEAVEN, RG_PIT, RG_SEWER, @@ -3219,14 +3242,15 @@ enum REGIONTYPE { }; enum HABITAT { - H_DUNGEON = 1, - H_FOREST = 2, - H_HEAVEN = 3, - H_PIT = 4, - H_VILLAGE = 5, - H_SEWER = 6, - H_STOMACH = 7, - H_SWAMP = 8, + 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 }; @@ -3238,6 +3262,7 @@ typedef struct regiontype_s { int stairsperlev; int deeperdir; int majorbranch; + int depthmod; struct regiontype_s *next, *prev; } regiontype_t; @@ -3274,6 +3299,7 @@ typedef struct region_s { regionoutline_t *outline; struct region_s *parentregion; int nthings; // is this used??? + int depthmod; struct region_s *next, *prev; } region_t; diff --git a/doc/add_habitat.txt b/doc/add_habitat.txt index 03a499b..0d2d144 100644 --- a/doc/add_habitat.txt +++ b/doc/add_habitat.txt @@ -4,5 +4,12 @@ defs.h: map.c: initmap: define via addhabitat() + make a new function to create this kind of habitat + +text.c: + update getregionname() + +io.c: + update announcearrival() diff --git a/io.c b/io.c index 57a3275..06b3573 100644 --- a/io.c +++ b/io.c @@ -71,6 +71,7 @@ extern objectclass_t *objectclass; extern knowledge_t *knowledge; extern objecttype_t *objecttype; extern command_t *firstcommand; +extern option_t *firstoption,*lastoption; extern vault_t *firstvault; extern skill_t *firstskill; @@ -1121,8 +1122,8 @@ char *askstring(char *prompt, char punc, char *retbuf, int retBUFLEN, char *def) void announcearrival(lifeform_t *lf, map_t *newmap) { if (isplayer(lf)) { - if (newmap->region == RG_WORLDMAP) { - if (lf->cell->map->region == RG_WORLDMAP) { + if (newmap->region->rtype->id == RG_WORLDMAP) { + if (lf->cell->map->region->rtype->id == RG_WORLDMAP) { msg("You arrive in a new area."); } else { msg("You arrive at the surface."); @@ -1135,6 +1136,15 @@ void announcearrival(lifeform_t *lf, map_t *newmap) { (newmap->lastplayervisit == -1) ? "" : "back ", newmap->depth); break; + case H_CAVE: + if ((newmap->depth == 1) && (newmap->lastplayervisit == -1)) { + msg("You arrive at the goblin caves."); + } else { + msg("You arrive %sat level %d of the goblin caves.", + (newmap->lastplayervisit == -1) ? "" : "back ", + newmap->depth); + } + break; case H_SWAMP: msg("You arrive %sat a swamp.", (newmap->lastplayervisit == -1) ? "" : "back "); @@ -2321,7 +2331,7 @@ int announceflagloss(lifeform_t *lf, flag_t *f) { break; case F_SPIDERCLIMB: if (isplayer(lf)) { - msg("Your skin is no longet adhesive."); + msg("Your skin is no longer adhesive."); donesomething = B_TRUE; } break; @@ -4375,21 +4385,28 @@ void dolook(cell_t *where, int onpurpose) { numobs = 0; numtrails = 0; - + // first search for any non-trail objects. for (o = where->obpile->first ; o ; o = o->next) { if (!canseeob(player, o)) continue; - if (hasflag(o->flags, F_COSMETIC)) continue; + if (hasflag(o->flags, F_COSMETIC) && !onpurpose) continue; // footprints/scents only count if there are no other obs here if (!hasflag(o->flags, F_TRAIL)) { // found a non-trail object includetrails = B_FALSE; + break; } } + // now go through eech object... for (o = where->obpile->first ; o ; o = o->next) { if (!canseeob(player, o)) continue; //if (hasflag(o->flags, F_SECRET)) continue; - if (hasflag(o->flags, F_COSMETIC)) continue; - if (!includetrails && hasflag(o->flags, F_TRAIL)) continue; + if (hasflag(o->flags, F_COSMETIC) && !onpurpose) continue; + if (hasflag(o->flags, F_TRAIL)) { + if (!includetrails) continue; + // ignore it if we're have 'show trails' turned off + if (!onpurpose && !getoption(OPT_ALWAYSSHOWTRAILS)) continue; + //if (!onpurpose) continue; + } f = hasflag(o->flags, F_THEREISHERE); if (f) { @@ -4473,7 +4490,7 @@ void dolook(cell_t *where, int onpurpose) { seensomething = B_TRUE; } - if (!seensomething) { + if (!seensomething && onpurpose) { // just clear the message buffer //clearmsg(); if (isblind(player)) { @@ -6696,6 +6713,65 @@ void dooperate(obpile_t *op) { if (o) { operate(player, o, NULL); } +} + +void dooptions(void) { + char buf[BUFLEN]; + char part1[BUFLEN]; + char promptstr[BUFLEN],cmdchars[BUFLENSMALL]; + char ch; + int y,h,done = B_FALSE; + option_t *opt; + + + h = getmaxy(mainwin); + + sprintf(promptstr, "Press letters to toggle options or ESC when done"); + strcpy(cmdchars, ""); + for (opt = firstoption ; opt ; opt = opt->next) { + char thislet[2]; + sprintf(thislet, "%c", opt->letter); + strcat(cmdchars, thislet); + } + + curs_set(0); + + while (!done) { + cls(); + centre(mainwin,C_WHITE, 0, "OPTIONS"); + y = 2; + ch = '\0'; + for (opt = firstoption ; opt ; opt = opt->next) { + sprintf(part1, "%c - %s", opt->letter, opt->text); + sprintf(buf, "%-40s%s", part1, opt->enabled ? " ^gEnabled^n" : " ^BDisabled^n"); + if (opt->enabled == opt->def) strcat(buf, " (default)"); + wmove(mainwin, y, 0); + textwithcol(mainwin, buf); + if (opt->next && downline(&y, h, "INVENTORY", NULL, promptstr, cmdchars, &ch)) { + break; + } + } + if (!ch) { + centre(mainwin, C_WHITE, h-1, promptstr); + ch = getch(); + } + if (ch == 27) { + done = B_TRUE; + } else { + // find option with this letter + for (opt = firstoption ; opt ; opt = opt->next) { + if (opt->letter == ch) { + // toggle it. + if (opt->enabled) opt->enabled = B_FALSE; + else opt->enabled = B_TRUE; + break; + } + } + } + } + + curs_set(1); + restoregamewindows(); } int dopickup(obpile_t *op, int forceask) { @@ -8356,9 +8432,7 @@ void handleinput(void) { // certain objects in the current cell will stop us from running. for (o = player->cell->obpile->first ; o ; o = o->next) { - if ( !hasflag(o->flags, F_NOPICKUP) || - hasflag(o->flags, F_SHOP) || - hasflag(o->flags, F_CLIMBABLE) ) { + if ( !hasflag(o->flags, F_COSMETIC)) { stopnow = B_TRUE; break; } @@ -8738,6 +8812,9 @@ void handleinput(void) { dooffer(); break; // GAME FUNCTIONS + case '=': // options + dooptions(); + break; case 'Q': // quit doquit(); break; @@ -10265,7 +10342,7 @@ void showlfstats(lifeform_t *lf, int showall) { unsetcol(mainwin, lorecol); } else { setcol(mainwin, lorecol); - wrapprint(mainwin, &y, &x, "You would never be able to kill it. "); + wrapprint(mainwin, &y, &x, "You probably couldn't kill it. "); unsetcol(mainwin, lorecol); } if (hitstokillyou) { @@ -10275,7 +10352,7 @@ void showlfstats(lifeform_t *lf, int showall) { unsetcol(mainwin, lorecol); } else { setcol(mainwin, lorecol); - wrapprint(mainwin, &y, &x, "It would never be able to kill you. "); + wrapprint(mainwin, &y, &x, "It probably couldn't kill you. "); unsetcol(mainwin, lorecol); } } diff --git a/io.h b/io.h index adda93d..9adcbc1 100644 --- a/io.h +++ b/io.h @@ -59,6 +59,7 @@ void domemmagic(void); void domsghist(void); void dooffer(void); void dooperate(obpile_t *op); +void dooptions(void); int dopickup(obpile_t *op, int forceask); void donextguntarget(void); void dopour(obpile_t *op); diff --git a/lf.c b/lf.c index 44e7d6b..7d463a3 100644 --- a/lf.c +++ b/lf.c @@ -1410,6 +1410,10 @@ int cantalk(lifeform_t *lf) { if (getattr(lf, A_IQ) <= AT_VLOW) { return B_FALSE; } + // beheaded? + if (lfhasflag(lf, F_BEHEADED)) { + return B_FALSE; + } return B_TRUE; } @@ -3407,15 +3411,25 @@ void enhancerandomskill(lifeform_t *lf) { enum SKILL poss[MAXSKILLS]; int nposs = 0; int sel; - for (f = lf->flags->first ; f ; f = f->next) { - if ((f->id == F_HASSKILL) && !ismaxedskill(lf, f->val[0])) { - poss[nposs] = f->val[0]; - nposs++; + enum SKILLLEVEL wantlev; + + // enhance lower level skills first, and only up to PR_ADEPT. + for (wantlev = PR_NOVICE; wantlev <= PR_BEGINNER; wantlev++) { + for (f = lf->flags->first ; f ; f = f->next) { + if ((f->id == F_HASSKILL) && !ismaxedskill(lf, f->val[0]) && (f->val[1] == wantlev)) { + if (isplayer(lf) && (f->val[2] != B_TRUE)) { + // for player - select only from skills which we have used since last levelup. + } else { + poss[nposs] = f->val[0]; + nposs++; + } + } + } + if (nposs > 0) { + sel = rnd(0,nposs-1); + giveskill(lf, poss[sel]); + break; } - } - if (nposs > 0) { - sel = rnd(0,nposs-1); - giveskill(lf, poss[sel]); } } @@ -3673,13 +3687,13 @@ void enhanceskills(lifeform_t *lf) { f = levelabilityready(lf); while (f) { if (f->id == F_LEVABIL) { - addflag(lf->flags, F_CANWILL, f->val[1], f->val[2], f->val[2], f->text); + addtempflag(lf->flags, F_CANWILL, f->val[1], f->val[2], f->val[2], f->text, FROMJOB); } else if (f->id == F_LEVFLAG) { - addflag(lf->flags, f->val[1], f->val[2], NA, NA, f->text); + addtempflag(lf->flags, f->val[1], f->val[2], NA, NA, f->text, FROMJOB); } else if (f->id == F_LEVSKILL) { giveskill(lf, f->val[1]); } else if (f->id == F_LEVSPELL) { - addflag(lf->flags, F_CANCAST, f->val[1], NA, NA, NULL); + addtempflag(lf->flags, F_CANCAST, f->val[1], NA, NA, NULL, FROMJOB); } else if (f->id == F_LEVSPELLSCHOOL) { // select a spell from school if (isplayer(lf)) { int done = B_FALSE; @@ -3693,7 +3707,7 @@ void enhanceskills(lifeform_t *lf) { ot = prompt.result; if (ot) { if (prompt.whichq == 0) { // learn the spell - addflag(lf->flags, F_CANCAST, ot->id, NA, NA, NULL); + addtempflag(lf->flags, F_CANCAST, ot->id, NA, NA, NULL, FROMJOB); done = B_TRUE; } else { describespell(ot); @@ -3712,7 +3726,7 @@ void enhanceskills(lifeform_t *lf) { // pick one randomly ot = (objecttype_t *)prompt.choice[rnd(0,prompt.nchoices)].data; if (ot) { - addflag(lf->flags, F_CANCAST, ot->id, NA, NA, NULL); + addtempflag(lf->flags, F_CANCAST, ot->id, NA, NA, NULL, FROMJOB); } } } @@ -8312,6 +8326,10 @@ void giveobflags(lifeform_t *lf, object_t *o, enum FLAG whattype) { int held = B_FALSE, equipped = B_FALSE,activated = B_FALSE; int lifetimeval; + if (gettechlevel(o->type->id) > getskill(lf, SK_TECHUSAGE)) { + return; + } + if (o->pile->owner == lf) held = B_TRUE; if (held) { @@ -8404,6 +8422,17 @@ void giveobflags(lifeform_t *lf, object_t *o, enum FLAG whattype) { flag_t *giveskill(lifeform_t *lf, enum SKILL id) { flag_t *f = NULL, *newf; skill_t *sk; + int markasused = B_FALSE; + + switch (id) { + case SK_CARTOGRAPHY: + case SK_PERCEPTION: + markasused = B_TRUE; + break; + default: + break; + } + if (lfhasflagval(lf, F_NOSKILL, id, NA, NA, NULL)) { return NULL; @@ -8419,6 +8448,7 @@ flag_t *giveskill(lifeform_t *lf, enum SKILL id) { // already have the skill - make it better if (f->val[1] < PR_MASTER) { f->val[1]++; + f->val[2] = markasused; } if (isplayer(lf) && (gamemode == GM_GAMESTARTED)) { msg("^gYou have learned the %s %s skill!", getskilllevelname(f->val[1]), getskillname(sk->id)); @@ -8427,7 +8457,7 @@ flag_t *giveskill(lifeform_t *lf, enum SKILL id) { statdirty = B_TRUE; // in case skill changes your stats } else { // gaining a new skill - f = addflag(lf->flags, F_HASSKILL, id, PR_NOVICE, NA, NULL); + f = addflag(lf->flags, F_HASSKILL, id, PR_NOVICE, markasused, NULL); if (isplayer(lf) && (gamemode == GM_GAMESTARTED)) { msg("^gYou have learned the %s %s skill!", getskilllevelname(PR_NOVICE), getskillname(sk->id)); more(); @@ -8628,15 +8658,24 @@ flag_t *giveskill(lifeform_t *lf, enum SKILL id) { // if objecttype has a tech level , and it is // lower (or equal to) our tech knowledge... if (tf && !isknownot(ot) && (tf->val[0] <= f->val[1])) { + object_t *o; // then make it known! makeknown(ot->id); - if (isplayer(lf)) { - object_t *o; - o = hasob(lf->pack, ot->id); - if (o) { - char buf[BUFLEN]; - getobname(o, buf, o->amt); - msgnocap("%c - %s", o->letter, buf); + for (o = lf->pack->first ; o ; o = o->next) { + if (o->type->id == ot->id) { + if (isplayer(lf)) { + char buf[BUFLEN]; + getobname(o, buf, o->amt); + msgnocap("%c - %s", o->letter, buf); + } + // now confer effects... + giveobflags(lf, o, F_HOLDCONFER); + if (isactivated(o)) { + giveobflags(lf, o, F_ACTIVATECONFER); + } + if (isequipped(o)) { + giveobflags(lf, o, F_EQUIPCONFER); + } } } } @@ -9661,7 +9700,6 @@ int lockpick(lifeform_t *lf, cell_t *targcell, object_t *target, object_t *devic // take time taketime(lf, getactspeed(lf) ); - if (skillcheck(lf, SC_OPENLOCKS, difficulty, bonus )) { // success! // announce @@ -9705,8 +9743,10 @@ int lockpick(lifeform_t *lf, cell_t *targcell, object_t *target, object_t *devic msg("%s fail%s to unlock %s.",lfname, isplayer(lf) ? "" : "s", obname); } } + practice(lf, SK_LOCKPICKING, 1); return B_TRUE; } + practice(lf, SK_LOCKPICKING, 1); return B_FALSE; } @@ -11148,6 +11188,7 @@ lifeform_t *makezombie(object_t *o) { if (!cellwalkable(NULL, where, NULL)) { where = getrandomadjcell(where, WE_WALKABLE, B_ALLOWEXPAND); } + if (!where) return NULL; lf = addlf(where, r->id, 1); addflag(lf->flags, F_LFSUFFIX, B_TRUE, NA, NA, "zombie"); @@ -12814,7 +12855,7 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nclass, int volume, if (f) { // can't hear while unconscious if (f->val[1] == ST_KO) continue; - lbonus -= 4; + lbonus -= 6; limit(&lbonus, 0, NA); } @@ -12934,7 +12975,8 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nclass, int volume, if (f->lifetime > 0) { // ie. temporary timeeffectsflag(f, volume + rnd(1,3)); } else if (f->lifetime == PERMENANT) { - if (f->val[2] == NA) { // ie asleep rather than 'resting' + if (f->val[2] == NA) { + // ie asleep rather than 'resting' // wake up! if (isplayer(l)) { msg("^wA nearby noise awakens you!"); @@ -13275,6 +13317,10 @@ void practice(lifeform_t *lf, enum SKILL skid, int amt) { sk = findskill(skid); if (!sk) return; + // do this even if the skill is not 'trainable' + setskillused(lf, skid); + + slev = getskill(lf, skid); timeneeded = sk->traintime * (getskill(lf, skid)+1); @@ -13284,7 +13330,6 @@ void practice(lifeform_t *lf, enum SKILL skid, int amt) { if (!canlearn(lf, skid)) return; if (!slev || onein(slev)) { - // practice a little bit... f = lfhasflagval(lf, F_PRACTICINGSKILL, skid, NA, NA, NULL); if (f) { @@ -13747,6 +13792,14 @@ void relinklf(lifeform_t *src, map_t *dst) { sortlf(dst, src); } +void setskillused(lifeform_t *lf, enum SKILL skid) { + flag_t *f; + f = lfhasflagval(lf, F_HASSKILL, skid, NA, NA, NULL); + if (f) { + f->val[2] = B_TRUE; + } +} + int startclimbing(lifeform_t *lf) { cell_t *where; char lfname[BUFLEN]; @@ -13816,9 +13869,11 @@ int startclimbing(lifeform_t *lf) { } else if (cansee(player, lf)) { msg("%s tries to start climbing, but fails.", lfname); } + practice(lf, SK_CLIMBING, 1); return B_TRUE; } } + practice(lf, SK_CLIMBING, 1); return B_FALSE; } @@ -16753,7 +16808,22 @@ int tryclimb(lifeform_t *lf, cell_t *where, char *towhat) { // to climb up int adjwalls; char lfname[BUFLEN]; + + // climbing without climb skill? + if (isplayer(lf) && + !getskill(lf, SK_CLIMBING) && + !lfhasflag(lf, F_SPIDERCLIMB) && + !hasobwithflag(lf->pack, F_HELPSCLIMB)) { + // you are about to do something foolish! + if (getattrbracket(getattr(lf, A_WIS), A_WIS, NULL) >= AT_AVERAGE) { + if (!warnabout(TEXT_WARN_CLIMB)) { + return B_TRUE; + } + } + } + getlfname(lf, lfname); + adjwalls = countadjwalls(where); if (adjwalls || hasobwithflag(lf->pack, F_HELPSCLIMB)) { if (isplayer(lf)) { @@ -17704,6 +17774,7 @@ int rest(lifeform_t *lf, int onpurpose) { if (isplayer(lf)) { pleasegodmaybe(R_GODMERCY, 1); } + practice(lf, SK_FIRSTAID, 1); } } diff --git a/lf.h b/lf.h index d7a871a..8116e31 100644 --- a/lf.h +++ b/lf.h @@ -365,6 +365,7 @@ int recruit(lifeform_t *lf); void refreshlevelabilities(lifeform_t *lf); void relinklf(lifeform_t *src, map_t *dst); int rest(lifeform_t *lf, int onpurpose); +void setskillused(lifeform_t *lf, enum SKILL skid); int startclimbing(lifeform_t *lf); int startresting(lifeform_t *lf, int willtrain); int rollattr(enum ATTRBRACKET bracket); diff --git a/map.c b/map.c index 0ac40b8..ed599b5 100644 --- a/map.c +++ b/map.c @@ -676,7 +676,7 @@ void getroomedge(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, } // if outlineid is -1, it's automatically assigned -region_t *addregion(enum REGIONTYPE rtype, region_t *parent, int outlineid) { +region_t *addregion(enum REGIONTYPE rtype, region_t *parent, int outlineid, int depthmod) { region_t *a; regionoutline_t *ro,*poss[MAXCANDIDATES]; int nposs = 0; @@ -707,6 +707,7 @@ region_t *addregion(enum REGIONTYPE rtype, region_t *parent, int outlineid) { a->id = id; a->rtype = findregiontype(rtype); a->parentregion = parent; + a->depthmod = depthmod; if (outlineid == -1) { // randomly assign a regionoutline @@ -781,7 +782,7 @@ regionthing_t *addregionthing(regionoutline_t *ro, int depth, int x, int y, enum return rt; } -regiontype_t *addregiontype(enum REGIONTYPE id, char *name, enum HABITAT defaulthabitat, int maxdepth, int stairsperlev, int deeperdir, int major) { +regiontype_t *addregiontype(enum REGIONTYPE id, char *name, enum HABITAT defaulthabitat, int maxdepth, int stairsperlev, int deeperdir, int major, int depthmod) { regiontype_t *a; // add to the end of the list @@ -807,6 +808,7 @@ regiontype_t *addregiontype(enum REGIONTYPE id, char *name, enum HABITAT default a->stairsperlev = stairsperlev; a->deeperdir = deeperdir; a->majorbranch = major; + a->depthmod = depthmod; return a; } @@ -1496,6 +1498,7 @@ flag_t *getmapcoords(map_t *m, int *x, int *y) { int getmapdifficulty(map_t *m) { int diff = 1; + if (m) { if (isoutdoors(m)) { int x,y; @@ -1505,6 +1508,10 @@ int getmapdifficulty(map_t *m) { } else { diff = m->depth; } + if (m->region) { + diff += m->region->rtype->depthmod; + diff += m->region->depthmod; + } } else { diff = rnd(1,MAXDEPTH); } @@ -1653,7 +1660,7 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int int nposs = 0; cell_t *cell; int sel; - int db = B_TRUE; + int db = B_FALSE; int foundvalid = B_FALSE; // init coords list @@ -1692,6 +1699,7 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int if (hasobwithflag(cell->obpile, F_CLIMBABLE)) { valid = B_FALSE; } + /* // - overlap the inside of an existing room if (cellwalkable(NULL, cell, NULL) && isroom(cell)) { valid = B_FALSE; @@ -1700,6 +1708,11 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int if (cell->room && cell->room->vault) { valid = B_FALSE; } + */ + // - overlap any part of an existing room/vault + if (cell->room) { + valid = B_FALSE; + } // is this cell adjacent to an empty cell and not a // corner (ie. a valid door location) @@ -1897,6 +1910,153 @@ int countmapobs(map_t *m, enum OBTYPE oid) { return count; } + +void createcave(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) { + int wantrooms = B_TRUE; + int x,y,i; + int numrooms = 0; + int entrylinked = B_FALSE; + cell_t *c; + object_t *o; + //int db = B_TRUE; + enum CELLTYPE emptycell,solidcell; + + // parameters + int minrooms = 0; + int maxrooms = 3; + int numstartpos = 5; + int numpasses = 50; + + + // fill entire maze with walls + for (y = 0; y < map->h; y++) { + for (x = 0; x < map->w; x++) { + addcell(map, x, y); + } + } + + + // is the map lit? + if (depth == 1) { + map->lit = B_TRUE; + } else { + int darkchance; + darkchance = depth*15; // ie. level 2 = 30% chance of being dark, level 6 = 90% chance + if (pctchance(darkchance)) { + map->lit = B_FALSE; + } else { + map->lit = B_TRUE; + } + } + + // what kind of cells will 'empty' ones be? + emptycell = map->habitat->emptycelltype; + solidcell = map->habitat->solidcelltype; + + // pick initial random points + for (i = 0; i < numstartpos; i++) { + c = getrandomcell(map); + setcelltype(c, emptycell); + } + + expand_cave(map, numpasses); + + // adjust min/maxrooms based on fixed vaults + minrooms -= map->nfixedrooms; + maxrooms -= map->nfixedrooms; + limit(&minrooms, 0, NA); + limit(&maxrooms, 0, NA); + + // create rooms + if (wantrooms && (maxrooms > 0)) { + numrooms = rnd(minrooms, maxrooms); + + for (i = 0; i < numrooms; i++) { + // maybe make it a special room + if (rnd(1,100) <= map->habitat->randvaultpct) { + vault_t *v; + v = getvaulttype(map); + if (!createvault(map, map->nrooms, v, NULL, NULL, NULL, NULL)) { + // success + continue; + } + } + // just do a normal room + calcposandmakeroom(map, map->nrooms, NA, NA, DEF_VAULTMARGIN, DEF_VAULTMARGIN, NULL, NULL, NULL, NULL, 50, B_FALSE); + //roomvault[i] = B_FALSE; + } + } + + // link up room exits + /* + for (i = 0; i < map->nrooms; i++) { + int wantlink = B_FALSE; + if (!map->room[i].exitslinked) { + if (map->room[i].vault && hasflag(map->room[i].vault->flags, F_VAULTNOLINK)) { + } else { + wantlink = B_TRUE; + } + } + if (wantlink) { + linkexits(map, map->room[i].id); + } + } + */ + + // UP STAIRS + for (i = 0; i < map->region->rtype->stairsperlev; i++) { + c = NULL; + while (!c || !isempty(c) || countobs(c->obpile, B_TRUE)) { + c = getrandomcell(map); + } + o = addobfast(c->obpile, OT_TUNNELUP); + assert(o); + if (entryob && !entrylinked) { // first cave level + linkstairs(o, entryob); + entrylinked = B_TRUE; + } else { + linkstairs(o, NULL); + } + } + // make sure we have at least one up stairs + assert(findobinmap(map, OT_TUNNELUP)); + + // DOWN STAIRS + if (map->depth < map->region->rtype->maxdepth) { + for (i = 0; i < map->region->rtype->stairsperlev; i++) { + c = NULL; + while (!c || !isempty(c) || countobs(c->obpile, B_TRUE)) { + c = getrandomcell(map); + } + o = addobfast(c->obpile, OT_TUNNELDOWN); + assert(o); + linkstairs(o, NULL); + } + } + + // now do a border + y = 0; + for (x = 0; x < map->w; x++) { + // n + c = getcellat(map, x, 0); + clearcell(c); + setcelltype(c,solidcell); + // s + c = getcellat(map, x, map->h-1); + clearcell(c); + setcelltype(c,solidcell); + } + for (y = 1; y < map->h-1; y++) { + // w + c = getcellat(map, 0, y); + clearcell(c); + setcelltype(c,solidcell); + // e + c = getcellat(map, map->w-1, y); + clearcell(c); + setcelltype(c,solidcell); + } +} // void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) { int wantrooms = B_TRUE; @@ -2158,13 +2318,17 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ c = getrandomroomcell(map, ANYROOM); } o = addobfast(c->obpile, OT_STAIRSUP); - // have to force these stairs to go back to a different region. - f = hasflag(o->flags, F_CLIMBABLE); - f->val[1] = map->region->parentregion->id; - linkstairs(o, NULL); + if (entryob) { + linkstairs(o, entryob); + } else { + // have to force these stairs to go back to a different region. + f = hasflag(o->flags, F_CLIMBABLE); + f->val[1] = map->region->parentregion->id; + linkstairs(o, NULL); + } // special case: first dungeon level has barriers over the exit stairs - if (map->region->rtype->id == RG_FIRSTDUNGEON) { + if (map->region->rtype->id == RG_MAINDUNGEON) { if (c->lf) killlf(c->lf); addobfast(c->obpile, OT_MAGICBARRIER); // also clear all the cells around it to prevent reachability errors @@ -2177,7 +2341,7 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ } else { for (i = 0; i < map->region->rtype->stairsperlev; i++) { c = NULL; - while (!isempty(c) || countobs(c->obpile, B_TRUE)) { + while (!c || !isempty(c) || countobs(c->obpile, B_TRUE)) { c = getrandomroomcell(map, ANYROOM); if (!c) { // ANY cell at all, doesn't have to be a room. @@ -2288,10 +2452,7 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ // river? - // TODO FIX - //if ((depth >= 4) && pctchance(20)) { - //if (depth > 1) { - if (0) { + if ((depth >= 4) && pctchance(20)) { createriver(map); } @@ -2416,6 +2577,9 @@ void createhabitat(map_t *map, int depth, map_t *parentmap, int exitdir, object_ case H_DUNGEON: createdungeon(map, depth, parentmap, exitdir, entryob); break; + case H_CAVE: + createcave(map, depth, parentmap, exitdir, entryob); + break; case H_FOREST: createforest(map, depth, parentmap, exitdir, entryob, rnd(0,5)); break; @@ -2683,7 +2847,7 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex matched = B_TRUE; } } else { // match on depth - if (region->outline->thing[i].depth == getmapdifficulty(map)) { + if (region->outline->thing[i].depth == map->depth) { matched = B_TRUE; } } @@ -2784,7 +2948,7 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex if (!failed) { if (fix_reachability(map)) { failed = B_TRUE; - } + } } //if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging @@ -2795,6 +2959,12 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex } //if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging + if (map->habitat->id == H_CAVE) { + // expand the cave a little more now that we've fixed reachability. + // this will help make any new corridors look more 'cave-like'. + expand_cave(map, 2); + } + // special cases // village - add town walls and clear it out if (db) dblog(" finalising village creation..."); @@ -2967,16 +3137,29 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex } //if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging - // add random objects and monsters + // add random objects and monsters , and remove + // bad objects if (db) dblog(" adding random objects+monsters"); for (y = 0; y < map->h; y++) { for (x = 0; x < map->w; x++) { cell_t *c; c = getcellat(map, x, y); - // no random obs in vaults - if (c && isempty(c) && !getcellvault(c)) { - if (rnd(1,100) <= c->habitat->randthingpct) { - addrandomthing(c, c->habitat->randobpct, NULL); + if (c) { + // add random obs, but not in vaults + if (isempty(c) && !getcellvault(c)) { + if (rnd(1,100) <= c->habitat->randthingpct) { + addrandomthing(c, c->habitat->randobpct, NULL); + } + } + // remove bad objects + if (!c->room) { + object_t *o,*nexto; + for (o = c->obpile->first ; o ; o = nexto) { + nexto = o->next; + if (hasflag(o->flags, F_ONLYINROOM)) { + killob(o); + } + } } } } @@ -3257,7 +3440,6 @@ void createsewer(map_t *map, int depth, map_t *parentmap, int exitdir, object_t assert(f); f->val[1] = map->region->parentregion->id; linkstairs(o, entryob); - } void createstomach(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob) { @@ -4013,8 +4195,12 @@ void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *e void createregionlink(map_t *m, cell_t *c, object_t *o, char *obname, enum REGIONTYPE newregiontype, region_t *parent) { flag_t *f; region_t *r; - // create a new region - r = addregion(newregiontype, m->region, -1); + int basedepth = 0; + if (newregiontype != RG_MAINDUNGEON) { + basedepth = getmapdifficulty(m); + } + // create a new region. + r = addregion(newregiontype, m->region, -1, basedepth); // add stairs going to the new region, if required if (!c) { c = NULL; @@ -4298,7 +4484,7 @@ void dumpoutlines(void) { if (rt->whatkind == RT_REGIONLINK) { regiontype_t *rtype; rtype = findregiontype(rt->value); - dblog(" at %s: link to %s",loctext, rtype->name); + dblog(" at %s: link to %s (%s)",loctext, rtype->name, rt->what); } else if (rt->whatkind == RT_HABITAT) { habitat_t *h; h = findhabitat(rt->value); @@ -4380,6 +4566,31 @@ void explodecells(cell_t *c, int dam, int killwalls, object_t *o, int range, int } } +void expand_cave(map_t *map, int numpasses) { + int n,x,y,dir; + cell_t *c; + for (n = 0; n < numpasses; n++) { + // for each dug map cell, 25% chance of clearing each adjacent cell + for (y = 0; y < map->h; y++) { + for (x = 0; x < map->w; x++) { + c = getcellat(map, x, y); + if (!c->type->solid && !c->visited) { // cell is empty and not processed already? + cell_t *c2; + // check for surrounding solid cells + for (dir = DC_N; dir <= DC_NW; dir++) { + c2 = getcellindir(c, dir); + if (c2 && c2->type->solid && pctchance(25)) { + setcelltype(c2, map->habitat->emptycelltype); + } + } + // mark cell as processed + c->visited = B_TRUE; + } + } + } + } +} + // this should never be called directly - only from explodecells(). // (otherwise knockback effect won't happen) void explodesinglecell(cell_t *c, int dam, int killwalls, object_t *o, cell_t *centre) { @@ -4827,66 +5038,6 @@ int getnewdigdir(cell_t *cell, int lastdir, int turnpct, int *moved) { } -char *getregionname(char *buf, map_t *m, int withlevel) { - region_t *r; - - r = m->region; - - if (withlevel) { - flag_t *f; - int x,y; - f = hasflag(m->flags, F_MAPCOORDS); - if (f) { - x = f->val[0]; - y = f->val[1]; - } else { - x = NA; - y = NA; - } - switch (r->rtype->id) { - case RG_WORLDMAP: - snprintf(buf, BUFLEN, "the surface(%d,%d)",x,y); - break; - case RG_FIRSTDUNGEON: - snprintf(buf, BUFLEN, "dungeon L%d", m->depth); - break; - case RG_HEAVEN: - snprintf(buf, BUFLEN, "the realm of gods"); - break; - case RG_PIT: - snprintf(buf, BUFLEN, "a pit L%d", m->depth); - break; - case RG_SEWER: - snprintf(buf, BUFLEN, "a sewer L%d", m->depth); - break; - case RG_STOMACH: - snprintf(buf, BUFLEN, "a stomach"); - break; - } - } else { - switch (r->rtype->id) { - case RG_WORLDMAP: - strcpy(buf, "the surface"); - break; - case RG_FIRSTDUNGEON: - strcpy(buf, "the dungeon"); - break; - case RG_HEAVEN: - snprintf(buf, BUFLEN, "the realm of gods"); - break; - case RG_PIT: - snprintf(buf, BUFLEN, "a pit"); - break; - case RG_SEWER: - snprintf(buf, BUFLEN, "a sewer"); - break; - case RG_STOMACH: - snprintf(buf, BUFLEN, "a stomach"); - break; - } - } - return buf; -} cell_t *getrandomadjcell(cell_t *c, int wantempty, int allowexpand) { return real_getrandomadjcell(c, wantempty, allowexpand, LOF_NEED, NULL, NULL); @@ -5270,6 +5421,7 @@ void initmap(void) { // habitats // thingchance, obchance, vaultchance, maxvisrange addhabitat(H_DUNGEON, "dungeon", CT_CORRIDOR, CT_WALL, 3, 50, 30, 6); + addhabitat(H_CAVE, "cave", CT_DIRT, CT_WALLDIRT, 5, 60, 10, 6); addhabitat(H_FOREST, "forest", CT_GRASS, CT_WALL, 3, 75, 0, MAXVISRANGE); addhabitat(H_HEAVEN, "heaven", CT_CORRIDOR, CT_WALL, 0, 0, 0, MAXVISRANGE); addhabitat(H_PIT, "pit", CT_CORRIDOR, CT_WALL, 0, 0, 0, 5); @@ -5281,6 +5433,7 @@ void initmap(void) { // cell types - solid addcelltype(CT_WALL, "rock wall", UNI_SHADEDARK, C_GREY, B_SOLID, B_OPAQUE, MT_STONE, 0, 100); addcelltype(CT_ROOMWALL, "rock wall", UNI_SHADEDARK, C_GREY, B_SOLID, B_OPAQUE, MT_STONE, 0, 100); + addcelltype(CT_WALLDIRT, "dirt wall", UNI_SHADEDARK, C_BROWN, B_SOLID, B_OPAQUE, MT_STONE, 0, 50); addcelltype(CT_WALLWOOD, "wooden wall", UNI_SOLID, C_BROWN, B_SOLID, B_OPAQUE, MT_WOOD, 0, 50); addcelltype(CT_WALLFLESH, "flesh wall", UNI_SOLID, C_RED, B_SOLID, B_OPAQUE, MT_FLESH, 0, 50); addcelltype(CT_WALLGLASS, "glass wall", UNI_SOLID, C_CYAN, B_SOLID, B_TRANS, MT_GLASS, 0, 150); @@ -5299,18 +5452,19 @@ void initmap(void) { addcelltype(CT_VLOWFLOOR, "very low rock floor", '.', C_GREY, B_EMPTY, B_TRANS, MT_STONE, -2, -1); // region types - addregiontype(RG_WORLDMAP, "World map", H_FOREST, 10, 0, D_NONE, B_TRUE); - addregiontype(RG_FIRSTDUNGEON, "First Dungeon", H_DUNGEON, 25, 3, D_DOWN, B_TRUE); - addregiontype(RG_HEAVEN, "Realm of Gods", H_HEAVEN, 1, 0, D_NONE, B_FALSE); - addregiontype(RG_PIT, "Pit", H_PIT, 1, 1, D_DOWN, B_FALSE); - addregiontype(RG_SEWER, "Sewer", H_SEWER, 1, 0, D_NONE, B_FALSE); - addregiontype(RG_STOMACH, "Stomach", H_STOMACH, 1, 0, D_NONE, B_FALSE); + addregiontype(RG_WORLDMAP, "World map", H_FOREST, 10, 0, D_NONE, B_TRUE, 0); + addregiontype(RG_MAINDUNGEON, "First Dungeon", H_DUNGEON, 25, 3, D_DOWN, B_TRUE, 0); + addregiontype(RG_CAVE, "Goblin Caves", H_CAVE, 6, 1, D_DOWN, B_TRUE, 5); + addregiontype(RG_HEAVEN, "Realm of Gods", H_HEAVEN, 1, 0, D_NONE, B_FALSE, 0); + addregiontype(RG_PIT, "Pit", H_PIT, 1, 1, D_DOWN, B_FALSE, 0); + addregiontype(RG_SEWER, "Sewer", H_SEWER, 1, 0, D_NONE, B_FALSE, 2); + addregiontype(RG_STOMACH, "Stomach", H_STOMACH, 1, 0, D_NONE, B_FALSE, 0); // MAPMAPMAPMAP // region definitions (outlines) addregionoutline(RG_WORLDMAP); // link to first dungeon - addregionthing(lastregionoutline, NA, 0, 0, RT_REGIONLINK, RG_FIRSTDUNGEON, "staircase going down"); + addregionthing(lastregionoutline, NA, 0, 0, RT_REGIONLINK, RG_MAINDUNGEON, "staircase going down"); // four villages for (i = 0; i < 4; i++) { vx[i] = 0; vy[i] = 0; @@ -5337,8 +5491,10 @@ void initmap(void) { //vx = 0; vy = -1; - addregionoutline(RG_FIRSTDUNGEON); + addregionoutline(RG_MAINDUNGEON); addregionthing(lastregionoutline, 1, NA, NA, RT_RNDVAULTWITHFLAG, F_VAULTISPLAYERSTART, NULL); + // l2-4: goblin caves + addregionthing(lastregionoutline, rnd(2,4), NA, NA, RT_REGIONLINK, RG_CAVE, "tunnel leading down"); // l6: jimbo's lair addregionthing(lastregionoutline, 6, NA, NA, RT_VAULT, NA, "jimbos_lair"); // l7 - 10: swamp @@ -5355,6 +5511,7 @@ void initmap(void) { addregionthing(lastregionoutline, rnd(17,19), NA, NA, RT_OBJECT, NA, "random building"); addregionthing(lastregionoutline, rnd(20,22), NA, NA, RT_OBJECT, NA, "random building"); addregionthing(lastregionoutline, rnd(23,25), NA, NA, RT_OBJECT, NA, "random building"); + addregionoutline(RG_CAVE); } int isadjacent(cell_t *src, cell_t *dst) { diff --git a/map.h b/map.h index 8e3d245..52885e5 100644 --- a/map.h +++ b/map.h @@ -7,10 +7,10 @@ map_t *addmap(void); lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int amt, int autogen, int *nadded); object_t *addrandomob(cell_t *c); int addrandomthing(cell_t *c, int obchance, int *nadded); -region_t *addregion(enum REGIONTYPE rtype, region_t *parent, int outlineid); +region_t *addregion(enum REGIONTYPE rtype, region_t *parent, int outlineid, int depthmod); regionoutline_t *addregionoutline(enum REGIONTYPE rtype); regionthing_t *addregionthing(regionoutline_t *ro, int depth, int x, int y, enum REGIONTHING whatkind, int value, char *what); -regiontype_t *addregiontype(enum REGIONTYPE id, char *name, enum HABITAT defaulthabitat, int maxdepth, int stairsperlev, int deeperdir, int major); +regiontype_t *addregiontype(enum REGIONTYPE id, char *name, enum HABITAT defaulthabitat, int maxdepth, int stairsperlev, int deeperdir, int major, int depthmod); void adjustcellglyphforlight(cell_t *c, glyph_t *col); int autodoors(map_t *map, int roomid, int minx, int miny, int maxx, int maxy, int doorpct, int dooropenchance); int cellhaslos(cell_t *c1, cell_t *dest); @@ -46,6 +46,7 @@ int countadjwalls(cell_t *cell); int countcellexits(cell_t *cell, int dirtype); int countcellexitsfor(lifeform_t *lf); int countmapobs(map_t *m, enum OBTYPE oid); +void createcave(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createfakes(map_t *map, cell_t *cell); void createforest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob, int nclearings); @@ -65,6 +66,7 @@ int createvault(map_t *map, int roomid, vault_t *v, int *retw, int *reth, int *r int dirtox(int dt, int dir); int dirtoy(int dt, int dir); void dumpmap(map_t *map, int showrooms); +void expand_cave(map_t *map, int numpasses); void explodesinglecell(cell_t *c, int dam, int killwalls, object_t *o, cell_t *centre); void explodecells(cell_t *c, int dam, int killwalls, object_t *o, int range, int dirtype, int wantannounce); celltype_t *findcelltype(enum CELLTYPE cid); @@ -89,7 +91,6 @@ vault_t *getcellvault(cell_t *c); cell_t *getclosestroomcell(lifeform_t *lf, int roomid); int getnewdigdir(cell_t *cell, int lastdir, int turnpct, int *moved); int getobchance(int habitat); -char *getregionname(char *buf, map_t *m, int withlevel); int getthingchance(int habitat); cell_t *getrandomadjcell(cell_t *c, int wantempty, int allowexpand); cell_t *real_getrandomadjcell(cell_t *c, int wantempty, int allowexpand, enum LOFTYPE needlof, enum OBTYPE *dontwantob, lifeform_t *preferlos); diff --git a/move.c b/move.c index fe52fdf..957cba2 100644 --- a/move.c +++ b/move.c @@ -72,7 +72,7 @@ int ispossiblemove(lifeform_t *lf, int dir) { object_t *inway = NULL; switch (error) { case E_OFFMAP: - if (lf->cell->map->region == RG_WORLDMAP) { + if (lf->cell->map->region->id == RG_WORLDMAP) { return B_TRUE; } break; @@ -852,7 +852,7 @@ int knockback(lifeform_t *lf, int dir, int howfar, lifeform_t *pusher, int fallc // failed to move switch (reason) { case E_OFFMAP: - if (lf->cell->map->region == RG_WORLDMAP) { + if (lf->cell->map->region->id == RG_WORLDMAP) { if (!walkoffmap(lf, dir, B_FALSE)) { // successful break; @@ -1021,7 +1021,7 @@ int moveeffects(lifeform_t *lf) { int didmsg = B_FALSE; if (lfhasflagval(lf, F_INJURY, IJ_HAMSTRUNG, NA, NA, NULL)) { - if (!skillcheck(lf, SC_FALL, 20, 0)) { + if (!skillcheck(lf, SC_FALL, 18, 0)) { fall(lf, NULL, B_TRUE); if (isplayer(lf)) didmsg = B_TRUE; } @@ -1034,6 +1034,7 @@ int moveeffects(lifeform_t *lf) { if (isbleeding(lf)) { if (hasbleedinginjury(lf, BP_LEGS)) { if (!bleedfrom(lf, BP_LEGS, B_FALSE)) { + if (isplayer(lf)) msg("^BYou bleed!"); losehp(lf, 1, DT_DIRECT, NULL, "blood loss"); } } else { @@ -1050,6 +1051,7 @@ int moveeffects(lifeform_t *lf) { for (i = 0; i < nretflags; i++) { if (retflag[i]->lifetime == FROMRACE) { if (!bleedfrom(lf, BP_WINGS, B_FALSE)) { + if (isplayer(lf)) msg("^BYou bleed!"); losehp(lf, 1, DT_DIRECT, NULL, "blood loss"); } } @@ -1415,7 +1417,14 @@ int movelf(lifeform_t *lf, cell_t *newcell) { } dointerrupt = B_TRUE; // mark the observed race as known. - lf->race->known = B_TRUE; + if (!lf->race->known) { + raceclass_t *rc; + lf->race->known = B_TRUE; + rc = findraceclass(lf->race->raceclass->id); + if (rc) { + practice(lf, getskill(lf, rc->skill), 2); + } + } } } else if (isplayer(lf)) { if (areallies(lf, l)) { diff --git a/nexus.c b/nexus.c index c0619f3..f269608 100644 --- a/nexus.c +++ b/nexus.c @@ -48,6 +48,7 @@ buildingusage_t buildingusage[MAXBUILDINGTYPES]; int nbuildingusage = 0; warning_t *firstwarning = NULL,*lastwarning = NULL; +option_t *firstoption = NULL,*lastoption = NULL; int maxmonhitdice = 0; // highest number of hitdice for any monster @@ -244,17 +245,17 @@ int main(int argc, char **argv) { newworld = B_TRUE; // create world map. - wregion = addregion(RG_WORLDMAP, NULL, -1); + wregion = addregion(RG_WORLDMAP, NULL, -1, 0); assert(wregion); addmap(); createmap(firstmap, 1, wregion, NULL, D_NONE, NULL); // create first dungeon - dregion = findregionbytype(RG_FIRSTDUNGEON); + dregion = findregionbytype(RG_MAINDUNGEON); assert(dregion); dmap = addmap(); createmap(dmap, 1, dregion, firstmap, D_DOWN, NULL); // create heaven - hregion = addregion(RG_HEAVEN, NULL, -1); + hregion = addregion(RG_HEAVEN, NULL, -1, 0); assert(hregion); heaven = addmap(); createmap(heaven, 1, hregion, NULL, D_NONE, NULL); @@ -656,8 +657,9 @@ void cleanup(void) { fclose(logfile); cleanupgfx(); - // free commands + // free commands & options while (firstcommand) killcommand(firstcommand); + while (firstoption) killoption(firstoption); // free maps (this will kill its lifeforms & obs & cells too) while (firstmap) killmap(firstmap); // free knowledge @@ -998,6 +1000,16 @@ void gethitdicerange(int depth, int *min, int *max, int range, int oodok) { *max = mid + range; limit(max, *min, maxmonhitdice); } +int getoption(enum OPTION id) { + option_t *opt; + for (opt = firstoption ; opt ; opt = opt->next) { + if (opt->id == id) { + if (opt->enabled) return B_TRUE; + } + } + return B_FALSE; +} + enum COLOUR getpctcol(float num, float max) { float pct; pct = (num / max) * 100; @@ -1084,6 +1096,7 @@ int init(void) { // load npc names loadnpcnames(); + initoptions(); initcommands(); initobjects(); initskills(); diff --git a/nexus.h b/nexus.h index fd15fea..2820a4a 100644 --- a/nexus.h +++ b/nexus.h @@ -12,6 +12,7 @@ void dobresnham(int d, int xinc1, int yinc1, int dinc1, int xinc2, int yinc2, in void donextturn(map_t *map); warning_t *findwarning(char *text); void gethitdicerange(int depth, int *min, int *max, int range, int oodok); +int getoption(enum OPTION id); enum COLOUR getpctcol(float num, float max); char getpctletter(float num, float max); void getrarityrange(int depth, int *min, int *max, int range, int oodok); diff --git a/objects.c b/objects.c index 4626f9f..b229d4a 100644 --- a/objects.c +++ b/objects.c @@ -1861,7 +1861,7 @@ void addobsinradius(cell_t *centre, int radius, int dirtype, char *name, int all ot = findotn(name); if (!ot) return; - getradiuscells(centre, radius, DT_ORTH, B_FALSE, LOF_WALLSTOP, B_FALSE, cell, &ncells, B_FALSE); + getradiuscells(centre, radius, DT_ORTH, B_FALSE, LOF_WALLSTOP, (radius == 0) ? B_TRUE : B_FALSE, cell, &ncells, B_FALSE); for (i = 0; i < ncells; i++) { c = cell[i]; @@ -3538,6 +3538,7 @@ int getobspellpower(object_t *o, lifeform_t *lf) { slev = getskill(lf, SK_CHANNELING); power += slev; if (slev >= PR_ADEPT) power += (slev - 2); + setskillused(lf, SK_CHANNELING); } // blessed objects are more powerful if (isblessed(o)) power += 4; @@ -8211,6 +8212,9 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) { } } // end if techtype affected by gremlins + if (o->type->obclass->id == OC_TECH) { + setskillused(lf, SK_TECHUSAGE); + } // mark obejct as tried if (isplayer(lf)) maketried(o->type->id); @@ -8317,6 +8321,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) { // increase based on your magic item usage skill chanlev = getskill(lf, SK_CHANNELING); + setskillused(lf, SK_CHANNELING); power += chanlev; if (chanlev >= PR_ADEPT) power += (chanlev - 2); @@ -8661,7 +8666,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) { } else if (o->type->id == OT_ORBDUNGEONEXIT) { map_t *m; m = lf->cell->map; - if ((m->region->rtype->id == RG_FIRSTDUNGEON) && (m->depth == 1)) { + if ((m->region->rtype->id == RG_MAINDUNGEON) && (m->depth == 1)) { cell_t *cell[MAXCANDIDATES]; int ncells,i; getradiuscells(lf->cell, 1, DT_COMPASS, B_FALSE, LOF_DONTNEED, B_TRUE, cell, &ncells, B_FALSE); @@ -11716,6 +11721,7 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, } announcedmiss = B_TRUE; } + practice(target, SK_EVASION, 1); } } } @@ -11786,7 +11792,6 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, dam = pctof(150, dam); } } - // special case if (o->type->id == OT_RUBBERBULLET) { diff --git a/save.c b/save.c index 48487f5..272ed0e 100644 --- a/save.c +++ b/save.c @@ -625,6 +625,7 @@ int loadregions(void) { int rtid,nthings,i,n; int numoutlines,numregions; int db = B_FALSE; + int depthmod; // TODO: check that map dir exists snprintf(filename, BUFLEN, "%s/regions.dat",MAPDIR); @@ -674,8 +675,9 @@ int loadregions(void) { fscanf(f, " outline:%d\n",&outlineid); fscanf(f, " parentregion:%d\n",&parentid); fscanf(f, " nthings:%d\n",&nthings); + fscanf(f, " depthmod:%d\n",&depthmod); fscanf(f, "endregion\n"); - r = addregion(rtid, (parentid == -1) ? NULL : findregion(parentid), outlineid); + r = addregion(rtid, (parentid == -1) ? NULL : findregion(parentid), outlineid, depthmod); r->nthings = nthings; if (db) dblog("Loaded region #%d / %d",n+1, numregions); } @@ -1059,6 +1061,7 @@ int saveregions(void) { fprintf(f, " outline:%d\n",r->outline ? r->outline->id : -1); fprintf(f, " parentregion:%d\n",r->parentregion ? r->parentregion->id : -1); fprintf(f, " nthings:%d\n",r->nthings); + fprintf(f, " depthmod:%d\n",r->depthmod); fprintf(f, "endregion\n"); } fclose(f); diff --git a/shops.c b/shops.c index 8c31dcc..6dcdf9b 100644 --- a/shops.c +++ b/shops.c @@ -362,6 +362,7 @@ enum SHOPRETURN shopdonate(lifeform_t *lf, object_t *vm, int starty, char *topte newob = moveob(o, vm->contents, count); newob->letter = let; (*ndonated)++; + practice(player, SK_SPEECH, 1); } if ((vm->type->id == OT_TEMPLE) && goldgiven) { @@ -698,6 +699,7 @@ enum SHOPRETURN shoppurchase(lifeform_t *lf, object_t *vm, int starty, char *top getobname(o, obname, shopamt); snprintf(toptext, BUFLEN, "Purchased: %c - %s", o->letter, obname); if (npurchased) (*npurchased)++; + practice(player, SK_SPEECH, 1); } else { msg("You don't seem to have any money..."); more(); o = NULL; @@ -724,6 +726,7 @@ enum SHOPRETURN shoppurchase(lifeform_t *lf, object_t *vm, int starty, char *top getobname(o, obname, shopamt); snprintf(toptext, BUFLEN, "Stolen: %c - %s", o->letter, obname); + practice(player, SK_THIEVERY, 1); pleasegodmaybe(R_GODTHIEVES, (value/50)); o = NULL; } else { diff --git a/spell.c b/spell.c index 91374f2..ee9a131 100644 --- a/spell.c +++ b/spell.c @@ -128,12 +128,14 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } if (!range) { + int movespeed; // get max range - based on speed. - range = (int) (((float)SP_NORMAL / (float)getmovespeed(user)) * 2.5); - if (range <= 1) { + movespeed = getmovespeed(user); + if (movespeed > SP_NORMAL) { if (isplayer(user)) msg("You are too slow to charge!"); return B_TRUE; } + range = 3 + ((SP_NORMAL - movespeed)/5); } if (!targcell) { @@ -636,6 +638,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef // takes longer taketime(user, getactspeed(user) * (ncooked-1)); } + practice(user, SK_COOKING, 1); return B_FALSE; } @@ -694,9 +697,10 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef msgnocap("%c - %s", o->letter, obname); // take some time taketime(user, getactspeed(user)); + practice(user, SK_COOKING, 1); } else { // pack full? - msg("You have space to cook!"); + msg("You have no space to cook!"); } } } else if (abilid == OT_A_DARKWALK) { @@ -1398,6 +1402,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef fall(user, NULL, B_TRUE); } } + practice(user, SK_ATHLETICS, 1); } else if (abilid == OT_A_PICKLOCK) { lockpick(user, NULL, NULL, NULL); } else if (abilid == OT_A_RAGE) { @@ -1513,6 +1518,8 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef buf, withbuf); } + practice(user, SK_METALWORK, 1); + practice(user, SK_SEWING, 1); // TODO: make this like eating/resting/etc ? taketime(user, getactspeed(user)); } else if (abilid == OT_A_RESIZE) { @@ -1624,7 +1631,8 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef more(); msgnocap("%c - %s", o->letter, obname); - + practice(user, SK_METALWORK, 1); + practice(user, SK_SEWING, 1); // TODO: make this like eating/resting/etc ? taketime(user, getactspeed(user)); } else if (abilid == OT_A_SHIELDBASH) { @@ -2036,7 +2044,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef // this map will be destroyed when you leave it. r = findregionbytype(RG_STOMACH); if (!r) { - r = addregion(RG_STOMACH, NULL, -1); + r = addregion(RG_STOMACH, NULL, -1, 0); } // create stomach map newmap = addmap(); @@ -2501,6 +2509,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef return B_FALSE; } } + practice(user, SK_ATHLETICS, 1); } else if (abilid == OT_A_POLYREVERT) { flag_t *f; if (!target) target = user; @@ -2928,6 +2937,9 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef getobname(o, obname, o->amt); msgnocap("%c - %s", o->letter, obname); + practice(user, SK_METALWORK, 1); + practice(user, SK_SEWING, 1); + taketime(user, getactspeed(user)); } else if (abilid == OT_A_EXPOSEDSTRIKE) { flag_t *f; @@ -3248,6 +3260,10 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef // start hiding addflag(user->flags, F_HIDING, penalty, NA, NA, NULL); + // even though it's untrainable - this will + // still mark it as used. + practice(user, SK_STEALTH, 1); + taketime(user, getactspeed(user)); } else if (abilid == OT_A_INSPECT) { object_t *o; @@ -5943,7 +5959,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ } getlfname(target, targname); if (cansee(player, target)) { - msg("Magical vines grasp %s!",targname); + msg("Entangling vines rise up and grasp %s!",targname); if (seenbyplayer) *seenbyplayer = B_TRUE; } diff --git a/text.c b/text.c index cc1c4c3..48a3c70 100644 --- a/text.c +++ b/text.c @@ -925,6 +925,73 @@ char *getrarityname(enum RARITY rr) { return "?unknownrarity?"; } +char *getregionname(char *buf, map_t *m, int withlevel) { + region_t *r; + + r = m->region; + + if (withlevel) { + flag_t *f; + int x,y; + f = hasflag(m->flags, F_MAPCOORDS); + if (f) { + x = f->val[0]; + y = f->val[1]; + } else { + x = NA; + y = NA; + } + switch (r->rtype->id) { + case RG_CAVE: + snprintf(buf, BUFLEN, "goblin caves L%d", m->depth); + break; + case RG_WORLDMAP: + snprintf(buf, BUFLEN, "the surface(%d,%d)",x,y); + break; + case RG_MAINDUNGEON: + snprintf(buf, BUFLEN, "dungeon L%d", m->depth); + break; + case RG_HEAVEN: + snprintf(buf, BUFLEN, "the realm of gods"); + break; + case RG_PIT: + snprintf(buf, BUFLEN, "a pit L%d", m->depth); + break; + case RG_SEWER: + snprintf(buf, BUFLEN, "a sewer L%d", m->depth); + break; + case RG_STOMACH: + snprintf(buf, BUFLEN, "a stomach"); + break; + } + } else { + switch (r->rtype->id) { + case RG_CAVE: + strcpy(buf, "the goblin caves"); + break; + case RG_WORLDMAP: + strcpy(buf, "the surface"); + break; + case RG_MAINDUNGEON: + strcpy(buf, "the dungeon"); + break; + case RG_HEAVEN: + snprintf(buf, BUFLEN, "the realm of gods"); + break; + case RG_PIT: + snprintf(buf, BUFLEN, "a pit"); + break; + case RG_SEWER: + snprintf(buf, BUFLEN, "a sewer"); + break; + case RG_STOMACH: + snprintf(buf, BUFLEN, "a stomach"); + break; + } + } + return buf; +} + char *getreldirname(int reldir) { switch (reldir) { case RD_FORWARDS: diff --git a/text.h b/text.h index 35e9ce3..f6a4950 100644 --- a/text.h +++ b/text.h @@ -27,6 +27,7 @@ char *getinjuredbpname(enum BODYPART bp); char *getinjuryname(enum DAMTYPE dt); char *getinjurydesc(enum BODYPART bp, enum DAMTYPE dt); char *getrarityname(enum RARITY rr); +char *getregionname(char *buf, map_t *m, int withlevel); char *getreldirname(int reldir); char *getsizetext(enum LFSIZE sz); char *gettimetext(char *retbuf);