more orctown-related follow-up

Under some circumstances, when all the marauding orcs belonging to the
horde operating within the gnomish mines had been provided with their
spoils and placed appropriately, there could still be some pillaged stuff
left-over on the migrating obj chain. Orcs created by regular monster
generation elsewhere would then be susceptable to receiving that stuff
until it was used up. That part is fine, except that the orcs were then
being named as part of the same horde operating within the mines. Now
they will no longer be named as part of the Gnomish Mines horde.

Mythos: There's a good chance that these particular orcs received the
stolen goods from the Gnomish Mines horde.
This commit is contained in:
nhmall
2018-11-25 12:47:53 -05:00
parent 03e6c26af6
commit ccd6f1cf22
6 changed files with 67 additions and 26 deletions

View File

@@ -231,6 +231,8 @@ setting the inverse attribute for gold had the space before "$:"
getting highlighted along with the gold field
sortloot segfaulted when filtering a subset of items (seen with 'A' command)
orctown: prevent Bad fruit #0 and some minor tuning
orctown: orcs beyond the mines were being given any left-over booty and named
as part of the same marauding gang operating within the mines
make long extended commands list be more navigable
simplify #wizidentify; don't rely on having bold menu entries
ensure tmp_at() structures are initialized for all code paths when swallowed

View File

@@ -431,7 +431,7 @@ E struct obj *FDECL(realloc_obj,
(struct obj *, int, genericptr_t, int, const char *));
E char *FDECL(coyotename, (struct monst *, char *));
E char *FDECL(rndorcname, (char *));
E struct monst *FDECL(christen_orc, (struct monst *, char *));
E struct monst *FDECL(christen_orc, (struct monst *, char *, char *));
E const char *FDECL(noveltitle, (int *));
E const char *FDECL(lookup_novel, (const char *, int *));

View File

@@ -2088,18 +2088,28 @@ char *s;
}
struct monst *
christen_orc(mtmp, gang)
christen_orc(mtmp, gang, other)
struct monst *mtmp;
char *gang;
char *gang, *other;
{
int sz = 0;
char buf[BUFSZ], buf2[BUFSZ], *orcname;
orcname = rndorcname(buf2);
sz = (int) (strlen(gang) + strlen(orcname) + sizeof " of " - sizeof "");
if (gang && orcname && sz < BUFSZ) {
Sprintf(buf, "%s of %s", upstart(orcname), upstart(gang));
mtmp = christen_monst(mtmp, buf);
sz = (int) ((gang ? strlen(gang) : other ? strlen(other) : 0)
+ strlen(orcname) + sizeof " of " - sizeof "");
if (sz < BUFSZ) {
boolean nameit = FALSE;
if (gang && orcname) {
Sprintf(buf, "%s of %s", upstart(orcname), upstart(gang));
nameit = TRUE;
} else if (other && orcname) {
Sprintf(buf, "%s%s", upstart(orcname), other);
nameit = TRUE;
}
if (nameit)
mtmp = christen_monst(mtmp, buf);
}
return mtmp;
}

View File

@@ -1680,7 +1680,8 @@ unsigned long deliverflags;
{
struct obj *otmp, *otmp2;
int where, maxobj = 1;
boolean at_crime_scene = In_mines(&u.uz);
if ((deliverflags & DF_RANDOM) && cnt > 1)
maxobj = rnd(cnt);
else if (deliverflags & DF_ALL)
@@ -1702,8 +1703,12 @@ unsigned long deliverflags;
/* special treatment for orcs and their kind */
if ((otmp->corpsenm & M2_ORC) != 0 && has_oname(otmp)) {
if (!has_mname(mtmp))
mtmp = christen_orc(mtmp, ONAME(otmp));
if (!has_mname(mtmp)) {
if (at_crime_scene || (!at_crime_scene && !rn2(2)))
mtmp = christen_orc(mtmp,
at_crime_scene ? ONAME(otmp) : (char *) 0,
" the Fence"); /* bought the stolen goods */
}
free_oname(otmp);
}
otmp->corpsenm = 0;

View File

@@ -785,7 +785,7 @@ stolen_booty(VOID_ARGS)
* member of the main orc horde.
*/
if (mtmp->data != &mons[PM_ORC_CAPTAIN])
mtmp = christen_orc(mtmp, upstart(gang));
mtmp = christen_orc(mtmp, upstart(gang), "");
}
}
/* Lastly, ensure there's several more orcs from the gang along the way.

View File

@@ -1346,8 +1346,9 @@ char *name;
struct permonst *pm;
boolean without_asking;
{
int textidx = 0;
winid datawin = WIN_ERR;
char *entrytext = name, *bp;
char *entrytext = name, *bp = (char *) 0, *bp2 = (char *) 0;
char question[QBUFSZ];
boolean yes_to_moreinfo = FALSE;
@@ -1357,7 +1358,8 @@ boolean without_asking;
* available from data.base or other sources.
*/
if (name && pm && is_orc(pm) && (strlen(name) < (BUFSZ - 1))
&& (bp = strstri(name, " of ")) != 0) {
&& ((bp = strstri(name, " of ")) != 0) ||
(bp2 = strstri(name, " the Fence")) != 0) {
char fullname[BUFSZ];
Strcpy(fullname, name);
@@ -1372,28 +1374,50 @@ boolean without_asking;
}
if (yes_to_moreinfo) {
int i, subs = 0;
char *gang = bp + 4;
static const char *text[] = {
"%s is a member of a marauding horde of orcs",
"rumored to have brutally attacked and plundered the ordinarily",
"sheltered town that is located deep within The Gnomish Mines.",
"",
"The members of that vicious horde proudly and defiantly acclaim",
"their allegiance to their leader %s in their names.",
char *gang = (char *) 0;
if (bp)
textidx = 0;
else
textidx = 1;
static const char *text[2][6] = {
{
"%s is a member of a marauding horde of orcs",
"rumored to have brutally attacked and plundered the ordinarily",
"sheltered town that is located deep within The Gnomish Mines.",
"",
"The members of that vicious horde proudly and defiantly acclaim",
"their allegiance to their leader %s in their names.",
},
{
"%s is a nefarious orc who is known to acquire property",
"from thieves and sell it off for profit or gain.",
"The perpetrator was last seen hanging around the stairs leading",
"to the Gnomish Mines.",
"",
"",
}
};
*bp = '\0';
if (bp) {
gang = bp + 4;
*bp = '\0';
} else {
gang = "";
}
datawin = create_nhwindow(NHW_MENU);
for (i = 0; i < SIZE(text); i++) {
for (i = 0; i < SIZE(text[textidx]); i++) {
char buf[BUFSZ];
const char *txt;
if (strstri(text[i], "%s") != 0) {
Sprintf(buf, text[i],
if (strstri(text[textidx][i], "%s") != 0) {
Sprintf(buf, text[textidx][i],
subs++ ? gang : fullname);
txt = buf;
} else
txt = text[i];
txt = text[textidx][i];
putstr(datawin, 0, txt);
}
display_nhwindow(datawin, FALSE);