]> granicus.if.org Git - nethack/commitdiff
Add more explicit helpless reasons
authorPasi Kallinen <paxed@alt.org>
Sun, 29 Mar 2015 19:08:46 +0000 (22:08 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 29 Mar 2015 19:12:19 +0000 (22:12 +0300)
Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless.  For example:
"while frozen by a monster's gaze"

25 files changed:
doc/fixes35.0
include/decl.h
src/apply.c
src/artifact.c
src/decl.c
src/detect.c
src/dig.c
src/do_wear.c
src/dothrow.c
src/eat.c
src/end.c
src/hack.c
src/mcastu.c
src/mhitu.c
src/pickup.c
src/polyself.c
src/potion.c
src/pray.c
src/priest.c
src/sounds.c
src/spell.c
src/steal.c
src/timeout.c
src/trap.c
src/uhitm.c

index 6d859ff4d7e70a7f0d168329f1503d1f5baa6035..03cb10a960613bfc97feaf40da212e394a49a384 100644 (file)
@@ -1107,6 +1107,7 @@ cursor positioning ignores uninteresting dungeon features
 allow reading many more items
 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
 
 
 Platform- and/or Interface-Specific New Features
index 15191842e4e52bb2242672998cb0dea79d98e8a0..417ca9d621ce8c027c7bf6622fb0aec71fc44da7 100644 (file)
@@ -28,6 +28,7 @@ E char SAVEP[];
 E NEARDATA int bases[MAXOCLASSES];
 
 E NEARDATA int multi;
+E const char *multi_reason;
 E NEARDATA int nroom;
 E NEARDATA int nsubroom;
 E NEARDATA int occtime;
index 6f13d6623811b5a3cc4073d5b2ccc8076495b56d..386365f498ffa7ffde6c31971a0edcae6d6594a3 100644 (file)
@@ -737,8 +737,10 @@ struct obj *obj;
                                pline("Yow!  The %s stares back!", mirror);
                            else
                                pline("Yikes!  You've frozen yourself!");
-                           if (!Hallucination || !rn2(4))
+                           if (!Hallucination || !rn2(4)) {
                                nomul(-rnd(MAXULEV + 6 - u.ulevel));
+                               multi_reason = "gazing into a mirror";
+                           }
                            nomovemsg = 0;  /* default, "you can move again" */
                        }
                    } else if (youmonst.data->mlet == S_VAMPIRE)
@@ -916,6 +918,7 @@ struct obj **optr;
                                break;
                        case 2: /* no explanation; it just happens... */
                                nomovemsg = "";
+                               multi_reason = NULL;
                                nomul(-rnd(2));
                                break;
                }
@@ -1509,6 +1512,7 @@ int magic; /* 0=Physical, otherwise skill level */
            teleds(cc.x, cc.y, TRUE);
            sokoban_guilt();
            nomul(-1);
+           multi_reason = "jumping around";
            nomovemsg = "";
            morehungry(rnd(25));
            return 1;
