"fix" #H894 - reading mail violates illiterate conduct (trunk only)

From a bug report, reading a scroll
of mail violates illiterate conduct and he requests that it not do so.
I didn't go that far, since unlike needing to read the Book of the Dead
to be able to finish the game, reading scrolls of mail is completely
voluntary and someone attempting voluntary challanges can choose not to
do it.  Instead, this issues a prompt to require confirmation if reading
such a scroll will be the first violation of that conduct.  Ordinary
players can answer no and then use '!' to read mail from a shell.  I'm not
sure what'll happen to players on public servers who aren't given access
to a shell.  Usually they wouldn't be able to get mail either, so more
elaborate servers like the one at nethack.alt.org which allow players to
use mail to communicate with each other will have to come up with their
own solution (perhaps by providing a mail-reader-only shell).
This commit is contained in:
nethack.rankin
2007-07-14 00:37:51 +00:00
parent 1a9c99797a
commit e58458ef42
2 changed files with 22 additions and 5 deletions

View File

@@ -255,6 +255,8 @@ wizard mode: WIZKIT wishes could overflow inventory's 52 slots
when loading bones files, censor suspect characters from player-supplied
strings such as pet and fruit names
can't swap places with tame grid bug when moving diagonally
require confirmation to read a scroll of mail if doing so will be the first
violation of illiteracy conduct
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)read.c 3.5 2007/04/07 */
/* SCCS Id: @(#)read.c 3.5 2007/07/13 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -124,16 +124,31 @@ doread()
}
}
confused = (Confusion != 0);
#ifdef MAIL
if (scroll->otyp == SCR_MAIL) {
confused = FALSE; /* override */
/* reading mail is a convenience for the player and takes
place outside the game, so shouldn't affect gameplay;
on the other hand, it starts by explicitly making the
hero actively read something, which is pretty hard
to simply ignore; as a compromise, if the player has
maintained illiterate conduct so far, and this mail
scroll didn't come from bones, ask for confirmation */
if (!u.uconduct.literate) {
if (!scroll->spe &&
yn("Reading mail will violate \"illiterate\" conduct. Read anyway?")
!= 'y') return 0;
}
}
#endif
/* Actions required to win the game aren't counted towards conduct */
if (scroll->otyp != SPE_BOOK_OF_THE_DEAD &&
scroll->otyp != SPE_BLANK_PAPER &&
scroll->otyp != SCR_BLANK_PAPER)
u.uconduct.literate++;
confused = (Confusion != 0);
#ifdef MAIL
if (scroll->otyp == SCR_MAIL) confused = FALSE;
#endif
if(scroll->oclass == SPBOOK_CLASS) {
return(study_book(scroll));
}