]> granicus.if.org Git - nethack/commitdiff
Unify description of hero's visage into single function
authorPasi Kallinen <paxed@alt.org>
Tue, 14 Apr 2015 16:41:44 +0000 (19:41 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 14 Apr 2015 16:41:44 +0000 (19:41 +0300)
include/extern.h
src/apply.c
src/do_name.c

index ebe38de5e7df466645c959469f7ffe22e703d24f..3a0535cf079c22b0aad7cc68e10d9ba90e31b620 100644 (file)
@@ -39,6 +39,7 @@ E void FDECL(m_unleash, (struct monst *,BOOLEAN_P));
 E void NDECL(unleash_all);
 E boolean NDECL(next_to_u);
 E struct obj *FDECL(get_mleash, (struct monst *));
+E const char *NDECL(beautiful);
 E void FDECL(check_leash, (XCHAR_P,XCHAR_P));
 E boolean FDECL(um_dist, (XCHAR_P,XCHAR_P,XCHAR_P));
 E boolean FDECL(snuff_candle, (struct obj *));
index 40249be1fd8e1708eb0f80ab4ffd5910d4577fe4..e8b0bfea450391516493e30ec5e5eeeef1cf25dc 100644 (file)
@@ -703,6 +703,14 @@ register xchar x, y;
        }
 }
 
+const char *
+beautiful()
+{
+    return (ACURR(A_CHA) > 14) ?
+       (poly_gender() == 1 ? "beautiful" : "handsome") : "ugly";
+}
+
+
 #define WEAK   3       /* from eat.c */
 
 static const char look_str[] = "look %s.";
@@ -720,8 +728,7 @@ struct obj *obj;
        if(!getdir((char *)0)) return 0;
        invis_mirror = Invis;
        useeit = !Blind && (!invis_mirror || See_invisible);
-       uvisage = (ACURR(A_CHA) > 14) ?
-                   (poly_gender() == 1 ? "beautiful" : "handsome") : "ugly";
+       uvisage = beautiful();
        mirror = simpleonames(obj); /* "mirror" or "looking glass" */
        if(obj->cursed && !rn2(2)) {
                if (!Blind)
index c8a49a443283b2b097518fba5dac8130c27ef316..b893748045d1066e6ba3c9d3224dacbb6cfaeb9d 100644 (file)
@@ -421,10 +421,7 @@ do_mname()
                mtmp = u.usteed;
            else {
                pline("This %s creature is called %s and cannot be renamed.",
-               ACURR(A_CHA) > 14 ?
-               (flags.female ? "beautiful" : "handsome") :
-               "ugly",
-               plname);
+                     beautiful(), plname);
                return;
            }
        } else