- [+] monk fist damage not increasing.

- [+] RANDOM MONSTER BUGS
    - [+] levle 1: always getting goblins/kobolds
    - [+] levle 2: always getting poltergeists
    - [+] debug getrandomrace()....
    - [+] enforce f_rarity val[2] != NA!!
- [+] empty levels
    - [+] whenever we pick rr=frquent, we're getting no monsters
    - [+] start MONSTER randomness at COMMON
- [+] bug: i lost f_size when i died when polymorphed!
- [+] yumi should only hate killing helpless things, not ANYTHNIG!
- [+] make armour more common than weapons, since this tends to get
      damaged
- [+] bookshelf (contains scrolls/books)
- [+] wardrobe (contains armour)
- [+] coffin sometimes contains corpses
- [+] not getting enough objects now ??
This commit is contained in:
Rob Pearce 2011-11-22 00:38:01 +00:00
parent c20802fc6e
commit c596623603
9 changed files with 128 additions and 83 deletions

View File

@ -185,7 +185,7 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) {
// anyone there? if so just attack. // anyone there? if so just attack.
if (c->lf) { if (c->lf) {
if (!force && isplayer(lf) && isprone(lf)) { if (!force && isplayer(lf) && isprone(lf)) {
if (!warnabout("Really attack while prone (-40% accuracy)?")) { if (!warnabout("Really attack while prone (-4 accuracy)?")) {
return B_TRUE; return B_TRUE;
} }
} }

66
data.c
View File

@ -1117,13 +1117,13 @@ void initobjects(void) {
addflag(lastobjectclass->flags, F_SHOP, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_SHOP, B_TRUE, NA, NA, NULL);
addflag(lastobjectclass->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_OPERABLE, B_TRUE, NA, NA, NULL);
addoc(OC_DFEATURE, "Dungeon Features", "Doors, etc.", '\\', C_GREY, RR_RARE); addoc(OC_DFEATURE, "Dungeon Features", "Doors, etc.", '\\', C_GREY, RR_RARE);
addoc(OC_FURNITURE, "Furniture", "Various kinds of mundane (or not so mundane) furnishings.", '\\', C_BROWN, RR_COMMON); addoc(OC_FURNITURE, "Furniture", "Various kinds of mundane (or not so mundane) furnishings.", '\\', C_BROWN, RR_FREQUENT);
addocnoun(lastobjectclass, "furniture"); addocnoun(lastobjectclass, "furniture");
addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addoc(OC_TERRAIN, "Terrain", "Water, etc.", '\\', C_GREY, RR_NEVER); addoc(OC_TERRAIN, "Terrain", "Water, etc.", '\\', C_GREY, RR_NEVER);
addoc(OC_TRAP, "Trap", "Fiendish traps.", '^', C_GREY, RR_RARE); addoc(OC_TRAP, "Trap", "Fiendish traps.", '^', C_GREY, RR_RARE);
addocnoun(lastobjectclass, "trap"); addocnoun(lastobjectclass, "trap");
addoc(OC_MONEY, "Money", "The standard currency of Nexus.", '$', C_GREY, RR_COMMON); addoc(OC_MONEY, "Money", "The standard currency of Nexus.", '$', C_GREY, RR_UNCOMMON);
addoc(OC_SCROLL, "Scrolls", "An arcane roll of parchment, inscribed with many magical glyphs.", '?', C_GREY, RR_UNCOMMON); addoc(OC_SCROLL, "Scrolls", "An arcane roll of parchment, inscribed with many magical glyphs.", '?', C_GREY, RR_UNCOMMON);
addocnoun(lastobjectclass, "scroll"); addocnoun(lastobjectclass, "scroll");
addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, NULL);
@ -1161,7 +1161,7 @@ void initobjects(void) {
addflag(lastobjectclass->flags, F_ENCHANTABLE, B_TRUE, NA, NA, NULL); addflag(lastobjectclass->flags, F_ENCHANTABLE, B_TRUE, NA, NA, NULL);
addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_MASTERWORK, 17, NA, NULL); addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_MASTERWORK, 17, NA, NULL);
addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_SHODDY, 34, NA, NULL); addflag(lastobjectclass->flags, F_CANHAVEOBMOD, OM_SHODDY, 34, NA, NULL);
addoc(OC_ARMOUR, "Armour/Clothing", "Protective gear.", '[', C_GREY, RR_COMMON); addoc(OC_ARMOUR, "Armour/Clothing", "Protective gear.", '[', C_GREY, RR_FREQUENT);
addocnoun(lastobjectclass, "armour"); addocnoun(lastobjectclass, "armour");
addocnoun(lastobjectclass, "clothing"); addocnoun(lastobjectclass, "clothing");
addocnoun(lastobjectclass, "clothes"); addocnoun(lastobjectclass, "clothes");
@ -4414,9 +4414,35 @@ void initobjects(void) {
// furniture // furniture
addot(OT_ARMOURRACK, "armour rack", "An upright metal rack made for armour storage.", MT_METAL, 150, OC_FURNITURE, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_UNCOMMON, NULL);
addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "\\");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_STARTOB, 80, NA, NA, "random armour");
addflag(lastot->flags, F_STARTOB, 60, NA, NA, "random armour");
addflag(lastot->flags, F_STARTOB, 50, NA, NA, "good armour");
addflag(lastot->flags, F_STARTOB, 50, NA, NA, "great armour");
addot(OT_BOOKSHELF, "bookshelf", "A set of wooden shelves, sized for book storage.", MT_WOOD, 150, OC_FURNITURE, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_RARE, NULL);
addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "\\");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_STARTOB, 90, NA, NA, "random scroll");
addflag(lastot->flags, F_STARTOB, 80, NA, NA, "random scroll");
addflag(lastot->flags, F_STARTOB, 70, NA, NA, "random scroll");
addflag(lastot->flags, F_STARTOB, 60, NA, NA, "random scroll");
addflag(lastot->flags, F_STARTOB, 60, NA, NA, "random book");
addflag(lastot->flags, F_STARTOB, 50, NA, NA, "random book");
addot(OT_CANDELABRUM, "candelabrum", "A large (and heavy) decorative candle, about human height.", MT_METAL, 60, OC_FURNITURE, SZ_HUMAN); 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, NA, "\\"); addflag(lastot->flags, F_GLYPH, C_YELLOW, NA, NA, "\\");
addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, RR_COMMON, NULL);
addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, 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_OPERONOFF, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_ACTIVATEPREFIX, NA, NA, NA, "lit"); addflag(lastot->flags, F_ACTIVATEPREFIX, NA, NA, NA, "lit");
@ -4429,17 +4455,19 @@ void initobjects(void) {
addflag(lastot->flags, F_CHARGEOUTMSG, B_TRUE, NA, NA, "goes out"); addflag(lastot->flags, F_CHARGEOUTMSG, B_TRUE, NA, NA, "goes out");
addot(OT_COFFIN, "coffin", "A wooden coffin, made for holding the dead.", MT_WOOD, 100, OC_FURNITURE, SZ_HUMAN); addot(OT_COFFIN, "coffin", "A wooden coffin, made for holding the dead.", MT_WOOD, 100, OC_FURNITURE, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_RARE, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 75, RR_UNCOMMON, NULL);
addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "|"); addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "|");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CONTAINER, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_STARTOB, 80, NA, NA, "3-4 piles of ash"); addflag(lastot->flags, F_STARTOB, 80, NA, NA, "corpse");
addflag(lastot->flags, F_STARTOB, 80, NA, NA, "5-10 bones"); addflag(lastot->flags, F_STARTOB, 70, NA, NA, "3-4 piles of ash");
addflag(lastot->flags, F_STARTOB, 70, NA, NA, "5-10 bones");
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL);
addot(OT_FIREPLACE, "fireplace", "A roaring fireplace.", MT_STONE, 200, OC_FURNITURE, SZ_LARGE); 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_GLYPH, C_RED, NA, NA, "\\"); addflag(lastot->flags, F_GLYPH, C_RED, NA, NA, "\\");
addflag(lastot->flags, F_PRODUCESLIGHT, 3, NA, IFACTIVE, NULL); addflag(lastot->flags, F_PRODUCESLIGHT, 3, NA, IFACTIVE, NULL);
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
@ -4447,8 +4475,9 @@ void initobjects(void) {
addflag(lastot->flags, F_ONFIRE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ONFIRE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL); addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_MAX, NA, NULL);
addot(OT_WEAPONRACK, "weapon rack", "A large matel frame, made to store weapons.", MT_METAL, 150, OC_FURNITURE, SZ_HUMAN); addot(OT_WEAPONRACK, "weapon rack", "A large matel frame, made to store weapons.", MT_METAL, 150, OC_FURNITURE, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_RARE, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 80, RR_UNCOMMON, NULL);
addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "\\"); addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "\\");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL);
@ -4460,8 +4489,7 @@ void initobjects(void) {
addflag(lastot->flags, F_STARTOB, 50, NA, NA, "great weapon"); addflag(lastot->flags, F_STARTOB, 50, NA, NA, "great weapon");
addot(OT_WOODENBARREL, "wooden barrel", "A solid wooden barrel.", MT_WOOD, 40, OC_FURNITURE, SZ_HUMAN); addot(OT_WOODENBARREL, "wooden barrel", "A solid wooden barrel.", MT_WOOD, 40, OC_FURNITURE, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_VILLAGE, 75, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL);
addflag(lastot->flags, F_RARITY, H_ALL, 75, NA, NULL);
addflag(lastot->flags, F_GLYPH, NA, NA, NA, "("); addflag(lastot->flags, F_GLYPH, NA, NA, NA, "(");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL); addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_LARGE, NA, NULL);
addflag(lastot->flags, F_CRUSHABLE, SZ_HUGE, NA, NA, NULL); addflag(lastot->flags, F_CRUSHABLE, SZ_HUGE, NA, NA, NULL);
@ -4482,7 +4510,7 @@ void initobjects(void) {
addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL); addflag(lastot->flags, F_STARTOBCLASS, 50, OC_FOOD, NA, NULL);
addot(OT_WOODENTABLE, "wooden table", "A waist-height wooden table.", MT_WOOD, 25, OC_FURNITURE, SZ_HUMAN); addot(OT_WOODENTABLE, "wooden table", "A waist-height wooden table.", MT_WOOD, 25, OC_FURNITURE, SZ_HUMAN);
addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 70, RR_COMMON, NULL);
addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "\\"); addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "\\");
addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_HUMAN, NA, NULL); addflag(lastot->flags, F_IMPASSABLE, SZ_MIN, SZ_HUMAN, NA, NULL);
addflag(lastot->flags, F_CRUSHABLE, SZ_LARGE, NA, NA, NULL); addflag(lastot->flags, F_CRUSHABLE, SZ_LARGE, NA, NA, NULL);
@ -4495,7 +4523,7 @@ void initobjects(void) {
addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL); addflag(lastot->flags, F_DTVULN, DT_CHOP, NA, NA, NULL);
addot(OT_WOODENSTOOL, "wooden footstool", "A small, wooden footstool.", MT_WOOD, 5, OC_FURNITURE, SZ_MEDIUM); addot(OT_WOODENSTOOL, "wooden footstool", "A small, wooden footstool.", MT_WOOD, 5, OC_FURNITURE, SZ_MEDIUM);
addflag(lastot->flags, F_RARITY, H_ALL, 83, NA, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 83, RR_COMMON, NULL);
addflag(lastot->flags, F_GLYPH, NA, NA, NA, "\\"); addflag(lastot->flags, F_GLYPH, NA, NA, NA, "\\");
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL);
@ -7271,11 +7299,11 @@ void initrace(void) {
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_CANWILL, OT_A_FEIGNDEATH, NA, NA, NULL); 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_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, 87, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 87, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_FOREST, 87, NA, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, 87, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, 87, NA, NULL); addflag(lastrace->flags, F_RARITY, H_SWAMP, 87, RR_COMMON, NULL);
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);
addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+3"); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3");
addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL);
addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL);
addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, "");
@ -7294,7 +7322,7 @@ void initrace(void) {
addflag(lastrace->flags, F_DODGES, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DODGES, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_PACKATTACK, 2, DT_SLASH, 3, NULL); addflag(lastrace->flags, F_PACKATTACK, 2, DT_SLASH, 3, NULL);
addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_STARTJOB, 25, J_ROGUE, NA, NULL); addflag(lastrace->flags, F_STARTJOB, 10, J_ROGUE, NA, NULL);
addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL);
addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_MORALE, 0, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 0, NA, NA, NULL);
@ -7472,8 +7500,8 @@ void initrace(void) {
addrace(R_KOBOLD, "kobold", 18, 'k', C_BROWN, MT_FLESH, RC_HUMANOID, "An evil humanoid race with doglike features, kobolds are known for their cowardace and prefer to attack from a distance if at all possible."); addrace(R_KOBOLD, "kobold", 18, 'k', C_BROWN, MT_FLESH, RC_HUMANOID, "An evil humanoid race with doglike features, kobolds are known for their cowardace and prefer to attack from a distance if at all possible.");
addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL);
addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RARITY, H_DUNGEON, 95, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 95, RR_COMMON, NULL);
addflag(lastrace->flags, F_RARITY, H_SWAMP, 95, NA, 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_POISONCORPSE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, ""); addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, "");
addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL);

