]> granicus.if.org Git - nethack/commitdiff
more urgent_pline()'s
authorPatR <rankin@nethack.org>
Thu, 23 Dec 2021 02:29:01 +0000 (18:29 -0800)
committerPatR <rankin@nethack.org>
Thu, 23 Dec 2021 02:29:01 +0000 (18:29 -0800)
countdown messages for turning to stone or slime or being strangled
drowning
burning in lava
feeling feverish
changing form

src/polyself.c
src/timeout.c
src/trap.c
src/uhitm.c
src/were.c

index ae786d63dd6065ae3b6a99c9f95d5e2819e9b685..f8066b31668127d1d3a016afb3513c638a7ae6f5 100644 (file)
@@ -198,7 +198,7 @@ polyman(const char *fmt, const char *arg)
 
     newsym(u.ux, u.uy);
 
-    You(fmt, arg);
+    urgent_pline(fmt, arg);
     /* check whether player foolishly genocided self while poly'd */
     if (ugenocided()) {
         /* intervening activity might have clobbered genocide info */
@@ -363,7 +363,8 @@ newman(void)
                 u.uhp = 1;
         } else {
  dead:      /* we come directly here if experience level went to 0 or less */
-            Your("new form doesn't seem healthy enough to survive.");
+            urgent_pline(
+                     "Your new form doesn't seem healthy enough to survive.");
             g.killer.format = KILLED_BY_AN;
             Strcpy(g.killer.name, "unsuccessful polymorph");
             done(DIED);
@@ -374,7 +375,7 @@ newman(void)
         }
     }
     newuhs(FALSE);
