From ffb61612e3fce17cef660d4a69e3fe447676a955 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 11 Apr 2023 13:19:46 +0300 Subject: [PATCH] Option to create the character deaf Allows creating your character permanently deaf, for that added challenge. Breaks saves. --- doc/Guidebook.mn | 9 +++++++-- doc/Guidebook.tex | 9 +++++++-- doc/fixes3-7-0.txt | 1 + include/optlist.h | 2 ++ include/patchlevel.h | 2 +- include/you.h | 1 + include/youprop.h | 2 +- src/attrib.c | 3 ++- src/insight.c | 2 ++ src/potion.c | 3 ++- src/timeout.c | 3 ++- src/topten.c | 1 + 12 files changed, 29 insertions(+), 9 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 0eeb03edd..c5cf4a122 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -3355,6 +3355,8 @@ Reached the Elemental Planes. Reached the Astral Plane level. .PL Blind Blind from birth. +.PL Deaf +Deaf from birth. .PL Nudist Never wore any armor. .PL Ascended @@ -3393,10 +3395,10 @@ instrument played closely enough\(embut not too close!\(emto the Castle level's drawbridge or can be given to you via prayer boon. .pg -\fIBlind\fP and \fINudist\fP are also conducts, and they can only be +\fIBlind\fP, \fIDeaf\fP, and \fINudist\fP are also conducts, and they can only be enabled by setting the correspondingly named option in NETHACKOPTIONS or run-time configuration file prior to game start. -In the case of \fIBlind\fP, the option also enforces the conduct. +In the case of \fIBlind\fP and \fIDeaf\fP, the option also enforces the conduct. They aren't really significant accomplishments unless/until you make substantial progress into the dungeon. . @@ -3815,6 +3817,9 @@ Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). Persistent. .lp dark_room Show out-of-sight areas of lit rooms (default on). Persistent. +.lp "deaf " +Start the character permanently deaf (default false). +Persistent. .lp disclose Controls what information the program reveals when the game ends. Value is a space separated list of prompting/category pairs diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 80c57ad7b..317c9329f 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3635,6 +3635,8 @@ Reached the Elemental Planes. Reached the Astral Plane level. \item[{\tt Blind}] Blind from birth. +\item[{\tt Deaf}] +Deaf from birth. \item[{\tt Nudist}] Never wore any armor. \item[{\tt Ascended}] @@ -3683,10 +3685,10 @@ enough---but not too close!---to the Castle level's drawbridge or can be given to you via prayer boon. %.pg -{\it Blind\/} and {\it Nudist\/} are also conducts, and they can only be +{\it Blind\/}, {\it Deaf\/}, and {\it Nudist\/} are also conducts, and they can only be enabled by setting the correspondingly named option in {\tt NETHACKOPTIONS} or run-time configuration file prior to game start. -In the case of {\it Blind\/}, the option also enforces the conduct. +In the case of {\it Blind\/} and {\it Deaf\/}, the option also enforces the conduct. They aren't really significant accomplishments unless/until you make substantial progress into the dungeon. @@ -4161,6 +4163,9 @@ peaceable creatures (default on). Persistent. \item[\ib{dark\verb+_+room}] Show out-of-sight areas of lit rooms (default on). Persistent. %.lp +\item[\ib{deaf}] +Start the character permanently deaf (default false). Persistent. +%.lp \item[\ib{disclose}] Controls what information the program reveals when the game ends. Value is a space separated list of prompting/category pairs diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 61018d800..08f7a5d69 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2037,6 +2037,7 @@ give a helpful tip when first entering "farlook" mode add a boolean option tips to disable all of the helpful tips add a tutorial level engravings appear on the map display +option to create the character deaf Platform- and/or Interface-Specific New Features diff --git a/include/optlist.h b/include/optlist.h index 2d1247349..d4b5953f5 100644 --- a/include/optlist.h +++ b/include/optlist.h @@ -215,6 +215,8 @@ static int optfn_##a(int, int, boolean, char *, char *); #endif NHOPTB(dark_room, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.dark_room, Term_False) + NHOPTB(deaf, Advanced, 0, opt_in, set_in_config, + Off, Yes, No, No, "permadeaf", &u.uroleplay.deaf, Term_False) #ifdef BACKWARD_COMPAT NHOPTC(DECgraphics, Advanced, 70, opt_in, set_in_config, Yes, Yes, No, No, NoAlias, diff --git a/include/patchlevel.h b/include/patchlevel.h index 668992e6d..c2e0d0a15 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -17,7 +17,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 80 +#define EDITLEVEL 81 /* * Development status possibilities. diff --git a/include/you.h b/include/you.h index 4e17b3313..155cbd038 100644 --- a/include/you.h +++ b/include/you.h @@ -160,6 +160,7 @@ struct u_conduct { /* number of times... */ struct u_roleplay { boolean blind; /* permanently blind */ boolean nudist; /* has not worn any armor, ever */ + boolean deaf; /* permanently deaf */ long numbones; /* # of bones files loaded */ }; diff --git a/include/youprop.h b/include/youprop.h index 01464d00d..5301e800d 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -114,7 +114,7 @@ /* Timeout, plus a worn mask */ #define HDeaf u.uprops[DEAF].intrinsic #define EDeaf u.uprops[DEAF].extrinsic -#define Deaf (HDeaf || EDeaf) +#define Deaf (HDeaf || EDeaf || u.uroleplay.deaf) #define HFumbling u.uprops[FUMBLING].intrinsic #define EFumbling u.uprops[FUMBLING].extrinsic diff --git a/src/attrib.c b/src/attrib.c index 0fba34b4c..5052641f0 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -886,7 +886,8 @@ from_what(int propidx) /* special cases can have negative values */ * There are exceptions. Versatile jumping from spell or boots * takes priority over knight's innate but limited jumping. */ - if (propidx == BLINDED && u.uroleplay.blind) + if ((propidx == BLINDED && u.uroleplay.blind) + || (propidx == DEAF && u.uroleplay.deaf)) Sprintf(buf, " from birth"); else if (innateness == FROM_ROLE || innateness == FROM_RACE) Strcpy(buf, " innately"); diff --git a/src/insight.c b/src/insight.c index 738d3b23d..69a5bd526 100644 --- a/src/insight.c +++ b/src/insight.c @@ -2013,6 +2013,8 @@ show_conduct(int final) if (u.uroleplay.blind) you_have_been("blind from birth"); + if (u.uroleplay.deaf) + you_have_been("deaf from birth"); if (u.uroleplay.nudist) you_have_been("faithfully nudist"); diff --git a/src/potion.c b/src/potion.c index 58b52b58f..668068dc4 100644 --- a/src/potion.c +++ b/src/potion.c @@ -448,7 +448,8 @@ make_deaf(long xtime, boolean talk) if ((xtime != 0L) ^ (old != 0L)) { gc.context.botl = TRUE; if (talk) - You(old ? "can hear again." : "are unable to hear anything."); + You(old && !Deaf ? "can hear again." + : "are unable to hear anything."); } } diff --git a/src/timeout.c b/src/timeout.c index 42de676da..65caadfea 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -817,7 +817,8 @@ nh_timeout(void) * to this number must be thoroughly play tested. */ if ((inv_weight() > -500)) { - You("make a lot of noise!"); + if (!Deaf) + You("make a lot of noise!"); wake_nearby(); } } diff --git a/src/topten.c b/src/topten.c index 95a913707..96fe69a01 100644 --- a/src/topten.c +++ b/src/topten.c @@ -591,6 +591,7 @@ encode_extended_conducts(char *buf) if (sokoban_in_play()) add_achieveX(buf, "sokoban", !u.uconduct.sokocheat); add_achieveX(buf, "blind", u.uroleplay.blind); + add_achieveX(buf, "deaf", u.uroleplay.deaf); add_achieveX(buf, "nudist", u.uroleplay.nudist); add_achieveX(buf, "bonesless", !flags.bones);