Binary file not shown.

2
defs.h
View File

@ -1485,6 +1485,8 @@ enum OBTYPE {
// tech l6 // tech l6
// none yet. // none yet.
// furniture // furniture
OT_ARMOURRACK,
OT_BOOKSHELF,
OT_CANDELABRUM, OT_CANDELABRUM,
OT_COFFIN, OT_COFFIN,
OT_FIREPLACE, OT_FIREPLACE,

6
flag.c
View File

@ -58,6 +58,7 @@ flag_t *addflag_real(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3,
int redrawstatatend = B_FALSE; int redrawstatatend = B_FALSE;
int i; int i;
// identified things mean all new flags are autmaticlaly known. // identified things mean all new flags are autmaticlaly known.
if (hasflag(fp, F_IDENTIFIED)) { if (hasflag(fp, F_IDENTIFIED)) {
known = B_KNOWN; known = B_KNOWN;
@ -73,6 +74,11 @@ flag_t *addflag_real(flagpile_t *fp, enum FLAG id, int val1, int val2, int val3,
return NULL; return NULL;
} }
// overrite NA rarity
if ((id == F_RARITY) && (val3 == NA)) {
val3 = RR_COMMON;
}
// auto-increment order for EXTRADESC flag // auto-increment order for EXTRADESC flag
if ((id == F_EXTRADESC) && (val1 == NA)) { if ((id == F_EXTRADESC) && (val1 == NA)) {
flag_t *retflag[MAXCANDIDATES]; flag_t *retflag[MAXCANDIDATES];

6
io.c
View File

@ -4134,7 +4134,7 @@ void doeat(obpile_t *op) {
int dowear(obpile_t *op) { int dowear(obpile_t *op) {
object_t *o; object_t *o;
int rv; int rv;
o = askobject(op, "Wear what", NULL, 'W', AO_WEARABLE); o = askobject(op, "Wear what", NULL, '\0', AO_WEARABLE);
if (o) { if (o) {
if (isunknownbadobject(o) && skillcheck(player, A_WIS, 30, 0)) { if (isunknownbadobject(o) && skillcheck(player, A_WIS, 30, 0)) {
if (!confirm_badfeeling(o)) { if (!confirm_badfeeling(o)) {
@ -9289,7 +9289,7 @@ void showlfstats(lifeform_t *lf, int showall) {
xpneeded = getxpforlev(lf->level + 1) - lf->xp; xpneeded = getxpforlev(lf->level + 1) - lf->xp;
wprintw(mainwin, "%d (%ld XP, %ld for next)", lf->level, lf->xp, xpneeded); y++; wprintw(mainwin, "%d (%ld XP, %ld for next)", lf->level, lf->xp, xpneeded); y++;
} else { } else {
wprintw(mainwin, "%d", lf->level); y++; wprintw(mainwin, "%d", gethitdice(lf)); y++;
} }
if (isplayer(lf)) { if (isplayer(lf)) {
int attpoints; int attpoints;
@ -9753,7 +9753,7 @@ void showlfstats(lifeform_t *lf, int showall) {
//mvwprintw(mainwin, y, 0, "Threat rating: %0.1f",comparelfs(player, lf)); //mvwprintw(mainwin, y, 0, "Threat rating: %0.1f",comparelfs(player, lf));
wrapprint(mainwin, &y, &x, "%s ", buf); wrapprint(mainwin, &y, &x, "%s ", buf);
unsetcol(mainwin, lorecol); unsetcol(mainwin, lorecol);
y++; y++; x = 0;
} }
} }

115
lf.c
View File

@ -2280,7 +2280,7 @@ void die(lifeform_t *lf) {
} }
// mercy god doesn't like killing // mercy god doesn't like killing
angergodmaybe(R_GODMERCY, 1, GA_MURDER); //angergodmaybe(R_GODMERCY, 1, GA_MURDER);
} }
} }
@ -2780,7 +2780,7 @@ void dumplev(void) {
int min,max,prevmin,prevmax; int min,max,prevmin,prevmax;
gethitdicerange(i-1, &prevmin, &prevmax, RARITYVARIANCELF, B_FALSE); gethitdicerange(i-1, &prevmin, &prevmax, RARITYVARIANCELF, B_FALSE);
gethitdicerange(i, &min, &max, RARITYVARIANCELF, B_FALSE); gethitdicerange(i, &min, &max, RARITYVARIANCELF, B_FALSE);
fprintf(logfile, "Dlev %d (hd >= %d): ",i,min); fprintf(logfile, "Dlev %d (hd %d-%d): ",i,min,max);
for (r = firstrace ; r; r = r->next) { for (r = firstrace ; r; r = r->next) {
int hd = 0; int hd = 0;
hd = gethitdicerace(r); hd = gethitdicerace(r);
@ -2954,7 +2954,7 @@ int eat(lifeform_t *lf, object_t *o) {
// uncooked meat? // uncooked meat?
if (iscorpse(o) && isplayer(lf)) { if (iscorpse(o) && isplayer(lf)) {
if (!hasflag(o->flags, F_PREPARED)) { if (!hasflag(o->flags, F_PREPARED)) {
if (getskill(lf, SK_COOKING)) { if (!lfhasflag(lf, F_EATING) && getskill(lf, SK_COOKING)) {
int ch; int ch;
char ques[BUFLEN]; char ques[BUFLEN];
more(); more();
@ -3555,45 +3555,38 @@ void enhanceskills(lifeform_t *lf) {
// enhance fist strength // enhance fist strength
f = lfhasflagval(lf, F_HASATTACK, OT_FISTS, NA, NA, NULL); f = lfhasflagval(lf, F_HASATTACK, OT_FISTS, NA, NA, NULL);
if (f) { if (f) {
char newtext[BUFLEN]; int newdr;
strcpy(newtext, f->text); //newdr = ((lf->level+1) / 2) + 2;
newdr = lf->level+2;
/*
switch(lf->level) { switch(lf->level) {
case 2: case 2:
strcpy(newtext,"1d6"); newdr = 4; break;
break;
case 3: case 3:
newdr = 5; break;
case 4: case 4:
strcpy(newtext,"1d6+1"); newdr = 6; break;
break;
case 5: case 5:
strcpy(newtext,"2d4"); newdr = 7; break;
break;
case 6: case 6:
newdr = 8; break;
case 7: case 7:
strcpy(newtext,"3d3"); newdr = 9; break;
break;
case 8: case 8:
strcpy(newtext,"2d6"); newdr = 10; break;
break;
case 9: case 9:
case 10: case 10:
strcpy(newtext,"3d4"); newdr = 11; break;
break;
case 11: case 11:
strcpy(newtext,"3d4+1");
break;
case 12: case 12:
newdr = 12; break;
case 13: case 13:
strcpy(newtext,"4d4");
break;
case 14: case 14:
strcpy(newtext,"4d4+1"); newdr = 13; break;
break;
case 15: case 15:
strcpy(newtext,"5d4");
break;
case 16: case 16:
case 17: case 17:
newdr = 14; break;
strcpy(newtext,"4d6"); strcpy(newtext,"4d6");
break; break;
case 18: case 18:
@ -3609,8 +3602,11 @@ void enhanceskills(lifeform_t *lf) {
strcpy(newtext,"6d6"); strcpy(newtext,"6d6");
break; break;
} }
if (!streq(newtext, f->text)) { */
changeflagtext(f, newtext); if (newdr != f->val[1]) {
//if (!streq(newtext, f->text)) {
// changeflagtext(f, newtext);
f->val[1] = newdr;
if (isplayer(lf)) msg("^gYour unarmed attack damage has increased!"); if (isplayer(lf)) msg("^gYour unarmed attack damage has increased!");
} }
} }
@ -5766,16 +5762,17 @@ int getlfaccuracy(lifeform_t *lf, object_t *wep) {
} }
// agi scaling on weapon // agi scaling on weapon
getflags(wep->flags, retflag, &nretflags, F_ATTREQ, F_NONE); if (wep) {
for (i = 0; i < nretflags; i++) { getflags(wep->flags, retflag, &nretflags, F_ATTREQ, F_NONE);
if (retflag[i]->val[0] == A_AGI) { for (i = 0; i < nretflags; i++) {
int pctmod; if (retflag[i]->val[0] == A_AGI) {
meetsattreq(lf, retflag[i], wep, &pctmod); int pctmod;
acc += pctmod; meetsattreq(lf, retflag[i], wep, &pctmod);
acc += pctmod;
}
} }
} }
// modify for nausea // modify for nausea
if (lfhasflag(lf, F_NAUSEATED)) { if (lfhasflag(lf, F_NAUSEATED)) {
acc -= 25; acc -= 25;
@ -6694,7 +6691,10 @@ char *real_getlfnamea(lifeform_t *lf, char *buf, int usevis) {
enum LFSIZE getlfsize(lifeform_t *lf) { enum LFSIZE getlfsize(lifeform_t *lf) {
flag_t *f; flag_t *f;
f = hasflag(lf->flags, F_SIZE); f = hasflag(lf->flags, F_SIZE);
assert(f); if (!f) f = hasflag(lf->race->flags, F_SIZE);
if (!f) {
return SZ_HUMAN;
}
return f->val[0]; return f->val[0];
} }
@ -7009,7 +7009,7 @@ race_t *getrandomrace(cell_t *c, int forcedepth) {
race_t *poss[MAXRANDOMLFCANDIDATES]; race_t *poss[MAXRANDOMLFCANDIDATES];
int nposs = 0; int nposs = 0;
int selidx; int selidx;
int db = B_FALSE; int db = B_TRUE;
int depth; int depth;
int hdmin,hdmax; int hdmin,hdmax;
enum RARITY wantrr = RR_FREQUENT; enum RARITY wantrr = RR_FREQUENT;
@ -7029,7 +7029,7 @@ race_t *getrandomrace(cell_t *c, int forcedepth) {
// pick rr... // pick rr...
wantrr = pickrr(TT_MONSTER); wantrr = pickrr(TT_MONSTER);
if (db) dblog("finding random lf with hitdice %d-%d and rr <= %d\n",hdmin,hdmax, wantrr); if (db) dblog("finding random lf with hitdice %d-%d and rr <= %d (for depth %d)\n",hdmin,hdmax, wantrr, depth);
// try to find a lf of this type which will // try to find a lf of this type which will
// fit in the map's habitat // fit in the map's habitat
@ -7061,7 +7061,7 @@ race_t *getrandomrace(cell_t *c, int forcedepth) {
if (rarflag) { if (rarflag) {
if ((rarflag->val[2] == NA) || (rarflag->val[2] <= wantrr)) { if ((rarflag->val[2] == NA) || (rarflag->val[2] <= wantrr)) {
if (db) dblog("%s has correct rarity rr (%d <= wantr(%d)).",r->name, rarflag->val[2], wantrr); if (db) dblog("%s has correct rarity rr (%d <= wantrr(%d)).",r->name, rarflag->val[2], wantrr);
valid = B_TRUE; valid = B_TRUE;
thisrr = rarflag->val[2]; thisrr = rarflag->val[2];
} else { } else {
@ -7099,17 +7099,22 @@ race_t *getrandomrace(cell_t *c, int forcedepth) {
// nothing found? // nothing found?
if (nposs == 0) { if (nposs == 0) {
// already at lowest hitdice? // at frequency "FREQUENT"? Try COMMON.
if ((hdmax >= maxmonhitdice) && (hdmin <= 0)) { if (wantrr == RR_FREQUENT) {
// give up if (db) dblog("no possible lfs like this. trying again with rr_common instead of frequent.\n");
if (db) dblog("no possible lf at all! giving up."); wantrr = RR_COMMON;
return NULL; } else {
} if ((hdmax >= maxmonhitdice) && (hdmin <= 0)) {
// give up
if (db) dblog("no possible lf at all! giving up.");
return NULL;
}
// expand range and try again // expand range and try again
hdmax ++; if (hdmax > maxmonhitdice) hdmax = maxmonhitdice; hdmax++; if (hdmax > maxmonhitdice) hdmax = maxmonhitdice;
hdmin --; if (hdmin < 0) hdmin = 0; hdmin--; if (hdmin < 0) hdmin = 0;
if (db) dblog("no possible lfs like this. trying again with hitdice %d-%d\n",hdmin,hdmax); if (db) dblog("no possible lfs like this. trying again with hitdice %d-%d\n",hdmin,hdmax);
}
} }
} }
@ -7844,14 +7849,14 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
f = lfhasflagval(lf, F_HASATTACK, OT_FISTS, NA, NA, NULL); f = lfhasflagval(lf, F_HASATTACK, OT_FISTS, NA, NA, NULL);
if (f) { if (f) {
// monk fists do more damage // monk fists do more damage
changeflagtext(f, "1d4"); f->val[1] = 3;
} }
} else if (j->id == J_PIRATE) { } else if (j->id == J_PIRATE) {
flag_t *f; flag_t *f;
f = lfhasflagval(lf, F_HASATTACK, OT_FISTS, NA, NA, NULL); f = lfhasflagval(lf, F_HASATTACK, OT_FISTS, NA, NA, NULL);
if (f) { if (f) {
f->val[0] = OT_HOOKHAND; f->val[0] = OT_HOOKHAND;
changeflagtext(f, "1d4"); f->val[1] = 4;
} }
} else if (j->id == J_SHOPKEEPER) { } else if (j->id == J_SHOPKEEPER) {
// shopkeepers are not hostile. // shopkeepers are not hostile.
@ -14302,18 +14307,18 @@ void startlfturn(lifeform_t *lf) {
} }
// suffocate? // suffocate?
if (lfhasflag(lf, F_NEEDSWATER) && !hasobwithflag(lf->cell->obpile, F_DEEPWATER)) { if (lfhasflag(lf, F_NEEDSWATER) && !hasobwithflag(lf->cell->obpile, F_DEEPWATER)) {
int dam;
if (isplayer(lf)) { if (isplayer(lf)) {
msg("^BYou are suffocating without water to breath!"); msg("^BYou are suffocating without water to breath!");
} else if (cansee(player, lf)) { } else if (cansee(player, lf)) {
int dam;
char lfname[BUFLEN]; char lfname[BUFLEN];
getlfname(lf, lfname); getlfname(lf, lfname);
msg("^%c%s is suffocating!", getlfcol(lf, CC_VBAD), lfname); msg("^%c%s is suffocating!", getlfcol(lf, CC_VBAD), lfname);
dam = lf->maxhp / 3;
limit(&dam, 1, NA);
losehp(lf, dam, DT_DIRECT, NULL, "suffocation");
if (isdead(lf)) return;
} }
dam = lf->maxhp / 3;
limit(&dam, 1, NA);
losehp(lf, dam, DT_DIRECT, NULL, "suffocation");
if (isdead(lf)) return;
} }
// vampire in sunlight? // vampire in sunlight?
if ((lf->race->id == R_VAMPIRE) && isoutdoors(lf->cell->map) && !isnighttime()) { if ((lf->race->id == R_VAMPIRE) && isoutdoors(lf->cell->map) && !isnighttime()) {

View File

@ -5129,7 +5129,7 @@ char *real_getrandomob(map_t *map, char *buf, int forcedepth, int forcehabitat,
int amt; int amt;
flag_t *f; flag_t *f;
int db = B_FALSE; int db = B_FALSE;
int partdb = B_TRUE; int partdb = B_FALSE;
char *pluralname; char *pluralname;
char brandname[BUFLEN]; char brandname[BUFLEN];
char cursestr[BUFLEN]; char cursestr[BUFLEN];
@ -8422,18 +8422,22 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
enum RARITY pickrr(int whatfor) { enum RARITY pickrr(int whatfor) {
enum RARITY wantrr = RR_FREQUENT; enum RARITY wantrr = RR_FREQUENT;
int chance = 3; int chance = 2;
int mod = 0;
if ((gamemode == GM_GAMESTARTED) && hasflag(player->flags, F_EXTRALUCK)) { if ((gamemode == GM_GAMESTARTED) && hasflag(player->flags, F_EXTRALUCK)) {
if (whatfor == TT_OBJECT) { if (whatfor == TT_OBJECT) {
chance = 2; wantrr++;
} else if (whatfor == TT_MONSTER) { } else if (whatfor == TT_MONSTER) {
chance = 4; mod = 1;
} }
} }
// pick rr... // pick rr...
while ((wantrr < RR_VERYRARE) && onein(chance)) { while ((wantrr < RR_VERYRARE) && onein(chance)) {
wantrr++; wantrr++;
//chance = wantrr + 1 + mod;
chance = 2 + mod;
} }
return wantrr; return wantrr;
} }

2
save.c
View File

@ -1122,7 +1122,7 @@ int writehiscore(lifeform_t *lf, int *rank) {
// add escapes // add escapes
escaped = strdup(killedby); escaped = strdup(killedby);
escaped = strrep(escaped, "'", "\\'", NULL); escaped = strrep(escaped, "'", "''", NULL);
if (!lfhasflag(lf, F_NOSCORE)) { if (!lfhasflag(lf, F_NOSCORE)) {
asprintf(&cmd, "insert into 'hiscores' (score,name,job,killedby) VALUES (%ld, '%s', '%s', '%s')", score, pname, jobname, escaped); asprintf(&cmd, "insert into 'hiscores' (score,name,job,killedby) VALUES (%ld, '%s', '%s', '%s')", score, pname, jobname, escaped);