Give honorifics to vampires and elves

This commit is contained in:
Pasi Kallinen
2015-04-23 21:46:02 +03:00
parent ea6157c475
commit aea472c0c0
4 changed files with 28 additions and 15 deletions

View File

@@ -902,6 +902,7 @@ camera may contain a picture-painting demon
some monsters can eat through iron bars
inaccessible niches occasionally have iron bars in front
sinks may teleport or polymorph
shopkeepers give honorifics to vampires and elves
Platform- and/or Interface-Specific Fixes

View File

@@ -172,6 +172,8 @@
#define is_mind_flayer(ptr) ((ptr) == &mons[PM_MIND_FLAYER] || \
(ptr) == &mons[PM_MASTER_MIND_FLAYER])
#define is_vampire(ptr) ((ptr)->mlet == S_VAMPIRE)
#define nonliving(ptr) (is_golem(ptr) || is_undead(ptr) || \
(ptr)->mlet == S_VORTEX || \
(ptr) == &mons[PM_MANES])

View File

@@ -350,7 +350,7 @@ int psflags;
monsterpoly = (psflags == 2),
draconian = (uarm && Is_dragon_armor(uarm)),
iswere = (u.ulycn >= LOW_PM),
isvamp = (youmonst.data->mlet == S_VAMPIRE),
isvamp = is_vampire(youmonst.data),
controllable_poly = Polymorph_control && !(Stunned || Unaware);
if (Unchanging) {
@@ -730,7 +730,7 @@ int mntmp;
pline(use_thec,monsterc,"emit a mental blast");
if (youmonst.data->msound == MS_SHRIEK) /* worthless, actually */
pline(use_thec,monsterc,"shriek");
if (youmonst.data->mlet == S_VAMPIRE)
if (is_vampire(youmonst.data))
pline(use_thec,monsterc,"change shape");
if (lays_eggs(youmonst.data) && flags.female)
@@ -1386,9 +1386,8 @@ dohide()
int
dopoly()
{
boolean isvampire = youmonst.data->mlet == S_VAMPIRE;
struct permonst *savedat = youmonst.data;
if (isvampire) {
if (is_vampire(youmonst.data)) {
polyself(2);
if (savedat != youmonst.data) {
You("transform into %s.", an(youmonst.data->mname));

View File

@@ -28,6 +28,7 @@ STATIC_VAR NEARDATA long int followmsg; /* last time of follow message */
STATIC_VAR const char and_its_contents[] = " and its contents";
STATIC_VAR const char the_contents_of[] = "the contents of ";
STATIC_DCL void FDECL(append_honorific, (char *));
STATIC_DCL void FDECL(setpaid, (struct monst *));
STATIC_DCL long FDECL(addupbill, (struct monst *));
STATIC_DCL void FDECL(pacify_shk, (struct monst *));
@@ -2344,23 +2345,13 @@ boolean ininv, dummy, silent;
The(xname(obj)), ltmp, currency(ltmp),
(obj->quan > 1L) ? " each" : "");
} else {
/* (chooses among [0]..[3] normally; [1]..[4] after the
Wizard has been killed or invocation ritual performed) */
static const char * const honored[] = {
"good", "honored", "most gracious", "esteemed",
"most renowned and sacred"
};
long save_quan = obj->quan;
Strcpy(buf, "\"For you, ");
if (ANGRY(shkp)) {
Strcat(buf, "scum;");
} else {
int idx = rn2(SIZE(honored) - 1) + u.uevent.udemigod;
Strcat(buf, honored[idx]);
Strcat(buf, !is_human(youmonst.data) ? " creature" :
(flags.female) ? " lady" : " sir");
append_honorific(buf);
Strcat(buf, "; only");
}
obj->quan = 1L; /* fool xname() into giving singular */
@@ -2385,6 +2376,26 @@ boolean ininv, dummy, silent;
}
}
void
append_honorific(buf)
char *buf;
{
/* (chooses among [0]..[3] normally; [1]..[4] after the
Wizard has been killed or invocation ritual performed) */
static const char * const honored[] = {
"good", "honored", "most gracious", "esteemed",
"most renowned and sacred"
};
Strcat(buf, honored[rn2(SIZE(honored) - 1) + u.uevent.udemigod]);
if (is_vampire(youmonst.data))
Strcat(buf, (flags.female) ? " dark lady" : " dark lord");
else if (is_elf(youmonst.data))
Strcat(buf,(flags.female) ? " hiril" : " hir");
else
Strcat(buf, !is_human(youmonst.data) ? " creature" :
(flags.female) ? " lady" : " sir");
}
void
splitbill(obj, otmp)
register struct obj *obj, *otmp;