From e645c0b4bb38595e95990930e207d68118a96d1f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 29 Aug 2024 20:51:09 +0300 Subject: [PATCH] Allow starting game as pauper, without any inventory And also without spells, skills, or preidentified items. This also implies nudist. Breaks saves and bones. --- doc/Guidebook.mn | 6 +++++- doc/Guidebook.tex | 7 ++++++- include/optlist.h | 3 +++ include/patchlevel.h | 2 +- include/you.h | 1 + src/insight.c | 2 ++ src/options.c | 4 ++++ src/topten.c | 1 + src/u_init.c | 8 ++++++++ 9 files changed, 31 insertions(+), 3 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 2446fab6a..d55d3c6c4 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -3465,6 +3465,8 @@ Blind from birth. Deaf from birth. .PL Nudist Never wore any armor. +.PL Pauper +Started out with no possessions. .PL Ascended Delivered the Amulet to its final destination. .PE @@ -3501,7 +3503,7 @@ 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, \fIDeaf\fP, and \fINudist\fP are also conducts, and they can only be +\fIBlind\fP, \fIDeaf\fP, \fINudist\fP, and \FIPauper\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 and \fIDeaf\fP, the option also enforces the conduct. @@ -4396,6 +4398,8 @@ use the \(oq\f(CR+\fP\(cq form and list entries to be added by their name and entries to be removed by \(oq\f(CR!\fP\(cq and name. The positive (no \(oq!\(cq) and negative (with \(oq!\(cq) entries can be intermixed. +.lp pauper +Start the character with no possessions (default false). Persistent. .lp perm_invent If true, always display your current inventory in a window (default false). .lp "" diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index dba5ab268..74e6c6884 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3731,6 +3731,8 @@ Blind from birth. Deaf from birth. \item[{\tt Nudist}] Never wore any armor. +\item[{\tt Pauper}] +Started out with no possessions. \item[{\tt Ascended}] Delivered the Amulet to its final destination. \elist @@ -3777,7 +3779,7 @@ enough---but not too close!---to the Castle level's drawbridge or can be given to you via prayer boon. %.pg -{\it Blind\/}, {\it Deaf\/}, and {\it Nudist\/} are also conducts, and they can only be +{\it Blind\/}, {\it Deaf\/}, {\it Nudist\/}, and {\it Pauper\/} 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\/} and {\it Deaf\/}, the option also enforces the conduct. @@ -4794,6 +4796,9 @@ and entries to be removed by `{\tt !}' and name. The positive (no `!') and negative (with `!') entries can be intermixed. %.lp +\item[\ib{pauper}] +Start the character with no possessions (default false). Persistent. +%.lp \item[\ib{perm\verb+_+invent}] If true, always display your current inventory in a window (default is false). %.lp "" diff --git a/include/optlist.h b/include/optlist.h index 00b954c60..08288fd08 100644 --- a/include/optlist.h +++ b/include/optlist.h @@ -548,6 +548,9 @@ static int optfn_##a(int, int, boolean, char *, char *); NHOPTC(paranoid_confirmation, Advanced, 28, opt_in, set_in_game, Yes, Yes, Yes, Yes, "prayconfirm", "extra prompting in certain situations") + NHOPTB(pauper, Advanced, 0, opt_in, set_in_config, + Off, Yes, No, No, NoAlias, &u.uroleplay.pauper, Term_False, + "start your character without any items") NHOPTB(perm_invent, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.perm_invent, Term_Off, "show persistent inventory window") diff --git a/include/patchlevel.h b/include/patchlevel.h index c8784d7da..ec66ac797 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 106 +#define EDITLEVEL 107 /* * Development status possibilities. diff --git a/include/you.h b/include/you.h index 8efaea587..cd734ca42 100644 --- a/include/you.h +++ b/include/you.h @@ -162,6 +162,7 @@ struct u_roleplay { boolean blind; /* permanently blind */ boolean nudist; /* has not worn any armor, ever */ boolean deaf; /* permanently deaf */ + boolean pauper; /* no starting inventory */ long numbones; /* # of bones files loaded */ }; diff --git a/src/insight.c b/src/insight.c index 91c74994e..577b01475 100644 --- a/src/insight.c +++ b/src/insight.c @@ -2061,6 +2061,8 @@ show_conduct(int final) you_have_been("deaf from birth"); if (u.uroleplay.nudist) you_have_been("faithfully nudist"); + if (u.uroleplay.pauper) + enl_msg(You_, "have gone", "started out", " without possessions", ""); if (!u.uconduct.food) enl_msg(You_, "have gone", "went", " without food", ""); diff --git a/src/options.c b/src/options.c index 7d7e09fae..01339bfd4 100644 --- a/src/options.c +++ b/src/options.c @@ -5172,6 +5172,10 @@ optfn_boolean( /* After the change */ switch (optidx) { + case opt_pauper: + /* pauper implies nudist */ + u.uroleplay.nudist = u.uroleplay.pauper; + break; case opt_ascii_map: iflags.wc_tiled_map = negated; break; diff --git a/src/topten.c b/src/topten.c index 4742b9b02..f38de9244 100644 --- a/src/topten.c +++ b/src/topten.c @@ -596,6 +596,7 @@ encode_extended_conducts(char *buf) add_achieveX(buf, "blind", u.uroleplay.blind); add_achieveX(buf, "deaf", u.uroleplay.deaf); add_achieveX(buf, "nudist", u.uroleplay.nudist); + add_achieveX(buf, "pauper", u.uroleplay.pauper); add_achieveX(buf, "bonesless", !flags.bones); add_achieveX(buf, "petless", !u.uconduct.pets); diff --git a/src/u_init.c b/src/u_init.c index f7356cb56..aa2a2a131 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -559,6 +559,8 @@ static const struct def_skill Skill_W[] = { staticfn void knows_object(int obj) { + if (u.uroleplay.pauper) + return; discover_object(obj, TRUE, FALSE); objects[obj].oc_pre_discovered = 1; /* not a "discovery" */ } @@ -571,6 +573,9 @@ knows_class(char sym) struct obj odummy, *o; int ct; + if (u.uroleplay.pauper) + return; + odummy = cg.zeroobj; odummy.oclass = sym; o = &odummy; /* for use in various obj.h macros */ @@ -1213,6 +1218,9 @@ ini_inv(struct trobj *trop) int otyp; boolean got_sp1 = FALSE; /* got a level 1 spellbook? */ + if (u.uroleplay.pauper) /* pauper gets no items */ + return; + while (trop->trclass) { otyp = (int) trop->trotyp; if (otyp != UNDEF_TYP) {