inappropriate very difficult reading message
add missing set of parentheses around lense test in read_ability calculation
This commit is contained in:
43
src/spell.c
43
src/spell.c
@@ -382,30 +382,31 @@ register struct obj *spellbook;
|
|||||||
|
|
||||||
/* Books are often wiser than their readers (Rus.) */
|
/* Books are often wiser than their readers (Rus.) */
|
||||||
spellbook->in_use = TRUE;
|
spellbook->in_use = TRUE;
|
||||||
if (!spellbook->blessed && spellbook->otyp != SPE_BOOK_OF_THE_DEAD) {
|
if (!spellbook->blessed &&
|
||||||
if (spellbook->cursed) {
|
spellbook->otyp != SPE_BOOK_OF_THE_DEAD) {
|
||||||
too_hard = TRUE;
|
if (spellbook->cursed) {
|
||||||
} else {
|
too_hard = TRUE;
|
||||||
/* uncursed - chance to fail */
|
} else {
|
||||||
int read_ability = ACURR(A_INT) + 4 + u.ulevel/2
|
/* uncursed - chance to fail */
|
||||||
- 2*objects[booktype].oc_level
|
int read_ability = ACURR(A_INT) + 4 + u.ulevel/2
|
||||||
+ (ublindf && ublindf->otyp == LENSES) ? 2 : 0;
|
- 2*objects[booktype].oc_level
|
||||||
/* only wizards know if a spell is too difficult */
|
+ ((ublindf && ublindf->otyp == LENSES) ? 2 : 0);
|
||||||
if (Role_if(PM_WIZARD) && read_ability < 20) {
|
/* only wizards know if a spell is too difficult */
|
||||||
char qbuf[QBUFSZ];
|
if (Role_if(PM_WIZARD) && read_ability < 20) {
|
||||||
Sprintf(qbuf,
|
char qbuf[QBUFSZ];
|
||||||
|
Sprintf(qbuf,
|
||||||
"This spellbook is %sdifficult to comprehend. Continue?",
|
"This spellbook is %sdifficult to comprehend. Continue?",
|
||||||
(read_ability < 12 ? "very " : ""));
|
(read_ability < 12 ? "very " : ""));
|
||||||
if (yn(qbuf) != 'y') {
|
if (yn(qbuf) != 'y') {
|
||||||
spellbook->in_use = FALSE;
|
spellbook->in_use = FALSE;
|
||||||
return(1);
|
return(1);
|
||||||
}
|
|
||||||
}
|
|
||||||
/* its up to random luck now */
|
|
||||||
if (rnd(20) > read_ability) {
|
|
||||||
too_hard = TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* its up to random luck now */
|
||||||
|
if (rnd(20) > read_ability) {
|
||||||
|
too_hard = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (too_hard) {
|
if (too_hard) {
|
||||||
|
|||||||
Reference in New Issue
Block a user