*Rats should be immune to disease

*Increase IQ bracket level required to count as "genius"
*prevent baba yaga's hut (or any F_NORANDOM buildings) from being randomly created
This commit is contained in:
Rob Pearce 2016-07-07 16:25:06 +10:00
parent c9e4e4f5f4
commit 7a5563de68
4 changed files with 34 additions and 23 deletions

11
data.c
View File

@ -2515,7 +2515,7 @@ void initobjects(void) {
// baba yaga's hut
addot(OT_BABAYAGAHUT, "wooden hut", "A small wooden cabin on the ground, two chicken's legs folded underneath it.", MT_DRAGONWOOD, 1000, OC_BUILDING, SZ_LARGE);
addflag(lastot->flags, F_NOKO, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NORANDOM, B_TRUE, NA, NA, 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_GLYPH, C_WOOD, '_', NA, NULL);
@ -2527,6 +2527,7 @@ void initobjects(void) {
// the exit to baba yaga's hut
addot(OT_BYHUTDOOR, "hut's doorway", "The front door of Baba Yaga's hut.", MT_STONE, 3000, OC_DFEATURE, SZ_HUGE);
addflag(lastot->flags, F_NORANDOM, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_UNIQUE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_THE, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_GLYPH, C_WOOD, '>', NA, NULL);
@ -15815,6 +15816,8 @@ void initrace(void) {
addflag(lastrace->flags, F_TREMORSENSE, 2, NA, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_FLY, SV_TALK, NA, "^flapping wings");
addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
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_RARE, NULL);
@ -17073,6 +17076,7 @@ void initrace(void) {
addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CON, AT_RANDOM, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_WIS, AT_LOW, NA, NULL);
addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_STARTATT, A_CHA, AT_AVERAGE, NA, NULL);
addflag(lastrace->flags, F_HITDICE, 1, NA, 4, NULL);
addflag(lastrace->flags, F_TR, 1, NA, NA, NULL);
@ -17111,6 +17115,7 @@ void initrace(void) {
addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_RETALIATE, DT_PIERCE, NA, NA, "1d4^sharp spines");
addflag(lastrace->flags, F_CORPSEFLAG, F_SHARP, 1, 4, NULL);
addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addrace(R_RAT, "giant rat", 3, 'r', C_BROWN, MT_FLESH, RC_ANIMAL, "An aggressive rodent, approximately the size of a cat.");
setbodytype(lastrace, BT_QUADRAPED);
@ -17142,6 +17147,7 @@ void initrace(void) {
addflag(lastrace->flags, F_DTRESIST, DT_COLD, NA, NA, NULL);
addflag(lastrace->flags, F_CANEATRAW, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_WALKVERB, NA, NA, NA, "scuttle");
addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^squeaking");
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 1, NA, "squeaks^squeaking");
@ -17179,6 +17185,7 @@ void initrace(void) {
addflag(lastrace->flags, F_WALKVERB, NA, NA, NA, "scuttle");
addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^squeaking");
addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 1, NA, "squeaks^squeaking");
addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addrace(R_RATMIND, "mesmerat", 3, 'r', C_PINK, MT_FLESH, RC_ANIMAL, "Glowing, irradiated rats which have developed amazing intellects and mental powers.");
@ -17214,6 +17221,7 @@ void initrace(void) {
addflag(lastrace->flags, F_RNDSPELLCOUNT, 5, NA, NA, NULL);
addflag(lastrace->flags, F_RNDSPELLSCHOOL, SS_MENTAL, 1, 2, NULL);
addflag(lastrace->flags, F_EATCONFER, F_MUTABLE, B_TRUE, NA, "100");
addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addrace(R_RATPLAGUE, "plague rat", 3, 'r', C_GREEN, MT_FLESH, RC_ANIMAL, "Plague rats are named both for their infectious bite as well as the great speed at which they run.");
setbodytype(lastrace, BT_QUADRAPED);
@ -17253,6 +17261,7 @@ void initrace(void) {
addflag(lastrace->flags, F_POISONCORPSE, B_TRUE, NA, NA, NULL);
addflag(lastrace->flags, F_FILLPOT, OT_POT_POISON, BLOODFORPOT, NA, NULL);
addflag(lastrace->flags, F_GERMS, NA, NA, NA, NULL);
addflag(lastrace->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addrace(R_ROC, "roc", 1, 'A', C_LIGHTMAGENTA, MT_FLESH, RC_ANIMAL, "Rocs are unbelievably gargantuan birds or prey, large enough to carry a fully-grown elephant. They are generally peaceful, but deadly once provoked."); // 'A' for Avian
setbodytype(lastrace, BT_BIRD);

14
lf.c
View File

@ -15289,7 +15289,7 @@ int isgenius(lifeform_t *lf) {
if (lfhasflag(lf, F_OMNIPOTENT) ||
lfhasflag(lf, F_EXTRAINFO) ||
iqb >= AT_VHIGH) {
iqb >= AT_EXHIGH) {
return B_TRUE;
}
return B_FALSE;
@ -16000,6 +16000,7 @@ void addraceclassflags(flagpile_t *fp, enum RACECLASS rcid, enum RACE rid) {
addflag(fp, F_BREATHWATER, B_TRUE, NA, NA, NULL);
addflag(fp, F_DTIMMUNE, DT_WATER, NA, NA, NULL);
addflag(fp, F_STABILITY, B_TRUE, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
} else if (rcid == RC_DEMON) {
addflag(fp, F_NOBREATH, B_TRUE, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
@ -16008,16 +16009,19 @@ void addraceclassflags(flagpile_t *fp, enum RACECLASS rcid, enum RACE rid) {
addflag(fp, F_NOSLEEP, B_TRUE, NA, NA, NULL);
addflag(fp, F_SEEINVIS, B_TRUE, NA, NA, NULL);
addflag(fp, F_NOSTAM, B_TRUE, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
} else if (rcid == RC_INSECT) {
addflag(fp, F_NOSTAM, B_TRUE, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addflag(fp, F_STABILITY, B_TRUE, NA, NA, NULL);
addflag(fp, F_DTRESIST, DT_COLD, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
} else if (rcid == RC_DRAGON) {
// wyrms hate hydras
if (rid != R_HYDRA) {
addflag(fp, F_HATESRACE, R_HYDRA, NA, NA, NULL);
}
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
} else if (rcid == RC_GOD) {
addflag(fp, F_NOBREATH, B_TRUE, NA, NA, NULL);
addflag(fp, F_PIETY, 100, NA, NA, NULL);
@ -16038,11 +16042,13 @@ void addraceclassflags(flagpile_t *fp, enum RACECLASS rcid, enum RACE rid) {
addflag(fp, F_NOSTAM, B_TRUE, NA, NA, NULL);
addflag(fp, F_GIFTTIMER, 0, 50, NA, NULL);
addflag(fp, F_NONAUSEA, B_TRUE, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
} else if (rcid == RC_MAGIC) {
addflag(fp, F_NOBREATH, B_TRUE, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
addflag(fp, F_NOSTAM, B_TRUE, NA, NA, NULL);
addflag(fp, F_NONAUSEA, B_TRUE, NA, NA, NULL);
addflag(fp, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
} else if (rcid == RC_PLANT) {
addflag(fp, F_NOKO, B_TRUE, NA, NA, NULL);
addflag(fp, F_GETKILLEDVERB, NA, NA, NA, "destroy");
@ -19953,6 +19959,7 @@ int poison(lifeform_t *lf, int howlong, enum POISONTYPE ptype, int power, char *
return B_TRUE;
}
// plants can't be diseased
if (getraceclass(lf) == RC_PLANT) {
return B_TRUE;
}
@ -21790,6 +21797,7 @@ void setbodytype(race_t *r, enum BODYTYPE bt) {
if (getracesize(r->id) <= SZ_SMALL) {
addflagifneeded(r->flags, F_STABILITY, B_TRUE, NA, NA, NULL);
}
addflagifneeded(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
break;
case BT_HUMANOID:
for (i = BP_WEAPON; i <= BP_LEFTFINGER; i++) {
@ -21804,6 +21812,7 @@ void setbodytype(race_t *r, enum BODYTYPE bt) {
addbodypart(r, BP_WINGS, NULL);
addflag(r->flags, F_SEEWITHOUTEYES, B_TRUE, NA, NA, NULL );
addflagifneeded(r->flags, F_STABILITY, B_TRUE, NA, NA, NULL);
addflagifneeded(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
break;
case BT_QUADRAPED:
addbodypart(r, BP_EYES, NULL);
@ -21824,12 +21833,14 @@ void setbodytype(race_t *r, enum BODYTYPE bt) {
addbodypart(r, BP_BODY, NULL);
addbodypart(r, BP_TAIL, NULL);
addflagifneeded(r->flags, F_STABILITY, B_TRUE, NA, NA, NULL);
addflagifneeded(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
break;
case BT_SNAKE:
addbodypart(r, BP_EYES, NULL);
addbodypart(r, BP_HEAD, NULL);
addbodypart(r, BP_TAIL, NULL);
addflagifneeded(r->flags, F_STABILITY, B_TRUE, NA, NA, NULL);
addflagifneeded(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
break;
case BT_SPIDER:
addbodypart(r, BP_EYES, NULL);
@ -21837,6 +21848,7 @@ void setbodytype(race_t *r, enum BODYTYPE bt) {
addbodypart(r, BP_BODY, "abdomen");
addbodypart(r, BP_LEGS, NULL);
addflagifneeded(r->flags, F_STABILITY, B_TRUE, NA, NA, NULL);
addflagifneeded(r->flags, F_DISEASEIMMUNE, B_TRUE, NA, NA, NULL);
break;
}

2
map.c
View File

@ -9684,7 +9684,7 @@ int linkstairs(object_t *o, object_t *o2) {
c2 = othermap->cell[n];
oo = hasob(c2->obpile, otherstairtype->id);
if (oo) {
if (!db) dblog("linkstairs(): possibility: '%s'", oo->type->name);
if (db) dblog("linkstairs(): possibility: '%s'", oo->type->name);
// remember all stairs of correct type, for debugging.
poss[nposs++] = oo;
// does it go nowhere?

View File

@ -5366,7 +5366,7 @@ objecttype_t *getrandomobofclass(enum OBCLASS ocid, int minrarity, int maxrarity
while (tryagain) {
tryagain = B_FALSE;
for (ot = objecttype ; ot ; ot = ot->next) {
if ((ot->obclass->id == ocid) && !hasflag(ot->flags, F_UNIQUE)) {
if ((ot->obclass->id == ocid) && !hasflag(ot->flags, F_UNIQUE) && !hasflag(ot->flags, F_NORANDOM)) {
int rarityok = B_FALSE;
int skillok = B_FALSE;
int condok = B_FALSE;
@ -7214,22 +7214,6 @@ objecttype_t *real_getrandomob(cell_t *cell, char *buf, int forcedepth, int forc
}
}
/*
if (!nwantclass) {
if (wantsk || nwantdt) {
wantclass[0] = OC_WEAPON;
nwantclass = 1;
} else if (!nwantflag) {
wantclass[0] = getrandomobclass(hab->id);
nwantclass = 1;
//if (wantclass[0] == OC_WAND) {
//dblog("random WAND picked!");
//partdb = B_TRUE;
//}
}
}
*/
if (!multiwantcl && (wantcl == OC_BUILDING)) {
int minused = 9999;
objecttype_t *selot = NULL;
@ -7243,11 +7227,15 @@ objecttype_t *real_getrandomob(cell_t *cell, char *buf, int forcedepth, int forc
nposs = 0;
for (i = 0; i < nbuildingusage; i++) {
if (buildingusage[i].count == minused) {
objecttype_t *bt;
enum OBTYPE thisoid;
thisoid = buildingusage[i].oid;
poss[nposs] = findot(thisoid);
assert(poss[nposs]);
nposs++;
bt = findot(thisoid);
assert(bt);
if (!hasflag(bt->flags, F_NORANDOM) && !hasflag(bt->flags, F_UNIQUE)) {
poss[nposs] = bt;
nposs++;
}
}
}
assert(nposs > 0);
@ -7276,6 +7264,8 @@ objecttype_t *real_getrandomob(cell_t *cell, char *buf, int forcedepth, int forc
int rarok = B_FALSE, condok = B_TRUE;
flag_t *rarflag = NULL;
if (hasflag(ot->flags, F_NORANDOM)) continue;
// correct rarity number?
if (hab) {
rarflag = hasflagval(ot->flags, F_RARITY, hab->id, NA, NA, NULL);