index c9baaf3659bd8fc76667c68ec994ec9dce12481c..81bfd4cf0fbea5d8a8dfd1b30380a6c2b22f8d3b 100644 (file)
@@ -983,6 +983,7 @@ char *hittee;                       /* target's name: "you" or mon_nam(mdef) */
                resisted = TRUE;
            } else {
                nomul(-3);
+               multi_reason = "being scared stiff";
                nomovemsg = "";
                if (magr && magr == u.ustuck && sticks(youmonst.data)) {
                    u.ustuck = (struct monst *)0;
index 75203c0567521574fa28caf2c8a02407478c7a2b..2df304575647e281cf6d1d56e754acd34a4ba945 100644 (file)
@@ -21,6 +21,7 @@ char *catmore = 0;            /* default pager */
 NEARDATA int bases[MAXOCLASSES] = DUMMY;
 
 NEARDATA int multi = 0;
+const char *multi_reason = NULL;
 NEARDATA int nroom = 0;
 NEARDATA int nsubroom = 0;
 NEARDATA int occtime = 0;
index ecc4d3878f817ab00f1c8a329f2aa011cb3c9521..2af53021e7c3c30364ea2679621a4e4a26669324 100644 (file)
@@ -890,6 +890,7 @@ struct obj *obj;
     }
     You("peer into %s...", the(xname(obj)));
     nomul(-rnd(10));
+    multi_reason = "gazing into a crystal ball";
     nomovemsg = "";
     if (obj->spe <= 0)
        pline_The("vision is unclear.");
index fa25f76a065e601ac8dd7d2b9a4ffe4c7f833be2..f50d8aa76b46c7a00ab5bcb68eff5b94673c3568 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -1023,6 +1023,7 @@ struct obj *obj;
                            /* you ought to be able to let go; tough luck */
                            /* (maybe `move_into_trap()' would be better) */
                            nomul(-d(2,2));
+                           multi_reason = "stuck in a spider web";
                            nomovemsg = "You pull free.";
                        } else if (lev->typ == IRONBARS) {
                            pline("Clang!");
index 39d3b6c3f2e115cd728c007c2c2bc11ddfa6aa36..ef04ee360ab71cdd3bac097532a45cc836592b29 100644 (file)
@@ -1407,6 +1407,7 @@ register struct obj *otmp;
        if(cursed(otmp)) return(0);
        if(delay) {
                nomul(delay);
+               multi_reason = "disrobing";
                if (is_helmet(otmp)) {
                        /* ick... */
                        nomovemsg = !strcmp(helm_simple_name(otmp), "hat") ?
@@ -1664,6 +1665,7 @@ dowear()
        delay = -objects[otmp->otyp].oc_delay;
        if(delay){
                nomul(delay);
+               multi_reason = "dressing up";
                if(is_boots(otmp)) afternmv = Boots_on;
                if(is_helmet(otmp)) afternmv = Helmet_on;
                if(is_gloves(otmp)) afternmv = Gloves_on;
index aedb4fc4001aec868bd5cacf34eb9243a8cffb7b..ab4b96497974f6860ddcfb062989dd630a6b36e1 100644 (file)
@@ -693,6 +693,7 @@ hurtle(dx, dy, range, verbose)
     if(!range || (!dx && !dy) || u.ustuck) return; /* paranoia */
 
     nomul(-range);
+    multi_reason = "moving through the air";
     nomovemsg = "";                    /* it just happens */
     if (verbose)
        You("%s in the opposite direction.", range > 1 ? "hurtle" : "float");
index a5b413772708233dac14e1ab346abc43fdc11ec8..cc87f399ebb8369009780ade9eeddd75c651acf2 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -962,6 +962,7 @@ register int pm;
                    /* A pile of gold can't ride. */
                    if (u.usteed) dismount_steed(DISMOUNT_FELL);
                    nomul(-tmp);
+                   multi_reason = "pretending to be a pile of gold";
                    Sprintf(buf, Hallucination ?
                        "You suddenly dread being peeled and mimic %s again!" :
                        "You now prefer mimicking %s again.",
@@ -1479,6 +1480,7 @@ struct obj *obj;
                pline_The("world spins and %s %s.", what, where);
                incr_itimeout(&HDeaf, duration);
                nomul(-duration);
+               multi_reason = "unconscious from rotten food";
                nomovemsg = "You are conscious again.";
                afternmv = Hear_again;
                return(1);
@@ -2677,6 +2679,7 @@ boolean incr;
                                if (!Levitation) selftouch("Falling, you");
                                incr_itimeout(&HDeaf, duration);
                                nomul(-duration);
+                               multi_reason = "fainted from lack of food";
                                nomovemsg = "You regain consciousness.";
                                afternmv = unfaint;
                                newhs = FAINTED;
@@ -2853,6 +2856,7 @@ vomit()           /* A good idea from David Neves */
        else
            make_sick(0L, (char *)0, TRUE, SICK_VOMITABLE);
        nomul(-2);
+       multi_reason = "vomiting";
        nomovemsg = You_can_move_again;
 }
 
index 7ada3976715721926ee2dba7a259f5218b442a19..35a5393bd06665c7f3c0da7ac536d04c6b5d950e 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -465,7 +465,12 @@ int how;
                    Sprintf(eos(buf), " called %s", MNAME(mtmp));
        }
 
-       if (multi) Strcat(buf, ", while helpless");
+       if (multi) {
+           if (multi_reason)
+               Sprintf(eos(buf), ", while %s", multi_reason);
+           else
+               Strcat(buf, ", while helpless");
+       }
        Strcpy(killer.name, buf);
        if (mptr->mlet == S_WRAITH)
                u.ugrave_arise = PM_WRAITH;
index 98e615ac88a753e4a51f1cc202b48f94eb80cc8c..32ceb8e69e413c56a6c8c470db7c6fb798624396 100644 (file)
@@ -1568,6 +1568,7 @@ domove()
        /* must come after we finished picking up, in spoteffects() */
        if (cause_delay) {
            nomul(-2);
+           multi_reason = "dragging an iron ball";
            nomovemsg = "";
        }
 
@@ -2434,6 +2435,7 @@ nomul(nval)
        u.uinvulnerable = FALSE;        /* Kludge to avoid ctrl-C bug -dlc */
        u.usleep = 0;
        multi = nval;
+       if (nval == 0) multi_reason = NULL;
        context.travel = context.travel1 = context.mv = context.run = 0;
 }
 
@@ -2448,6 +2450,7 @@ const char *msg_override;
        if (*nomovemsg) pline1(nomovemsg);
        nomovemsg = 0;
        u.usleep = 0;
+       multi_reason = NULL;
        if (afternmv) (*afternmv)();
        afternmv = 0;
 }
index a677db12e115d3cf0d3ebf6f3d6cc4278393a37e..03c06f2edf44cff987d399213b8a772b923e3e00 100644 (file)
@@ -634,12 +634,14 @@ int spellnum;
            if (multi >= 0)
                You("stiffen briefly.");
            nomul(-1);
+           multi_reason = "paralyzed by a monster";
        } else {
            if (multi >= 0)
                You("are frozen in place!");
            dmg = 4 + (int)mtmp->m_lev;
            if (Half_spell_damage) dmg = (dmg + 1) / 2;
            nomul(-dmg);
+           multi_reason = "paralyzed by a monster";
        }
        nomovemsg = 0;
        dmg = 0;