-    polyman("feel like a new %s!",
+    polyman("You feel like a new %s!",
             /* use saved gender we're about to revert to, not current */
             ((Upolyd ? u.mfemale : flags.female) && g.urace.individual.f)
                 ? g.urace.individual.f
@@ -1155,7 +1156,7 @@ rehumanize(void)
 
     if (emits_light(g.youmonst.data))
         del_light_source(LS_MONSTER, monst_to_any(&g.youmonst));
-    polyman("return to %s form!", g.urace.adj);
+    polyman("You return to %s form!", g.urace.adj);
 
     if (u.uhp < 1) {
         /* can only happen if some bit of code reduces u.uhp
@@ -1516,7 +1517,7 @@ dogaze(void)
                     pline("Gazing at the awake %s is not a very good idea.",
                           l_monnam(mtmp));
                     /* as if gazing at a sleeping anything is fruitful... */
-                    You("turn to stone...");
+                    urgent_pline("You turn to stone...");
                     g.killer.format = KILLED_BY;
                     Strcpy(g.killer.name,
                            "deliberately meeting Medusa's gaze");
index 655f40eb48e330223154674ef24e73f568d7ec61..e3f1f4f10b3e179c96eb23dd13c9d4cb42611e1c 100644 (file)
@@ -114,7 +114,7 @@ static NEARDATA const char *const stoned_texts[] = {
 static void
 stoned_dialogue(void)
 {
-    register long i = (Stoned & TIMEOUT);
+    long i = (Stoned & TIMEOUT);
 
     if (i > 0L && i <= SIZE(stoned_texts)) {
         char buf[BUFSZ];
@@ -122,7 +122,7 @@ stoned_dialogue(void)
         Strcpy(buf, stoned_texts[SIZE(stoned_texts) - i]);
         if (nolimbs(g.youmonst.data) && strstri(buf, "limbs"))
             (void) strsubst(buf, "limbs", "extremities");
-        pline1(buf);
+        urgent_pline("%s", buf);
     }
     switch ((int) i) {
     case 5: /* slowing down */
@@ -260,18 +260,19 @@ static NEARDATA const char *const choke_texts2[] = {
 static void
 choke_dialogue(void)
 {
-    register long i = (Strangled & TIMEOUT);
+    long i = (Strangled & TIMEOUT);
 
     if (i > 0 && i <= SIZE(choke_texts)) {
         if (Breathless || !rn2(50)) {
-            pline(choke_texts2[SIZE(choke_texts2) - i], body_part(NECK));
+            urgent_pline(choke_texts2[SIZE(choke_texts2) - i],
+                         body_part(NECK));
         } else {
             const char *str = choke_texts[SIZE(choke_texts) - i];
 
             if (index(str, '%'))
-                pline(str, hcolor(NH_BLUE));
+                urgent_pline(str, hcolor(NH_BLUE));
             else
-                pline1(str);
+                urgent_pline("%s", str);
         }
     }
     exercise(A_STR, FALSE);
@@ -302,8 +303,8 @@ levitation_dialogue(void)
             boolean danger = (is_pool_or_lava(u.ux, u.uy)
                               && !Is_waterlevel(&u.uz));
 
-            pline(s, danger ? "over" : "in",
-                  danger ? surface(u.ux, u.uy) : "air");
+            urgent_pline(s, danger ? "over" : "in",
+                         danger ? surface(u.ux, u.uy) : "air");
         } else
             pline1(s);
     }
@@ -343,13 +344,13 @@ slime_dialogue(void)
         if (index(buf, '%')) {
             if (i == 4L) {  /* "you are turning green" */
                 if (!Blind) /* [what if you're already green?] */
-                    pline(buf, hcolor(NH_GREEN));
+                    urgent_pline(buf, hcolor(NH_GREEN));
             } else {
-                pline(buf,
-                      an(Hallucination ? rndmonnam(NULL) : "green slime"));
+                urgent_pline(buf, an(Hallucination ? rndmonnam(NULL)
+                                                   : "green slime"));
             }
         } else {
-            pline1(buf);
+            urgent_pline("%s", buf);
         }
     }
 
index 9a20c199a094a752a378d563fdf25647d92cd993..af9795801198f9e1b70683fe2ee47251a1c92d27 100644 (file)
@@ -3134,7 +3134,7 @@ instapetrify(const char *str)
         return;
     if (poly_when_stoned(g.youmonst.data) && polymon(PM_STONE_GOLEM))
         return;
-    You("turn to stone...");
+    urgent_pline("You turn to stone...");
     g.killer.format = KILLED_BY;
     if (str != g.killer.name)
         Strcpy(g.killer.name, str ? str : "");
@@ -4299,7 +4299,7 @@ drown(void)
         pline("But in vain.");
     }
     set_uinwater(1); /* u.uinwater = 1 */
-    You("drown.");
+    urgent_pline("You drown.");
     for (i = 0; i < 5; i++) { /* arbitrary number of loops */
         /* killer format and name are reconstructed every iteration
            because lifesaving resets them */
@@ -5803,7 +5803,8 @@ lava_effects(void)
                because lifesaving resets them */
             g.killer.format = KILLED_BY;
             Strcpy(g.killer.name, lava_killer);
-            You("%s...", boil_away ? "boil away" : "burn to a crisp");
+            urgent_pline("You %s...", boil_away ? "boil away"
+                                                : "burn to a crisp");
             done(BURNING);
             if (safe_teleds(TELEDS_ALLOW_DRAG | TELEDS_TELEPORT))
                 break; /* successful life-save */
@@ -5862,7 +5863,7 @@ sink_into_lava(void)
         if (u.utrap < (1 << 8)) {
             g.killer.format = KILLED_BY;
             Strcpy(g.killer.name, "molten lava");
-            You("sink below the surface and die.");
+            urgent_pline("You sink below the surface and die.");
             burn_away_slime(); /* add insult to injury? */
             done(DISSOLVED);
             /* can only get here via life-saving; try to get away from lava */
index 24d2573e24e486e4baa9d2b6538e85303868084c..61ea2213aaaf9b49970814aad48a50f3f6076c68 100644 (file)
@@ -3613,8 +3613,9 @@ mhitm_ad_ston(struct monst *magr, struct attack *mattk, struct monst *mdef,
 }
 
 void
-mhitm_ad_were(struct monst *magr, struct attack *mattk, struct monst *mdef,
-              struct mhitm_data *mhm)
+mhitm_ad_were(
+    struct monst *magr, struct attack *mattk,
+    struct monst *mdef, struct mhitm_data *mhm)
 {
     struct permonst *pa = magr->data;
 
@@ -3631,7 +3632,7 @@ mhitm_ad_were(struct monst *magr, struct attack *mattk, struct monst *mdef,
         hitmsg(magr, mattk);
         if (uncancelled && !rn2(4) && u.ulycn == NON_PM
             && !Protection_from_shape_changers && !defends(AD_WERE, uwep)) {
-            You_feel("feverish.");
+            urgent_pline("You feel feverish.");
             exercise(A_CON, FALSE);
             set_ulycn(monsndx(pa));
             retouch_equipment(2);
index 3969dededc586c4eccb6075c61330615ab443854..5f9e0cac6e1382a15b78d1933d17f1e4cd4b7008 100644 (file)
@@ -91,7 +91,7 @@ were_beastie(int pm)
 void
 new_were(struct monst *mon)
 {
-    register int pm;
+    int pm;
 
     pm = counter_were(monsndx(mon->data));
     if (pm < LOW_PM) {
@@ -121,10 +121,11 @@ new_were(struct monst *mon)
 
 /* were-creature (even you) summons a horde */
 int
-were_summon(struct permonst *ptr,
-            boolean yours,
-            int *visible, /* number of visible helpers created */
-            char *genbuf)
+were_summon(
+    struct permonst *ptr,
+    boolean yours,
+    int *visible, /* number of visible helpers created */
+    char *genbuf)
 {
     int i, typ, pm = monsndx(ptr);
     struct monst *mtmp;