]> granicus.if.org Git - nethack/commitdiff
additional urgent messages
authorPatR <rankin@nethack.org>
Mon, 20 Dec 2021 16:42:58 +0000 (08:42 -0800)
committerPatR <rankin@nethack.org>
Mon, 20 Dec 2021 16:42:58 +0000 (08:42 -0800)
Now I've remembered why I didn't follow through with these back when
I originally laid the groundwork.  New urgent messages:

 having an item of armor be destroyed
 having weapon be grabbed by a monster's bullwhip
 becoming engulfed
 being grabbed by an eel
 subsequently being drowned by an eel
 dying of petrification
 turning into slime then dying due to genocide
 dying due to fatal illness

There are lots more candidates.

src/do_wear.c
src/mhitu.c
src/muse.c
src/timeout.c
src/uhitm.c

index 19131afe2fe8b27c97fd642640bf4b465c016b23..4cfef9ac70f2ceec62c0511da9099fa5e75402b6 100644 (file)
@@ -2782,7 +2782,14 @@ menu_remarm(int retry)
 int
 destroy_arm(register struct obj *atmp)
 {
-    register struct obj *otmp;
+    struct obj *otmp;
+    /*
+     * Note: if there were any artifact cloaks, the 90% chance of
+     * resistance here means that the cloak could survive and then
+     * the suit or shirt underneath could be destroyed.  Likewise for
+     * artifact suit over a shirt.  That would be a bug.  Since there
+     * aren't any, we'll just look the other way.
+     */
 #define DESTROY_ARM(o)                            \
     ((otmp = (o)) != 0 && (!atmp || atmp == otmp) \
              && (!obj_resists(otmp, 0, 90))       \
@@ -2792,48 +2799,57 @@ destroy_arm(register struct obj *atmp)
     if (DESTROY_ARM(uarmc)) {
         if (donning(otmp))
             cancel_don();
-        Your("%s crumbles and turns to dust!", cloak_simple_name(uarmc));
+        urgent_pline("Your %s crumbles and turns to dust!",
+                     /* cloak/robe/apron/smock (ID'd apron)/wrapping */
+                     cloak_simple_name(uarmc));
         (void) Cloak_off();
         useup(otmp);
     } else if (DESTROY_ARM(uarm)) {
+        const char *suit = suit_simple_name(uarm);
+
         if (donning(otmp))
             cancel_don();
         /* for gold DSM, we don't want Armor_gone() to report that it
            stops shining _after_ we've been told that it is destroyed */
         if (otmp->lamplit)
             end_burn(otmp, FALSE);
-        Your("armor turns to dust and falls to the %s!", surface(u.ux, u.uy));
+        urgent_pline("Your %s %s to dust and %s to the %s!",
+                     /* suit might be "dragon scales" so vtense() is needed */
+                     suit, vtense(suit, "turn"), vtense(suit, "fall"),
+                     surface(u.ux, u.uy));
         (void) Armor_gone();
         useup(otmp);
     } else if (DESTROY_ARM(uarmu)) {
         if (donning(otmp))
             cancel_don();
-        Your("shirt crumbles into tiny threads and falls apart!");
+        urgent_pline("Your %s crumbles into tiny threads and falls apart!",
+                     shirt_simple_name(uarmu)); /* always "shirt" */
         (void) Shirt_off();
         useup(otmp);
     } else if (DESTROY_ARM(uarmh)) {
         if (donning(otmp))
             cancel_don();
-        Your("%s turns to dust and is blown away!", helm_simple_name(uarmh));
+        urgent_pline("Your %s turns to dust and is blown away!",
+                     helm_simple_name(uarmh)); /* "helm" or "hat" */
         (void) Helmet_off();
         useup(otmp);
     } else if (DESTROY_ARM(uarmg)) {
         if (donning(otmp))
             cancel_don();
-        Your("gloves vanish!");
+        urgent_pline("Your %s vanish!", gloves_simple_name(uarmg));
         (void) Gloves_off();
         useup(otmp);
         selftouch("You");
     } else if (DESTROY_ARM(uarmf)) {
         if (donning(otmp))
             cancel_don();
-        Your("boots disintegrate!");
+        urgent_pline("Your %s disintegrate!", boots_simple_name(uarmf));
         (void) Boots_off();
         useup(otmp);
     } else if (DESTROY_ARM(uarms)) {
         if (donning(otmp))
             cancel_don();
-        Your("shield crumbles away!");
+        urgent_pline("Your %s crumbles away!", shield_simple_name(uarms));
         (void) Shield_off();
         useup(otmp);
     } else {
index 938a4fa88881c2c8babcdeca2d79509786a68004..5e04b2a008728d1aaa587fa7aef644a82397bacc 100644 (file)
@@ -1121,11 +1121,11 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
              * like horses for now :-)
              */
             Strcpy(buf, mon_nam(u.usteed));
-            pline("%s lunges forward and plucks you off %s!", Monnam(mtmp),
-                  buf);
+            urgent_pline("%s lunges forward and plucks you off %s!",
+                         Monnam(mtmp), buf);
             dismount_steed(DISMOUNT_ENGULFED);
         } else {
-            pline("%s engulfs you!", Monnam(mtmp));
+            urgent_pline("%s engulfs you!", Monnam(mtmp));
         }
         stop_occupation();
         reset_occupations(); /* behave as if you had moved */
@@ -1495,7 +1495,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
             stop_occupation();
             if (poly_when_stoned(g.youmonst.data) && polymon(PM_STONE_GOLEM))
                 break;
-            You("turn to stone...");
+            urgent_pline("You turn to stone...");
             g.killer.format = KILLED_BY;
             Strcpy(g.killer.name, pmname(mtmp->data, Mgender(mtmp)));
             done(STONING);
index 9422efd4b6d16d7fa4ff65eac6407b98c7587574..5336d275fd2d0d8da60edc23ff97a92a03a216df 100644 (file)
@@ -2214,8 +2214,8 @@ use_misc(struct monst* mtmp)
                 pline("%s fails to wrap around %s.", The_whip, the_weapon);
                 return 1;
             }