index 6aa4225f7303cf1a54b1bc30d049c5042a19f9d4..9ec602895af88c9240343893aadae8dc46f29ff5 100644 (file)
@@ -1053,6 +1053,7 @@ dopois:
                        else You("are frozen by %s!", mon_nam(mtmp));
                        nomovemsg = You_can_move_again;
                        nomul(-rnd(10));
+                       multi_reason = "paralyzed by a monster";
                        exercise(A_DEX, FALSE);
                    }
                }
index d2a76416cee7e5019f48f00ed29378e81c2c90f1..bf5d0612918837e2f5a54c3483c0ebbb9ad24f7e 100644 (file)
@@ -2121,6 +2121,7 @@ int held;
            /* even if the trap fails, you've used up this turn */
            if (multi >= 0) {   /* in case we didn't become paralyzed */
                nomul(-1);
+               multi_reason = "opening a container";
                nomovemsg = "";
            }
            return 1;
@@ -2630,6 +2631,7 @@ struct obj *box;  /* or bag */
        /* even if the trap fails, you've used up this turn */
        if (multi >= 0) {       /* in case we didn't become paralyzed */
            nomul(-1);
+           multi_reason = "tipping a container";
            nomovemsg = "";
        }
     } else if (box->otyp == BAG_OF_TRICKS || box->otyp == HORN_OF_PLENTY) {
index 3effba8b2932afed852600b6d49efbca427e0a34..023b1f44aa1b6e4e92284b3ea979f4f660a67d54 100644 (file)
@@ -1285,6 +1285,7 @@ dogaze()
                                    -d((int)mtmp->m_lev+1,
                                            (int)mtmp->data->mattk[0].damd)
                                    : -200);
