Options to create the character blind or nudist
authorPasi Kallinen <paxed@alt.org>
Mon, 30 Mar 2015 19:09:20 +0000 (22:09 +0300)
committerPasi Kallinen <paxed@alt.org>
Mon, 30 Mar 2015 19:12:54 +0000 (22:12 +0300)
For those pro players who really want to try their hand
at that zen samurai, without needing to reroll thousands
of times to start with blindfold.  Nudist starts without
any armor, and keeps tabs whether you wore any during
the game, for even more bragging rights.

Also makes the Book of the Dead readable even while
blind, for obvious reasons.

13 files changed:
doc/Guidebook.mn
doc/Guidebook.tex
doc/fixes35.0
include/patchlevel.h
include/you.h
include/youprop.h
src/attrib.c
src/cmd.c
src/options.c
src/read.c
src/topten.c
src/u_init.c
src/worn.c

index 496d588de9a154018b135ecb7cc9bbd9d2f9daa8..df7301a81af591398ab6c2b0d508747f4b3a4486 100644 (file)
@@ -1921,6 +1921,8 @@ quality of the weapon; you are free to manually fill your quiver or quiver sack
 or make ready
 with the `Q' command instead.  If no weapon is found or the option is
 false, the `t' (throw) command is executed instead.  (default false)
+.lp blind
+Start the character permanently blind. (default false)
 .lp bones
 Allow saving and loading bones files.  (default true)
 .lp boulder
@@ -2143,6 +2145,8 @@ Cannot be set with the `O' command.
 Read the NetHack news file, if present (default on).
 Since the news is shown at the beginning of the game, there's no point
 in setting this with the `O' command.
+.lp nudist
+Start the character with no armor (default false).
 .lp "null    "
 Send padding nulls to the terminal (default on).
 .lp number_pad
index 6c3ccbded1fe764db0376563aaf14ce81f207bb0..7c2464664650a24e68b5ed683bcedf831007bc20 100644 (file)
@@ -2322,6 +2322,9 @@ or make ready
 with the `Q' command instead.  If no weapon is found or the option is
 false, the `t' (throw) command is executed instead.  (default false)
 %.lp
+\item[\ib{blind}]
+Start the character permanently blind. (default false)
+%.lp
 \item[\ib{bones}]
 Allow saving and loading bones files.  (default true)
 %.lp