-            pline("%s wraps around %s you're wielding!", The_whip,
-                  the_weapon);
+            urgent_pline("%s wraps around %s you're wielding!", The_whip,
+                         the_weapon);
             if (welded(obj)) {
                 pline("%s welded to your %s%c",
                       !is_plural(obj) ? "It is" : "They are", hand,
index 1f6604ad0e44ed8df10f3254969ed8508e0cd9b1..655f40eb48e330223154674ef24e73f568d7ec61 100644 (file)
@@ -263,9 +263,9 @@ choke_dialogue(void)
     register long i = (Strangled & TIMEOUT);
 
     if (i > 0 && i <= SIZE(choke_texts)) {
-        if (Breathless || !rn2(50))
+        if (Breathless || !rn2(50)) {
             pline(choke_texts2[SIZE(choke_texts2) - i], body_part(NECK));
-        else {
+        else {
             const char *str = choke_texts[SIZE(choke_texts) - i];
 
             if (index(str, '%'))
@@ -344,11 +344,13 @@ slime_dialogue(void)
             if (i == 4L) {  /* "you are turning green" */
                 if (!Blind) /* [what if you're already green?] */
                     pline(buf, hcolor(NH_GREEN));
-            } else
+            } else {
                 pline(buf,
                       an(Hallucination ? rndmonnam(NULL) : "green slime"));
-        } else
+            }
+        } else {
             pline1(buf);
+        }
     }
 
     switch (i) {
@@ -434,10 +436,10 @@ slimed_to_death(struct kinfo* kptr)
         Strcpy(slimebuf, "green slime has been genocided...");
         if (iflags.last_msg == PLNMSG_OK_DONT_DIE)
             /* follows "OK, so you don't die." and arg is second sentence */
-            pline("Yes, you do.  %s", upstart(slimebuf));
+            urgent_pline("Yes, you do.  %s", upstart(slimebuf));
         else
             /* follows "The medallion crumbles to dust." */
-            pline("Unfortunately, %s", slimebuf);
+            urgent_pline("Unfortunately, %s", slimebuf);
         /* die again; no possibility of amulet this time */
         done(GENOCIDED); /* [should it be done_timeout(GENOCIDED, SLIMED)?] */
         /* could be life-saved again (only in explore or wizard mode)
@@ -583,8 +585,8 @@ nh_timeout(void)
                 make_vomiting(0L, TRUE);
                 break;
             case SICK:
-                /* You might be able to bounce back from food poisoning, but not
-                 * other forms of illness. */
+                /* hero might be able to bounce back from food poisoning,
+                   but not other forms of illness */
                 if ((u.usick_type & SICK_NONVOMITABLE) == 0
                     && rn2(100) < ACURR(A_CON)) {
                     You("have recovered from your illness.");
@@ -593,7 +595,7 @@ nh_timeout(void)
                     adjattrib(A_CON, -1, 1);
                     break;
                 }
-                You("die from your illness.");
+                urgent_pline("You die from your illness.");
                 if (kptr && kptr->name[0]) {
                     g.killer.format = kptr->format;
                     Strcpy(g.killer.name, kptr->name);
index 5a34396d916d7c671d65c3cd0150d0ad08599af3..aff4172e8dc6b6dfb1c94ae4f6632d26a98dcb95 100644 (file)
@@ -2646,8 +2646,9 @@ mhitm_ad_drst(struct monst *magr, struct attack *mattk, struct monst *mdef,
 }
 
 void
-mhitm_ad_drin(struct monst *magr, struct attack *mattk, struct monst *mdef,
-              struct mhitm_data *mhm)
+mhitm_ad_drin(
+    struct monst *magr, struct attack *mattk,
+    struct monst *mdef, struct mhitm_data *mhm)
 {
     struct permonst *pd = mdef->data;
 
@@ -2744,8 +2745,9 @@ mhitm_ad_drin(struct monst *magr, struct attack *mattk, struct monst *mdef,
 }
 
 void
-mhitm_ad_stck(struct monst *magr, struct attack *mattk, struct monst *mdef,
-              struct mhitm_data *mhm)
+mhitm_ad_stck(
+    struct monst *magr, struct attack *mattk,
+    struct monst *mdef, struct mhitm_data *mhm)
 {
     struct permonst *pd = mdef->data;
 
@@ -2816,7 +2818,8 @@ mhitm_ad_wrap(struct monst *magr, struct attack *mattk, struct monst *mdef,
                     mhm->damage = 0;
                 } else {
                     set_ustuck(magr); /* before message, for botl update */
-                    pline("%s swings itself around you!", Monnam(magr));
+                    urgent_pline("%s swings itself around you!",
+                                 Monnam(magr));
                 }
             } else if (u.ustuck == magr) {
                 if (is_pool(magr->mx, magr->my) && !Swimming && !Amphibious) {
@@ -2825,7 +2828,7 @@ mhitm_ad_wrap(struct monst *magr, struct attack *mattk, struct monst *mdef,
                                    && !Is_medusa_level(&u.uz)
                                    && !Is_waterlevel(&u.uz);
 
-                    pline("%s drowns you...", Monnam(magr));
+                    urgent_pline("%s drowns you...", Monnam(magr));
                     g.killer.format = KILLED_BY_AN;
                     Sprintf(g.killer.name, "%s by %s",
                             moat ? "moat" : "pool of water",