Guidebook update and SEDUCE runtime switch

add SYSCF docs to the Guidebook because it's info needed in a binary distro
Guidebook.tex - also add some missing italics to some "NetHack" occurances
call nethack.org "official"
Guidebook.txt - didn't regenerate cleanly so no diff
add SEDUCE to SYSCF (only partly inspired by the recent email)
This commit is contained in:
keni
2010-05-13 00:54:13 +00:00
parent d55db3584e
commit bd1a922dae
12 changed files with 137 additions and 25 deletions

View File

@@ -1650,7 +1650,8 @@ command allows you to view all options and change most of them.
You can also set options automatically by placing them in the
NETHACKOPTIONS environment variable or in a configuration file.
Some versions of NetHack also have front-end programs that allow
you to set options before starting the game.
you to set options before starting the game or a global configuration
for system administrators.
.hn 2
Using the NETHACKOPTIONS environment variable
.pg
@@ -2638,6 +2639,56 @@ This will assist in the interface to speech synthesizers.
A lot of speech access programs use the number-pad to review the screen.
If this is the case, disable the number_pad option and use the traditional
Rogue-like commands.
.hn 2
Global Configuration for System Administrators
.pg
If NetHack is compiled with the SYSCF option, a system administrator
should set up a global configuration; this is a file in the
same format as the traditional per-user configuration file (see above).
This file should be named sysconf and placed in the same directory as
the other NetHack support files.
The options recognized in this file are listed below. Any option not
set uses a compiled-in default (which may not be appropriate for your
system).
.pg
.lp
WIZARDS
A space-separated list of user names who are allowed to play in wizard
mode (the debugging mode, not the magic-using role). A value of a single
asterisk (*) allows anyone to start a game in wizard mode.
.lp
SHELLERS
A list of users who are allowed to use the shell escape command (!). The
syntax is the same as WIZARDS.
.lp
MAXPLAYERS
Limit the maximum number of games that can be running at the same time.
.lp
SUPPORT
A string explaining how to get local support (no default value).
.lp
RECOVER
A string explaining how to recover a game on this system (no default value).
.lp
SEDUCE
0 or 1 to disable or enable, respectively, the SEDUCE option (see the source
for details on this function).
.pg
The following options affect the score file:
.pg
.lp
PERSMAX
Maximum number of entries for one person.
.lp
ENTRYMAX
Maximum number of entries in the score file.
.lp
POINTSMIN
Minimum number of points to get an entry in the score file.
.lp
PERS_IS_UID
0 or 1 to use user names or numeric userids, respectively, to identify
unique people for the score file.
.hn 1
Scoring
.pg
@@ -2881,7 +2932,7 @@ it for 3.3.1.
\fBChristian ``Marvin'' Bressler\fP maintained 3.5 for the Atari after he
resurrected it for 3.3.1.
.pg
There is a NetHack web site maintained by \fBKen Lorber\fP at http://www.nethack.org/.
The official NetHack web site is maintained by \fBKen Lorber\fP at http://www.nethack.org/.
.pg
- - - - - - - - - -
.pg

View File

@@ -161,6 +161,7 @@
* ENTRYMAX (max entries in the record file)
* POINTSMIN (min points to get an entry)
* PERS_IS_UID (0 or 1 - person is name or (numeric) userid)
* SEDUCE (0 or 1 - runtime disable/enable SEDUCE option)
*
* The following options select how the config space is stored:
* SYSCF_FILE in the named file

View File

@@ -2118,6 +2118,12 @@ E int FDECL(add_sound_mapping, (const char *));
E void FDECL(play_sound_for_message, (const char *));
#endif
/* ### sys.c ### */
#ifdef SYSCF
E void FDECL(sysopt_seduce_set,(int));
#endif
/* ### sys/msdos/sound.c ### */
#ifdef MSDOS

View File

@@ -29,8 +29,15 @@ struct sysopt {
int panictrace_glibc;
# endif
#endif
int seduce;
};
E struct sysopt sysopt;
#ifdef SEDUCE
# define SYSOPT_SEDUCE sysopt.seduce
#else
# define SYSOPT_SEDUCE 0
#endif
#endif /* SYS_H */

View File

