- Safety googles (and anything tinted) will protect you from being blinded by bright lights.

This commit is contained in:
Rob Pearce 2016-05-31 00:49:04 +10:00
parent 7706dd8360
commit 23e50d1cf2
2 changed files with 16 additions and 7 deletions

1
data.c
View File

@ -8418,6 +8418,7 @@ void initobjects(void) {
addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL);
addflag(lastot->flags, F_GOESON, BP_EYES, NA, NA, NULL);
addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL);
addflag(lastot->flags, F_TINTED, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL);
addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL);

14
lf.c
View File

@ -13917,14 +13917,22 @@ int lfproduceslight(lifeform_t *lf, object_t **fromwhat) {
}
int lighthurtseyes(lifeform_t *lf) {
// note: if you don't have eyes, your'e safe!
if (!isblind(lf) && !lfhasflagval(lf, F_NOBODYPART, BP_EYES, NA, NA, NULL)) {
flag_t *f;
if (eyesshaded(lf)) return B_FALSE;
if (isblind(lf)) return B_FALSE;
// if you don't have eyes, your'e safe!
if (lfhasflagval(lf, F_NOBODYPART, BP_EYES, NA, NA, NULL)) {
return B_FALSE;
}
f = lfhasflag(lf, F_SEEINDARK);
if (f && (f->val[1] == B_BLINDABLE)) {
return B_TRUE;
}
}
return B_FALSE;
}