Unify description of hero's visage into single function

This commit is contained in:
Pasi Kallinen
2015-04-14 19:41:44 +03:00
parent 9b2c298fec
commit cd3b0efe5d
3 changed files with 11 additions and 6 deletions
+1
View File
@@ -39,6 +39,7 @@ E void FDECL(m_unleash, (struct monst *,BOOLEAN_P));
E void NDECL(unleash_all); E void NDECL(unleash_all);
E boolean NDECL(next_to_u); E boolean NDECL(next_to_u);
E struct obj *FDECL(get_mleash, (struct monst *)); E struct obj *FDECL(get_mleash, (struct monst *));
E const char *NDECL(beautiful);
E void FDECL(check_leash, (XCHAR_P,XCHAR_P)); E void FDECL(check_leash, (XCHAR_P,XCHAR_P));
E boolean FDECL(um_dist, (XCHAR_P,XCHAR_P,XCHAR_P)); E boolean FDECL(um_dist, (XCHAR_P,XCHAR_P,XCHAR_P));
E boolean FDECL(snuff_candle, (struct obj *)); E boolean FDECL(snuff_candle, (struct obj *));
+9 -2
View 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 */ #define WEAK 3 /* from eat.c */
static const char look_str[] = "look %s."; static const char look_str[] = "look %s.";
@@ -720,8 +728,7 @@ struct obj *obj;
if(!getdir((char *)0)) return 0; if(!getdir((char *)0)) return 0;
invis_mirror = Invis; invis_mirror = Invis;
useeit = !Blind && (!invis_mirror || See_invisible); useeit = !Blind && (!invis_mirror || See_invisible);
uvisage = (ACURR(A_CHA) > 14) ? uvisage = beautiful();
(poly_gender() == 1 ? "beautiful" : "handsome") : "ugly";
mirror = simpleonames(obj); /* "mirror" or "looking glass" */ mirror = simpleonames(obj); /* "mirror" or "looking glass" */
if(obj->cursed && !rn2(2)) { if(obj->cursed && !rn2(2)) {
if (!Blind) if (!Blind)
+1 -4
View File
@@ -421,10 +421,7 @@ do_mname()
mtmp = u.usteed; mtmp = u.usteed;
else { else {
pline("This %s creature is called %s and cannot be renamed.", pline("This %s creature is called %s and cannot be renamed.",
ACURR(A_CHA) > 14 ? beautiful(), plname);
(flags.female ? "beautiful" : "handsome") :
"ugly",
plname);
return; return;
} }
} else } else