@@ -2576,6 +2579,9 @@ Read the {\it NetHack\/} news file, if present (default on).
 Since the news is shown at the beginning of the game, there's no point
 in setting this with the `{\tt O}' command.
 %.lp
+\item[\ib{nudist}]
+Start the character with no armor (default false).
+%.lp
 \item[\ib{null}]
 Send padding nulls to the terminal (default on).
 %.lp
index 50748076870eef7761dbe7821fb6b168081c90db..b5dfeea67729d9b3288f104d17dd0643cc1df908 100644 (file)
@@ -1109,6 +1109,7 @@ when you're hiding under something a zap downward should not hit that
        something, while a zap upward should
 show more explicit reason why player was helpless at death
 added new hallucinatory-only gods
+options to create the character blind or nudist
 
 
 Platform- and/or Interface-Specific New Features
index 1b0ebf24159886ca6af159e97785853a3493a7f0..f4281139eedbf3922f53b3fac75a2df7ee70fd58 100644 (file)
@@ -14,7 +14,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL      59
+#define EDITLEVEL      60
 
 #define COPYRIGHT_BANNER_A \
 "NetHack, Copyright 1985-2015"
index 0fc5c6073c9310ea1337480563bb9d451cf3e4f1..a69fe4de377618f3836d0090b210573113977154 100644 (file)
@@ -92,6 +92,11 @@ struct u_conduct {           /* number of times... */
                                /* genocides already listed at end of game */
 };
 
+struct u_roleplay {
+    boolean  blind;   /* permanently blind */
+    boolean  nudist;  /* has not worn any armor, ever */
+};
+
 /*** Unified structure containing role information ***/
 struct Role {
        /*** Strings that name various things ***/
@@ -330,6 +335,7 @@ struct you {
        struct u_event  uevent;         /* certain events have happened */
        struct u_have   uhave;          /* you're carrying special objects */
        struct u_conduct uconduct;      /* KMH, conduct */
+       struct u_roleplay uroleplay;
        struct attribs  acurr,          /* your current attributes (eg. str)*/
                        aexe,           /* for gain/loss via "exercise" */
                        abon,           /* your bonus attributes (eg. str) */
index 1dfe3a9e9cbaaa451d89c71956578a87c5656353..cdecb6c82f7e94ae7395384c129e7fbf157cc0ef 100644 (file)
@@ -91,7 +91,7 @@
 #define Blinded                        u.uprops[BLINDED].intrinsic
 #define Blindfolded            (ublindf && ublindf->otyp != LENSES)
                /* ...means blind because of a cover */
-#define Blind  ((Blinded || Blindfolded || !haseyes(youmonst.data)) && \
+#define Blind  ((u.uroleplay.blind || Blinded || Blindfolded || !haseyes(youmonst.data)) && \
                 !(ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD))
                /* ...the Eyes operate even when you really are blind
                    or don't have any eyes */
index b9ce67596ecf4340188c80c63004d86cb18219ee..f7af4fee84d82315ba95e36768095044e7434c4f 100644 (file)
@@ -691,6 +691,8 @@ int propidx;        /* special cases can have negative values */
                Sprintf(buf, because_of,
                        obj->oartifact ? bare_artifactname(obj) :
                                ysimple_name(obj));
+           else if (propidx == BLINDED && u.uroleplay.blind)
+               Sprintf(buf, " from birth");
            else if (propidx == BLINDED && Blindfolded_only)
                Sprintf(buf, because_of, ysimple_name(ublindf));
 
index 5d9bcfc279c59cefdcccde81d27d6952a54770c7..51bc10896cd3c428dacb0d3e0c6fcc4423af83a9 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -2246,6 +2246,9 @@ int final;
        en_win = create_nhwindow(NHW_MENU);
        putstr(en_win, 0, "Voluntary challenges:");
 
+       if (u.uroleplay.blind) you_have_been("blind from birth");
+       if (u.uroleplay.nudist) you_have_been("faithfully nudist");
+
        if (!u.uconduct.food)
            enl_msg(You_, "have gone", "went", " without food", "");
            /* But beverages are okay */
index e1ff15ff0a7650a96b8f668b64141605d09eac9c..742958fc326ee92e749a82cc36c914464e45f27e 100644 (file)
@@ -85,6 +85,7 @@ static struct Bool_Opt
 #else
        {"BIOS", (boolean *)0, FALSE, SET_IN_FILE},
 #endif
+       {"blind", &u.uroleplay.blind, FALSE, DISP_IN_GAME},
        {"bones", &flags.bones, TRUE, SET_IN_FILE},
 #ifdef INSURANCE
        {"checkpoint", &flags.ins_chkpt, TRUE, SET_IN_GAME},
@@ -149,6 +150,7 @@ static struct Bool_Opt
 #else
        {"news", (boolean *)0, FALSE, SET_IN_FILE},
 #endif
+       {"nudist", &u.uroleplay.nudist, FALSE, DISP_IN_GAME},
        {"null", &flags.null, TRUE, SET_IN_GAME},
 #if defined(SYSFLAGS) && defined(MAC)
        {"page_wait", &sysflags.page_wait, TRUE, SET_IN_GAME},
index 9d8cac038df56b2e1f9b30edff7f0e5842a9c90b..3ad28e8aa5e5491bb2a8756db181a47e0329d619 100644 (file)
@@ -287,7 +287,7 @@ doread()
                && scroll->oclass != SPBOOK_CLASS) {
            pline(silly_thing_to, "read");
            return(0);
-       } else if (Blind) {
+       } else if (Blind && (scroll->otyp != SPE_BOOK_OF_THE_DEAD)) {
            const char *what = 0;
            if (scroll->oclass == SPBOOK_CLASS)
                what = "mystic runes";
index 19eaa2ed2b5200870ca73e9c684a665f8039cb7f..48c69cb8e8772444b0c3d43fccaafed1dee0366f 100644 (file)
@@ -397,6 +397,8 @@ encodeachieve()
     if(u.uachieve.mines_luckstone) r |= 1L << 9;
     if(u.uachieve.finish_sokoban)  r |= 1L << 10;
     if(u.uachieve.killed_medusa)   r |= 1L << 11;
+    if(u.uroleplay.blind)          r |= 1L << 12;
+    if(u.uroleplay.nudist)         r |= 1L << 13;
 
     return r;
 }
index 79954841c970bdfe2f10722255fa9366b4d084a4..3c32637dde223efb3ba3724afb87ef6f56db019f 100644 (file)
@@ -491,6 +491,7 @@ void
 u_init()
 {
        register int i;
+       struct u_roleplay tmpuroleplay = u.uroleplay; /* these set by rcfile options */
 
        flags.female = flags.initgend;
        flags.beginner = 1;
@@ -502,6 +503,8 @@ u_init()
        (void) memset((genericptr_t)&ubirthday, 0, sizeof(ubirthday));
        (void) memset((genericptr_t)&urealtime, 0, sizeof(urealtime));
 
+       u.uroleplay = tmpuroleplay; /* restore options set via rcfile */
+
 #if 0  /* documentation of more zero values as desirable */
        u.usick_cause[0] = 0;
        u.uluck  = u.moreluck = 0;
@@ -922,6 +925,13 @@ register struct trobj *trop;
                                nocreate4 = otyp;
                }
 
+               /* nudist gets no armor */
+               if (u.uroleplay.nudist && obj->oclass == ARMOR_CLASS) {
+                   dealloc_obj(obj);
+                   trop++;
+                   continue;
+               }
+
                if (trop->trclass == COIN_CLASS) {
                        /* no "blessed" or "identified" money */
                        obj->quan = u.umoney0;
index 70ba11b3a4562b5d425a65bc12ef1fc6f14f3151..b810332ea3860e7e83b62affbb0ee3addf8167c0 100644 (file)
@@ -57,6 +57,7 @@ long mask;
            uskin = obj;
         /* assert( !uarm ); */
        } else {
+           if ((mask & W_ARMOR)) u.uroleplay.nudist = FALSE;
            for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) {
                oobj = *(wp->w_obj);
                if(oobj && !(oobj->owornmask & wp->w_mask))