+                           multi_reason = "frozen by a monster's gaze";
                            nomovemsg = 0;
                            return 1;
                        } else
index d9e5e9ca8b858079c55e99a565462e5a2ba043e5..d32c65b65884aefc0d2d81cfd79d66809b7879e5 100644 (file)
@@ -375,6 +375,7 @@ ghost_from_bottle()
        if(flags.verbose)
            You("are frightened to death, and unable to move.");
        nomul(-3);
+       multi_reason = "being frightened to death";
        nomovemsg = "You regain your composure.";
 }
 
@@ -678,6 +679,7 @@ peffects(otmp)
                        Your("%s are frozen to the %s!",
                             makeplural(body_part(FOOT)), surface(u.ux, u.uy));
                    nomul(-(rn1(10, 25 - 12*bcsign(otmp))));
+                   multi_reason = "frozen by a potion";
                    nomovemsg = You_can_move_again;
                    exercise(A_DEX, FALSE);
                }
@@ -1467,6 +1469,7 @@ register struct obj *obj;
                if (!Free_action) {
                    pline("%s seems to be holding you.", Something);
                    nomul(-rnd(5));
+                   multi_reason = "frozen by a potion";
                    nomovemsg = You_can_move_again;
                    exercise(A_DEX, FALSE);
                } else You("stiffen momentarily.");
@@ -1476,6 +1479,7 @@ register struct obj *obj;
                if (!Free_action && !Sleep_resistance) {
                    You_feel("rather tired.");
                    nomul(-rnd(5));
+                   multi_reason = "sleeping off a magical draught";
                    nomovemsg = You_can_move_again;
                    exercise(A_DEX, FALSE);
                } else You("yawn.");
index ffdee9b4903b25131a10d6f79ca2b9ca3587c08e..bd95018c408943468f43ca21c83aa9f289e8c1c7 100644 (file)
@@ -1269,6 +1269,7 @@ dosacrifice()
                        dmon->mpeaceful = TRUE;
                    You("are terrified, and unable to move.");
                    nomul(-3);
+                   multi_reason = "being terrified of a demon";
                    nomovemsg = 0;
                } else pline_The("%s.", demonless_msg);
            }
@@ -1655,6 +1656,7 @@ dopray()
        }
     }
     nomul(-3);
+    multi_reason = "praying";
     nomovemsg = "You finish your prayer.";
     afternmv = prayer_done;
 
@@ -1817,6 +1819,7 @@ doturn()
            }
        }
        nomul(-5);
+       multi_reason = "trying to turn the monsters";
        nomovemsg = You_can_move_again;
        return(1);
 }
index a28f2b8d4658bc34f1d0d4f88a7be074154bb934..0b520cfdfb58693c167e585ea2455779bbb40545 100644 (file)
@@ -475,6 +475,7 @@ int roomno;
            if (flags.verbose)
                You("are frightened to death, and unable to move.");
            nomul(-3);
+           multi_reason = "being terrified of a demon";
            nomovemsg = "You regain your composure.";
        }
     }
index d8d78b4cc9d2533678b3583d643a710149612089..f1dec986f5ba67d44e771cbf37abcaf6cb3d2707 100644 (file)
@@ -710,6 +710,7 @@ register struct monst *mtmp;
            pline("%s rattles noisily.", Monnam(mtmp));
            You("freeze for a moment.");
            nomul(-2);
+           multi_reason = "scared by rattling";
            nomovemsg = 0;
            break;
        case MS_LAUGH:
index 53b8626f0904525e4265fb0d55f69a5db06db67e..5ce0a6015e6754ad820be0ae3e0d8afdf361218c 100644 (file)
@@ -329,6 +329,7 @@ learn(VOID_ARGS)
            context.spbook.book = 0;                    /* no longer studying */
            context.spbook.o_id = 0;
            nomul(context.spbook.delay); /* remaining delay is uninterrupted */
+           multi_reason = "reading a book";
            nomovemsg = 0;
            context.spbook.delay = 0;
            return(0);
@@ -506,6 +507,7 @@ register struct obj *spellbook;
                    boolean gone = cursed_book(spellbook);
 
                    nomul(context.spbook.delay);        /* study time */