@@ -2092,6 +2092,15 @@ int src;
if(sysopt.recover) free(sysopt.recover);
sysopt.recover = (char*)alloc(strlen(bufp)+1);
Strcpy(sysopt.recover, bufp);
} else if ( match_varname(buf, "SEDUCE", 6)) {
int temp = !!atoi(bufp); /* XXX this could be tighter */
/* allow anyone to turn it off, but only sysconf to turn it on*/
if(src!=SET_IN_SYS && temp!=0){
raw_printf("Illegal value in SEDUCE");
return 0;
}
sysopt.seduce = temp;
sysopt_seduce_set(temp);
} else if ( (src==SET_IN_SYS) && match_varname(buf, "MAXPLAYERS", 10)) {
int temp = atoi(bufp);
/* XXX to get more than 25, need to rewrite all lock code */

View File

@@ -1251,6 +1251,17 @@ dopois:
if(!mtmp->mcan) stealgold(mtmp);
break;
#ifdef SEDUCE
case AD_SSEX:
if(SYSOPT_SEDUCE){
if(could_seduce(mtmp, &youmonst, mattk) == 1
&& !mtmp->mcan)
if (doseduce(mtmp))
return 3;
break;
}
/* else FALLTHRU */
#endif
case AD_SITM: /* for now these are the same */
case AD_SEDU:
if (is_animal(mtmp->data)) {
@@ -1259,7 +1270,7 @@ dopois:
/* Continue below */
} else if (dmgtype(youmonst.data, AD_SEDU)
#ifdef SEDUCE
|| dmgtype(youmonst.data, AD_SSEX)
|| (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX))
#endif
) {
pline("%s %s.", Monnam(mtmp), mtmp->minvent ?
@@ -1300,14 +1311,7 @@ dopois:
return 3;
}
break;
#ifdef SEDUCE
case AD_SSEX:
if(could_seduce(mtmp, &youmonst, mattk) == 1
&& !mtmp->mcan)
if (doseduce(mtmp))
return 3;
break;
#endif
case AD_SAMU:
hitmsg(mtmp, mattk);
/* when the Wiz hits, 1/20 steals the amulet */
@@ -2196,7 +2200,7 @@ struct attack *mattk;
if(agrinvis && !defperc
#ifdef SEDUCE
&& mattk && mattk->adtyp != AD_SSEX
&& (!SYSOPT_SEDUCE || ( mattk && mattk->adtyp != AD_SSEX))
#endif
)
return 0;
@@ -2204,7 +2208,7 @@ struct attack *mattk;
if(pagr->mlet != S_NYMPH
&& ((pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
#ifdef SEDUCE
|| (mattk && mattk->adtyp != AD_SSEX)
|| (SYSOPT_SEDUCE && mattk && mattk->adtyp != AD_SSEX)
#endif
))
return 0;

View File

@@ -2548,14 +2548,16 @@ struct permonst _mons2[] = {
M3_INFRAVISIBLE|M3_INFRAVISION, CLR_BLUE),
/* standard demons & devils
*/
#ifdef SEDUCE
# define SEDUCTION_ATTACKS \
#define SEDUCTION_ATTACKS_YES \
A(ATTK(AT_BITE, AD_SSEX, 0, 0), ATTK(AT_CLAW, AD_PHYS, 1, 3), \
ATTK(AT_CLAW, AD_PHYS, 1, 3), NO_ATTK, NO_ATTK, NO_ATTK)
#else
# define SEDUCTION_ATTACKS \
#define SEDUCTION_ATTACKS_NO \
A(ATTK(AT_CLAW, AD_PHYS, 1, 3), ATTK(AT_CLAW, AD_PHYS, 1, 3), \
ATTK(AT_BITE, AD_DRLI, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK)
#ifdef SEDUCE
# define SEDUCTION_ATTACKS SEDUCTION_ATTACKS_YES
#else
# define SEDUCTION_ATTACKS SEDUCTION_ATTACKS_NO
#endif
MON("succubus", S_DEMON,
LVL(6, 12, 0, 70, -9), (G_NOCORPSE|1),
@@ -3479,6 +3481,10 @@ monst_init()
{
return;
}
struct attack sa_yes[NATTK] = SEDUCTION_ATTACKS_YES;
struct attack sa_no[NATTK] = SEDUCTION_ATTACKS_NO;
#endif
/*monst.c*/

View File

@@ -779,17 +779,20 @@ register struct monst *mtmp;
}
break;
case MS_SEDUCE:
{
int swval;
#ifdef SEDUCE
if (ptr->mlet != S_NYMPH &&
if (SYSOPT_SEDUCE) {
if (ptr->mlet != S_NYMPH &&
could_seduce(mtmp, &youmonst, (struct attack *)0) == 1) {
(void) doseduce(mtmp);
break;
}
switch ((poly_gender() != (int) mtmp->female) ? rn2(3) : 0)
#else
switch ((poly_gender() == 0) ? rn2(3) : 0)
}
swval = ((poly_gender() != (int) mtmp->female) ? rn2(3) : 0);
} else
#endif
{
swval = ((poly_gender() == 0) ? rn2(3) : 0);
switch(swval){
case 2:
verbl_msg = "Hello, sailor.";
break;
@@ -799,6 +802,7 @@ register struct monst *mtmp;
default:
pline_msg = "cajoles you.";
}
}
break;
#ifdef KOPS
case MS_ARREST:

View File

@@ -47,5 +47,25 @@ sys_early_init(){
# endif
# endif
#endif
#ifdef SEDUCE
sysopt.seduce = 1; /* if it's compiled in, default to on */
sysopt_seduce_set(sysopt.seduce);
#endif
}
extern struct attack sa_yes[NATTK];
extern struct attack sa_no[NATTK];
void
sysopt_seduce_set(val)
int val;
{
struct attack *setval = val ? sa_yes : sa_no;
int x;
for(x=0; x<NATTK; x++){
mons[PM_INCUBUS].mattk[x] = setval[x];
mons[PM_SUCCUBUS].mattk[x] = setval[x];
}
}

View File

@@ -2075,7 +2075,8 @@ use_weapon:
/* succubi/incubi are humanoid, but their _second_
* attack is AT_CLAW, not their first...
*/
if (i==1 && uwep && (u.umonnum == PM_SUCCUBUS ||
if (SYSOPT_SEDUCE && i==1 && uwep &&
(u.umonnum == PM_SUCCUBUS ||
u.umonnum == PM_INCUBUS)) goto use_weapon;
#endif
case AT_KICK:

View File

@@ -589,7 +589,7 @@ coord *cc;
but some need to stay cancelled */
if (!dmgtype(mtmp2->data, AD_SEDU)
#ifdef SEDUCE
&& !dmgtype(mtmp2->data, AD_SSEX)
&& (!SYSOPT_SEDUCE || !dmgtype(mtmp2->data, AD_SSEX))
#endif
) mtmp2->mcan = 0;
mtmp2->mcansee = 1; /* set like in makemon */

View File

@@ -23,6 +23,9 @@ MAXPLAYERS=10
# If not null, displayed at the end of a panic-save sequence.
#RECOVER=Run the recover program.
# Uncomment the next line to disable the SEDUCE option.
#SEDUCE=0
# Record (high score) file options.
# CAUTION: changing these after people have started playing games can
# lead to lost high scores!