+                   multi_reason = "reading a book";
                    nomovemsg = 0;
                    context.spbook.delay = 0;
                    if(gone || !rn2(3)) {
@@ -522,6 +524,7 @@ register struct obj *spellbook;
                        spellbook->in_use = FALSE;
                    }
                    nomul(context.spbook.delay);
+                   multi_reason = "reading a book";
                    nomovemsg = 0;
                    context.spbook.delay = 0;
                    return(1);
index c73878310c7ff05d8041c7c249bc7171e9244b98..f803ae4dae24022be3d2728a61047dc37cafac85 100644 (file)
@@ -361,6 +361,7 @@ gotobj:
                        named++;
                        /* the following is to set multi for later on */
                        nomul(-armordelay);
+                       multi_reason = "taking off clothes";
                        nomovemsg = 0;
                        remove_worn_item(otmp, TRUE);
                        otmp->cursed = curssv;
index e47d863fba26ea1dbf38090e71b7323b23d6a5e3..e1ccaf96eb028b2a3ad31afef2a23c1b5248d1ec 100644 (file)
@@ -51,6 +51,7 @@ stoned_dialogue()
        case 3:         /* limbs turned to stone */
                stop_occupation();
                nomul(-3);      /* can't move anymore */
+               multi_reason = "getting stoned";
                nomovemsg = You_can_move_again; /* not unconscious */
                break;
        default:
@@ -377,6 +378,7 @@ nh_timeout()
                        if (u.umoved && !Levitation) {
                            slip_or_trip();
                            nomul(-2);
+                           multi_reason = "fumbling";
                            nomovemsg = "";
                            /* The more you are carrying the more likely you
                             * are to make noise when you fumble.  Adjustments
@@ -409,6 +411,7 @@ boolean wakeup_msg;
 {
        stop_occupation();
        nomul(how_long);
+       multi_reason = "sleeping";
        /* generally don't notice sounds while sleeping */
        if (wakeup_msg && multi == how_long) {
            /* caller can follow with a direct call to Hear_again() if
@@ -1271,6 +1274,7 @@ do_storms()
        if(!u.uinvulnerable) {
            stop_occupation();
            nomul(-3);
+           multi_reason = "hiding from thunderstorm";
            nomovemsg = 0;
        }
     } else
index 47d8d99b2f1a7444af4cd3ae212c8d164a292dec..775bca5cb1855220ed3a7537ba9d135d433d9d54 100644 (file)
@@ -4447,6 +4447,7 @@ boolean disarm;
                        if (!Free_action) {                        
                        pline("Suddenly you are frozen in place!");
                        nomul(-d(5, 6));
+                       multi_reason = "frozen by a trap";
                        exercise(A_DEX, FALSE);
                        nomovemsg = You_can_move_again;
                        } else You("momentarily stiffen.");
index 80f38addf953634c6bae16397a2cf2ba3de96e49..2bf963c94fd5445afe1f5315fc568f017ccd01cb 100644 (file)
@@ -1871,6 +1871,7 @@ register struct attack *mattk;
                                You("digest %s.", mon_nam(mdef));
                                if (Slow_digestion) tmp *= 2;
                                nomul(-tmp);
+                               multi_reason = "digesting something";
                                nomovemsg = msgbuf;
                            } else pline1(msgbuf);
                            if (pd == &mons[PM_GREEN_SLIME]) {
@@ -2353,6 +2354,7 @@ boolean wep_was_destroyed;
                            You("are frozen by %s gaze!",
                                  s_suffix(mon_nam(mon)));
                            nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127);
+                           multi_reason = "frozen by a monster's gaze";
                            nomovemsg = 0;
                        }
                    } else {
@@ -2366,6 +2368,7 @@ boolean wep_was_destroyed;
                    You("are frozen by %s!", mon_nam(mon));
                    nomovemsg = You_can_move_again;
                    nomul(-tmp);
+                   multi_reason = "frozen by a monster";
                    exercise(A_DEX, FALSE);
                }
                break;